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.ColumnType - The column type * @type {"Number"|"Text"|"Formula"|"Checkbox"|"Date"|"Currency"|"Percent"|"Phone"|"Email"|"URL"|"Lookup"|"CreatedTime"|"ModifiedTime"|"Attachment"|"Select"|"Barcode"} */ export type ColumnType = "Number"|"Text"|"Formula"|"Checkbox"|"Date"|"Currency"|"Percent"|"Phone"|"Email"|"URL"|"Lookup"|"CreatedTime"|"ModifiedTime"|"Attachment"|"Select"|"Barcode" /** * @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.CornerFold * @property {number} size - The size of the corner fold. * @property {string} position - The corner fold's position, which supports "leftTop", "rightTop", "leftBottom", "rightBottom". * @property {string} color - The color of the corner fold. */ export type CornerFold = { /** * The size of the corner fold. */ size?: number; /** * The corner fold's position, which supports "leftTop", "rightTop", "leftBottom", "rightBottom". */ position?: "leftTop" | "rightTop" | "leftBottom" | "rightBottom"; /** * The color of the corner fold. */ color?: string; } /** * @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. * @property {GC.Data.CornerFold} cornerFold - The corner fold of the decoration in the style. */ export type Decoration = { /** * The icons of the decoration in the style. */ icons?: GC.Data.Icon[]; /** * The corner fold of the decoration in the style. */ cornerFold?: GC.Data.CornerFold; } /** * @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.FileUploadOptions * @property {string} type - The type of the cell type, supports "fileUpload". * @property {number} maxSize -The maximum file size that can be uploaded. * @property {string} accept - The file types that can be uploaded. * @property {boolean} isPreviewEnabled - Whether to display the file preview button. * @property {boolean} isDownloadEnabled - Whether to display the file download button. * @property {boolean} isClearEnabled - Whether to display the file clear button. * @property {number} marginTop - The margin top value. * @property {number} marginRight - The margin right value. * @property {number} marginBottom - The margin bottom value. * @property {number} marginLeft - The margin left value. * @property {string} valuePath - The valuePath is used to get the cell value from File. */ export type FileUploadOptions = { /** * The type of the cell type, supports "fileUpload". */ type: "fileUpload"; maxSize?: number; /** * The file types that can be uploaded. */ accept?: string; /** * Whether to display the file preview button. */ isPreviewEnabled?: boolean; /** * Whether to display the file download button. */ isDownloadEnabled?: boolean; /** * Whether to display the file clear button. */ isClearEnabled?: boolean; /** * The margin top value. */ marginTop?: number; /** * The margin right value. */ marginRight?: number; /** * The margin bottom value. */ marginBottom?: number; /** * The margin left value. */ marginLeft?: number; /** * The valuePath is used to get the cell value from File. */ valuePath?: string; } /** * @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. * @property {GC.Data.Decoration} decoration - The decoration. */ 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; /** * The decoration. */ decoration?: GC.Data.Decoration; } /** * @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.IHierarchyCustomParseOptions) => any /** * @typedef GC.Data.HierarchyCustomUnparseHandler * @param {GC.Data.IHierarchyCustomUnparseOptions} options - the options for the handler. * @returns {any} Returns of the id of the current record. * @description Get the id of the current record. */ export type HierarchyCustomUnparseHandler = (options: GC.Data.IHierarchyCustomUnparseOptions) => any /** * @typedef GC.Data.HighlightStyle * @property {"circle" | "dogEar" | "icon"} type - The highlight type. * @property {GC.Data.ColorString} color - The highlight color. * @property {"topLeft" | "topRight" | "bottomRight" | "bottomLeft" | "outsideLeft" | "outsideRight"} position - The highlight position. * @property {string} image - The highlight image, it could be an url or base64 data. */ export type HighlightStyle = { /** * The highlight type. */ type?: "circle" | "dogEar" | "icon"; /** * The highlight color. */ color?: string; /** * The highlight position. */ position: "topLeft" | "topRight" | "bottomRight" | "bottomLeft" | "outsideLeft" | "outsideRight"; /** * The highlight image, it could be an url or base64 data. */ image?: string; } /** * @typedef GC.Data.HyperlinkOptions * @property {string} type - The type of the cell type, supports "hyperlink". * @property {string} linkColor - The color of the link. * @property {string} visitedLinkColor - The color of the visited link. * @property {string} text - The text of the link. * @property {string} linkToolTip - The tooltip of the link. * @property {string} target - The type of the link's target, which support "blank", "self", "parent", "top". * @property {boolean} activeOnClick - Whether to move to the active cell when clicked. */ export type HyperlinkOptions = { /** * The type of the cell type, supports "hyperlink". */ type: "hyperlink"; /** * The color of the link. */ linkColor: string; /** * The color of the visited link. */ visitedLinkColor: string; /** * The text of the link. */ text: string; /** * The tooltip of the link. */ linkToolTip: string; /** * The type of the link's target, which support "blank", "self", "parent", "top". */ target: "blank" | "self" | "parent" | "top"; /** * Whether to move to the active cell when clicked. */ activeOnClick: boolean; } /** * @typedef GC.Data.IColumn - The column options. * @property {string} name - The unique name of the column. * @property {string} value - The value of the column, could be a field name of table from database, or formula which uses the fields names. * @property {string} type - The column type, any of "Number", "Text", "Formula", "Checkbox", "Date", "Currency", "Percent", "Phone", "Email", "URL", "Lookup", "CreatedTime", "ModifiedTime", "Attachment", "Select", "Barcode" * @property {string | string[]} caption - The caption of the column. * @property {number | string} width - The width of the column, support number in pixel, or star size. * @property {GC.Data.StyleOptions} style - The style of the column. * @property {(GC.Data.CellValueRuleOptions | GC.Data.SpecificTextRuleOptions | GC.Data.FormulaRuleOptions | GC.Data.DateOccurringRuleOptions | GC.Data.Top10RuleOptions | GC.Data.UniqueRuleOptions | GC.Data.DuplicateRuleOptions | GC.Data.AverageRuleOptions | GC.Data.TwoScaleRuleOptions | GC.Data.ThreeScaleRuleOptions | GC.Data.DataBarRuleOptions | GC.Data.IconSetRuleOptions)[]} conditionalFormats - The conditional formats array of the column. * @property {GC.Data.NumberValidatorOptions | GC.Data.DateValidatorOptions | GC.Data.TimeValidatorOptions | GC.Data.TextLengthValidatorOptions | GC.Data.FormulaValidatorOptions | GC.Data.FormulaListValidatorOptions | GC.Data.ListValidatorOptions} validator - The data validator of the column. * @property {boolean} isPrimaryKey - Mark the column as primary key column. * @property {boolean} readonly - Mark the column is readonly. * @property {boolean} required - Mark the column is required when insert a new row. * @property {Object} defaultValue - Provide the default value when insert a new row, could be a const or a formula. * @property {GC.Data.HeaderStyleOptions} headerStyle - The header style of the column. * @property {boolean} visible - Mark the column is visible. * @property {string} headerFit - The header fit mode, any of the "normal", "vertical" or "stack". The default value is "normal". * @property {string} dataType - The actual data type of original value, any of "string", "number", "boolean", "object", "formula", "array", "date" or "rowOrder". It is useful for a Date because a Date is a string in JSON data and need be converted. * @property {string} dataPattern - The data pattern for parsing string to value, such as formatter "dd/MM/yyyy" for a date string, truthy and falsy value pairs "Yes|No" for a boolean string, decimal separator "," for a numeric string. * @property {Object} dataMap - A simple map to display the original value more meaningful, its key could be a number or string, and its value could be a number, string or Date. * @property {boolean} spread - Whether to spread a column when its value is an object. * @property {string} dataName - The original name of the table field, using this property to map the original name to the specified name. * @property {boolean} indexed - Weather need to create the filter cache while creating the table. * @property {boolean} allowSort - Whether show sort after opening filer dialog. * @property {boolean} allowFilterByValue - Whether show filter by value after opening filer dialog. * @property {boolean} allowFilterByList - Whether show filter by list after opening filer dialog. If allowSort, allowFilterByValue and allowFilterByList are all false, not show the filter button in this column. * @property {string | GC.Data.ICrossOptions} cross - The cross options of the column. * @property {string | (string | number | boolean | Date)[] | GC.Data.ILookupOptions} lookup - Define the lookup for the column, only be used in the columns of the schema of the data source. * @property {boolean | GC.Data.IOutlineColumnOptions} outlineColumn - Define the outline column only when the data be the hierarchy data. * @property {GC.Data.ITriggerFormulaOption} trigger - The trigger formula of the column. */ export type IColumn = { /** * The unique name of the column. */ name?: string; /** * The value of the column, could be a field name of table from database, or formula which uses the fields names. */ value?: string; /** * The column type, any of "Number", "Text", "Formula", "Checkbox", "Date", "Currency", "Percent", "Phone", "Email", "URL", "Lookup", "CreatedTime", "ModifiedTime", "Attachment", "Select", "Barcode" */ type?: string; /** * The caption of the column. */ caption?: string | string[]; /** * The width of the column, support number in pixel, or star size. */ width?: number | string; /** * The style of the column. */ style?: GC.Data.StyleOptions; /** * The conditional formats array of the column. */ conditionalFormats?: Array; /** * The data validator of the column. */ validator?: GC.Data.NumberValidatorOptions | GC.Data.DateValidatorOptions | GC.Data.TimeValidatorOptions | GC.Data.TextLengthValidatorOptions | GC.Data.FormulaValidatorOptions | GC.Data.FormulaListValidatorOptions | GC.Data.ListValidatorOptions; /** * Mark the column as primary key column. */ isPrimaryKey?: boolean; /** * Mark the column is readonly. */ readonly?: boolean; /** * Mark the column is required when insert a new row. */ required?: boolean; /** * Provide the default value when insert a new row, could be a const or a formula. */ defaultValue?: any; /** * The header style of the column. */ headerStyle?: GC.Data.HeaderStyleOptions; /** * Mark the column is visible. */ visible?: boolean; /** * The header fit mode, any of the "normal", "vertical" or "stack". The default value is "normal". */ headerFit?: "normal" | "vertical" | "stack"; /** * The actual data type of original value, any of "string", "number", "boolean", "object", "formula", "array", "date" or "rowOrder". It is useful for a Date because a Date is a string in JSON data and need be converted. */ dataType?: "string" | "number" | "boolean" | "object" | "formula" | "array" | "date" | "rowOrder" | "TaskStartDate" | "TaskFinishDate" | "TaskDuration" | "TaskSubject" | "TaskSchedulingMode" | "TaskComplete" | "TaskPredecessor"; /** * The data pattern for parsing string to value, such as formatter "dd/MM/yyyy" for a date string, truthy and falsy value pairs "Yes|No" for a boolean string, decimal separator "," for a numeric string. */ dataPattern?: string; /** * A simple map to display the original value more meaningful, its key could be a number or string, and its value could be a number, string or Date. */ dataMap?: any; /** * Whether to spread a column when its value is an object. */ spread?: boolean; /** * The original name of the table field, using this property to map the original name to the specified name. */ dataName?: string; /** * Weather need to create the filter cache while creating the table. */ indexed?: boolean; /** * Whether show sort after opening filer dialog. */ allowSort?: boolean; /** * Whether show filter by value after opening filer dialog. */ allowFilterByValue?: boolean; /** * Whether show filter by list after opening filer dialog. If allowSort, allowFilterByValue and allowFilterByList are all false, not show the filter button in this column. */ allowFilterByList?: boolean; /** * The cross options of the column. */ cross?: string | GC.Data.ICrossOptions; /** * Define the lookup for the column, only be used in the columns of the schema of the data source. */ lookup?: string | (string | number | boolean | Date)[] | GC.Data.ILookupOptions; /** * Define the outline column only when the data be the hierarchy data. */ outlineColumn?: boolean | GC.Data.IOutlineColumnOptions; /** * The trigger formula of the column. */ trigger?: GC.Data.ITriggerFormulaOption; } /** * @typedef GC.Data.IColumnCollection - The column collection. * @property {GC.Data.IColumn} key - A key-value collection, which key is a string, and value is a GC.Data.IColumn object. */ export type IColumnCollection = { [key: string]: GC.Data.IColumn; } /** * @typedef GC.Data.Icon * @property {string} position - The icon's position, which supports "left", "right", "leftOfText", "rightOfText", "outsideLeft", "outsideRight". * @property {number} width - The painted width. * @property {number} height - The painted height. * @property {string} src - The icon path. */ export type Icon = { /** * The icon's position, which supports "left", "right", "leftOfText", "rightOfText", "outsideLeft", "outsideRight". */ position?: "left" | "right" | "leftOfText" | "rightOfText" | "outsideLeft" | "outsideRight"; /** * The painted width. */ width?: number; /** * The painted height. */ height?: number; /** * The icon path. */ src?: string; } /** * @typedef GC.Data.IconCriteriaOptions - The icon criteria options. * @property {boolean} isGreaterThanOrEqualTo - If set to true, use the greater than or equal to operator to calculate the value. * @property {GC.Data.IconValueType} iconValueType - The icon value type. * @property {number|string} iconValue - The icon value. */ export type IconCriteriaOptions = { /** * If set to true, use the greater than or equal to operator to calculate the value. */ isGreaterThanOrEqualTo: boolean; /** * The icon value type. */ iconValueType: GC.Data.IconValueType; /** * The icon value. */ iconValue: number|string; } /** * @typedef GC.Data.IconOptions - The icon options. * @property {GC.Data.IconSetType} iconSetType - The icon value type. * @property {number} iconIndex - The custom icon index */ export type IconOptions = { /** * The icon value type. */ iconSetType: GC.Data.IconSetType; /** * The custom icon index */ iconIndex: number; } /** * @typedef GC.Data.IconSetRuleOptions - The options of icon set rule. * @property {"iconSetRule"} ruleType - The rule type if you want to use icon set rule. * @property {GC.Data.IconSetType} iconSetType - The icon set type. * @property {boolean} reverseIconOrder - Whether to reverse icon order. * @property {boolean} showIconOnly - Whether to display the icon only. * @property {GC.Data.IconOptions[]} icons - The array of icon options. * @property {number} priority - The priority of the rule. * @property {boolean} stopIfTrue - Whether rules with lower priority are applied before this rule. */ export type IconSetRuleOptions = { /** * The rule type if you want to use icon set rule. */ ruleType: "iconSetRule"; /** * The icon set type. */ iconSetType: GC.Data.IconSetType; /** * Whether to reverse icon order. */ reverseIconOrder: boolean; /** * Whether to display the icon only. */ showIconOnly: boolean; /** * The array of icon options. */ icons: GC.Data.IconOptions[]; /** * The priority of the rule. */ priority: number; /** * Whether rules with lower priority are applied before this rule. */ stopIfTrue: boolean; } /** * @typedef GC.Data.IconSetType * @type {"threeArrowsColored"|"threeArrowsGray"|"threeTriangles"|"threeStars"|"threeFlags"|"threeTrafficLightsUnrimmed"|"threeTrafficLightsRimmed"|"threeSigns"|"threeSymbolsCircled"|"threeSymbolsUncircled"|"fourArrowsColored"|"fourArrowsGray"|"fourRedToBlack"|"fourRatings"|"fourTrafficLights"|"fiveArrowsColored"|"fiveArrowsGray"|"fiveRatings"|"fiveQuarters"|"fiveBoxes"|"noIcons"} * @description The icon set type. */ export type IconSetType = "threeArrowsColored"|"threeArrowsGray"|"threeTriangles"|"threeStars"|"threeFlags"|"threeTrafficLightsUnrimmed"|"threeTrafficLightsRimmed"|"threeSigns"|"threeSymbolsCircled"|"threeSymbolsUncircled"|"fourArrowsColored"|"fourArrowsGray"|"fourRedToBlack"|"fourRatings"|"fourTrafficLights"|"fiveArrowsColored"|"fiveArrowsGray"|"fiveRatings"|"fiveQuarters"|"fiveBoxes"|"noIcons" /** * @typedef GC.Data.IconValueType * @type {"number"|"percent"|"formula"|"percentile"} * @description The icon value type. */ export type IconValueType = "number"|"percent"|"formula"|"percentile" /** * @typedef GC.Data.ICrossAttributeOptions * @property {string} value - To define the header of cross column. * @property {string} formatter - To format the value. * @description The options to define the header of cross column. */ export type ICrossAttributeOptions = { /** * To define the header of cross column. */ value: string; /** * To format the value. */ formatter?: string; } /** * @typedef GC.Data.ICrossOptions * @property {string} over - The key to find cross column. * @property {(string | GC.Data.ICrossAttributeOptions)[]} attributes - The attributes to define multi headers of the cross column. * @property {string} filter - The formula to filter out the cross columns. * @property {string} caption - The self-defined header. * @description The options to define the cross column. */ export type ICrossOptions = { /** * The key to find cross column. */ over: string; /** * The attributes to define multi headers of the cross column. */ attributes?: (string | GC.Data.ICrossAttributeOptions)[]; /** * The formula to filter out the cross columns. */ filter?: string; /** * The self-defined header. */ caption?: string; } /** * @typedef GC.Data.ICrossViewOptions - The cross view options. * @property {GC.Data.ICrossOptions} key - A key-value collection, which key is a string, and value is a GC.Data.ICrossOptions object. */ export type ICrossViewOptions = { [key: string]: GC.Data.ICrossOptions; } /** * @typedef GC.Data.IDataSourceOption - The data source options. * @property {Array | string} data - Local data source, which could be an object array for JSON, a string for CSV or XML. * @property {GC.Data.IRemoteTransportOption} remote - Remote data source, which supports REST API, OData, GraphQL. * @property {boolean} autoSync - In auto sync mode, data changes will be synced to server immediately. * @property {boolean} batch - In batch mode, data changes will be held in data source, user need invoke submitChanges method to sync server. * @property {GC.Data.ISchemaOption} schema - The data source schema options. */ export type IDataSourceOption = { /** * Local data source, which could be an object array for JSON, a string for CSV or XML. */ data?: any; /** * Remote data source, which supports REST API, OData, GraphQL. */ remote?: GC.Data.IRemoteTransportOption; /** * In auto sync mode, data changes will be synced to server immediately. */ autoSync?: boolean; /** * In batch mode, data changes will be held in data source, user need invoke submitChanges method to sync server. */ batch?: boolean; /** * The data source schema options. */ schema?: GC.Data.ISchemaOption; } /** * @typedef GC.Data.IFormulaCollection - The formula collection. * @property {string} key - A key-value collection, which key is a string, and value is a string. */ export type IFormulaCollection = { [key: string]: string; } /** * @typedef GC.Data.IHierarchyCustomParseOptions - The options to parse the parentId for the custom hierarchy type. * @property {any} data - The data of the current record. * @property {number} index - The record index. */ export type IHierarchyCustomParseOptions = { /** * The data of the current record. */ data: any; /** * The record index. */ index: number; } /** * @typedef GC.Data.IHierarchyCustomUnparseOptions - The options to unparse the record to the id for the custom hierarchy type. * @property {any} data - The data of the current record. * @property {number} index - The record index. * @property {any} parentData - The data of the parent record. */ export type IHierarchyCustomUnparseOptions = { /** * The data of the current record. */ data: any; /** * The record index. */ index: number; /** * The data of the parent record. */ parentData: any; } /** * @typedef GC.Data.IHierarchyOption - The hierarchy options. * @property {string} type - Supports 'Parent', 'ChildrenPath', 'Level', 'Custom'. * @property {string} column - The column that has the data to build hierarchy. * @property {string | GC.Data.IHierarchyOutlineColumnOptions} outlineColumn - The definitions of the outline column of the column that show as hierarchy. * @property {GC.Data.IHierarchySummaryFieldCollection} summaryFields - The definitions of the collections of hierarchy summary fields. * @property {GC.Data.HierarchyCustomParseHandler} parse - The options to parse the parentId for the custom hierarchy type. * @property {GC.Data.HierarchyCustomUnparseHandler} unparse - The options to unparse the record to the id for the custom hierarchy type. */ export type IHierarchyOption = { /** * Supports 'Parent', 'ChildrenPath', 'Level', 'Custom'. */ type: 'Parent' | 'ChildrenPath' | 'Level' | 'Custom'; /** * The column that has the data to build hierarchy. */ column: string; /** * The definitions of the outline column of the column that show as hierarchy. */ outlineColumn?: string | GC.Data.IHierarchyOutlineColumnOptions; /** * The definitions of the collections of hierarchy summary fields. */ summaryFields?: GC.Data.IHierarchySummaryFieldCollection; /** * The options to parse the parentId for the custom hierarchy type. */ parse?: GC.Data.HierarchyCustomParseHandler; /** * The options to unparse the record to the id for the custom hierarchy type. */ unparse?: GC.Data.HierarchyCustomUnparseHandler; } /** * @typedef GC.Data.IHierarchyOutlineColumnOptions - The outline column options of the column that show as hierarchy. * @property {string} value - Specified the column that show as hierarchy. * @property {boolean} showCheckBox - Whether to display the check box. * @property {boolean} showImage - Whether to display images. * @property {string[]} images - The images by level (url or base64Image). * @property {boolean} showIndicator - Whether to display the indicator. * @property {string} expandIndicator - The expand indicator (url or base64Image). * @property {string} collapseIndicator - The collapse indicator (url or base64Image). */ export type IHierarchyOutlineColumnOptions = { /** * Specified the column that show as hierarchy. */ value: string; /** * Whether to display the check box. */ showCheckBox?: boolean; /** * Whether to display images. */ showImage?: boolean; /** * The images by level (url or base64Image). */ images?: string[]; /** * Whether to display the indicator. */ showIndicator?: boolean; /** * The expand indicator (url or base64Image). */ expandIndicator?: string; /** * The collapse indicator (url or base64Image). */ collapseIndicator?: string; } /** * @typedef GC.Data.IHierarchySummaryFieldCollection - The hierarchy summary field collection. * @property {string} key - A key-value collection, which key is a field string, and value is a formula string. */ export type IHierarchySummaryFieldCollection = { [key: string]: string; } /** * @typedef GC.Data.ILookupOptions - The lookup options. * @property {string} name - The relation ship name. * @property {string[] | GC.Data.IColumn[]} columns - The columns definitions of the related table, used for multi-column drop down. */ export type ILookupOptions = { /** * The relation ship name. */ name: string; /** * The columns definitions of the related table, used for multi-column drop down. */ columns: string[] | GC.Data.IColumn[]; } /** * @typedef GC.Data.IOutlineColumnOptions - The outline column options of the column that show as hierarchy. * @property {boolean} showCheckBox - Whether to display the check box. * @property {boolean} showImage - Whether to display images. * @property {string[]} images - The images by level (url or base64Image). * @property {boolean} showIndicator - Whether to display the indicator. * @property {string} expandIndicator - The expand indicator (url or base64Image). * @property {string} collapseIndicator - The collapse indicator (url or base64Image). */ export type IOutlineColumnOptions = { /** * Whether to display the check box. */ showCheckBox?: boolean; /** * Whether to display images. */ showImage?: boolean; /** * The images by level (url or base64Image). */ images?: string[]; /** * Whether to display the indicator. */ showIndicator?: boolean; /** * The expand indicator (url or base64Image). */ expandIndicator?: string; /** * The collapse indicator (url or base64Image). */ collapseIndicator?: string; } /** * @typedef {RequestInit} GC.Data.IRemoteFetchOption - The remote request options similar as RequestInit of the Fetch API. */ export type IRemoteFetchOption = RequestInit /** * @typedef GC.Data.IRemoteReadRequestOption - The remote request options for read operation. * @property {string} url - Request url. * @property {string} method - Request method, such as 'GET', 'POST', 'PUT', 'DELETE', default value is 'GET'. * @property {GC.Data.IRemoteFetchOption} options - Request options, similar as RequestInit of the Fetch API, optional. * @property {string} adapter - Adapt different data protocol, supports "rest", "odata", "odata4", "graphql". * @property {Object} body - Request body. */ export type IRemoteReadRequestOption = { /** * Request url. */ url: string; /** * Request method, such as 'GET', 'POST', 'PUT', 'DELETE', default value is 'GET'. */ method?: 'GET' | 'POST' | 'PUT' | 'DELETE'; /** * Request options, similar as RequestInit of the Fetch API, optional. */ options?: GC.Data.IRemoteFetchOption; /** * Adapt different data protocol, supports "rest", "odata", "odata4", "graphql". */ adapter?: string; /** * Request body. */ body?: Object; } /** * @typedef GC.Data.IRemoteRequestOption - The remote request options. * @property {string} url - Request url. * @property {string} method - Request method, such as 'GET', 'POST', 'PUT', 'DELETE', default value is 'GET'. * @property {GC.Data.IRemoteFetchOption} options - Request options, similar as RequestInit of the Fetch API, optional. */ export type IRemoteRequestOption = { /** * Request url. */ url: string; /** * Request method, such as 'GET', 'POST', 'PUT', 'DELETE', default value is 'GET'. */ method?: 'GET' | 'POST' | 'PUT' | 'DELETE'; /** * Request options, similar as RequestInit of the Fetch API, optional. */ options?: GC.Data.IRemoteFetchOption; } /** * @typedef GC.Data.IRemoteTransportOption - The remote transport options. * @property {GC.Data.IRemoteReadRequestOption | GC.Data.RemoteReadHandler} read - The options for read operation. * @property {GC.Data.IRemoteRequestOption | GC.Data.RemoteChangeHandler} create - The options for create operation. * @property {GC.Data.IRemoteRequestOption | GC.Data.RemoteChangeHandler} update - The options for update operation. * @property {GC.Data.IRemoteRequestOption | GC.Data.RemoteChangeHandler} delete - The options for delete operation. * @property {GC.Data.IRemoteRequestOption | GC.Data.RemoteChangeHandler} batch - The options for batch operation. * @property {GC.Data.IRemoteReadRequestOption | GC.Data.RemoteReadHandler} getColumns - The options for getting columns operation. * @property {GC.Data.IRemoteRequestOption | GC.Data.RemoteChangeHandler} addColumn - The options for adding column operation. * @property {GC.Data.IRemoteRequestOption | GC.Data.RemoteChangeHandler} updateColumn - The options for updating column operation. * @property {GC.Data.IRemoteRequestOption | GC.Data.RemoteChangeHandler} removeColumn - The options for deleting column operation. */ export type IRemoteTransportOption = { /** * The options for read operation. */ read: GC.Data.IRemoteReadRequestOption | GC.Data.RemoteReadHandler; /** * The options for create operation. */ create?: GC.Data.IRemoteRequestOption | GC.Data.RemoteChangeHandler; /** * The options for update operation. */ update?: GC.Data.IRemoteRequestOption | GC.Data.RemoteChangeHandler; /** * The options for delete operation. */ delete?: GC.Data.IRemoteRequestOption | GC.Data.RemoteChangeHandler; /** * The options for batch operation. */ batch?: GC.Data.IRemoteRequestOption | GC.Data.RemoteChangeHandler; /** * The options for getting columns operation. */ getColumns?: GC.Data.IRemoteReadRequestOption | GC.Data.RemoteReadHandler; /** * The options for adding column operation. */ addColumn?: GC.Data.IRemoteRequestOption | GC.Data.RemoteChangeHandler; /** * The options for updating column operation. */ updateColumn?: GC.Data.IRemoteRequestOption | GC.Data.RemoteChangeHandler; /** * The options for deleting column operation. */ removeColumn?: GC.Data.IRemoteRequestOption | GC.Data.RemoteChangeHandler; } /** * @typedef GC.Data.ISchemaOption - The data source schema options. * @property {string} type - Supports 'json', 'csv', 'xml', 'columnJson'. * @property {string} dataPath - Data reader use this to get data source collection after parse, return entire parsed object if this is not specified. * @property {GC.Data.IColumnCollection} columns - The definitions of all columns of current table. * @property {GC.Data.IFormulaCollection} window - The definitions of all formulas of window chaining. * @property {GC.Data.IHierarchyOption} hierarchy - The definitions of hierarchy options. */ export type ISchemaOption = { /** * Supports 'json', 'csv', 'xml', 'columnJson'. */ type?: string; /** * Data reader use this to get data source collection after parse, return entire parsed object if this is not specified. */ dataPath?: string; /** * The definitions of all columns of current table. */ columns?: GC.Data.IColumnCollection; /** * The definitions of all formulas of window chaining. */ window?: GC.Data.IFormulaCollection; /** * The definitions of hierarchy options. */ hierarchy?: GC.Data.IHierarchyOption; } /** * @typedef GC.Data.ItemOptions * @property {string} text - The item text. * @property {Object} value - The item value, could be a number, string, boolean, Date. */ export type ItemOptions = { /** * The item text. */ text: string; /** * The item value, could be a number, string, boolean, Date. */ value: any; } /** * @typedef GC.Data.ITriggerFormulaOption * @property {string} when - Indicates when to trigger the formula. * @property {string} formula - The formula to be triggered. * @property {string} fields - The watched fields which be updated could trigger the formula, "*" be set for any field, be omitted when on new. * @description The options to define the trigger formula. */ export type ITriggerFormulaOption = { /** * Indicates when to trigger the formula. */ when: "onNew" | "onNewAndUpdate"; /** * The formula to be triggered. */ formula: string; /** * The watched fields which be updated could trigger the formula, "*" be set for any field, be omitted when on new. */ fields?: string; } /** * @typedef GC.Data.LabelOptions * @property {string} alignment - The cell label position, which supports "topLeft", "topCenter", "topRight", "bottomLeft", "bottomCenter", "bottomRight". * @property {string} visibility - The cell label visibility, which supports "visible", "hidden", "auto". * @property {string} font - The cell label font. * @property {string} foreColor - The cell label foreground color. * @property {string} margin - The cell label margin. */ export type LabelOptions = { /** * The cell label position, which supports "topLeft", "topCenter", "topRight", "bottomLeft", "bottomCenter", "bottomRight". */ alignment: "topLeft" | "topCenter" | "topRight" | "bottomLeft" | "bottomCenter" | "bottomRight"; /** * The cell label visibility, which supports "visible", "hidden", "auto". */ visibility: "visible" | "hidden" | "auto"; /** * The cell label font. */ font: string; /** * The cell label foreground color. */ foreColor: string; /** * The cell label margin. */ margin: string; } /** * @typedef GC.Data.LineBorder * @property {string} color - The border color. * @property {string} style - The border style, which supports "empty", "thin", "medium", "dashed", "dotted", "thick", "double", "hair", "mediumDashed", "dashDot", "mediumDashDot", "dashDotDot", "mediumDashDotDot", "slantedDashDot". */ export type LineBorder = { /** * The border color. */ color: string; /** * The border style, which supports "empty", "thin", "medium", "dashed", "dotted", "thick", "double", "hair", "mediumDashed", "dashDot", "mediumDashDot", "dashDotDot", "mediumDashDotDot", "slantedDashDot". */ style: "empty" | "thin" | "medium" | "dashed" | "dotted" | "thick" | "double" | "hair" | "mediumDashed" | "dashDot" | "mediumDashDot" | "dashDotDot" | "mediumDashDotDot" | "slantedDashDot"; } /** * @typedef GC.Data.ListItem * @property {string} text - The item text. * @property {string} value - The item value. * @property {string} icon - The item icon. */ export type ListItem = { /** * The item text. */ text?: string; /** * The item value. */ value?: string; /** * The item icon. */ icon?: string; } /** * @typedef GC.Data.ListLayout * @property {string} direction - The layout direction, which accepts "horizontal", "vertical". * @property {string} displayAs - The layout display, which accepts "inline", "popup", "tree". * @property {boolean} collapsible - Whether the list can be collapsed. */ export type ListLayout = { /** * The layout direction, which accepts "horizontal", "vertical". */ direction?: "horizontal" | "vertical"; /** * The layout display, which accepts "inline", "popup", "tree". */ displayAs?: "inline" | "popup" | "tree"; /** * Whether the list can be collapsed. */ collapsible?: boolean; } /** * @typedef GC.Data.ListOptions * @property {string} text - The text. * @property {GC.Data.ListLayout} layout - The layout. * @property {boolean} multiSelect - Whether to set the list to multi-select. * @property {string} valueType - The cell value type of dropdown list result, which accepts "string", "array". * @property {GC.Data.ListItem[] | GC.Data.ListOptions[] | Function} items - The items. Usually, it accepts an array. Specially, when it accepts a function, the function should returns a DOM element. * @property {Function} onItemSelected - It is used when items or sub-items are selected. */ export type ListOptions = { /** * The text. */ text?: string; /** * The layout. */ layout?: GC.Data.ListLayout; /** * Whether to set the list to multi-select. */ multiSelect?: boolean; /** * The cell value type of dropdown list result, which accepts "string", "array". */ valueType?: "string" | "array"; /** * a function returns a DOM element */ items: GC.Data.ListItem[] | GC.Data.ListOptions[] | (() => HTMLElement); /** * used when items or sub-items is (() => HTMLElement) */ onItemSelected?: (e: MouseEvent) => string; } /** * @typedef GC.Data.ListString * @type {string} * @description The list type string, such as "1,2,3". */ export type ListString = string /** * @typedef GC.Data.ListValidatorOptions * @property {"list"} type - The data validator type. * @property {GC.Data.ListString} source - The data validator source. * @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 ListValidatorOptions = { /** * The data validator type. */ type: "list"; /** * The data validator source. */ source: GC.Data.ListString; /** * 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.MaskType * @property {string} pattern - The mask pattern. * @property {string} placeholder - The mask placeholder. * @property {boolean} excludeLiteral - The mask exclude literal. * @property {boolean} excludePlaceholder - The mask exclude placeholder. */ export type MaskType = { /** * The mask pattern. */ pattern: string; /** * The mask placeholder. */ placeholder?: string; /** * The mask exclude literal. */ excludeLiteral?: boolean; /** * The mask exclude placeholder. */ excludePlaceholder?: boolean; } /** * @typedef GC.Data.MonthPickerOptions * @property {number} startYear - The month picker's start year, default value is ten year ago. * @property {number} stopYear - The month picker's stop year, default value is this year. * @property {number} height - The dom's height of month picker, default value is 300. */ export type MonthPickerOptions = { /** * The month picker's start year, default value is ten year ago. */ startYear: number; /** * The month picker's stop year, default value is this year. */ stopYear: number; /** * The dom's height of month picker, default value is 300. */ height: number; } /** * @typedef GC.Data.MultiColumnOptions * @property {number} width - User can customize the width for multi-column dropdown. By default, it is the min value between 800 and the result of auto calculated all the column width. * @property {number} height - User can customize the height for multi-column dropdown. By default, it is the min value between 400 and the result of auto calculated all the row height. * @property {string | Object[]} dataSource - User should specify the dataSource for binding.The dataSource is required, supports array or formula which return an array. * @property {GC.Data.ColumnBindingInfo[]} bindingInfos - User can customize the bound column infos. */ export type MultiColumnOptions = { /** * User can customize the width for multi-column dropdown. By default, it is the min value between 800 and the result of auto calculated all the column width. */ width?: number; /** * User can customize the height for multi-column dropdown. By default, it is the min value between 400 and the result of auto calculated all the row height. */ height?: number; /** * User should specify the dataSource for binding.The dataSource is required, supports array or formula which return an array. */ dataSource: string | any[]; /** * User can customize the bound column infos. */ bindingInfos?: GC.Data.ColumnBindingInfo[]; } /** * @typedef GC.Data.NumberValidatorOptions * @property {"number"} type - The data validator type. * @property {GC.Data.CellValueComparisonOperator} comparisonOperator - The data validator comparison operator. * @property {number | GC.Data.FormulaString} value1 - The data validator first value. * @property {number | GC.Data.FormulaString} value2 - The data validator second value if validator comparison operator is "between" or "notBetween". * @property {boolean} isIntegerValue - Is it an integer value if the validator type if "number". * @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 NumberValidatorOptions = { /** * The data validator type. */ type: "number"; /** * The data validator comparison operator. */ comparisonOperator: GC.Data.CellValueComparisonOperator; /** * The data validator first value. */ value1: number | GC.Data.FormulaString; /** * The data validator second value if validator comparison operator is "between" or "notBetween". */ value2?: number | GC.Data.FormulaString; /** * Is it an integer value if the validator type if "number". */ isIntegerValue: boolean; /** * 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.PatternFillOptions * @property {string} type - The pattern fill type, which supports "solid", "darkGray", "mediumGray", "lightGray", "gray125", "gray0625", "darkHorizontal", "darkVertical", "darkDown", "darkUp", "darkGrid", "darkTrellis", "lightHorizontal", "lightVertical", "lightDown", "lightUp", "lightGrid" and "lightTrellis". * @property {string} patternColor - the pattern fill color. * @property {string} backgroundColor - the pattern fill background color. */ export type PatternFillOptions = { /** * The pattern fill type, which supports "solid", "darkGray", "mediumGray", "lightGray", "gray125", "gray0625", "darkHorizontal", "darkVertical", "darkDown", "darkUp", "darkGrid", "darkTrellis", "lightHorizontal", "lightVertical", "lightDown", "lightUp", "lightGrid" and "lightTrellis". */ type: "solid" | "darkGray" | "mediumGray" | "lightGray" | "gray125" | "gray0625" | "darkHorizontal" | "darkVertical" | "darkDown" | "darkUp" | "darkGrid" | "darkTrellis" | "lightHorizontal" | "lightVertical" | "lightDown" | "lightUp" | "lightGrid" | "lightTrellis"; /** * the pattern fill color. */ patternColor: string; /** * the pattern fill background color. */ backgroundColor?: string; } /** * @typedef GC.Data.RadioButtonCheckboxListOptions * @property {string} type - The type of the cell type, supports "radioButtonList","checkboxList". * @property {GC.Data.ItemOptions[]} items - The items, which supports Object Array which each item contains text and value. * @property {string} direction - The the radio box or check box's orders, which support "horizontal", "vertical". * @property {number} maxColumnCount - The the radio box or check box's column count. * @property {number} maxRowCount - The the radio box or check box's row count. * @property {boolean} isFlowLayout - The the radio box or check box's layout is auto fit. * @property {Object} itemSpacing - The space for two items. * @property {number} itemSpacing.horizontal - The space for two items in horizontal direction. * @property {number} itemSpacing.vertical - The space for two items in vertical direction. * @property {string} textAlign - The text alignment relative to the radio box or check box, which supports "left", "right". * @property {number} boxSize - The radio box or check box size. */ export type RadioButtonCheckboxListOptions = { /** * The type of the cell type, supports "radioButtonList","checkboxList". */ type: "radioButtonList" | "checkboxList"; /** * The items, which supports Object Array which each item contains text and value. */ items: GC.Data.ItemOptions[]; /** * The the radio box or check box's orders, which support "horizontal", "vertical". */ direction: "horizontal" | "vertical"; /** * The the radio box or check box's column count. */ maxColumnCount: number; /** * The the radio box or check box's row count. */ maxRowCount: number; /** * The the radio box or check box's layout is auto fit. */ isFlowLayout: boolean; /** * The space for two items. */ itemSpacing: { horizontal: number; vertical: number }; /** * The text alignment relative to the radio box or check box, which supports "left", "right". */ textAlign: "left" | "right"; /** * The radio box or check box size. */ boxSize: number; } /** * @typedef GC.Data.RemoteChangeHandler * @param {Object | Object[]} data - the data changes. * @param {GC.Data.IRemoteFetchOption} options - the options for the handler, similar as RequestInit of the Fetch API. * @returns {Promise} Returns of the handler. * @description handle data changes. */ export type RemoteChangeHandler = (data: Object | Object[], options: GC.Data.IRemoteFetchOption) => Promise /** * @typedef GC.Data.RemoteReadHandler * @param {GC.Data.IRemoteFetchOption} options - the options for the handler, similar as RequestInit of the Fetch API. * @returns {Promise} Returns of the handler. * @description handle reading data. */ export type RemoteReadHandler = (options: Object) => Promise /** * @typedef GC.Data.ScaleValueType * @type {"number"|"lowestValue"|"highestValue"|"percent"|"percentile"|"automin"|"formula"|"automax"} * @description The scale value type. */ export type ScaleValueType = "number"|"lowestValue"|"highestValue"|"percent"|"percentile"|"automin"|"formula"|"automax" /** * @typedef GC.Data.SliderOptions * @property {boolean} scaleVisible - Whether the thumb can drag over tick only, default value is false. * @property {number} max - The maximum value the slider can slide to, default value is 100. * @property {number} min - The minimum value the slider can slide to, default value is 0. * @property {number} step - The granularity that the slider can step through values. Must greater than 0, and be divided by (max - min). When marks no null, step can be null, default value is 1. * @property {boolean} tooltipVisible - If true, tooltip will show always, or it will not show anyway, even if dragging or hovering, default value is false. * @property {number} width - The slider's width when direction is horizontal, default value is 350. * @property {number} height - The slider's height when direction is vertical, default value is 350. * @property {string} direction - The direction of slider, which accepts "horizontal", "vertical", and default value is horizontal. * @property {number[]} marks - The tick mark of slider. * @property {string} formatString - The display formatter, that used to tooltip or marks. */ export type SliderOptions = { /** * Whether the thumb can drag over tick only, default value is false. */ scaleVisible: boolean; /** * The maximum value the slider can slide to, default value is 100. */ max: number; /** * The minimum value the slider can slide to, default value is 0. */ min: number; /** * The granularity that the slider can step through values. Must greater than 0, and be divided by (max - min). When marks no null, step can be null, default value is 1. */ step: number; /** * If true, tooltip will show always, or it will not show anyway, even if dragging or hovering, default value is false. */ tooltipVisible: boolean; /** * The slider's width when direction is horizontal, default value is 350. */ width: number; /** * The slider's height when direction is vertical, default value is 350. */ height: number; /** * The direction of slider, which accepts "horizontal", "vertical", and default value is horizontal. */ direction: "horizontal" | "vertical"; /** * The tick mark of slider. */ marks: number[]; /** * The display formatter, that used to tooltip or marks. */ formatString: string; } /** * @typedef GC.Data.SpecificTextComparisonOperator * @type {"contains"|"doesNotContain"|"beginsWith"|"endsWith"} * @description The specific text comparison operator. */ export type SpecificTextComparisonOperator = "contains"|"doesNotContain"|"beginsWith"|"endsWith" /** * @typedef GC.Data.SpecificTextRuleOptions - The options of specific text rule. * @property {"specificTextRule"} ruleType - The rule type if you want to use specific text rule. * @property {GC.Data.SpecificTextComparisonOperator} comparisonOperator - The comparison operator of specific text. * @property {string} text - The specific text. * @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 SpecificTextRuleOptions = { /** * The rule type if you want to use specific text rule. */ ruleType: "specificTextRule"; /** * The comparison operator of specific text. */ comparisonOperator: GC.Data.SpecificTextComparisonOperator; /** * The specific text. */ text: string; /** * 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.StateRule * @property {GC.Data.StateRuleDirection} direction - The state rule direction. * @property {GC.Data.RowColumnStates} state - The state. * @property {GC.Data.ViewArea} [area] - The rule area. * @description The state rule. */ export type StateRule = { /** * the state rule direction */ direction: GC.Data.StateRuleDirection; /** * the formula string */ state: GC.Data.RowColumnStates; /** * the position where the rule takes an effect */ area?: GC.Data.ViewArea; } /** * @typedef GC.Data.StyleOptions * @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 {GC.Data.CheckboxOptions | GC.Data.ComboBoxOptions | GC.Data.HyperlinkOptions | GC.Data.FileUploadOptions | GC.Data.RadioButtonCheckboxListOptions} cellType - The cell type. * @property {string} backgroundImageLayout - The layout for the background image, which supports "stretch", "center", "zoom", "none". * @property {boolean} tabStop - Whether the user can set focus to the cell using the Tab key. * @property {GC.Data.TextDecoration} textDecoration - The decoration added to text. * @property {string} imeMode - The input method editor mode, which supports "auto", "active", "inactive", "disabled". * @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 {number} textOrientation - The cell text rotation angle. * @property {boolean} showEllipsis - Whether the text out of bounds shows ellipsis. * @property {GC.Data.CellButtonOptions[]} cellButtons - The cell buttons. * @property {GC.Data.DropDownOptions[]} dropDowns - The drop downs. * @property {GC.Data.Decoration} decoration - The decoration. * @property {GC.Data.MaskType} mask - The mask. */ export type StyleOptions = { /** * 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 cell type. */ cellType?: GC.Data.CheckboxOptions | GC.Data.ComboBoxOptions | GC.Data.HyperlinkOptions | GC.Data.FileUploadOptions | GC.Data.RadioButtonCheckboxListOptions; /** * The layout for the background image, which supports "stretch", "center", "zoom", "none". */ backgroundImageLayout?: "stretch" | "center" | "zoom" | "none"; /** * Whether the user can set focus to the cell using the Tab key. */ tabStop?: boolean; /** * The decoration added to text. */ textDecoration?: GC.Data.TextDecoration; /** * The input method editor mode, which supports "auto", "active", "inactive", "disabled". */ imeMode?: "auto" | "active" | "inactive" | "disabled"; /** * 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; /** * The cell text rotation angle. */ textOrientation?: number; /** * Whether the text out of bounds shows ellipsis. */ showEllipsis?: boolean; /** * The cell buttons. */ cellButtons?: GC.Data.CellButtonOptions[]; /** * The drop downs. */ dropDowns?: GC.Data.DropDownOptions[]; /** * The decoration. */ decoration?: GC.Data.Decoration; /** * The mask. */ mask?: GC.Data.MaskType; } /** * @typedef GC.Data.StyleRule * @property {GC.Data.FormulaRule | GC.Data.StateRule} [rule] - The style rule. * @property {GC.Data.StyleOptions} [style] - The style rule style. * @description The style rule. */ export type StyleRule = { /** * the formula rule or the state rule */ rule?: GC.Data.FormulaRule | GC.Data.StateRule; /** * the style if the rule is satisfied */ style?: GC.Data.StyleOptions; } /** * @typedef GC.Data.StyleRules * @property {GC.Data.StyleRule} name - The style rule. * @description The style rules. */ export type StyleRules = { /** * the style rule */ name: GC.Data.StyleRule } /** * @typedef GC.Data.TextDecoration * @type {"underline" | "lineThrough" | "overline" | "doubleUnderline" | "none" | "lineThroughUnderline" | "lineThroughDoubleUnderline"} * @description The text decoration. */ export type TextDecoration = "underline" | "lineThrough" | "overline" | "doubleUnderline" | "none" | "lineThroughUnderline" | "lineThroughDoubleUnderline" /** * @typedef GC.Data.TextLengthString * @type {string} * @description The text length type string, such as "10". */ export type TextLengthString = string /** * @typedef GC.Data.TextLengthValidatorOptions * @property {"textLength"} type - The data validator type. * @property {GC.Data.CellValueComparisonOperator} comparisonOperator - The data validator comparison operator. * @property {GC.Data.TextLengthString | GC.Data.FormulaString} value1 - The data validator first value. * @property {GC.Data.TextLengthString | 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 TextLengthValidatorOptions = { /** * The data validator type. */ type: "textLength"; /** * The data validator comparison operator. */ comparisonOperator: GC.Data.CellValueComparisonOperator; /** * The data validator first value. */ value1: GC.Data.TextLengthString | GC.Data.FormulaString; /** * The data validator second value if validator comparison operator is "between" or "notBetween". */ value2?: GC.Data.TextLengthString | 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.ThreeScaleRuleOptions - The options of three scale rule. * @property {"threeScaleRule"} ruleType - The rule type if you want to use three scale rule. * @property {GC.Data.ScaleValueType} minType - The minimum scale type. * @property {number} minValue - The minimum scale value. * @property {GC.Data.ColorString} minColor - The minimum scale color string. * @property {GC.Data.ScaleValueType} midType - The midpoint scale type. * @property {number} midValue - The midpoint scale value. * @property {GC.Data.ColorString} midColor - The midpoint scale color string. * @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. */ export type ThreeScaleRuleOptions = { /** * The rule type if you want to use three scale rule. */ ruleType: "threeScaleRule"; /** * The minimum scale type. */ minType: GC.Data.ScaleValueType; /** * The minimum scale value. */ minValue: number; /** * The minimum scale color string. */ minColor: GC.Data.ColorString; /** * The midpoint scale type. */ midType: GC.Data.ScaleValueType; /** * The midpoint scale value. */ midValue: number; /** * The midpoint scale color string. */ midColor: GC.Data.ColorString; /** * The maximum scale type. */ maxType: GC.Data.ScaleValueType; /** * The maximum scale value. */ maxValue: number; /** * The maximum scale color string. */ maxColor: GC.Data.ColorString; /** * The priority of the rule. */ priority: number; /** * Whether rules with lower priority are applied before this rule. */ stopIfTrue: boolean; } /** * @typedef GC.Data.TimePickerOptions * @property {GC.Data.TimePickerValue} max - The maximum value the time picker can display, the value need hour, minute and second attribute. * @property {GC.Data.TimePickerValue} min - The minimum value the time picker can display, the value need hour, minute and second attribute. * @property {GC.Data.TimePickerValue} step - The granularity that the time picker can step through values. * @property {string} formatString - The format of the time item. * @property {number} height - The container of the time picker's size. */ export type TimePickerOptions = { /** * The maximum value the time picker can display, the value need hour, minute and second attribute. */ max: GC.Data.TimePickerValue; /** * The minimum value the time picker can display, the value need hour, minute and second attribute. */ min: GC.Data.TimePickerValue; /** * The granularity that the time picker can step through values. */ step: GC.Data.TimePickerValue; /** * The format of the time item. */ formatString: string; /** * The container of the time picker's size. */ height: number; } /** * @typedef GC.Data.TimePickerValue * @property {number} hour - The hour of the value. * @property {number} minute - The minute of the value. * @property {number} second - The second of the value. */ export type TimePickerValue = { /** * The hour of the value. */ hour: number; /** * The minute of the value. */ minute: number; /** * The second of the value. */ second: number; } /** * @typedef GC.Data.TimeValidatorOptions * @property {"time"} 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 TimeValidatorOptions = { /** * The data validator type. */ type: "time"; /** * 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.Top10RuleOptions - The options of top-10 rule. * @property {"top10Rule"} ruleType - The rule type if you want to use top-10 rule. * @property {GC.Data.Top10Type} type - The top-10 type. * @property {number} rank - The number of top or bottom items to apply the style to. * @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 Top10RuleOptions = { /** * The rule type if you want to use top-10 rule. */ ruleType: "top10Rule"; /** * The top-10 type. */ type: GC.Data.Top10Type; /** * The number of top or bottom items to apply the style to. */ rank: number; /** * 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.Top10Type * @type {"top"|"bottom"} * @description The top-10 type. */ export type Top10Type = "top"|"bottom" /** * @typedef GC.Data.TwoScaleRuleOptions - The options of two scale rule. * @property {"twoScaleRule"} ruleType - The rule type if you want to use two scale rule. * @property {GC.Data.ScaleValueType} minType - The minimum scale type. * @property {number} minValue - The minimum scale value. * @property {GC.Data.ColorString} minColor - The minimum scale color string. * @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. */ export type TwoScaleRuleOptions = { /** * The rule type if you want to use two scale rule. */ ruleType: "twoScaleRule"; /** * The minimum scale type. */ minType: GC.Data.ScaleValueType; /** * The minimum scale value. */ minValue: number; /** * The minimum scale color string. */ minColor: GC.Data.ColorString; /** * The maximum scale type. */ maxType: GC.Data.ScaleValueType; /** * The maximum scale value. */ maxValue: number; /** * The maximum scale color string. */ maxColor: GC.Data.ColorString; /** * The priority of the rule. */ priority: number; /** * Whether rules with lower priority are applied before this rule. */ stopIfTrue: boolean; } /** * @typedef GC.Data.UniqueRuleOptions - The options of unique rule. * @property {"uniqueRule"} ruleType - The rule type if you want to use unique 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 UniqueRuleOptions = { /** * The rule type if you want to use unique rule. */ ruleType: "uniqueRule"; /** * 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.ViewOptions * @property {number} [defaultColumnWidth] - The default column width. * @property {GC.Data.StyleRules} [styleRules] - The style rules. * @property {boolean} [showCrossValueHeader] - mark the cross value headers are visible. * @property {GC.Data.ICrossViewOptions} [cross] - define the cross column options. * @description The options for the view. */ export type ViewOptions = { /** * the default column width */ defaultColumnWidth?: number; /** * the style rules */ styleRules?: GC.Data.StyleRules; /** * mark the cross value headers are visible. */ showCrossValueHeader?: boolean; /** * define the cross column options. */ cross?: GC.Data.ICrossViewOptions; } /** * @typedef GC.Data.WorkFlowItem * @property {string} value - The item value. * @property {number[]|string[]} transitions - The item transitions. */ export type WorkFlowItem = { /** * The item value. */ value: string; /** * The item transitions. */ transitions: number[]|string[]; } /** * @typedef GC.Data.WorkFlowOptions * @property {GC.Data.WorkFlowItem[]} items - The items. */ export type WorkFlowOptions = { /** * The items. */ items: GC.Data.WorkFlowItem[]; } /** * Specifies the type of row and column state. * @enum {number} */ export enum RowColumnStates{ /** When mouse hover on the row and the column , its state include "hover" state. * @type {number} */ hover= 1, /** When the column is locked, its state include "readonly" state. This state only support for column. * @type {number} */ readonly= 4, /** When the row or the column is focus, its state include "active" state. * @type {number} */ active= 16, /** When the cell is in the selection range, the cell row and column state include "selected" state. * @type {number} */ selected= 32, /** When cell value is changed, cell row and column state include "dirty" state. * @type {number} */ dirty= 64, /** When inserted a row, its state include "inserted" state. This state only support for row. * @type {number} */ inserted= 128, /** When updated a row, its state include "updated" state. This state only support for row. * @type {number} */ updated= 256, /** When pin a row/column, its state include "pin" state. * @type {number} */ pin= 1024, /** When the column has primary key, its state include "primaryKey" state. This state only support for column. * @type {number} */ primaryKey= 2048, /** When the value of the column are required, its state include "required" state. This state only support for column. * @type {number} */ required= 4096 } /** * Defines the direction in which the style rule is applied. * @enum {number} * @example * ```javascript * view.addStyleRule("hoverRowStyle", GC.Data.View.StateRuleDirection, { backColor: "green" }, { state: GC.Data.RowColumnStates.hover }); * ``` */ export enum StateRuleDirection{ /** Specifies the style rule will not be applied. * @type {number} */ none= 0, /** Specifies the style rule will apply to the row direction. * @type {number} */ row= 1, /** Specifies the style rule will apply to the column direction. * @type {number} */ column= 2, /** Specifies the style rule will apply to both row and column direction. * @type {number} */ both= 3 } /** * Specifies the view area. * @enum {number} */ export enum ViewArea{ /** Indicates the column header. * @type {number} */ colHeader= 1, /** Indicates the viewport. * @type {number} */ viewport= 3 } export class DataManager{ /** * Represents the data manager. * @class * @example * ```javascript * // Create a data manager * var dataManager = new GC.Data.DataManager(); * ``` */ constructor(); /** * Represents the relationship array. Each relationship includes the following field, * @property {GC.Data.Table} sourceTable - The source table. * @property {string} sourceFieldName - The field name of the source table. * @property {string} sourceRelationshipName - The relationship name which can be used in source table. * @property {GC.Data.Table} targetTable - The target table. * @property {string} targetFieldName - The field name of the target table. * @property {string} targetRelationshipName - The relationship name which can be used in target table. * @type {Object[]} */ relationships: GC.Data.IRelationship[]; /** * Represents the table collection. Its key is table name, and value is GC.Data.Table instance. * @type {Object} */ tables: GC.Data.ITables; /** * Adds a relationship into the data manager. * @param {GC.Data.Table} sourceTable - The source table, which foreign key is target table's primary key. * @param {string} sourceFieldName - The source field name. * @param {string} sourceRelationshipName - The source relationship name. * @param {GC.Data.Table} targetTable - The target table, which primary key is source table's foreign key. * @param {string} targetFieldName - The target field name. * @param {string} targetRelationshipName - The target relationship name. * @returns {Object} Returns the relationship. * @example * ```javascript * // Add relationship between products table and categories table * dataManager.addRelationship(productTable, "categoryId", "categories", categoriesTable, "id", "products"); * ``` */ addRelationship(sourceTable: GC.Data.Table, sourceFieldName: string, sourceRelationshipName: string, targetTable: GC.Data.Table, targetFieldName: string, targetRelationshipName: string): GC.Data.IRelationship; /** * Add a table into the data manager. * @param {string} name - The table name. * @param {GC.Data.IDataSourceOption} dataSourceOption - The data source option for creating a table, which contains the following properties. * @returns {GC.Data.Table} Returns the table. * @example * ```javascript * // Add a sample table to read data * var tableName = "products"; * var dataSourceOption = { * remote: { * read: { * url: "https://demodata.mescius.io/northwind/api/v1/orders" * } * }, * schema: { * columns: { * orderId: {dataName: "id"}, * orderDate: {dataType: "date", dataPattern: "yyyy-MM-dd hh:mm:ss.000"}, * requiredDate: {dataType: "date"}, * shippedDate: {dataType: "date"}, * shipVia: {dataMap: {1: "Speedy Express", 2: "United Package", 3: "Federal Shipping"}} * } * } * }; * var dataManager = new GC.Data.DataManager(); * var productTable = dataManager.addTable(tableName, dataSourceOption); * ``` */ addTable(name: string, dataSourceOption: GC.Data.IDataSourceOption): GC.Data.Table; /** * Removes a relationship from the data manager by source relationship name. * @param {string} name - The source relationship name. * @example * ```javascript * // Remove a relationship from the data manager by source relationship name * dataManager.removeRelationship("categories"); * ``` */ removeRelationship(name: string): void; /** * Removes a table from the data manager. * @param {string} name - The table name. * @example * ```javascript * // Remove a table from data manager by table name * dataManager.removeTable("products"); * ``` */ removeTable(name: string): void; } export class Table{ /** * Represents the table. * @class * @param {string} name - The table name. * @param {GC.Data.IDataSourceOption} dataSourceOption - The data source of table. */ constructor(name: string, dataSourceOption: GC.Data.IDataSourceOption); /** * Represents the default columns of the table, it is only available after table is fetched. The key is column name, the value is column information. * @type {Object} */ columns: GC.Data.IColumnCollection; /** * Represents the name of the table. * @type {string} */ name: string; /** * Represents the data source options of the table. * @type {GC.Data.IDataSourceOption} */ options: GC.Data.IDataSourceOption; /** * Represents the view collection of the table. The key is view name, the value is GC.Data.View instance. * @type {Object} */ views: GC.Data.IViews; /** * Adds a view, which host table is current table. * @param {string} name - The view name. * @param {string[] | Object[]} [columnInfos] - The column information, each column includes the following properties. * @param {boolean} includeDefaultColumns - Whether to include current table's default columns when column information are empty. Its default value is true. * @param {GC.Data.ViewOptions} [options] - The view options. * @property {string} name - The unique name of the column. * @property {string} [value] - The value of the column, could be a field name of table from database, or formula which uses the fields names. * @property {string | string[]} [caption] - The caption of the column. * @property {number | string} [width] - The width of the column, support number in pixel, or star size. * @property {GC.Data.StyleOptions} [style] - The column style options. * @property {(GC.Data.CellValueRuleOptions | GC.Data.SpecificTextRuleOptions | GC.Data.FormulaRuleOptions | GC.Data.DateOccurringRuleOptions | GC.Data.Top10RuleOptions | GC.Data.UniqueRuleOptions | GC.Data.DuplicateRuleOptions | GC.Data.AverageRuleOptions | GC.Data.TwoScaleRuleOptions | GC.Data.ThreeScaleRuleOptions | GC.Data.DataBarRuleOptions | GC.Data.IconSetRuleOptions)[]} [conditionalFormats] - The conditional rules array. * @property {GC.Data.NumberValidatorOptions | GC.Data.DateValidatorOptions | GC.Data.TimeValidatorOptions | GC.Data.TextLengthValidatorOptions | GC.Data.FormulaValidatorOptions | GC.Data.FormulaListValidatorOptions | GC.Data.ListValidatorOptions} [validators] - The default data validator. * @property {boolean} [isPrimaryKey] - Mark the column as primary key column. * @property {boolean} [readonly] - Mark the column is readonly. * @property {boolean} [required] - Mark the column is required when insert a new row. * @property {Object} [defaultValue] - Provide the default value when insert a new row, could be a const or a formula. * @property {GC.Data.HeaderStyleOptions} [style] - The column header style options. * @returns {GC.Data.View} Returns the view. * @example * ```javascript * // Add a view by string array columns * productTable.addView("productView", [ * "id", "name", "reorderLevel", "unitPrice", "unitsInStock", "unitsOnOrder" * ]); * * // Add a view by customized columns * productTable.addView("productView", [{ * value: "id", * caption: "ID", * isPrimaryKey: true * }, { * value: "name", * caption: "NAME", * required: true * }, { * value: "quantityPerUnit", * caption: "QUANTITY PER UNIT" * }, { * value: "unitPrice", * caption: "UNIT PRICE" * }, { * value: "unitsInStock", * caption: "UNITS IN STOCK", * readonly: true * }, { * value: "unitsOnOrder", * caption: "UNITS ON ORDER" * }, { * value: "reorderLevel", * caption: "REORDER LEVEL" * }, { * value: "discontinued", * caption: "DISCONTINUED", * defaultValue: false * }); * * // Add a view with relationship columns * var supplierRelationship = dataManager.addRelationship(productTable, "supplierId", "supplier", supplierTable, "id", "products"); * productTable.addView("productWithSupplierView", [{ * value: "id", * caption: "ID" * }, { * value: "name", * caption: "NAME" * }, { * value: "supplier.companyName", // relationship * caption: "SUPPLIER NAME" * }, { * value: "supplier.contactName", // relationship * caption: "SUPPLIER CONTACT NAME" * }, { * value: "supplier.contactTitle", // relationship * caption: "SUPPLIER CONTACT TITLE" * }); * * // Add a view with calc field columns * var supplierRelationship = dataManager.addRelationship(productTable, "supplierId", "supplier", supplierTable, "id", "products"); * productTable.addView("productWithSupplierView", [{ * value: "id", * caption: "ID" * }, { * value: "name", * caption: "NAME" * }, { * caption: "TOTAL PRICE", * value: "=(unitsInStock + unitsOnOrder) * unitPrice" * }, { * caption: "SUPPLIER'S INFO", * value: "=CONCAT(supplierTable.companyName, ', ', supplierTable.contactName)" * }); * * ``` */ addView(name: string, columnInfos?: string[] | GC.Data.IColumn[], includeDefaultColumns?: boolean, options?: GC.Data.ViewOptions): GC.Data.View; /** * Clear all the indexed fields. * @example * ```javascript * // Clear all the indexed fields. * table.clearIndexes(); * ``` */ clearIndexes(): void; /** * Create index for the fields. * @param {Array} fields The index fields. * @example * ```javascript * // Create indexes. * table.createIndexes(["name", "country", "project"]); * ``` */ createIndexes(fields: string[]): void; /** * Drop indexed fields. * @param {Array} fields The indexed fields. * @example * ```javascript * // Drop indexed fields. * table.dropIndexes(["name", "country", "project"]); * ``` */ dropIndexes(fields: string[]): void; /** * Requests the table data from local data source or remote data source by the data source option. * @param {boolean} [reload] Whether to reload the data from server side forcibly. * @returns {Promise} The resolving Promise thenable. You could get the data in Promise.then(). * @example * ```javascript * // Use fetched data to build a tablesheet * productTable.fetch().then(function(data) { * var productView = productTable.addView("productView"); * var tableSheet = spread.addSheetTab(0, "productTableSheet", GC.Spread.Sheets.SheetType.tableSheet); * tableSheet.setDataView(productView); * }); * ``` */ fetch(reload?: boolean): Promise; /** * Get all the indexed fields. * @returns {Array} The indexed fields. * @example * ```javascript * // Indexed fields exist. * table.getIndexes(); // returns ["name", "country", "project"] * // No indexed field. * table.getIndexes(); // returns [] * ``` */ getIndexes(): string[]; /** * Removes a view. * @param {string} name - The name of the view to be removed. * @example * ```javascript * // Remove a view by name * dataManager.removeView("productView"); * ``` */ removeView(name: string): void; /** * Search the records with search value, returns all the exact matching records. * @param {Object} value The search value. Always convert the non-string to string type. * @param {string} field The target field. * @returns {Array} The all matching records. * @example * ```javascript * // Search value and succeed * table.search("SpreadJS", "group"); // returns [ {id: 1, project: "DataManager", group: "SpreadJS"}, {id: 3, project: "TableSheet", group: "SpreadJS"} ] * // Search value and failed * table.search("WPS", "project"); // returns [] * ``` */ search(value: any, field: string): any[]; } export class View{ /** * Represents the view. * @class * @param {string} name - The view name. * @param {string[] | Object[]} [columnInfos] - The column information, each column includes the following properties. * @param {boolean} [includeDefaultColumns] - Whether to include current table's default columns when column information are empty. Its default value is true. * @param {GC.Data.ViewOptions} [options] - The view options. * @property {string} name - The unique name of the column. * @property {string} [value] - The value of the column, could be a field name of table from database, or formula which uses the fields names. * @property {string | string[]} [caption] - The caption of the column. * @property {number | string} [width] - The width of the column, support number in pixel, or star size. * @property {GC.Data.StyleOptions} [style] - The column style options. * @property {(GC.Data.CellValueRuleOptions | GC.Data.SpecificTextRuleOptions | GC.Data.FormulaRuleOptions | GC.Data.DateOccurringRuleOptions | GC.Data.Top10RuleOptions | GC.Data.UniqueRuleOptions | GC.Data.DuplicateRuleOptions | GC.Data.AverageRuleOptions | GC.Data.TwoScaleRuleOptions | GC.Data.ThreeScaleRuleOptions | GC.Data.DataBarRuleOptions | GC.Data.IconSetRuleOptions)[]} [conditionalFormats] - The conditional rules array. * @property {GC.Data.NumberValidatorOptions | GC.Data.DateValidatorOptions | GC.Data.TimeValidatorOptions | GC.Data.TextLengthValidatorOptions | GC.Data.FormulaValidatorOptions | GC.Data.FormulaListValidatorOptions | GC.Data.ListValidatorOptions} [validators] - The default data validator. * @property {boolean} [isPrimaryKey] - Mark the column as primary key column. * @property {boolean} [readonly] - Mark the column is readonly. * @property {boolean} [required] - Mark the column is required when insert a new row. * @property {Object} [defaultValue] - Provide the default value when insert a new row, could be a const or a formula. * @property {GC.Data.HeaderStyleOptions} [style] - The column header style options. * @returns {GC.Data.View} Returns the view. * / ///* field name: string /** * Represents the name of the view. * @type {string} */ constructor(name: string, columnInfos?: string[] | GC.Data.IColumn[], includeDefaultColumns?: boolean, options?: GC.Data.ViewOptions); /** * Whether to filter again after data is changed. Its default value is true. * @type {string} */ autoFilter: boolean; /** * Whether to sort again after data is changed. Its default value is true. * @type {string} */ autoSort: boolean; /** * Adds a column into current view. * @param {string | Object} column - The column string or object. When the parameter is a string, the column name and value are the string. * @example * ```javascript * // Add columns to view * var productTable = dataManager.addTable("products", { * remote: { * read: { * url: "https://demodata.mescius.io/northwind/api/v1/products" * } * } * }); * var productView = productTable.addView("productView", [ "id", "name" ]); * productTable.fetch().then(function() { * productView.addColumn("reorderLevel"); * productView.addColumn({ value: "unitPrice", caption: "UNIT PRICE" }); * }); * ``` */ addColumn(column: string | GC.Data.IColumn): void; /** * Add a style rule into view. * @param {string} name - The style rule name. * @param {GC.Data.StyleOptions} [style] - The style if the rule is satisfied. * @param {GC.Data.FormulaRule | GC.Data.StateRule} [rule] - The style rule option. * @example * ```javascript * // add a style rule * view.addStyleRule("dirtyRowStyle", { backColor: "yellow" }, { * direction: GC.Data.StateRuleDirection.row, * state: GC.Data.RowColumnStates.dirty * }); * ``` */ addStyleRule(name: string, style?: GC.Data.StyleOptions, rule?: GC.Data.FormulaRule | GC.Data.StateRule): void; /** * clear all the style rules from view. * @example * ```javascript * // remove a style rule * view.clearStyleRules(); * ``` */ clearStyleRules(): void; /** * Requests the view data from its host table and related table. * @param {boolean} [reload] Whether to reload the data from server side forcibly. * @returns {Promise} The resolving Promise thenable. You could get the data in Promise.then(). * @example * ```javascript * // Set tablesheet with custom view * var tablesheet = spread.addSheetTab(0, "TableSheet1", GC.Spread.Sheets.SheetType.tableSheet); * var dataManager = new GC.Data.DataManager(); * var productTable = dataManager.addTable("productTable", { * remote: { * read: { * url: "https://demodata.mescius.io/northwind/api/v1/products" * } * } * }); * var productView = productTable.addView("productView", [ * "id", "name", "reorderLevel", "unitPrice", "unitsInStock", "unitsOnOrder" * ]); * productView.fetch().then(function () { * // set data source with a View * tablesheet.setDataView(productView); * }); * ``` */ fetch(reload?: boolean): Promise; /** * Gets a column of current view. * @param {number} [index] - The column index. * @returns {Object | Object[]} Returns a column by the specified index, or returns all columns when the parameter is omitted. * @example * ```javascript * // Get all columns * var allColumns = productWithSupplierView.getColumn(); * // Get the second column * var column1 = productWithSupplierView.getColumn(1); * ``` */ getColumn(index?: number): GC.Data.IColumn | GC.Data.IColumn[]; /** * Get a style rule or all style rules. * @param {string} [name] - The style rule name. * @returns {GC.Data.StyleRule | GC.Data.StyleRules | undefined} Returns a style rule or all style rules. * @example * ```javascript * // get a style rule * view.getStyleRule("dirtyRowStyle"); * // get all style rule * view.getStyleRule(); * ``` */ getStyleRule(name?: string): GC.Data.StyleRule | GC.Data.StyleRules | undefined; /** * Get the view host table data source length. * @returns {number} The host table data source length. * @example * ```javascript * // after fetch data, can get the view data source length. * let dataSourceLength = productView.length(); * ``` */ length(): number; /** * Removes a column from current view. * @param column - The column value. * @example * ```javascript * // Remove a column * productWithSupplierView.removeColumn("discontinued"); * ``` */ removeColumn(column: string): void; /** * Add a style rule by name from view. * @param {string} name - The style rule name. * @example * ```javascript * // remove a style rule * view.removeStyleRule("dirtyRowStyle"); * ``` */ removeStyleRule(name: string): void; /** * Get the visible data length in the current view. * @returns {number} The visible data length in the current view. * @example * ```javascript * // after fetch data, can get the view visibleLength. * let viewVisibleLength = productView.visibleLength(); * ``` */ visibleLength(): number; } } module Pivot{ export interface ICustomSortCallBack{ (fieldItemNameArray: any[], sortInfo: GC.Pivot.IPivotCustomSortInfo) : any[]; } export interface IPivotCustomSortInfo{ sortType: GC.Pivot.SortType; isDate?: boolean; } /** * @typedef {object} GC.Pivot.IDataPosition * @property {boolean} [display] * @property {GC.Pivot.DataPosition} * @property {number} */ export type IDataPosition = { display?: boolean; positionType: GC.Pivot.DataPosition; positionIndex: number; } /** * @typedef {object} GC.Pivot.IPivotCaptionConditionFilterInfo * @property {GC.Pivot.PivotConditionType} conType * @property {string[]} val * @property {GC.Pivot.PivotCaptionFilterOperator} operator */ export type IPivotCaptionConditionFilterInfo = { conType: GC.Pivot.PivotConditionType; val: string[]; operator: GC.Pivot.PivotCaptionFilterOperator; } /** * @typedef {object} GC.Pivot.IPivotDateConditionFilterInfo * @property {GC.Pivot.PivotConditionType} conType * @property {Date[]} val * @property {GC.Pivot.PivotDateFilterOperator} operator * @property {boolean} isWholeDay * @property {boolean} isDynamicEndDate * @property {boolean} isParallel * @property {GC.Pivot.PivotAdvancedDateFilterBy} by */ export type IPivotDateConditionFilterInfo = { conType: GC.Pivot.PivotConditionType; val: Date[]; operator: GC.Pivot.PivotDateFilterOperator; isWholeDay: boolean; isDynamicEndDate?: boolean; isParallel?: boolean; by?: GC.Pivot.PivotAdvancedDateFilterBy; } /** * @typedef {object} GC.Pivot.IPivotTop10ConditionFilterInfo * @property {GC.Pivot.PivotConditionType} conType * @property {number} val * @property {GC.Pivot.PivotTop10FilterType} type * @property {GC.Pivot.PivotTop10FilterOperator} operator */ export type IPivotTop10ConditionFilterInfo = { conType: GC.Pivot.PivotConditionType; val: number; type: GC.Pivot.PivotTop10FilterType; operator: GC.Pivot.PivotTop10FilterOperator; } /** * @typedef {object} GC.Pivot.IPivotValueConditionInfo * @property {GC.Pivot.PivotConditionType} conType * @property {number[]} val * @property {GC.Pivot.PivotValueFilterOperator} operator */ export type IPivotValueConditionInfo = { conType: GC.Pivot.PivotConditionType; val: number[]; operator: GC.Pivot.PivotValueFilterOperator; } /** * @typedef {object} GC.Pivot.IPivotViewSortInfo * @property {GC.Pivot.SortType} sortType sort field by ascending or descending or custom. * @property {string} sortValueFieldName sort field by specified value area field's value. * @property {GC.Spread.Pivot.IPivotReference[]} sortByPivotReferences sort field by specified row or column. sortValueFieldName is must if use this property. * @property {GC.Pivot.ICustomSortCallBack} customSortCallback sort field by custom way. should return the ordered field items array. */ export type IPivotViewSortInfo = { sortType?: GC.Pivot.SortType; sortValueFieldName?: string; sortByPivotReferences?: GC.Spread.Pivot.IPivotReference[]; customSortCallback?: GC.Pivot.ICustomSortCallBack; } /** * @typedef GC.Pivot.IStringGroupItems * @property {Object.} -The group field items name and the matched items text. */ export type IStringGroupItems = { [groupItemName: string]: (string | number)[]; } /** * @typedef {object} GC.Pivot.IValueInfo * @property {string} sourceName value field source name. * @property {GC.Pivot.SubtotalType} subtotalType value field subtotal type. */ export type IValueInfo = { sourceName: string; subtotalType: GC.Pivot.SubtotalType; } /** * indicates the area where the Values is located * @enum {number} */ export enum DataPosition{ /** * Values is displayed in the row area */ row= 0, /** * Values is displayed in the column area */ col= 1, /** * Values does not show */ none= 2 } /** * indicates the date group type * @enum {number} */ export enum DateGroupType{ /** * seconds */ seconds= 0, /** * minutes */ minutes= 1, /** * hours */ hours= 2, /** * days */ days= 3, /** * months */ months= 4, /** * quarters */ quarters= 5, /** * years */ years= 6 } /** * Describes the type of advanced date filter * @enum {number} */ export enum PivotAdvancedDateFilterBy{ /** * filter by month */ month= 1, /** * filter by quarter */ quarter= 2, /** * filter by year */ year= 3 } /** * Describe the type of caption filter * @enum {number} */ export enum PivotCaptionFilterOperator{ /** * Indicates whether the string is equal to a specified string. */ equalsTo= 0, /** * Indicates whether the string is not equal to a specified string. */ notEqualsTo= 1, /** * Indicates whether the string starts with a specified string. */ beginsWith= 2, /** * Indicates whether the string does not start with a specified string. */ doesNotBeginWith= 3, /** * Indicates whether the string ends with a specified string. */ endsWith= 4, /** * Indicates whether the string does not end with a specified string. */ doesNotEndWith= 5, /** * Indicates whether the string contains a specified string. */ contains= 6, /** * Indicates whether the string does not contain a specified string. */ doesNotContain= 7, /** * Indicates whether a value is greater than the parameter value. */ greaterThan= 8, /** * Indicates whether a value is greater than or equal to the parameter value. */ greaterThanOrEqualsTo= 9, /** * Indicates whether a value is less than the parameter value. */ lessThan= 10, /** * Indicates whether a value is less than or equal to the parameter value. */ lessThanOrEqualsTo= 11, /** * Indicates whether the number is between parameter values. */ between= 12, /** * Indicates whether the number is not between parameter values. */ notBetween= 13 } /** * describe the type of filter * @enum {number} */ export enum PivotConditionType{ /** * Indicates a text or number condition type. */ caption= 0, /** * Indicates a date type condition. */ date= 1, /** * Indicates number condition. */ value= 2, /** * Indicates a specific condition which use for finding the top10 number . */ top10= 3 } /** * Indicates the field data type of pivot table. * @enum {number} */ export enum PivotDataType{ /** * number type */ number= 0, /** * string type */ string= 1, /** * date type */ date= 2 } /** * Describe the type of date filter * @enum {number} */ export enum PivotDateFilterOperator{ /** * Indicates whether the date time is equal to a certain time. */ equalsTo= 0, /** * Indicates whether the date time is not equal to a certain time. */ notEqualsTo= 1, /** * Indicates whether the date time is before a certain time. */ before= 2, /** * Indicates whether the date time is before or equal to a certain time. */ beforeEqualsTo= 3, /** * Indicates whether the date time is after a certain time. */ after= 4, /** * Indicates whether the date time is after or equal to a certain time. */ afterEqualsTo= 5, /** * Indicates whether the date time is between the certain time. */ Between= 6, /** * Indicates whether the date time is not between the certain time. */ notBetween= 7, /** * Specifies today. */ today= 8, /** * Specifies yesterday. */ yesterday= 9, /** * Specifies tomorrow. */ tomorrow= 10, /** * Specifies this month. */ thisMonth= 12, /** * Specifies last month. */ lastMonth= 13, /** * Specifies next month. */ nextMonth= 14, /** * Specifies this week. */ thisWeek= 15, /** * Specifies last week. */ lastWeek= 16, /** * Specifies next week. */ nextWeek= 17, /** * Specifies next Quarter. */ nextQuarter= 18, /** * Specifies this Quarter. */ thisQuarter= 19, /** * Specifies last Quarter. */ lastQuarter= 20, /** * Specifies next Year. */ nextYear= 21, /** * Specifies this Year. */ thisYear= 22, /** * Specifies last Year. */ lastYear= 23, /** * Indicates the first quarter of a year. */ Q1= 24, /** * Indicates the second quarter of a year. */ Q2= 25, /** * Indicates the third quarter of a year. */ Q3= 26, /** * Indicates the fourth quarter of a year. */ Q4= 27, /** * Indicates the January of a year. */ M1= 28, /** * Indicates the February of a year. */ M2= 29, /** * Indicates the March of a year. */ M3= 30, /** * Indicates the April of a year. */ M4= 31, /** * Indicates the May of a year. */ M5= 32, /** * Indicates the June of a year. */ M6= 33, /** * Indicates the July of a year. */ M7= 34, /** * Indicates the August of a year. */ M8= 35, /** * Indicates the September of a year. */ M9= 36, /** * Indicates the October of a year. */ M10= 37, /** * Indicates the November of a year. */ M11= 38, /** * Indicates the December of a year. */ M12= 39, /** * Indicates the form Jan-1 to today in current year. */ yearToDate= 40, /** * Indicates the form customize start time to end time. */ dateToDate= 41 } /** * indicates the pivot table show value as type * @enum {number} */ export enum PivotShowDataAs{ /** * no calculation */ normal= 0, /** * % of Grand Total */ percentOfTotal= 1, /** * % of row Grand Total */ percentOfRow= 2, /** * % of Column Grand Total */ percentOfCol= 3, /** * % of */ percent= 4, /** * % of Parent Row Total */ percentOfParentRow= 5, /** * % of Parent Column Total */ percentOfParentCol= 6, /** * % of Parent Total */ percentOfParent= 7, /** * Difference from */ difference= 8, /** * % difference from */ percentDiff= 9, /** * running total in */ runTotal= 10, /** * % of running total in */ percentOfRunningTotal= 11, /** * rank smallest to largest */ rankAscending= 12, /** * rank largest to smallest */ rankDescending= 13, /** * index */ index= 14 } /** * Indicates the view layout type of pivot table. * @enum {number} */ export enum PivotShowDataAsBaseItemType{ /** * show data as base on a certain item of base field */ item= 0, /** * show data as base on the next item of base field */ next= 1, /** * show data as base on the previous item of base field */ previous= 2 } /** * Indicates the pivot field type of pivot table. * @enum {number} */ export enum PivotSourceFieldType{ /** * this is a calc field mark */ isCalcField= 0, /** * this is a group field mark */ isGroupField= 1 } /** * Indicates that the interception is the front or back * @enum {number} */ export enum PivotTop10FilterOperator{ /** * Indicates that the interception is the front */ top= 1, /** * Indicates that the interception is the back */ bottom= -1 } /** * Describes the type of filter * @enum {number} */ export enum PivotTop10FilterType{ /** * filter by count */ count= 0, /** * filter by percent */ percent= 1, /** * filter by sum */ sum= 2 } /** * describe the type of filter * @enum {number} */ export enum PivotValueFilterOperator{ /** * Determines whether a value is equal to the parameter value. */ equalsTo= 0, /** * Determines whether a value is not equal to the parameter value. */ notEqualsTo= 1, /** * Determines whether a value is greater than the parameter value. */ greaterThan= 2, /** * Determines whether a value is greater than or equal to the parameter value. */ greaterThanOrEqualsTo= 3, /** * Determines whether a value is less than the parameter value. */ lessThan= 4, /** * Determines whether a value is less than or equal to the parameter value. */ lessThanOrEqualsTo= 5, /** * Determines whether a value is between the two parameter values. */ between= 6, /** *Determines whether a cell value is not between the two parameter values. */ notBetween= 7 } /** * Indicates the pivot table sort type. * @enum {number} */ export enum SortType{ /** * Sort in ascending order */ asc= 0, /** * Sort in descending order */ desc= 1, /** * User-defined sort type */ custom= 2 } /** * Indicates the type of data subtotal * @enum {number} */ export enum SubtotalType{ /** * Average */ average= 0, /** * Count */ count= 1, /** * CountNums */ countNums= 2, /** * Max */ max= 3, /** * Min */ min= 4, /** * Product */ product= 5, /** * StdDev */ stdDev= 6, /** * StdDevp */ stdDevp= 7, /** * Sum */ sum= 8, /** * Var */ varr= 9, /** * Varp */ varp= 10 } } module Spread{ module CalcEngine{ /** * Gets or Sets the Excel Compatible Mode for CalcEngine. Default value is FALSE. * When ExcelCompatibleCalcMode disabled, SpreadJS will auto convert text to number for calculation. * When ExcelCompatibleCalcMode enabled, treated the text differently when provided as argument directly or in array / reference. * For example, A1 is text value "1", SUM(A1, 1) will be 2 if disabled, and 1 if enabled. * @example * ```javascript * GC.Spread.CalcEngine.ExcelCompatibleCalcMode = true; * ``` */ var ExcelCompatibleCalcMode: boolean; /** * Represents the expression type * @enum {number} */ export enum ExpressionType{ /** * Specifies the unknown type */ unknow= 0, /** * Specifies the reference type */ reference= 1, /** * Specifies the number type */ number= 2, /** * Specifies the string type */ string= 3, /** * Specifies the boolean type */ boolean= 4, /** * Specifies the error type */ error= 5, /** * Specifies the array type */ array= 6, /** * Specifies the function type */ function= 7, /** * Specifies the name type */ name= 8, /** * Specifies the operator type */ operator= 9, /** * Specifies the parenthesis type */ parentheses= 10, /** * Specifies the missing argument type */ missingArgument= 11, /** * Specifies the expand type */ expand= 12, /** * Specifies the struct reference type */ structReference= 13, /** * Specifies the local name type */ LocalName= 100 } export class AsyncEvaluateContext{ /** * Represents an evaluate context for async functions. * @class * @param {Object} context The common evaluate context. */ constructor(context: any); /** * Set the async function evaluate result to CalcEngine, CalcEngine uses this value to recalculate the cell that contains this async function and all dependents cells. * @param {Object} value The async function evaluate result. */ setAsyncResult(value: any): void; } export class CalcArray{ /** * Represents an array in the formula result. * @class * @param {any[][]} array The array content of the formula result. */ constructor(array: any[][]); } export class CalcError{ /** * Represents an error in calculation. * @class * @param {string} error The description of the error. */ constructor(error: string); /** * Parses the specified error from the string. * @param {string} value The error string. * @returns {GC.Spread.CalcEngine.CalcError} The calculation error. */ static parse(value:string): GC.Spread.CalcEngine.CalcError; /** * Returns a string that represents this instance. * @returns {string} The error string. */ toString(): string; } export class Expression{ /** * Provides the base class from which the classes that represent expression tree nodes are derived. This is an abstract class. * @class * @example * ```javascript * // the below code will return a Expression * GC.Spread.Sheets.CalcEngine.formulaToExpression(sheet, "=1"); * ``` */ constructor(type: GC.Spread.CalcEngine.ExpressionType); /** * Indicates the expression type * @type {GC.Spread.CalcEngine.ExpressionType} * @example * ```javascript * console.log(GC.Spread.Sheets.CalcEngine.formulaToExpression(sheet, "=1").type === GC.Spread.CalcEngine.ExpressionType.number); * ``` */ type: GC.Spread.CalcEngine.ExpressionType; } module Functions{ /** * Defines a global custom function. * @param {string} name The name of the function. * @param {GC.Spread.CalcEngine.Functions.Function} fn The function to add. */ function defineGlobalCustomFunction(name: string, fn: GC.Spread.CalcEngine.Functions.Function): GC.Spread.CalcEngine.Functions.Function; /** * Gets all of the global functions or one global function that specified by name. * @param {string} name The name of the function. * @returns {GC.Spread.CalcEngine.Functions.Function} If the name is empty, return all of the global functions, otherwise, return one function with the specified name. */ function findGlobalFunction(name?: string): any; /** * If the name is empty, remove all of the global functions, otherwise, remove one function with the specified name. * @param {string} name The name of the function. */ function removeGlobalFunction(name?: string): void; export interface IFunctionDescription{ /** * The description of the function. */ description: string; /** * The parameters' description array of the function. */ parameters: GC.Spread.CalcEngine.Functions.IParameterDescription[]; } export interface IParameterDescription{ /** * The parameter name. */ name: string; /** * Whether the parameter is repeatable. */ repeatable?: boolean; /** * Whether the parameter is optional. */ optional?: boolean; } /** * Represents the asynchronous function evaluate mode. * @enum {number} */ export enum AsyncFunctionEvaluateMode{ /** * enum value is 0, Specifies that the async function evaluates the changed, referenced cells. */ onRecalculation= 0, /** * enum value is 1, Specifies that the async function only evaluates once. */ calculateOnce= 1, /** * enum value is 2, Specifies that the async function evaluates based on the interval. */ onInterval= 2 } export class AsyncFunction extends GC.Spread.CalcEngine.Functions.Function{ /** * Represents an abstract base class for defining asynchronous functions. * @class * @param {string} name The name of the function. * @param {number} [minArgs] The minimum number of arguments for the function. * @param {number} [maxArgs] The maximum number of arguments for the function. * @param {GC.Spread.CalcEngine.Functions.IFunctionDescription} [description] The description of the function. * @example * ```javascript * class WeatherFunction extends GC.Spread.CalcEngine.Functions.AsyncFunction { * constructor () { * super('WEATHER', 0, 0, { * description: "Get Weather", * parameters: [] * }); * } * evaluate (context) { * setTimeout(function () { context.setAsyncResult('sunny'); }, 100); * } * } * spread.addCustomFunction(new WeatherFunction()); * spread.getActiveSheet().setFormula(0, 0, '=WEATHER()'); * ``` */ constructor(name: string, minArgs?: number, maxArgs?: number, description?: GC.Spread.CalcEngine.Functions.IFunctionDescription); /** * Returns the default value of the evaluated function result before getting the async result. * @returns {Object} The default value of the evaluated function result before getting the async result. */ defaultValue(): any; /** * Returns the result of the function applied to the arguments. * @param {GC.Spread.CalcEngine.AsyncEvaluateContext} context The evaluate context * @param {Object} args Arguments for the function evaluation * @returns {Object} The result of the function applied to the arguments. */ evaluateAsync(context: GC.Spread.CalcEngine.AsyncEvaluateContext, args: any): any; /** * Decides how to re-calculate the formula. * @returns {GC.Spread.CalcEngine.Functions.AsyncFunctionEvaluateMode} The evaluate mode. */ evaluateMode(): GC.Spread.CalcEngine.Functions.AsyncFunctionEvaluateMode; /** * Returns the interval. * @returns {number} The interval in milliseconds. */ interval(): number; } export class Function{ /** * Represents an abstract base class for defining functions. * @class * @param {string} name The name of the function. * @param {number} [minArgs] The minimum number of arguments for the function. * @param {number} [maxArgs] The maximum number of arguments for the function. * @param {GC.Spread.CalcEngine.Functions.IFunctionDescription} [functionDescription] The description object of the function. * @example * ```javascript * class FactorialFunction extends GC.Spread.CalcEngine.Functions.Function { * constructor () { * super('FACTORIAL', 1, 1, { * description: "Function to calculate the Fibonacci number.", * parameters: [{ name: 'n' }] * }); * } * evaluate (n) { * var fib = [0, 1]; * for (var i = 2; i <= n; i++) { * fib[i] = fib[i - 1] + fib[i - 2]; * } * return fib[n]; * } * } * spread.addCustomFunction(new FactorialFunction()); * spread.getActiveSheet().setFormula(0, 0, '=FACTORIAL(10)'); * ``` */ constructor(name: string, minArgs?: number, maxArgs?: number, functionDescription?: GC.Spread.CalcEngine.Functions.IFunctionDescription); /** * Represents the maximum number of arguments for the function. * @type {number} */ maxArgs: number; /** * Represents the minimum number of arguments for the function. * @type {number} */ minArgs: number; /** * Represents the name of the function. * @type {string} */ name: string; /** * Represents the type name string used for supporting serialization. * @type {string} */ typeName: string; /** * Determines whether the function accepts array values for the specified argument. * @param {number} argIndex Index of the argument. * @function * @returns {boolean} `true` if the function accepts array values for the specified argument; otherwise, `false`. */ acceptsArray(argIndex: number): boolean; /** * Indicates whether the function can process Error values. * @param {number} argIndex Index of the argument. * @returns {boolean} `true` if the function can process Error values for the specified argument; otherwise, `false`. * @function */ acceptsError(argIndex: number): boolean; /** * Indicates whether the Evaluate method can process missing arguments. * @param {number} argIndex Index of the argument * @returns {boolean} `true` if the Evaluate method can process missing arguments; otherwise, `false`. */ acceptsMissingArgument(argIndex: number): boolean; /** * Determines whether the function accepts Reference values for the specified argument. * @param {number} argIndex Index of the argument. * @returns {boolean} `true` if the function accepts Reference values for the specified argument; otherwise, `false`. * @function */ acceptsReference(argIndex: number): boolean; /** * Returns the description of the function. * @function * @returns {Object} The description of the function. */ description(): GC.Spread.CalcEngine.Functions.IFunctionDescription; /** * Returns the result of the function applied to the arguments. * @param {Object} args Arguments for the function evaluation * @returns {Object} The result of the function applied to the arguments. */ evaluate(...args: any): any; /** * Finds the branch argument. * @param {Object} test The test. * @returns {number} Indicates the index of the argument that would be treated as the branch condition. * @example * ```javascript * function EqualsFunction() { * this.name = 'Equals'; * this.maxArgs = 3; * this.minArgs = 3; * } * EqualsFunction.prototype = new GC.Spread.CalcEngine.Functions.Function(); * EqualsFunction.prototype.evaluate = function(logicalTest, valueIfTrue, valueIfFalse) { * return logicalTest ? valueIfTrue : valueIfFalse; * } * EqualsFunction.prototype.isBranch = function() { * return true; * } * EqualsFunction.prototype.findTestArgument = function() { * return 0; * } * EqualsFunction.prototype.findBranchArgument = function(logicalTestResult) { * if (logicalTestResult === true) { * return 1; * } * return 2; * } * var equalsFunction = new EqualsFunction(); * var spread = GC.Spread.Sheets.findControl("ss") || GC.Spread.Sheets.findControl("sampleDiv"); * spread.addCustomFunction(equalsFunction); * ``` */ findBranchArgument(test: any): number; /** * Finds the test argument when this function is branched. * @returns {number} Indicates the index of the argument that would be treated as the test condition. * @example * ```javascript * function EqualsFunction() { * this.name = 'Equals'; * this.maxArgs = 3; * this.minArgs = 3; * } * EqualsFunction.prototype = new GC.Spread.CalcEngine.Functions.Function(); * EqualsFunction.prototype.evaluate = function(logicalTest, valueIfTrue, valueIfFalse) { * return logicalTest ? valueIfTrue : valueIfFalse; * } * EqualsFunction.prototype.isBranch = function() { * return true; * } * EqualsFunction.prototype.findTestArgument = function() { * return 0; * } * EqualsFunction.prototype.findBranchArgument = function(logicalTestResult) { * if (logicalTestResult === true) { * return 1; * } * return 2; * } * var equalsFunction = new EqualsFunction(); * var spread = GC.Spread.Sheets.findControl("ss") || GC.Spread.Sheets.findControl("sampleDiv"); * spread.addCustomFunction(equalsFunction); * ``` */ findTestArgument(): number; /** * Gets a value that indicates whether this function is branched by arguments as conditional. * @returns {boolean} `true` if this instance is branched; otherwise, `false`. * @example * ```javascript * function EqualsFunction() { * this.name = 'Equals'; * this.maxArgs = 3; * this.minArgs = 3; * } * EqualsFunction.prototype = new GC.Spread.CalcEngine.Functions.Function(); * EqualsFunction.prototype.evaluate = function(logicalTest, valueIfTrue, valueIfFalse) { * return logicalTest ? valueIfTrue : valueIfFalse; * } * EqualsFunction.prototype.isBranch = function() { * return true; * } * EqualsFunction.prototype.findTestArgument = function() { * return 0; * } * EqualsFunction.prototype.findBranchArgument = function(logicalTestResult) { * if (logicalTestResult === true) { * return 1; * } * return 2; * } * var equalsFunction = new EqualsFunction(); * var spread = GC.Spread.Sheets.findControl("ss") || GC.Spread.Sheets.findControl("sampleDiv"); * spread.addCustomFunction(equalsFunction); * ``` */ isBranch(): boolean; /** * Determines whether the evaluation of the function is dependent on the context in which the evaluation occurs. * @returns {boolean} `true` if the evaluation of the function is dependent on the context; otherwise, `false`. */ isContextSensitive(): boolean; /** * Determines whether the function is volatile while it is being evaluated. * @returns {boolean} `true` if the function is volatile; otherwise, `false`. */ isVolatile(): boolean; } } module LanguagePackages{ /** * Gets or Sets the language package for calc engine. * @param {string} languageName the calc engine language name string; * @returns {string|void} If no value is set, return the calc engine language name string; * @example * ```javascript * GC.Spread.CalcEngine.LanguagePackages.languagePackages('fr'); * GC.Spread.CalcEngine.LanguagePackages.languagePackages(); * ``` */ function languagePackages(languageName?: string): any; } } module Commands{ /** * Represents the key code. * @enum {number} * @example * ```javascript * //This example creates a custom action using the enter key. * var activeSheet = spread.getActiveSheet(); * spread.commandManager().register('myCmd', * function ColorAction() { * //Click on a cell and press the Enter key. * activeSheet.getCell(activeSheet.getActiveRowIndex(), activeSheet.getActiveColumnIndex()).backColor("red"); * } * ); * //Map the created action to the Enter key. * spread.commandManager().setShortcutKey('myCmd', GC.Spread.Commands.Key.enter, false, false, false, false); * ``` */ export enum Key{ /** * Indicates the left arrow key. */ left= 37, /** * Indicates the right arrow key. */ right= 39, /** * Indicates the up arrow key. */ up= 38, /** * Indicates the down arrow key. */ down= 40, /** * Indicates the Tab key. */ tab= 9, /** * Indicates the Enter key. */ enter= 13, /** * Indicates the Shift key. */ shift= 16, /** * Indicates the Ctrl key. */ ctrl= 17, /** * Indicates the space key. */ space= 32, /** * Indicates the Alt key. */ altkey= 18, /** * Indicates the Home key. */ home= 36, /** * Indicates the End key. */ end= 35, /** * Indicates the Page Up key. */ pup= 33, /** * Indicates the Page Down key. */ pdn= 34, /** * Indicates the Backspace key. */ backspace= 8, /** * Indicates the Delete key. */ del= 46, /** * Indicates the Esc key. */ esc= 27, /** * Indicates the A key */ a= 65, /** * Indicates the C key. */ c= 67, /** * Indicates the V key. */ v= 86, /** * Indicates the X key. */ x= 88, /** * Indicates the Z key. */ z= 90, /** * Indicates the Y key. */ y= 89 } export class CommandManager{ /** * Represents a command manager. * @class * @param {Object} context The execution context for all commands in the command manager. * @constructor */ constructor(context: Object); /** * Executes a command and adds the command to UndoManager. * @param {Object} commandOptions The options for the command. * @param {string} commandOptions.cmd The command name, the field is required. * @param {Object} [commandOptions.arg1] The command argument, the name and type are decided by the command definition. * @param {Object} [commandOptions.arg2] The command argument, the name and type are decided by the command definition. * @param {Object} [commandOptions.argN] The command argument, the name and type are decided by the command definition. * @returns {boolean} The execute command result. * @example * ```javascript * //For example, the following code executes the autoFitColumn command. * var spread = GC.Spread.Sheets.findControl(document.getElementById("ss")); * spread.commandManager().execute({cmd: "autoFitColumn", sheetName: "Sheet1", columns: [{col: 1}], rowHeader: false, autoFitType: GC.Spread.Sheets.AutoFitType.cell}); * ``` */ execute(commandOptions: Object): boolean; /** * Registers a command with the command manager. * @param {string} name - The name of the command. * @param {Object} command - The object that defines the command. * @param {number|GC.Spread.Commands.Key} key - The key code. * @param {boolean} ctrl - `true` if the command uses the Ctrl key; otherwise, `false`. * @param {boolean} shift - `true` if the command uses the Shift key; otherwise, `false`. * @param {boolean} alt - `true` if the command uses the Alt key; otherwise, `false`. * @param {boolean} meta - `true` if the command uses the Command key on the Macintosh or the Windows key on Microsoft Windows; otherwise, `false`. * @example * ```javascript * //For example, the following code registers the changeBackColor command and then executes the command. * var command = { * canUndo: true, * execute: function (context, options, isUndo) { * var Commands = GC.Spread.Sheets.Commands; * options.cmd = "changeBackColor"; * if (isUndo) { * Commands.undoTransaction(context, options); * return true; * } else { * Commands.startTransaction(context, options); * var sheet = context.getSheetFromName(options.sheetName); * var cell = sheet.getCell(options.row, options.col); * cell.backColor(options.backColor); * Commands.endTransaction(context, options); * return true; * } * } * }; * var spread = GC.Spread.Sheets.findControl(document.getElementById("ss")); * var commandManager = spread.commandManager(); * commandManager.register("changeBackColor", command); * commandManager.execute({cmd: "changeBackColor", sheetName: spread.getSheet(0).name(), row: 1, col: 2, backColor: "red"}); * ``` */ register(name: string, command: Object, key?: number|GC.Spread.Commands.Key, ctrl?: boolean, shift?: boolean, alt?: boolean, meta?: boolean): void; /** * Binds a shortcut key to a command. * @param {string} commandName The command name, setting commandName to undefined removes the bound command of the shortcut key. * @param {number|GC.Spread.Commands.Key} key The key code, setting the key code to undefined removes the shortcut key of the command. * @param {boolean} ctrl `true` if the command uses the Ctrl key; otherwise, `false`. * @param {boolean} shift `true` if the command uses the Shift key; otherwise, `false`. * @param {boolean} alt `true` if the command uses the Alt key; otherwise, `false`. * @param {boolean} meta `true` if the command uses the Command key on the Macintosh or the Windows key on Microsoft Windows; otherwise, `false`. * @example * ```javascript * //This example changes the behavior of default keys. * var activeSheet = spread.getActiveSheet(); * //Change the default Up arrow key action to "Page Up" for the active cell. * spread.commandManager().setShortcutKey('navigationPageUp', GC.Spread.Commands.Key.up, false, false, false, false); * //Change the default Down arrow key action to "Page Down" for the active cell. * spread.commandManager().setShortcutKey('navigationPageDown', GC.Spread.Commands.Key.down, false, false, false, false); * ``` */ setShortcutKey(commandName: string, key?: number|GC.Spread.Commands.Key, ctrl?: boolean, shift?: boolean, alt?: boolean, meta?: boolean): void; } export class UndoManager{ /** * Represents the undo manager. * @constructor */ constructor(); /** * Gets whether the redo operation is allowed. * @returns {boolean} `true` if the redo operation is allowed; otherwise, `false`. */ canRedo(): boolean; /** * Gets whether the undo operation is allowed. * @returns {boolean} `true` if the undo operation is allowed; otherwise, `false`. */ canUndo(): boolean; /** * Clears all of the undo stack and the redo stack. */ clear(): void; /** * Get the redo stack. * @returns {any[]} It returns an object. This must include sheetName and cmd. the type of sheetName and cmd both is string. */ getRedoStack():any[]; /** * Get the undo stack. * @returns {any[]} It returns is an object. This object must include sheetName and cmd. the type of sheetName and cmd both is string. */ getUndoStack():any[]; /** * Gets or sets the the undo/redo stack max size. * @param {number} value this value should be greater or equal to 0. * @returns {number | UndoManager} If no value is set. return the max size of undo/redo stack. otherwise return UndoManager. */ maxSize(value?: number):any; /** * Redoes the last command. * @returns {boolean} `true` if the redo operation is successful; otherwise, `false`. */ redo(): boolean; /** * Undoes the last command. * @returns {boolean} `true` if the undo operation is successful; otherwise, `false`. */ undo(): boolean; } } module Common{ export interface IDateTimeFormat{ /** * Specifies the day formatter for "ddd". */ abbreviatedDayNames?: string[]; /** * Specifies the month formatter for "MMM". */ abbreviatedMonthGenitiveNames?: string[]; /** * Specifies the month formatter for "MMM". */ abbreviatedMonthNames?: string[]; /** * Indicates the AM designator. */ amDesignator?: string; /** * Specifies the day formatter for "dddd". */ dayNames?: string[]; /** * Specifies the standard date formatter for "F". */ fullDateTimePattern?: string; /** * Specifies the standard date formatter for "D". */ longDatePattern?: string; /** * Specifies the standard date formatter for "T" and "U". */ longTimePattern?: string; /** * Specifies the standard date formatter for "M" and "m". */ monthDayPattern?: string; /** * Specifies the formatter for "MMMM". */ monthGenitiveNames?: string[]; /** * Specifies the formatter for "M" or "MM". */ monthNames?: string[]; /** * Indicates the PM designator. */ pmDesignator?: string; /** * Specifies the standard date formatter for "d". */ shortDatePattern?: string; /** * Specifies the standard date formatter for "t". */ shortTimePattern?: string; /** * Specifies the standard date formatter for "y" and "Y". */ yearMonthPattern?: string; /** * Specifies the default date formatter for the case that cell formatter is null or "General" and cell value is a date with time. */ defaultDatePattern?: string; } export interface ILineBreakingStrategy{ (text: string, option: GC.Spread.Common.ITextFormatOption) : string[]; } export interface ILocalNumberFormat{ /** * this property key is number, this property value is format string. */ [K: number]: string; } export interface INumberFormat{ /** * Indicates the currency decimal point. */ currencyDecimalSeparator?: string; /** * Indicates the currency thousand separator. */ currencyGroupSeparator?: string; /** * Indicates the currency symbol. */ currencySymbol?: string; /** * Indicates the decimal point. */ numberDecimalSeparator?: string; /** * Indicates the thousand separator. */ numberGroupSeparator?: string; /** * Indicates the separator for function arguments in a formula. */ listSeparator?: string; /** * Indicates the separator for the constants in one row of an array constant in a formula. */ arrayListSeparator?: string; /** * Indicates the separator for the array rows of an array constant in a formula. */ arrayGroupSeparator?: string; /** * Specifies the DBNumber characters. */ dbNumber?: Object; } export interface IPredefinedFormats{ /** * The formats displayed in currency category. */ Currency?: Array; /** * The format displayed in accounting category. */ Accounting?: string; /** * The format displayed in accounting category has no symbol. */ Comma?: string; /** * The formats in date category. */ Date?: Array; /** * The formats in time category. */ Time?: Array; Special?: { [K: string]: string; /** * The formats in special category. */ }; shortcut?: { Number?: string; Currency?: string; Accounting?: string; ShortDate?: string; LongDate?: string; Time?: string; Percentage?: string; Fraction?: string; Scientific?: string; Text?: string; Comma?: string; }; } export interface ITextFormat{ /** * Specifies the characters can split up two lines. Default is [" ", "-"]. */ lineBreakingChar?: string[]; /** * Specifies the characters that are not allowed at the start of a breaking line. */ lineBreakingForbidStart?: string[]; /** * Specifies the characters that are not allowed at the end of a breaking line. */ lineBreakingForbidEnd?: string[]; /** * Specifies the function for word split. */ lineBreakingStrategy?: GC.Spread.Common.ILineBreakingStrategy; } export interface ITextFormatOption{ lineBreakingChar?: string[]; lineBreakingForbidStart?: string[]; lineBreakingForbidEnd?: string[]; } export class CultureInfo{ /** * Represents the custom culture class. The member variable can be overwritten. * @class */ constructor(); /** * Indicates the date time format fields. * @type {Object} * @example * ```javascript * // This example creates a custom culture. * var myCulture = new GC.Spread.Common.CultureInfo(); * myCulture.NumberFormat.currencySymbol = "\u20ac" * myCulture.NumberFormat.numberDecimalSeparator = ","; * myCulture.NumberFormat.numberGroupSeparator = "."; * myCulture.NumberFormat.arrayGroupSeparator = ";"; * myCulture.NumberFormat.arrayListSeparator = "\\"; * myCulture.NumberFormat.listSeparator = ";"; * myCulture.DateTimeFormat.amDesignator = ""; * myCulture.DateTimeFormat.pmDesignator = ""; * myCulture.DateTimeFormat.abbreviatedMonthNames = ["Jan", "Feb", "Mrz", "Apr", "Mai", "Jun", "Jul", "Aug", "Sep", "Okt", "Nov", "Dez", ""]; * myCulture.DateTimeFormat.abbreviatedDayNames = ["So", "Mo", "Di", "Mi", "Do", "Fr", "Sa"]; * myCulture.DateTimeFormat.abbreviatedMonthGenitiveNames = ["Jan", "Feb", "Mrz", "Apr", "Mai", "Jun", "Jul", "Aug", "Sep", "Okt", "Nov", "Dez", ""]; * myCulture.DateTimeFormat.dayNames = ["Sonntag", "Montag", "Dienstag", "Mittwoch", "Donnerstag", "Freitag", "Samstag"]; * myCulture.DateTimeFormat.fullDateTimePattern = "dddd, d. MMMM yyyy HH:mm:ss"; * myCulture.DateTimeFormat.longDatePattern = "dddd, d. MMMM yyyy"; * myCulture.DateTimeFormat.longTimePattern = "HH:mm:ss"; * myCulture.DateTimeFormat.monthDayPattern = "dd MMMM"; * myCulture.DateTimeFormat.monthNames = ["Januar", "Februar", "M\xe4rz", "April", "Mai", "Juni", "Juli", "August", "September", "Oktober", "November", "Dezember", ""]; * myCulture.DateTimeFormat.monthGenitiveNames = ["Januar", "Februar", "M\xe4rz", "April", "Mai", "Juni", "Juli", "August", "September", "Oktober", "November", "Dezember", ""]; * myCulture.DateTimeFormat.shortDatePattern = "dd.MM.yyyy"; * myCulture.DateTimeFormat.shortTimePattern = "HH:mm"; * myCulture.DateTimeFormat.yearMonthPattern = "MMMM yyyy"; * myCulture.DateTimeFormat.defaultDatePattern = "MM/dd/yyyy HH:mm:ss"; * //add one culture * GC.Spread.Common.CultureManager.addCultureInfo("de-DE", myCulture); * //switch to "de-DE" culture * GC.Spread.Common.CultureManager.culture("de-DE"); * var d = new Date(); * //With culture * activeSheet.setValue(1, 0, new Date(d.setDate(d.getDate() + 1))); * activeSheet.getCell(1, 0).formatter("mmm"); * var dvalue = 12345.6789; * activeSheet.setColumnWidth(0, 200); * activeSheet.setColumnWidth(1, 200); * activeSheet.setColumnWidth(2, 200); * activeSheet.setValue(0, 0, dvalue); * activeSheet.getCell(0, 0).formatter("###,###.00"); * activeSheet.setValue(2, 0, new Date(d.setDate(d.getDate() + 1))); * //With culture * activeSheet.getCell(3, 0).formatter("yyyy/mmm/dddd"); * activeSheet.setValue(3, 0, new Date()); * ``` */ DateTimeFormat: GC.Spread.Common.IDateTimeFormat; /** * The name displayed in the location dropdown or symbol dropdown in format dialog. * @type {string} * @example * ```javascript * //This example set the displayName of CultureInfo: * var culture = new GC.Spread.Common.CultureInfo(); * culture.displayName = "English(U.S.)" * ``` */ displayName: string; /* * A list that defines which characters are considered specially equal in the calculation. * @example * ```javascript * //This example sets the EqualCharacters of some characters: * var culture = new GC.Spread.Common.CultureInfo(); * culture.equalCharacters = ["\u3002.", "\uff0c,", "\u24601\u4e00\u58f9"]; * sheet.setFormula(0, 0, '"1.hello"="\u4e00\u3002Hello"'); // formula result will be TRUE after set culture. * ``` */ equalCharacters: string[]; /** * The font script code be used by theme to find the typeface. * @type {string} * @example * ```javascript * //This example set the fontScriptCode of CultureInfo: * var culture = new GC.Spread.Common.CultureInfo(); * culture.fontScriptCode = "Hans"; * ``` */ fontScriptCode?: string; /** * The id can be used to specify CultureInfo in number format. * @type {number} * @example * ```javascript * //This example adds a new CultureInfo and affects the number format. * let culture = new GC.Spread.Common.CultureInfo(); * culture.id = 0x407; * culture.NumberFormat.numberDecimalSeparator = ","; * culture.NumberFormat.numberGroupSeparator = "."; * culture.NumberFormat.listSeparator = ""; * culture.name = function () { return "de-DE"; }; * GC.Spread.Common.CultureManager.addCultureInfo(culture.name(), culture); * let formatter = new GC.Spread.Formatter.GeneralFormatter("[$-407]0,000.000"); * let result = formatter.format(100000); //result: '100.000,000' * ``` */ id: number; /** * indicates the local number format built. It's a map whose keys are number and values are formatString. * @type {Object} * @example * ```javascript * //this is an example for LocalNumberFormat. * var cultureInfo = new GC.Spread.Common.CultureInfo(). * cultureInfo.LocalNumberFormat = { * 14:"yyyy-mm-dd", * 15:"yyyy/mm/dd" * } * ``` */ LocalNumberFormat: GC.Spread.Common.ILocalNumberFormat; /** * Indicates all the number format fields. * @type {Object} * @example * ```javascript * // This example creates a custom culture. * var myCulture = new GC.Spread.Common.CultureInfo(); * myCulture.NumberFormat.currencySymbol = "\u20ac" * myCulture.NumberFormat.numberDecimalSeparator = ","; * myCulture.NumberFormat.numberGroupSeparator = "."; * myCulture.NumberFormat.arrayGroupSeparator = ";"; * myCulture.NumberFormat.arrayListSeparator = "\\"; * myCulture.NumberFormat.dbNumber = { * 1: {letters: ['\u5146', '\u5343', '\u767e', '\u5341', '\u4ebf', '\u5343', '\u767e', '\u5341', '\u4e07', '\u5343', '\u767e', '\u5341', ''], // \u5146\u5343\u767e\u5341\u4ebf\u5343\u767e\u5341\u4e07\u5343\u767e\u5341 * numbers: ['\u25cb', '\u4e00', '\u4e8c', '\u4e09', '\u56db', '\u4e94', '\u516d', '\u4e03', '\u516b', '\u4e5d'] }, // \u25cb\u4e00\u4e8c\u4e09\u56db\u4e94\u516d\u4e03\u516b\u4e5d * 2: {letters: ['\u5146', '\u4edf', '\u4f70', '\u62fe', '\u4ebf', '\u4edf', '\u4f70', '\u62fe', '\u4e07', '\u4edf', '\u4f70', '\u62fe', ''], // \u5146\u4edf\u4f70\u62fe\u4ebf\u4edf\u4f70\u62fe\u4e07\u4edf\u4f70\u62fe * numbers: ['\u96f6', '\u58f9', '\u8d30', '\u53c1', '\u8086', '\u4f0d', '\u9646', '\u67d2', '\u634c', '\u7396']}, // \u96f6\u58f9\u8d30\u53c1\u8086\u4f0d\u9646\u67d2\u634c\u7396 * 3: {letters: null, * numbers: ['\uff10', '\uff11', '\uff12', '\uff13', '\uff14', '\uff15', '\uff16', '\uff17', '\uff18', '\uff19']} // \uff10\uff11\uff12\uff13\uff14\uff15\uff16\uff17\uff18\uff19 * }; * myCulture.NumberFormat.listSeparator = ";"; * myCulture.DateTimeFormat.amDesignator = ""; * myCulture.DateTimeFormat.pmDesignator = ""; * myCulture.DateTimeFormat.abbreviatedMonthNames = ["Jan", "Feb", "Mrz", "Apr", "Mai", "Jun", "Jul", "Aug", "Sep", "Okt", "Nov", "Dez", ""]; * myCulture.DateTimeFormat.abbreviatedDayNames = ["So", "Mo", "Di", "Mi", "Do", "Fr", "Sa"]; * myCulture.DateTimeFormat.abbreviatedMonthGenitiveNames = ["Jan", "Feb", "Mrz", "Apr", "Mai", "Jun", "Jul", "Aug", "Sep", "Okt", "Nov", "Dez", ""]; * myCulture.DateTimeFormat.dayNames = ["Sonntag", "Montag", "Dienstag", "Mittwoch", "Donnerstag", "Freitag", "Samstag"]; * myCulture.DateTimeFormat.fullDateTimePattern = "dddd, d. MMMM yyyy HH:mm:ss"; * myCulture.DateTimeFormat.longDatePattern = "dddd, d. MMMM yyyy"; * myCulture.DateTimeFormat.longTimePattern = "HH:mm:ss"; * myCulture.DateTimeFormat.monthDayPattern = "dd MMMM"; * myCulture.DateTimeFormat.monthNames = ["Januar", "Februar", "M\xe4rz", "April", "Mai", "Juni", "Juli", "August", "September", "Oktober", "November", "Dezember", ""]; * myCulture.DateTimeFormat.monthGenitiveNames = ["Januar", "Februar", "M\xe4rz", "April", "Mai", "Juni", "Juli", "August", "September", "Oktober", "November", "Dezember", ""]; * myCulture.DateTimeFormat.shortDatePattern = "dd.MM.yyyy"; * myCulture.DateTimeFormat.shortTimePattern = "HH:mm"; * myCulture.DateTimeFormat.yearMonthPattern = "MMMM yyyy"; * //add one culture * GC.Spread.Common.CultureManager.addCultureInfo("de-DE", myCulture); * //switch to "de-DE" culture * GC.Spread.Common.CultureManager.culture("de-DE"); * var d = new Date(); * //With culture * activeSheet.setValue(1, 0, new Date(d.setDate(d.getDate() + 1))); * activeSheet.getCell(1, 0).formatter("mmm"); * var dvalue = 12345.6789; * activeSheet.setColumnWidth(0, 200); * activeSheet.setColumnWidth(1, 200); * activeSheet.setColumnWidth(2, 200); * activeSheet.setValue(0, 0, dvalue); * activeSheet.getCell(0, 0).formatter("###,###.00"); * activeSheet.setValue(2, 0, new Date(d.setDate(d.getDate() + 1))); * //With culture * activeSheet.getCell(3, 0).formatter("yyyy/mmm/dddd"); * activeSheet.setValue(3, 0, new Date()); * ``` */ NumberFormat: GC.Spread.Common.INumberFormat; /** * The predefinedFormats is an object that describes part of the number format in format dialog. * When opening the format dialog, designer read predefinedFormats in all CultureInfos to display culture related formats. * @type {Object} * @example * ```javascript * //This is an example for predefinedFormats: * var culture = new GC.Spread.Common.CultureInfo() * culture.predefinedFormats = { * Accounting: '_($* #,##0._);_($* (#,##0.);_($* "-"._);_(@_)', * Currency: [ * "[$$-409]#,##0.", * "[$$-409]#,##0.;[Red][$$-409]#,##0.", * "[$$-409]#,##0._);([$$-409]#,##0.)", * "[$$-409]#,##0._);[Red]([$$-409]#,##0.)" * ], * Date: [ * "m/d/yyyy", * "[$-409]dddd, mmmm dd, yyyy", * "m/d;@", * "m/d/yy;@", * "mm/dd/yy;@", * "[$-409]d-mmm;@", * "[$-409]d-mmm-yy;@", * "[$-409]mmm-yy;@", * "[$-409]mmmm-yy;@", * "[$-409]mmmm d, yyyy;@", * "[$-409]m/d/yy h:mm AM/PM;@", * "m/d/yy h:mm;@", * "[$-409]mmmmm;@", * "[$-409]mmmmm-yy;@", * "m/d/yyyy;@", * "[$-409]d-mmm-yyyy;@", * ], * Time: [ * "[$-409]h:mm:ss AM/PM", * "h:mm;@", * "[$-409]h:mm AM/PM;@", * "h:mm:ss;@", * "[$-409]h:mm:ss AM/PM;@", * "mm:ss.0;@", * "[h]:mm:ss;@", * "[$-409]m/d/yy h:mm AM/PM;@", * "m/d/yy h:mm;@" * ], * Special: { * "Zip Code": "00000", * "Zip Code + 4": "00000-0000", * "Phone Number": "[<=9999999]###-####;(###) ###-####", * "Social Security Number": "000-00-0000" * } * }; * ``` */ predefinedFormats: GC.Spread.Common.IPredefinedFormats; /** * Indicates the text format fields. * @type {Object} * @example * ```javascript * // This example modify culture line breaking strategy. * var myCulture = GC.Spread.Common.CultureManager.getCultureInfo(); * myCulture.TextFormat.lineBreakingChar = [" ", "+"]; // can line breaking when "+" * myCulture.TextFormat.lineBreakingForbidStart = ["\u300b"]; // the \u300bwon't be start of the breaking line * myCulture.TextFormat.lineBreakingForbidEnd = ["\u300a"]; // the \u300a won't be end of the breaking line * activeSheet.setValue(0, 0, "1. 1+2+3+4+5+6+7"); * activeSheet.getCell(0, 0).wordWrap(true); // the "1. " won't be in a single line * activeSheet.setValue(1, 0, "\u300aabc\u300b\u300adef\u300b\u300aghk\u300b"); * activeSheet.getCell(1, 0).wordWrap(true); // the\u300a \u300bwill looks better * ``` */ TextFormat: GC.Spread.Common.ITextFormat; /** * Get the name of the CultureInfo, such as 'de-DE'. * @returns {string} The name of the CultureInfo * @example * ```javascript * //This example adds and gets a new CultureInfo * let cultureInfo = new GC.Spread.Common.CultureInfo(); * cultureInfo.id = 0x407; * cultureInfo.NumberFormat.numberDecimalSeparator = ","; * cultureInfo.NumberFormat.numberGroupSeparator = "."; * cultureInfo.NumberFormat.listSeparator = ""; * cultureInfo.name = function () { return "de-DE"; }; * GC.Spread.Common.CultureManager.addCultureInfo(cultureInfo.name(), cultureInfo); * console.log(cultureInfo === GC.Spread.Common.CultureManager.getCultureInfo("de-DE"));//output: true * ``` */ name(): string; } export class CultureManager{ /** * Represent a culture manager. * @constructor */ constructor(); /** * Adds the cultureInfo or custom language into the culture manager. * @static * @param {string} cultureName The culture name to set. * @param {GC.Spread.Common.CultureInfo} cultureInfo The cultureInfo set to the culture. * @param {object} language The custom language set to the culture. If already set, it will overwrite the old language. * @example * ```javascript * var myCulture = new GC.Spread.Common.CultureInfo(); * myCulture.NumberFormat.currencySymbol = "\u20ac" * myCulture.NumberFormat.numberDecimalSeparator = ","; * myCulture.NumberFormat.numberGroupSeparator = "."; * myCulture.NumberFormat.arrayGroupSeparator = ";"; * myCulture.NumberFormat.arrayListSeparator = "\\"; * myCulture.NumberFormat.listSeparator = ";"; * //add one culture * GC.Spread.Common.CultureManager.addCultureInfo("de-DE", myCulture); * ``` */ static addCultureInfo(cultureName: string, culture: GC.Spread.Common.CultureInfo, language?: object): void; /** * Get or set the Sheets culture. * @static * @param {string} cultureName The culture name to get. * @returns {string}. The current culture name of Sheets. */ static culture(cultureName?: string): string; /** * Gets the specified cultureInfo. If no culture name, get current cultureInfo. * @static * @param {string | number} cultureName Culture name or culture ID * @returns {GC.Spread.Common.CultureInfo} The specified cultureInfo object. * @example * ```javascript * GC.Spread.Common.CultureManager.getCultureInfo(); // return the current culture info. * GC.Spread.Common.CultureManager.getCultureInfo(1033); // return the culture info of culture id 1033, it's en culture. * GC.Spread.Common.CultureManager.getCultureInfo('en-us'); // return the culture info of en. * ``` */ static getCultureInfo(cultureName?: string | number): GC.Spread.Common.CultureInfo; /** * Gets the specified custom language. * @static * @param {string} cultureName The culture name to get. * @returns {object} The specified object. Null if not define the language. */ static getLanguage(cultureName: string): object; /** * Gets the specified or current working resources. * @static * @param {string | null} [cultureName] The culture name to get. If the cultureName is null, will return the current working resources. * @returns {object} The specified or current working resources. Null if not define the language. */ static getResources(cultureName?: string): object; } } module Formatter{ export class FormatterBase{ /** * Represents a custom formatter with the specified format string. * @class * @param {string} format The format. * @param {string} cultureName The culture name. */ constructor(format: string, cultureName: string); /** Represents the type name string used for supporting serialization. * @type {string} * @example * ```javascript * //This example creates a custom formatter. * function MyFormatter(format, cultureName) { * GC.Spread.Formatter.FormatterBase.apply(this, arguments); * this.typeName = "MyFormatter"; * this.formatter = format; * } * MyFormatter.prototype = new GC.Spread.Formatter.FormatterBase(); * MyFormatter.prototype.format = function (obj, options) { * if (typeof obj === "number") { * var colors = this.formatter.split(";"); * if (obj >= 0) { * options && options.conditionalForeColor = colors[0]; * return "PositiveOrZero: " + obj; * } else { * options && options.conditionalForeColor = colors[1]; * return "Negative: " + obj; * } * } * return obj ? obj.toString() : ""; * }; * MyFormatter.prototype.parse = function (str) { * var index = str.indexOf(": "); * if (index >= 0) { * return +str.substr(index + 2); * } else { * return +str; * } * }; * MyFormatter.prototype.toJSON = function () { * return { * typeName: this.typeName, * formatter: this.formatter * }; * }; * MyFormatter.prototype.fromJSON = function (settings) { * if (settings) { * this.formatter = settings.formatter; * } * }; * var formatter = new MyFormatter("red;green"); * formatter.format(12345); // "PositiveOrZero: 12345" * formatter.parse("PositiveOrZero: 12345"); // 12345 * ``` */ typeName: string; /** * Formats the specified object as a string with a conditional color. This function should be overwritten. * @param {Object} obj - The object with cell data to format. * @param {Object} [options] - The additional format data. * @param {string} [options.conditionalForeColor] - The conditional foreColor when format pattern contains color patter, such as [red]###.## * @returns {string} The formatted string. * @example * ```javascript * //This example creates a custom formatter. * function CustomFormatterTest() { * } * CustomFormatterTest.prototype = new GC.Spread.Formatter.FormatterBase(); * CustomFormatterTest.prototype.format = function (obj, options) { * \xa0 \xa0 //if the obj is color string, exp: red, blue.the text will render with obj color. * \xa0 \xa0 if (obj) { * \xa0 \xa0 \xa0 \xa0 options.conditionalForeColor = obj.toString() * \xa0 \xa0 \xa0 \xa0 return "My format result : " + obj.toString(); * \xa0 \xa0 } * \xa0 \xa0 return ""; * }; * CustomFormatterTest.prototype.parse = function (str) { * \xa0 \xa0 if (!str) { * \xa0 \xa0 \xa0 \xa0 return ""; * \xa0 \xa0 } * \xa0 \xa0 return str; * } * var sheet = spread.getActiveSheet(); * sheet.getCell(1, 0).formatter(new CustomFormatterTest()); * sheet.getCell(1, 0).value("red"); * ``` */ format(obj: Object, options?: Object): string; /** * Loads the object state from the specified JSON string. * @param {Object} settings The custom formatter data from deserialization. * @example * ```javascript * //This example creates a custom formatter. * function MyFormatter(format, cultureName) { * GC.Spread.Formatter.FormatterBase.apply(this, arguments); * this.typeName = "MyFormatter"; * this.formatter = format; * } * MyFormatter.prototype = new GC.Spread.Formatter.FormatterBase(); * MyFormatter.prototype.format = function (obj, options) { * if (typeof obj === "number") { * var colors = this.formatter.split(";"); * if (obj >= 0) { * options && options.conditionalForeColor = colors[0]; * return "PositiveOrZero: " + obj; * } else { * options && options.conditionalForeColor = colors[1]; * return "Negative: " + obj; * } * } * return obj ? obj.toString() : ""; * }; * MyFormatter.prototype.parse = function (str) { * var index = str.indexOf(": "); * if (index >= 0) { * return +str.substr(index + 2); * } else { * return +str; * } * }; * MyFormatter.prototype.toJSON = function () { * return { * typeName: this.typeName, * formatter: this.formatter * }; * }; * MyFormatter.prototype.fromJSON = function (settings) { * if (settings) { * this.formatter = settings.formatter; * } * }; * var formatter = new MyFormatter("red;green"); * formatter.format(12345); // "PositiveOrZero: 12345" * formatter.parse("PositiveOrZero: 12345"); // 12345 * ``` */ fromJSON(settings: Object): void; /** * Parses the specified text. This function should be overwritten. * @param {string} text The text. * @returns {Object} The parsed object. * @example * ```javascript * //This example creates a custom formatter. * function CustomFormatterTest() { * } * CustomFormatterTest.prototype = new GC.Spread.Formatter.FormatterBase(); * CustomFormatterTest.prototype.format = function (obj, options) { * \xa0 \xa0 //if the obj is color string, exp: red, blue.the text will render with obj color. * \xa0 \xa0 if (obj) { * \xa0 \xa0 \xa0 \xa0 options.conditionalForeColor = obj.toString() * \xa0 \xa0 \xa0 \xa0 return "My format result : " + obj.toString(); * \xa0 \xa0 } * \xa0 \xa0 return ""; * }; * CustomFormatterTest.prototype.parse = function (str) { * \xa0 \xa0 if (!str) { * \xa0 \xa0 \xa0 \xa0 return ""; * \xa0 \xa0 } * \xa0 \xa0 return str; * } * var sheet = spread.getActiveSheet(); * sheet.getCell(1, 0).formatter(new CustomFormatterTest()); * sheet.getCell(1, 0).value("red"); * ``` */ parse(str: string): Object; /** * Saves the object state to a JSON string. * @returns {Object} The custom formatter data. * @example * ```javascript * //This example creates a custom formatter. * function MyFormatter(format, cultureName) { * GC.Spread.Formatter.FormatterBase.apply(this, arguments); * this.typeName = "MyFormatter"; * this.formatter = format; * } * MyFormatter.prototype = new GC.Spread.Formatter.FormatterBase(); * MyFormatter.prototype.format = function (obj, options) { * if (typeof obj === "number") { * var colors = this.formatter.split(";"); * if (obj >= 0) { * options && options.conditionalForeColor = colors[0]; * return "PositiveOrZero: " + obj; * } else { * options && options.conditionalForeColor = colors[1]; * return "Negative: " + obj; * } * } * return obj ? obj.toString() : ""; * }; * MyFormatter.prototype.parse = function (str) { * var index = str.indexOf(": "); * if (index >= 0) { * return +str.substr(index + 2); * } else { * return +str; * } * }; * MyFormatter.prototype.toJSON = function () { * return { * typeName: this.typeName, * formatter: this.formatter * }; * }; * MyFormatter.prototype.fromJSON = function (settings) { * if (settings) { * this.formatter = settings.formatter; * } * }; * var formatter = new MyFormatter("red;green"); * formatter.format(12345); // "PositiveOrZero: 12345" * formatter.parse("PositiveOrZero: 12345"); // 12345 * ``` */ toJSON(): Object; } export class GeneralFormatter{ /** * Represents a formatter with the specified format mode and format string. * @class * @param {string} [format] The format. * @param {string} [cultureName] The culture name. */ constructor(format?: string, cultureName?: string); /** * Formats the specified object as a string with a formatted data Object. * @param {Object} obj The object with cell data to format. * @param {Object} [formattedData] The object with formatted data. * @param {Array} [formattedData.content] - The formatted data array, each item is an object that has two properties type and value, And it may contain these types: 'number', 'text', 'fillingChar', 'placeholder', 'exponent', 'decimalSeparator', 'groupSeparator', 'numberPlaceholder', 'percent', 'permille' and 'currency'. For example: {type: 'number', value: '123'}. * @param {string} [formattedData.conditionalForeColor] - The conditional foreground color. * @returns {string} The formatted string. * @example * ```javascript * //This example uses the format method. * var formatter = new GC.Spread.Formatter.GeneralFormatter("#,##0.00"); * var result = formatter.format(123456.789); * console.log(result); // '123,456.79' * ``` */ format(obj: Object, formattedData?: Object): string; /** * Gets or sets the format string for this formatter. * @param {string} value The format string for this formatter. * @returns {string|GC.Spread.Formatter.GeneralFormatter} If no value is set, returns the formatter string for this formatter; otherwise, returns the formatter. * @example * ```javascript * //This example gets the format string. * var formatter = new GC.Spread.Formatter.GeneralFormatter("#,##0.00"); * var result = formatter.formatString(); * console.log(result); // '#,##0.00' * ``` */ formatString(value?: string): string | GC.Spread.Formatter.GeneralFormatter; /** * Parses the specified text. * @param {string} text The text. * @returns {Object} The parsed object. * @example * ```javascript * //This example uses the parse method. * var formatter = new GC.Spread.Formatter.GeneralFormatter("#,##0.00"); * var result = formatter.parse("123,456.78"); * console.log(result); // 123456.78 * ``` */ parse(str: string): Object; } } module Pivot{ export interface IPivotItemInfo{ fieldName: string; fieldItem: string; } export interface IPivotTableViewManager{ add: (view: IPivotTableView) => boolean; save: (name: string) => boolean; remove: (name: string) => void; get: (name: string) => GC.Spread.Pivot.IPivotTableView; all: () => IPivotTableView[]; apply: (name: string) => void; } /** * @typedef {object} GC.Spread.Pivot.ICalcFieldInfo * @property {string} fieldName the field name of calc field * @property {string} formula the formula of calc field */ export type ICalcFieldInfo = { fieldName: string; formula: string; } /** * @typedef {object} GC.Spread.Pivot.ICalcItemInfo * @property {string} sourceName The name of PivotTable sourceField name * @property {string} calcItemName The name of PivotTable sourceField calcItem name * @property {string} formula The formula of PivotTable sourceField calcItem formula * @property {number} priority The priority of PivotTable sourceField calcItem priority */ export type ICalcItemInfo = { sourceName: string; calcItemName: string; formula: string; priority: number; } /** * @typedef GC.Spread.Pivot.IDateGroupInfo * @property {GC.Pivot.DateGroupType} by The date unit of date group info. * @property {Date} [start] The start date of group. * @property {Date} [end] The end date of group. */ export type IDateGroupInfo = { start?: Date; end?: Date; by: GC.Pivot.DateGroupType; } /** * @typedef GC.Spread.Pivot.IDateGroupsInfo * @property {string} originFieldName The source field name. * @property {GC.Spread.Pivot.IDateGroupInfo[]} dateGroups The date group info. */ export type IDateGroupsInfo = { originFieldName: string; dateGroups: GC.Spread.Pivot.IDateGroupInfo[]; } /** * @typedef {object} GC.Spread.Pivot.IFieldInfo - the field info of a pivot table field * @property {string} fieldName the field name * @property {string} sourceName the source name * @property {GC.Pivot.PivotDataType} dataType the field correspondence source data type * @property {GC.Spread.Pivot.PivotTableFieldType} pivotArea the field type, which effect the field in different area * @property {number} pivotIndex the index in the field area * @property {Date|number} [start] the min value of number type data field or the oldest of date type field * @property {Date|number} [end] the max value of number type data field or the newest of date type field */ export type IFieldInfo = { fieldName: string; sourceName: string; dataType: GC.Pivot.PivotDataType; pivotArea: GC.Spread.Pivot.PivotTableFieldType; pivotIndex: number; start?: Date|number; end?: Date|number; } /** * @typedef GC.Spread.Pivot.INumberGroupInfo * @property {string} originFieldName The source field name. * @property {object} numberGroup The number group info * @property {number} [numberGroup.start] The start number of number group info. * @property {number} [numberGroup.end] The end number of number group info. * @property {number} numberGroup.by The step of number group info. */ export type INumberGroupInfo = { originFieldName: string; numberGroup: { start?: number; end?: number; by: number; }; } /** * @typedef {object} GC.Spread.Pivot.IPivotArea * @property {GC.Spread.Pivot.PivotAreaType} [type] * @property {string} [fieldName] * @property {boolean} [labelOnly] * @property {boolean} [dataOnly] * @property {boolean} [grandRow] * @property {boolean} [grandCol] * @property {GC.Spread.Pivot.IPivotReference[]} [references] * @property {GC.Spread.Pivot.IPivotAreaOffset} [offset] */ export type IPivotArea = { type?: GC.Spread.Pivot.PivotAreaType; fieldName?: string; labelOnly?: boolean; dataOnly?: boolean; grandRow?: boolean; grandCol?: boolean; references?: GC.Spread.Pivot.IPivotReference[]; } /** * @typedef {object} GC.Spread.Pivot.IPivotAreaOffset * @property {number} row * @property {number} col * @property {number} [rowCount] * @property {number} [colCount] */ export type IPivotAreaOffset = { row: number; col:number; rowCount?: number; colCount?: number } /** * @typedef {object} GC.Spread.Pivot.IPivotAreasCollection * @property {Object.} - key indicates pivot table name, value indicates selected pivot areas. */ export type IPivotAreasCollection = { [pivotTableName: string]: IPivotArea[]; } /** * @typedef {object} GC.Spread.Pivot.IPivotConditionFilterInfo * @property {string} conditionByName * @property {GC.Pivot.IPivotCaptionConditionFilterInfo | GC.Pivot.IPivotDateConditionFilterInfo | GC.Pivot.IPivotTop10ConditionFilterInfo | GC.Pivot.IPivotValueConditionInfo} condition */ export type IPivotConditionFilterInfo = { conditionByName: string; condition: GC.Pivot.IPivotCaptionConditionFilterInfo | GC.Pivot.IPivotDateConditionFilterInfo | GC.Pivot.IPivotTop10ConditionFilterInfo | GC.Pivot.IPivotValueConditionInfo } /** * @typedef {object} GC.Spread.Pivot.IPivotNodeInfo * @property {GC.Spread.Pivot.IPivotItemInfo[]} fieldInfos the label field infos of node info. * @property {GC.Pivot.IValueInfo} valueInfo the value field info of node info. */ export type IPivotNodeInfo = { fieldInfos: GC.Spread.Pivot.IPivotItemInfo[]; valueInfo: GC.Pivot.IValueInfo; } /** * @typedef {object} GC.Pivot.IOverwriteNodeInfo * @property {GC.Spread.Pivot.IPivotItemInfo[]} fieldInfos the label field infos of node info. * @property {GC.Pivot.IValueInfo} valueInfo the value field info of node info. * @property {number} value the value of node info. */ export type IPivotOverwriteNodeInfo = { fieldInfos: GC.Spread.Pivot.IPivotItemInfo[]; valueInfo: GC.Pivot.IValueInfo; value: number; } /** * @typedef {object} GC.Spread.Pivot.IPivotReference * @property {string} fieldName * @property {boolean} [subtotal] * @property {string[]} [items] */ export type IPivotReference = { fieldName: string; subtotal?: boolean; items?: string[]; } /** * @typedef {object} GC.Spread.Pivot.IPivotShowDataAsInfo * @property {string} baseFieldName * @property {GC.Pivot.PivotShowDataAsBaseItemType} baseFieldItemType * @property {string} baseFieldItem */ export type IPivotShowDataAsInfo = { showDataAs: GC.Pivot.PivotShowDataAs; baseFieldName?:string; baseFieldItemType?:GC.Pivot.PivotShowDataAsBaseItemType; baseFieldItem?:string; } /** * @typedef {object} GC.Spread.Pivot.IPivotStyle * @property {GC.Spread.Pivot.IPivotArea} pivotArea The pivotArea in pivot table. * @property {GC.Spread.Sheets.Style} style The style use for pivotArea. */ export type IPivotStyle = { pivotArea?: GC.Spread.Pivot.IPivotArea; style?: GC.Spread.Sheets.Style; } /** * @property {boolean} [allowMultipleFiltersPerField] * @property {boolean} [fillDownLabels] * @property {boolean} [insertBlankLineAfterEachItem] * @property {GC.Spread.Pivot.GrandTotalPosition} grandTotalPosition * @property {GC.Spread.Pivot.SubtotalsPosition} subtotalsPosition * @property {GC.Spread.Pivot.DisplayFields} displayFieldsInPageFilterArea * @property {number} reportFilterFieldsPerColumn * @property {boolean} [bandRows] * @property {boolean} [bandColumns] * @property {boolean} [showRowHeader] * @property {boolean} [showColumnHeader] * @property {boolean} [showDrill] * @property {boolean} [showMissing] * @property {string | number} missingCaption * @property {number} rowLabelIndent * @property {boolean} [printDrill] * @property {boolean} [itemPrintTitles] * @property {boolean} [fieldPrintTitles] * @property {boolean} [showFilter] * @property {boolean} [showToolTip] * @property {boolean} [mergeItem] * @property {boolean} [isShowErrorValue] * @property {string} [errorValueInfo] * @property {string} [rowHeaderCaption] * @property {string} [colHeaderCaption] * @property {string} [showHeaders] * @property {GC.Spread.Pivot.CalcItemAggregation} [calcItemAggregation] * @property {boolean} [enableDataValueEditing] */ export type IPivotTableOption = { allowMultipleFiltersPerField?: boolean; fillDownLabels?: boolean; insertBlankLineAfterEachItem?: boolean; grandTotalPosition?: GC.Spread.Pivot.GrandTotalPosition; subtotalsPosition?: GC.Spread.Pivot.SubtotalsPosition; displayFieldsInPageFilterArea?: GC.Spread.Pivot.DisplayFields; reportFilterFieldsPerColumn?: number; bandRows?: boolean; bandColumns?: boolean; showRowHeader?: boolean; showColumnHeader?: boolean; showDrill?: boolean; showMissing?: boolean; missingCaption?: string | number; rowLabelIndent?: number; printDrill?: boolean; itemPrintTitles?: boolean; fieldPrintTitles?: boolean; showFilter?: boolean; showToolTip?: boolean; mergeItem?: boolean; isShowErrorValue?: boolean; errorValueInfo?: string; rowHeaderCaption?: string; colHeaderCaption?: string; showHeaders?: boolean; calcItemAggregation?: CalcItemAggregation; enableDataValueEditing?: boolean; } /** * @typedef {object} GC.Spread.Pivot.IPivotTablePosition * @property {number} row indicates pivot table start row * @property {number} col indicates pivot table start col * @property {number} [sheetName] which sheet is pivot table on */ export type IPivotTablePosition = { row: number; col: number; sheetName?: string; } /** * @typedef GC.Spread.Pivot.IPivotTableRange * @property {GC.Spread.Sheets.Range} page the filter area range * @property {GC.Spread.Sheets.Range} content the content area range */ export type IPivotTableRange = { page: GC.Spread.Sheets.Range; content: GC.Spread.Sheets.Range; } /** * @typedef {object} GC.Spread.Pivot.IPivotTableView * @property {string} name * @property {GC.Spread.Pivot.ISerializeInfo} config */ export type IPivotTableView = { name: string; config: GC.Spread.Pivot.ISerializeInfo; } /** * @typedef {object} GC.Spread.Pivot.IPivotTextFilterInfo * @property {GC.Spread.Pivot.ITextCollectionCondition} textItem */ export type IPivotTextFilterInfo = { textItem: GC.Spread.Pivot.ITextCollectionCondition; } /** * @typedef {object} GC.Spread.Pivot.ISerializeFieldInfo * @property {string} conditionBySourceName * @property {string} displayName * @property {GC.Pivot.SubtotalType} [subtotal] * @property {GC.Spread.Pivot.IPivotTextFilterInfo | GC.Spread.Pivot.IPivotConditionFilterInfo} [labelFilter] * @property {GC.Spread.Pivot.IPivotConditionFilterInfo} [valueFilter] * @property {GC.Pivot.IPivotViewSortInfo} [sortInfo] */ export type ISerializeFieldInfo = { sourceName: string; displayName: string; subtotal?: GC.Pivot.SubtotalType; labelFilter?: GC.Spread.Pivot.IPivotTextFilterInfo | GC.Spread.Pivot.IPivotConditionFilterInfo; valueFilter?: GC.Spread.Pivot.IPivotConditionFilterInfo; sortInfo?: GC.Pivot.IPivotViewSortInfo; } /** * @typedef {object} GC.Spread.Pivot.ISerializeInfo * @property {GC.Spread.Pivot.PivotTableLayoutType} [layoutType] * @property {object} [options] the options of pivot table * @property {string} [theme] the theme of pivot table * @property {GC.Pivot.IDataPosition} [valuePosition] the valuePosition info of pivot table * @property {number[]} [pivotTablePosition] the position of pivot table * @property {GC.Spread.Pivot.ISerializeFieldInfo[][]} [fieldsInfo] the fields info of pivot table * @property {GC.Spread.Pivot.IPivotStyle} [styles] the pivot area styles of pivot table * @property {object} [collapseItems] the collapse info of pivot table * @property {GC.Spread.Pivot.ISerializeShowDataAsInfo[]} [showDataAsList] the show data as info of pivot table */ export type ISerializeInfo = { layoutType?: GC.Spread.Pivot.PivotTableLayoutType; options?: object; theme?: string; valuePosition?: GC.Pivot.IDataPosition; pivotTablePosition?: number[]; fieldsInfo?: GC.Spread.Pivot.ISerializeFieldInfo[][]; styles?: GC.Spread.Pivot.IPivotStyle[]; collapseItems?: object; showDataAsList?: GC.Spread.Pivot.ISerializeShowDataAsInfo[]; showNoDataInfo?: object } /** * @typedef {object} GC.Spread.Pivot.ISerializeShowDataAsInfo * @property {string} valueFieldName * @property {GC.Spread.Pivot.IPivotShowDataAsInfo} showDataAsInfo */ export type ISerializeShowDataAsInfo = { valueFieldName: string; showDataAsInfo: GC.Spread.Pivot.IPivotShowDataAsInfo; } /** * @typedef {object} GC.Spread.Pivot.ISourceFieldInfo * @property {string} name the name of source field * @property {GC.Pivot.PivotSourceFieldType} [fieldType] the pivot field type is calc field or group field */ export type ISourceFieldInfo = { name: string; fieldType?: GC.Pivot.PivotSourceFieldType; } /** * @typedef {object} GC.Spread.Pivot.ITextCollectionCondition * @property {string[]} list * @property {boolean} isAll */ export type ITextCollectionCondition = { list: string[]; isAll: boolean; } /** * @typedef {object} GC.Spread.Pivot.ITextGroupInfo The text group info. * @property {string} originFieldName The source field name. * @property {object} textGroup The text group info * @property {string} textGroup.fieldName The group field name. * @property {GC.Pivot.IStringGroupItems} textGroup.groupItems The text group items info. */ export type ITextGroupInfo = { originFieldName: string; textGroup: { fieldName: string; groupItems: GC.Pivot.IStringGroupItems; } } /** * Indicates whether PivotTable total contains the value of calcItem. */ export enum CalcItemAggregation{ /** * PivotTable total include calcItem value. */ include= 0, /** * PivotTable total exclude calcItem value. */ exclude= 1 } /** * Indicates the display direction of the pivot table's page area. * @enum {number} */ export enum DisplayFields{ /** * Indicates the first vertical direction, then horizontal direction. */ downThenOver= 0, /** * Indicates the first horizontal direction, then vertical direction. */ overThenDown= 1 } /** * Indicates the direction of grand total in the pivot table. * @enum {number} */ export enum GrandTotalPosition{ /** * Don't show grand total */ none= 0, /** * Show grand total in row direction for pivot table. */ row= 1, /** * Show grand total in column direction for pivot table. */ col= 2, /** * Show grand total in row and column direction for pivot table. */ both= 3 } /** * Indicates the pivot area axis type of pivot table. * @enum {number} */ export enum PivotAreaAxisType{ /** * indicate grandTotal is on the row axis */ row= 0, /** * indicate grandTotal is on the col axis */ col= 1 } /** * Specifies the whether automatically generate the getPivotData formula or cell reference when choose pivot table data area. Default is getPivotData. * @enum {number} */ export enum PivotAreaReference{ /** * Generate normal cell reference. */ cellReference= 0, /** * Generate the getPivotData formula. */ getPivotData= 1 } /** * Indicates the pivot area type of pivot table. * @enum {number} */ export enum PivotAreaType{ /** * indicate the whole pivot table */ all= 0, /** * indicate the filter button of the pivot table */ button= 1, /** * indicate the corner of the pivot table */ corner= 5, /** * indicate the top right area of the pivot table */ topRight= 7 } /** * Indicates the pivot panel layout type. * @enum {number} */ export enum PivotPanelLayoutType{ /** * stack * @type {number} */ stack= 0, /** * flow * @type {number} */ flow= 1 } /** * Indicates the pivot panel section. * @enum {number} */ export enum PivotPanelSection{ /** * fields * @type {number} */ fields= 1, /** * area * @type {number} */ area= 2, /** * viewList * @type {number} */ viewList= 4 } /** * Indicates the pivot table field area. * @enum {number} */ export enum PivotTableFieldType{ /** * Filter area * @type {number} */ filterField= 0, /** * Row area * @type {number} */ rowField= 1, /** * Column area * @type {number} */ columnField= 2, /** * Value area * @type {number} */ valueField= 3 } /** * Indicates the view layout type of pivot table. * @enum {number} */ export enum PivotTableLayoutType{ /** * Compact layout */ compact= 0, /** * Outline layout */ outline= 1, /** * Tabular layout */ tabular= 2 } /** * Indicates the position of subtotal in the pivot table. * @enum {number} */ export enum SubtotalsPosition{ /** * Don't show subtotal. */ none= 0, /** * Show subtotal at the top of the pivot table. */ top= 1, /** * Show subtotal at the bottom of the pivot table. */ bottom= 2 } export class CustomPivotTableThemeManager extends GC.Spread.Sheets.CustomThemeManagerBase{ /** * Represents a custom pivot table theme manager that can manage all custom pivot table themes. * @class * @param {GC.Spread.Sheets.Workbook} workbook The workbook. * @extends GC.Spread.Sheets.CustomThemeManagerBase */ constructor(workbook: GC.Spread.Sheets.Workbook); /** * add a new pivot table theme. * @param {string | GC.Spread.Pivot.PivotTableTheme} theme the new pivot table theme or just a new pivot table theme name you want to add * @returns {GC.Spread.Pivot.PivotTableTheme | undefined} return the newly added pivot table theme, if the named pivot table theme is existed, failed to add pivot table theme and return undefined * @example * ```javascript * // add a new pivot table theme named "custom0" * var spread = new GC.Spread.Sheets.Workbook(document.getElementById("ss")); * let pivotTableStyle = spread.customPivotTableThemes.add("custom0"); * let wholeTableStyle = new GC.Spread.Pivot.PivotTableStyle(); * wholeTableStyle.backColor = "#0C66E4"; * pivotTableStyle.wholeTableStyle(wholeTableStyle); * ``` */ add(theme: string | GC.Spread.Pivot.PivotTableTheme): GC.Spread.Pivot.PivotTableTheme | undefined; /** * get the pivot table themes collection. * @returns Array * @example * ```javascript * // get all pivot table themes * let tableStylesCollection = spread.customPivotTableThemes.all(); * ``` */ all(): Array; /** * get the pivot table theme by name. * @param {string} name the specific name of the pivot table theme to get * @returns {GC.Spread.Pivot.PivotTableTheme | undefined} If the corresponding pivot table theme with the spefic name is found, return the theme; otherwise, return undefined. * @example * ```javascript * // get pivot table theme * pivotTableStyle = spread.customPivotTableThemes.get("custom0"); * ``` */ get(name: string): GC.Spread.Pivot.PivotTableTheme | undefined; /** * remove the pivot table theme by name. * @param {string} name the specific name of the pivot table theme to remove * @returns {void} * @example * ```javascript * // delete pivot table theme * spread.customPivotTableThemes.remove("custom0"); * ``` */ remove(name: string): void; /** * update the pivot table theme. * @param {string} oldThemeName the specific name of the pivot table theme to update * @param {GC.Spread.Pivot.PivotTableTheme} newTheme the specific name of the pivot table theme to update * @returns {void} * @example * ```javascript * // update pivot table theme * tableStyle = spread.customPivotTableThemes.update("custom0", new GC.Spread.Pivot.PivotTableTheme()); * ``` */ update(oldThemeName: string, newTheme: GC.Spread.Pivot.PivotTableTheme): void; } export class PivotPanel{ /** * Represents the pivot panel of pivot table. * @class * @param {string} name Indicates the Pivot panel name. * @param {GC.Spread.Pivot.PivotTable} pivotTable Indicates the pivot table that is related pivot panel. * @param {HTMLDivElement} host Indicates the container html element of the pivot panel. * @example * ```javascript * //This example creates a pivot panel. * var spread = new GC.Spread.Sheets.Workbook(document.getElementById("ss"),{sheetCount:3}); * var sourceSheet = spread.getSheet(0); * var sheet = spread.getSheet(1); * var sourceData = [["Date","Buyer","Type","Amount"], * ["01-Jan","Mom","Fuel",74], * ["15-Jan","Mom","Food",235], * ["17-Jan","Dad","Sports",20], * ["21-Jan","Kelly","Books",125]]; * sourceSheet.setArray(0, 0, sourceData ); * sourceSheet.tables.add('sourceData', 0, 0, 5, 4); * var layout = GC.Spread.Pivot.PivotTableLayoutType.compact; * var theme = GC.Spread.Pivot.PivotTableThemes.medium2; * var options = {showRowHeader: true, showColumnHeader: true}; * var pivotTable = sheet.pivotTables.add("pivotTable_1", 'sourceData', 1, 1, layout, theme, options); * pivotTable.suspendLayout(); * pivotTable.options.showRowHeader =true; * pivotTable.options.showColumnHeader =true; * pivotTable.add("Buyer", "Buyer", GC.Spread.Pivot.PivotTableFieldType.columnField); * pivotTable.add("Type", "Type", GC.Spread.Pivot.PivotTableFieldType.rowField); * pivotTable.add("Amount", "Sum of Amount", GC.Spread.Pivot.PivotTableFieldType.valueField, GC.Pivot.SubtotalType.sum); * var panel = new GC.Spread.Pivot.PivotPanel("myPivotPanel", pivotTable, document.getElementById("panel")); * pivotTable.resumeLayout(); * ``` */ constructor(name: string, pivotTable: GC.Spread.Pivot.PivotTable, host: HTMLDivElement); /** * @description attach to a pivot table for pivot panel, then the pivot panel can control the bound pivot table. * @param {GC.Spread.Pivot.PivotTable} pivotTable Indicates the pivot table which is attached. * @returns void */ attach(pivotTable: GC.Spread.Pivot.PivotTable): any; /** * @description destroy the PivotPanel. */ destroy(): any; /** * @description detach the pivot table for pivot panel, stop the pivot panel control bound pivot table. * @returns void */ detach(): void; /** * Gets the PivotPanel instance by the host element. * @param {HTMLElement|string} host The host element or the host element id. * @returns {GC.Spread.Pivot.PivotPanel} The PivotPanel instance. * @example * ```javascript * var spread = new GC.Spread.Sheets.Workbook(document.getElementById("ss")); * var sourceSheet = spread.getSheet(0) * var sheet = spread.getSheet(1); * var sourceData = [["Date","Buyer","Type","Amount"], * ["01-Jan","Mom","Fuel",74], * ["15-Jan","Mom","Food",235], * ["17-Jan","Dad","Sports",20], * ["21-Jan","Kelly","Books",125]]; * sourceSheet.setArray(0, 0, sourceData); * sourceSheet.tables.add('sourceData', 0, 0, 5, 4); * var layout = GC.Spread.Pivot.PivotTableLayoutType.compact; * var theme = GC.Spread.Pivot.PivotTableThemes.medium2; * var options = {showRowHeader: true, showColumnHeader: true}; * sheet.pivotTables.add("pivotTable_1", 'sourceData', 1, 1, layout, theme, options); * var pivotTable = sheet.pivotTables.get("pivotTable_1"); * var panel = new GC.Spread.Pivot.PivotPanel("sourceData", pivotTable, document.getElementById("pivotPanel")); * var pivotPanel = GC.Spread.Pivot.PivotPanel.findControl("pivotPanel"); * ``` */ static findControl(host: HTMLElement|string): GC.Spread.Pivot.PivotPanel; /** * @description set or get the panelLayout type. * @param {GC.Spread.Pivot.PivotPanelLayoutType} [value] change the panelLayout option to stack or flow. * @returns GC.Spread.Pivot.PivotPanelLayoutType | void */ panelLayout(value?: GC.Spread.Pivot.PivotPanelLayoutType): GC.Spread.Pivot.PivotPanelLayoutType | void; /** * @description get or set which sections are visible. * @param {number} [value] get or set which sections are visible by the sum of GC.Spread.Pivot.PivotPanelSection enum. * @returns {number|void} The visibility value. * @example * ```javascript * var visibility = pivotPanel.sectionVisibility() // 7; * visibility = visibility & ~GC.Spread.Pivot.PivotPanelSection.viewList; // 3 * pivotPanel.sectionVisibility(visibility); * ``` */ sectionVisibility(value?: number): number | void; } export class PivotTable{ /** * Represents a PivotTable. * @class * @param {string} name Indicates the name of pivot table. * @param {GC.Spread.Sheets.Worksheet} sheet Indicates the owner worksheet. * @param {number} row Indicates the pivot table start row. * @param {number} col Indicates the pivot table start column. * @param {GC.Spread.Pivot.PivotTableLayoutType} layout Indicates the pivot table layout type. * @param {string | GC.Spread.Pivot.PivotTableTheme} style Indicates the pivot table theme style or style name. */ constructor(name: string, sheet?: GC.Spread.Sheets.Worksheet, row?: number, col?: number, layout?: GC.Spread.Pivot.PivotTableLayoutType, style?: string | GC.Spread.Pivot.PivotTableTheme, options?: GC.Spread.Pivot.IPivotTableOption, layoutModel?: any); /** * Indicates the options of the PivotTable. * @type {Object} * @property {boolean} [allowMultipleFiltersPerField] Indicates whether use multiple filter in one field. * @property {boolean} [fillDownLabels] Indicates show repeat label items or not. * @property {boolean} [insertBlankLineAfterEachItem] Indicates whether insert a blank row at end of each item. * @property {GC.Spread.Pivot.GrandTotalPosition} [grandTotalPosition] Indicates whether show grandtotal in row, column or both. * @property {GC.Spread.Pivot.SubtotalsPosition} [subtotalsPosition] Indicates show subtotal top or bottom or not show. * @property {GC.Spread.Pivot.DisplayFields} [displayFieldsInPageFilterArea] Indicates the field display in page area show first over then down or first down then over. * @property {number} [reportFilterFieldsPerColumn] Indicates the number of report filer field per column. * @property {boolean} [bandRows] Indicates show band row or not. * @property {boolean} [bandColumns] Indicates show band column or not. * @property {boolean} [showRowHeader] Indicates show row header style or not. * @property {boolean} [showColumnHeader] Indicates show column header style or not. * @property {boolean} [showDrill] Indicates show expand/collapse button or not. * @property {boolean} [showMissing] Indicates whether the missingCaption option is effected. * @property {boolean} [missingCaption] Indicates what value should be shown when the actual value is empty * @property {boolean} [rowLabelIndent] Indicates the indent of the title of each level. * @property {boolean} [printDrill] Print expand/collapse buttons when displayed on PivotTable. * @property {boolean} [itemPrintTitles] Repeat row labels on each PivotTable. * @property {boolean} [fieldPrintTitles] Set Print titles. * @property {boolean} [showFilter] Indicates show filter button or not. * @property {boolean} [showToolTip] Indicates show tooltip or not. * @property {boolean} [mergeItem] Indicates whether merge and center the cells with labels. * @property {boolean} [isShowErrorValue] Indicates whether the errorValueInfo option is effected. * @property {boolean} [errorValueInfo] Indicates what value should be shown when the actual value is a error. * @property {string} [rowHeaderCaption] Indicates what value should be shown in compact layout to replace Row Label. * @property {string} [colHeaderCaption] Indicates what value should be shown in compact layout to replace Column Label. * @property {boolean} [showHeaders] Indicates show field headers. * @property {GC.Spread.Pivot.CalcItemAggregation} [calcItemAggregation] Indicates whether PivotTable total contains the value of calcItem. * @property {boolean} [enableDataValueEditing] Indicates whether allow edit cell values of data area of pivot table. */ options: GC.Spread.Pivot.IPivotTableOption; /** * Pivot table view manager for the pivot table. * @type {GC.Spread.Pivot.IPivotTableViewManager} */ views: GC.Spread.Pivot.IPivotTableViewManager; /** * @description Add a field to pivot table. * @param {string} sourceName Indicates the source name of the field. * @param {string} displayName Indicates the display name of the field. * @param {number} area Indicates which area will be added to. * @param {GC.Pivot.SubtotalType} [subtotal] Indicates the summary type when the field add to value area. * @param {number} [index] Indicates the field index of pivot table's field area. * @returns {void} * @example * ```javascript * var spread = new GC.Spread.Sheets.Workbook(document.getElementById("ss"),{sheetCount:3}); * var sourceSheet = spread.getSheet(0); * var sheet = spread.getSheet(1); * var sourceData = [["Date","Buyer","Type","Amount"], * ["01-Jan","Mom","Fuel",74], * ["15-Jan","Mom","Food",235], * ["17-Jan","Dad","Sports",20], * ["21-Jan","Kelly","Books",125]]; * sourceSheet.setArray(0, 0, sourceData ); * sourceSheet.tables.add('sourceData', 0, 0, 5, 4); * var layout = GC.Spread.Pivot.PivotTableLayoutType.compact; * var theme = GC.Spread.Pivot.PivotTableThemes.medium2; * var options = {showRowHeader: true, showColumnHeader: true}; * var pivotTable = sheet.pivotTables.add("pivotTable_1", 'sourceData', 1, 1, layout, theme, options); * var subtotal = GC.Pivot.SubtotalType.count; * pivotTable.add("Buyer", "Buyer", 1, subtotal, 0) //add a field to pivot table, and field name is displayName, field in row area * ``` */ add(sourceName: string, displayName: string, area: number, subtotal?: GC.Pivot.SubtotalType, index?: number): void; /** * @description Add a calculated field, the calculated field can only add into value area of pivot table. * @param {string} fieldName Indicates the calculated field name. * @param {string} formula Indicates the calculated formula. * @returns {void} * @example * ```javascript * var spread = new GC.Spread.Sheets.Workbook(document.getElementById("ss"),{sheetCount:3}); * var sourceSheet = spread.getSheet(0); * var sheet = spread.getSheet(1); * var sourceData = [["Date","Buyer","Type","Amount"], * ["01-Jan","Mom","Fuel",74], * ["15-Jan","Mom","Food",235], * ["17-Jan","Dad","Sports",20], * ["21-Jan","Kelly","Books",125]]; * sourceSheet.setArray(0, 0, sourceData); * sourceSheet.tables.add('sourceData', 0, 0, 5, 4); * var layout = GC.Spread.Pivot.PivotTableLayoutType.compact; * var theme = GC.Spread.Pivot.PivotTableThemes.medium2; * var pivotTable = sheet.pivotTables.add("myPivotTable", 'sourceData', 1, 1, layout, theme); * pivotTable.addCalcField("PercentOfEach", "=Amount/454"); * ``` */ addCalcField(fieldName: string, formula: string): void; /** * @description add a calcItem * @param {string} sourceName The name of sourceField name * @param {string} calcItemName The name of sourceField calcItem name * @param {string} formula The formula of sourceField calcItem formula * @returns {void} * @example * ```javascript * var spread = new GC.Spread.Sheets.Workbook(document.getElementById("ss")); * var sourceSheet = spread.getSheet(0) * var sheet = spread.getSheet(1); * var sourceData = [["Date","Buyer","Type","Amount"], * ["01-Jan","Mom","Fuel",74], * ["15-Jan","Mom","Food",235], * ["17-Jan","Dad","Sports",20], * ["21-Jan","Kelly","Books",125]]; * sourceSheet.setArray(0, 0, sourceData); * sourceSheet.tables.add('sourceData', 0, 0, 5, 4); * var layout = GC.Spread.Pivot.PivotTableLayoutType.compact; * var theme = GC.Spread.Pivot.PivotTableThemes.medium2; * var options = {showRowHeader: true, showColumnHeader: true}; * sheet.pivotTables.add("pivotTable_1", 'sourceData', 1, 1, layout, theme, options); * var pivotTable = sheet.pivotTables.get("pivotTable_1"); * pivotTable.add("Buyer","Buyer",GC.Spread.Pivot.PivotTableFieldType.rowField); * pivotTable.add("Type","Type",GC.Spread.Pivot.PivotTableFieldType.columnField); * pivotTable.add("Amount","Sum of Amount",GC.Spread.Pivot.PivotTableFieldType.valueField, GC.Pivot.SubtotalType.sum); * pivotTable.addCalcItem("Buyer", "formula1", "=Buyer[Mom]+Buyer[Dad]"); * ``` */ addCalcItem(sourceName: string, calcItemName: string, formula: string): void; /** * Sets the rules using the pivot areas. * @param {GC.Spread.Pivot.IPivotArea[]} pivotArea The pivotArea in pivot table. * @param {GC.Spread.Sheets.ConditionalFormatting.ConditionRuleBase} conditionalRule The rules set to the pivot area. * @example * ```javascript * //This example uses the getRule method. * var pivotTable = activeSheet.pivotTables.all()[0]; * var rule = new GC.Spread.Sheets.ConditionalFormatting.ScaleRule(); * rule.ruleType(GC.Spread.Sheets.ConditionalFormatting.RuleType.threeScaleRule); * rule.midColor("#12ff34"); * rule.midType(GC.Spread.Sheets.ConditionalFormatting.ScaleValueType.number); * rule.midValue(50000); * rule.maxColor("#EE3344"); * rule.maxType(GC.Spread.Sheets.ConditionalFormatting.ScaleValueType.number); * rule.maxValue(400000); * rule.minColor("#AAff34"); * rule.minType(GC.Spread.Sheets.ConditionalFormatting.ScaleValueType.number); * rule.minValue(5000); * var AmericaPivotArea = { * dataOnly: true * references: [{ * fieldName: "Country", * items: ["America"] * }] * } * var BritainPivotArea = { * dataOnly: true * references: [{ * fieldName: "Country", * items: ["Britain"] * }] * } * pivotTable.addConditionalRule([AmericaPivotArea, BritainPivotArea], rule); * ``` */ addConditionalRule(pivotArea: GC.Spread.Pivot.IPivotArea[], conditionalRule: GC.Spread.Sheets.ConditionalFormatting.ConditionRuleBase): void; /** * @description Set the minimum visual column width for each Field item. * @example * ```javascript * var spread = new GC.Spread.Sheets.Workbook(document.getElementById("ss"),{sheetCount:3}); * var sourceSheet = spread.getSheet(0); * var sheet = spread.getSheet(1); * var sourceData = [["Date","Buyer","Type","Amount"], * ["01-Jan","Mom","Fuel",74], * ["15-Jan","Mom","Food",235], * ["17-Jan","Dad","Sports",20], * ["21-Jan","Kelly","Books",125]]; * sourceSheet.setArray(0, 0, sourceData ); * sourceSheet.tables.add('sourceData', 0, 0, 5, 4); * var layout = GC.Spread.Pivot.PivotTableLayoutType.compact; * var theme = GC.Spread.Pivot.PivotTableThemes.medium2; * var pivotTable = sheet.pivotTables.add("pivotTable_1", 'sourceData', 1, 1, layout, theme); * pivotTable.add("Type", "Type", GC.Spread.Pivot.PivotTableFieldType.rowField); * pivotTable.add("Date", "Date", GC.Spread.Pivot.PivotTableFieldType.columnField); * pivotTable.add("Amount", "Sum of Amount", GC.Spread.Pivot.PivotTableFieldType.valueField, GC.Pivot.SubtotalType.sum); * pivotTable.autoFitColumn(); * ``` */ autoFitColumn(): void; /** * clear overwrite info list. */ clearOverwriteList(): void; /** * @description Get or set collapse info for a field of pivot table. * @param {string} fieldName Indicates the target field name. * @param {string} item Indicates the collapse item name. * @param {boolean} [isCollapse] Indicates the status of the collapse. * @returns {boolean|void} whether is collapsed. * @example * ```javascript * var spread = new GC.Spread.Sheets.Workbook(document.getElementById("ss"),{sheetCount:3}); * var sourceSheet = spread.getSheet(0); * var sheet = spread.getSheet(1); * var sourceData = [["Date","Buyer","Type","Amount"], * ["01-Jan","Mom","Fuel",74], * ["15-Jan","Mom","Food",235], * ["17-Jan","Dad","Sports",20], * ["21-Jan","Kelly","Books",125]]; * sourceSheet.setArray(0, 0, sourceData ); * sourceSheet.tables.add('sourceData', 0, 0, 5, 4); * var layout = GC.Spread.Pivot.PivotTableLayoutType.compact; * var theme = GC.Spread.Pivot.PivotTableThemes.medium2; * var options = {showRowHeader: true, showColumnHeader: true}; * var pivotTable = sheet.pivotTables.add("pivotTable_1", 'sourceData', 1, 1, layout, theme, options); * pivotTable.add("Buyer", "Buyer", 1, subtotal, 0); * pivotTable.add("Type", "Type", 1, subtotal, 1); * var collapseValue = pivotTable.collapse("Buyer","Mom"); * pivotTable.collapse("Buyer","Mom", !collapseValue); * ``` */ collapse(fieldName: string, item: string, isCollapse?: boolean): boolean | void; /** * Connect slicer with the PivotTable * @param {string} name name of slicer */ connectSlicer(name: string): void; /** * @description Get or set the values position. * @param {GC.Pivot.DataPosition} [positionType] Indicates the position which is in row or column area. * @param {number} [positionIndex] Indicates the order in field row or column list. * @returns {GC.Pivot.IDataPosition|void} return the data position info of pivot table or void * @example * ```javascript * var spread = new GC.Spread.Sheets.Workbook(document.getElementById("ss"),{sheetCount:3}); * var sourceSheet = spread.getSheet(0); * var sheet = spread.getSheet(1); * var sourceData = [["Date","Buyer","Type","Amount"], * ["01-Jan","Mom","Fuel",74], * ["15-Jan","Mom","Food",235], * ["17-Jan","Dad","Sports",20], * ["21-Jan","Kelly","Books",125]]; * sourceSheet.setArray(0, 0, sourceData ); * sourceSheet.tables.add('sourceData', 0, 0, 5, 4); * var layout = GC.Spread.Pivot.PivotTableLayoutType.compact; * var theme = GC.Spread.Pivot.PivotTableThemes.medium2; * var options = {showRowHeader: true, showColumnHeader: true}; * var pivotTable = sheet.pivotTables.add("pivotTable_1", 'sourceData', 1, 1, layout, theme, options); * pivotTable.dataPosition(1,0) //move values to row area and index is 0 * pivotTable.dataPosition();//{positionType:1,positionIndex:0} * ``` */ dataPosition(positionType?: GC.Pivot.DataPosition, positionIndex?: number): GC.Pivot.IDataPosition | void; /** * @description restore serialized pivot table data to a existed pivot table * @param {object} serializeInfo serialized pivot table data. * @param {GC.Spread.Pivot.PivotTableLayoutType} [serializeInfo.layoutType] the layoutType of pivot table * @param {object} [serializeInfo.options] the options of pivot table * @param {string} [serializeInfo.theme] the theme of pivot table * @param {object} [serializeInfo.valuePosition] the valuePosition info of pivot table * @param {array} [serializeInfo.pivotTablePosition] the position of pivot table * @param {array} [serializeInfo.fieldsInfo] the fields info of pivot table * @param {array} [serializeInfo.styles] the pivot area styles of pivot table * @param {object} [serializeInfo.collapseItems] the collapse info of pivot table * @example * ```javascript * var spread = new GC.Spread.Sheets.Workbook(document.getElementById("ss"),{sheetCount:3}); * var sourceSheet = spread.getSheet(0); * var sheet = spread.getSheet(1); * var sourceData = [["Date","Buyer","Type","Amount"], * ["01-Jan","Mom","Fuel",74], * ["15-Jan","Mom","Food",235], * ["17-Jan","Dad","Sports",20], * ["21-Jan","Kelly","Books",125]]; * sourceSheet.setArray(0, 0, sourceData ); * sourceSheet.tables.add('sourceData', 0, 0, 5, 4); * var layout = GC.Spread.Pivot.PivotTableLayoutType.compact; * var theme = GC.Spread.Pivot.PivotTableThemes.medium2; * var pivotTable = sheet.pivotTables.add("pivotTable_1", 'sourceData', 1, 1, layout, theme); * pivotTable.add("Buyer","Buyer",GC.Spread.Pivot.PivotTableFieldType.rowField); * pivotTable.add("Type","Type",GC.Spread.Pivot.PivotTableFieldType.columnField); * pivotTable.add("Amount","Sum of Amount",GC.Spread.Pivot.PivotTableFieldType.valueField, GC.Pivot.SubtotalType.sum); * var serialization = pivotTable.serialize(); * pivotTable.remove('Type'); * pivotTable.deserialize(serialization); * ``` */ deserialize(serializeInfo: GC.Spread.Pivot.ISerializeInfo): void; /** * Disconnect slicer with PivotTable * @param {string} ptName name of slicer */ disconnectSlicer(name: string): void; /** * Get All Slicers connect with the PivotTable * @returns {GC.Spread.Pivot.PivotTableItemSlicer[]} slicers connect with the PivotTable */ getAllSlicers(): GC.Spread.Pivot.PivotTableItemSlicer[]; /** * @description get all calculated fields's info. * @return {GC.Spread.Pivot.ICalcFieldInfo[]} return all calculated fields's info. * @example * ```javascript * var spread = new GC.Spread.Sheets.Workbook(document.getElementById("ss"),{sheetCount:3}); * var sourceSheet = spread.getSheet(0); * var sheet = spread.getSheet(1); * var sourceData = [["Date","Buyer","Type","Amount"], * ["01-Jan","Mom","Fuel",74], * ["15-Jan","Mom","Food",235], * ["17-Jan","Dad","Sports",20], * ["21-Jan","Kelly","Books",125]]; * sourceSheet.setArray(0, 0, sourceData ); * sourceSheet.tables.add('sourceData', 0, 0, 5, 4); * var layout = GC.Spread.Pivot.PivotTableLayoutType.compact; * var theme = GC.Spread.Pivot.PivotTableThemes.medium2; * var pivotTable = sheet.pivotTables.add("pivotTable1", 'sourceData', 1, 1, layout, theme); * pivotTable.addCalcField("PercentOfEach", "=Amount/454"); * pivotTable.getCalcFields(); * ``` */ getCalcFields(): GC.Spread.Pivot.ICalcFieldInfo[]; /** * @description get calcItems information * @param {string} sourceName The name of sourceField name * @returns {GC.Spread.Pivot.ICalcItemInfo[]} * @example * ```javascript * var spread = new GC.Spread.Sheets.Workbook(document.getElementById("ss")); * var sourceSheet = spread.getSheet(0) * var sheet = spread.getSheet(1); * var sourceData = [["Date","Buyer","Type","Amount"], * ["01-Jan","Mom","Fuel",74], * ["15-Jan","Mom","Food",235], * ["17-Jan","Dad","Sports",20], * ["21-Jan","Kelly","Books",125]]; * sourceSheet.setArray(0, 0, sourceData); * sourceSheet.tables.add('sourceData', 0, 0, 5, 4); * var layout = GC.Spread.Pivot.PivotTableLayoutType.compact; * var theme = GC.Spread.Pivot.PivotTableThemes.medium2; * var options = {showRowHeader: true, showColumnHeader: true}; * sheet.pivotTables.add("pivotTable_1", 'sourceData', 1, 1, layout, theme, options); * var pivotTable = sheet.pivotTables.get("pivotTable_1"); * pivotTable.add("Buyer","Buyer",GC.Spread.Pivot.PivotTableFieldType.rowField); * pivotTable.add("Type","Type",GC.Spread.Pivot.PivotTableFieldType.columnField); * pivotTable.add("Amount","Sum of Amount",GC.Spread.Pivot.PivotTableFieldType.valueField, GC.Pivot.SubtotalType.sum); * pivotTable.addCalcItem("Buyer", "formula1", "=Buyer[Mom]+Buyer[Dad]"); * pivotTable.getCalcItems("Buyer"); * ``` */ getCalcItems(sourceName?: string): GC.Spread.Pivot.ICalcItemInfo[]; /** * Gets the rules using the pivot area. * @param {GC.Spread.Pivot.IPivotArea} pivotArea The pivotArea in pivot table. * @returns {GC.Spread.Sheets.ConditionalFormatting.ConditionRuleBase[]} The rules from the pivot area. * @example * ```javascript * //This example uses the getRule method. * var pivotTable = activeSheet.pivotTables.all()[0]; * var rule = new GC.Spread.Sheets.ConditionalFormatting.ScaleRule(); * rule.ruleType(GC.Spread.Sheets.ConditionalFormatting.RuleType.threeScaleRule); * rule.midColor("#12ff34"); * rule.midType(GC.Spread.Sheets.ConditionalFormatting.ScaleValueType.number); * rule.midValue(50000); * rule.maxColor("#EE3344"); * rule.maxType(GC.Spread.Sheets.ConditionalFormatting.ScaleValueType.number); * rule.maxValue(400000); * rule.minColor("#AAff34"); * rule.minType(GC.Spread.Sheets.ConditionalFormatting.ScaleValueType.number); * rule.minValue(5000); * var AmericaPivotArea = { * dataOnly: true * references: [{ * fieldName: "Country", * items: ["America"] * }] * } * var BritainPivotArea = { * dataOnly: true * references: [{ * fieldName: "Country", * items: ["Britain"] * }] * } * pivotTable.addConditionalRule([AmericaPivotArea, BritainPivotArea], rule); * var ruleTest = pivotTable.getConditionalRules(BritainPivotArea); * alert(ruleTest[0].midValue()); * ``` */ getConditionalRules(pivotArea: GC.Spread.Pivot.IPivotArea): GC.Spread.Sheets.ConditionalFormatting.ConditionRuleBase[]; /** * @description Get field information from pivot table by field name * @param {string} fieldName the field's name * @returns {GC.Spread.Pivot.IFieldInfo} return a field information * @example * ```javascript * var spread = new GC.Spread.Sheets.Workbook(document.getElementById("ss"),{sheetCount:3}); * var sourceSheet = spread.getSheet(0); * var sheet = spread.getSheet(1); * var sourceData = [["Date","Buyer","Type","Amount"], * ["01-Jan","Mom","Fuel",74], * ["15-Jan","Mom","Food",235], * ["17-Jan","Dad","Sports",20], * ["21-Jan","Kelly","Books",125]]; * sourceSheet.setArray(0, 0, sourceData ); * sourceSheet.tables.add('sourceData', 0, 0, 5, 4); * var layout = GC.Spread.Pivot.PivotTableLayoutType.compact; * var theme = GC.Spread.Pivot.PivotTableThemes.medium2; * var options = {showRowHeader: true, showColumnHeader: true}; * var pivotTable = sheet.pivotTables.add("pivotTable_1", 'sourceData', 1, 1, layout, theme, options); * pivotTable.add("Buyer","Buyer",GC.Spread.Pivot.PivotTableFieldType.rowField); * pivotTable.add("Type","Type",GC.Spread.Pivot.PivotTableFieldType.columnField); * pivotTable.add("Amount","Sum of Amount",GC.Spread.Pivot.PivotTableFieldType.valueField, GC.Pivot.SubtotalType.sum); * pivotTable.getField("Type"); * ``` */ getField(fieldName: string): GC.Spread.Pivot.IFieldInfo; /** * @description Get all field information from pivot table or one of pivot table area * @param {GC.Spread.Pivot.PivotTableFieldType} [area] area index * @returns {GC.Spread.Pivot.IFieldInfo[]} return all field information in the pivot table area * @example * ```javascript * var spread = new GC.Spread.Sheets.Workbook(document.getElementById("ss"),{sheetCount:3}); * var sourceSheet = spread.getSheet(0); * var sheet = spread.getSheet(1); * var sourceData = [["Date","Buyer","Type","Amount"], * ["01-Jan","Mom","Fuel",74], * ["15-Jan","Mom","Food",235], * ["17-Jan","Dad","Sports",20], * ["21-Jan","Kelly","Books",125]]; * sourceSheet.setArray(0, 0, sourceData ); * sourceSheet.tables.add('sourceData', 0, 0, 5, 4); * var layout = GC.Spread.Pivot.PivotTableLayoutType.compact; * var theme = GC.Spread.Pivot.PivotTableThemes.medium2; * var options = {showRowHeader: true, showColumnHeader: true}; * var pivotTable = sheet.pivotTables.add("pivotTable_1", 'sourceData', 1, 1, layout, theme, options); * pivotTable.add("Buyer","Buyer",GC.Spread.Pivot.PivotTableFieldType.rowField); * pivotTable.add("Type","Type",GC.Spread.Pivot.PivotTableFieldType.columnField); * pivotTable.add("Amount","Sum of Amount",GC.Spread.Pivot.PivotTableFieldType.valueField, GC.Pivot.SubtotalType.sum); * pivotTable.getFieldsByArea(GC.Spread.PivotTableFieldType.columnField); * ``` */ getFieldsByArea(area?: GC.Spread.Pivot.PivotTableFieldType): GC.Spread.Pivot.IFieldInfo[]; /** * @description get all items from pivot table by field name * @param {string} fieldName the field name of pivot table field * @returns {string[]}return all items of pivot table field */ getItemsByField(fieldName: string): any; /** * compose overwrite info from sheet row and column. * @param {number} row sheet row of the cell. * @param {number} col sheet column of the cell. * @returns {GC.Spread.Pivot.IPivotNodeInfo} The node info want to get. */ getNodeInfo(row: number, col: number): GC.Spread.Pivot.IPivotNodeInfo; /** * get value by node info. * @param {GC.Spread.Pivot.IPivotNodeInfo} nodeInfo The node info want to get. * @returns {number} value of node info. */ getNodeValue(nodeInfo: GC.Spread.Pivot.IPivotNodeInfo): number; /** * get all overwrite info of pivot cache. * @returns {GC.Spread.Pivot.IPivotOverwriteNodeInfo[]} overwrite info list. */ getOverwriteList(): GC.Spread.Pivot.IPivotOverwriteNodeInfo[]; /** * @description get the sheet ranges that corresponding to the specific pivotArea. * @param {GC.Spread.Pivot.IPivotArea} pivotArea the specific pivotArea * @returns {GC.Spread.Sheets.Range[]} ranges the sheet ranges that corresponding to the specific pivotArea. * @example * ```javascript * var spread = new GC.Spread.Sheets.Workbook(document.getElementById("ss")); * var sourceSheet = spread.getSheet(0) * var sheet = spread.getSheet(1); * var sourceData = [["Date","Buyer","Type","Amount"], * ["01-Jan","Mom","Fuel",74], * ["15-Jan","Mom","Food",235], * ["17-Jan","Dad","Sports",20], * ["21-Jan","Kelly","Books",125]]; * sourceSheet.setArray(0, 0, sourceData); * sourceSheet.tables.add('sourceData', 0, 0, 5, 4); * var layout = GC.Spread.Pivot.PivotTableLayoutType.compact; * var theme = GC.Spread.Pivot.PivotTableThemes.medium2; * var options = {showRowHeader: true, showColumnHeader: true}; * var pivotTable = sheet.pivotTables.add("pivotTable1", 'sourceData', 1, 1, layout, theme, options); * pivotTable.add("Buyer", "Buyer", GC.Spread.Pivot.PivotTableFieldType.rowField); * pivotTable.add("Type", "Type", GC.Spread.Pivot.PivotTableFieldType.rowField); * pivotTable.add("Date", "Date", GC.Spread.Pivot.PivotTableFieldType.columnField); * pivotTable.add("Amount", "Amount", GC.Spread.Pivot.PivotTableFieldType.valueField, GC.Pivot.SubtotalType.sum); * var pivotArea = { * dataOnly: false, * references: [ * { * fieldName: "Buyer", * items: ["Mom", "Dad"] * } * ] * }; * let ranges = pivotTable.getPivotAreaRanges(pivotArea); * ``` */ getPivotAreaRanges(pivotArea: GC.Spread.Pivot.IPivotArea): GC.Spread.Sheets.Range[]; /** * @description get PivotTable Details * @param {Array} pivotItemInfo The pivot details information list * @param {string} pivotItemInfo.fieldName The name of field * @param {string} pivotItemInfo.fieldItem The name of field item * @returns {array|void} * @example * ```javascript * var spread = new GC.Spread.Sheets.Workbook(document.getElementById("ss")); * var sourceSheet = spread.getSheet(0) * var sheet = spread.getSheet(1); * var sourceData = [["Date","Buyer","Type","Amount"], * ["01-Jan","Mom","Fuel",74], * ["15-Jan","Mom","Food",235], * ["17-Jan","Dad","Sports",20], * ["21-Jan","Kelly","Books",125]]; * sourceSheet.setArray(0, 0, sourceData); * sourceSheet.tables.add('sourceData', 0, 0, 5, 4); * var layout = GC.Spread.Pivot.PivotTableLayoutType.compact; * var theme = GC.Spread.Pivot.PivotTableThemes.medium2; * var options = {showRowHeader: true, showColumnHeader: true}; * sheet.pivotTables.add("pivotTable_1", 'sourceData', 1, 1, layout, theme, options); * var pivotTable = sheet.pivotTables.get("pivotTable_1"); * pivotTable.add("Buyer","Buyer",GC.Spread.Pivot.PivotTableFieldType.rowField); * pivotTable.add("Type","Type",GC.Spread.Pivot.PivotTableFieldType.columnField); * pivotTable.add("Amount","Sum of Amount",GC.Spread.Pivot.PivotTableFieldType.valueField, GC.Pivot.SubtotalType.sum); * pivotTable.getPivotDetails([{fieldName:"Buyer", fieldItem:"Kelly"}]); * ``` */ getPivotDetails(pivotItemInfo: GC.Spread.Pivot.IPivotItemInfo[]): any[][] | void; /** * @description Get the range of PivotTable, consist of page & content. They are readonly, change the range will not take any effect. * @returns {GC.Spread.Pivot.IPivotTableRange} return current pivot table range. * @example * ```javascript * var spread = new GC.Spread.Sheets.Workbook(document.getElementById("ss")); * var sourceSheet = spread.getSheet(0) * var sheet = spread.getSheet(1); * var sourceData = [["Date","Buyer","Type","Amount"], * ["01-Jan","Mom","Fuel",74], * ["15-Jan","Mom","Food",235], * ["17-Jan","Dad","Sports",20], * ["21-Jan","Kelly","Books",125]]; * sourceSheet.setArray(0, 0, sourceData); * sourceSheet.tables.add('sourceData', 0, 0, 5, 4); * var layout = GC.Spread.Pivot.PivotTableLayoutType.compact; * var theme = GC.Spread.Pivot.PivotTableThemes.medium2; * var pivotTable = sheet.pivotTables.add("pivotTable1", 'sourceData', 1, 1, layout, theme); * pivotTable.add("Buyer", "Buyer", GC.Spread.Pivot.PivotTableFieldType.filterField); * pivotTable.add("Type", "Type", GC.Spread.Pivot.PivotTableFieldType.rowField); * pivotTable.add("Date", "Date", GC.Spread.Pivot.PivotTableFieldType.columnField); * pivotTable.add("Amount", "Amount", GC.Spread.Pivot.PivotTableFieldType.valueField, GC.Pivot.SubtotalType.sum); * var ranges = pivotTable.getRange(); * console.log(ranges.page, ranges.content); * ``` */ getRange(): GC.Spread.Pivot.IPivotTableRange; /** * @description get PivotTable data refer * @returns {string} * @example * ```javascript * var spread = new GC.Spread.Sheets.Workbook(document.getElementById("ss")); * var sourceSheet = spread.getSheet(0) * var sheet = spread.getSheet(1); * var sourceData = [["Date","Buyer","Type","Amount"], * ["01-Jan","Mom","Fuel",74], * ["15-Jan","Mom","Food",235], * ["17-Jan","Dad","Sports",20], * ["21-Jan","Kelly","Books",125]]; * sourceSheet.setArray(0, 0, sourceData); * sourceSheet.tables.add('sourceData', 0, 0, 5, 4); * var layout = GC.Spread.Pivot.PivotTableLayoutType.compact; * var theme = GC.Spread.Pivot.PivotTableThemes.medium2; * sheet.pivotTables.add("pivotTable_1", 'sourceData', 1, 1, layout, theme); * var pivotTable = sheet.pivotTables.get("pivotTable_1"); * pivotTable.getSource(); * ``` */ getSource(): string; /** * @description get PivotTable source field information * @returns {GC.Spread.Pivot.ISourceFieldInfo[]} * @example * ```javascript * var spread = new GC.Spread.Sheets.Workbook(document.getElementById("ss")); * var sourceSheet = spread.getSheet(0) * var sheet = spread.getSheet(1); * var sourceData = [["Date","Buyer","Type","Amount"], * ["01-Jan","Mom","Fuel",74], * ["15-Jan","Mom","Food",235], * ["17-Jan","Dad","Sports",20], * ["21-Jan","Kelly","Books",125]]; * sourceSheet.setArray(0, 0, sourceData); * sourceSheet.tables.add('sourceData', 0, 0, 5, 4); * var layout = GC.Spread.Pivot.PivotTableLayoutType.compact; * var theme = GC.Spread.Pivot.PivotTableThemes.medium2; * var options = {showRowHeader: true, showColumnHeader: true}; * sheet.pivotTables.add("pivotTable_1", 'sourceData', 1, 1, layout, theme, options); * var pivotTable = sheet.pivotTables.get("pivotTable_1"); * pivotTable.addCalcField("calcField", "=Amount*2"); * pivotTable.getSourceFields(); * ``` */ getSourceFields(): GC.Spread.Pivot.ISourceFieldInfo[]; /** * @description Get style by the specific pivotArea. * @param {GC.Spread.Pivot.IPivotArea} pivotArea the specific pivotArea * @returns GC.Spread.Sheets.Style * @example * ```javascript * var spread = new GC.Spread.Sheets.Workbook(document.getElementById("ss")); * var sourceSheet = spread.getSheet(0) * var sheet = spread.getSheet(1); * var sourceData = [["Date","Buyer","Type","Amount"], * ["01-Jan","Mom","Fuel",74], * ["15-Jan","Mom","Food",235], * ["17-Jan","Dad","Sports",20], * ["21-Jan","Kelly","Books",125]]; * sourceSheet.setArray(0, 0, sourceData); * sourceSheet.tables.add('sourceData', 0, 0, 5, 4); * var layout = GC.Spread.Pivot.PivotTableLayoutType.compact; * var theme = GC.Spread.Pivot.PivotTableThemes.medium2; * var options = {showRowHeader: true, showColumnHeader: true}; * var pivotTable = sheet.pivotTables.add("pivotTable1", 'sourceData', 1, 1, layout, theme, options); * pivotTable.add("Buyer", "Buyer", GC.Spread.Pivot.PivotTableFieldType.rowField); * pivotTable.add("Type", "Type", GC.Spread.Pivot.PivotTableFieldType.rowField); * pivotTable.add("Date", "Date", GC.Spread.Pivot.PivotTableFieldType.columnField); * pivotTable.add("Amount", "Amount", GC.Spread.Pivot.PivotTableFieldType.valueField, GC.Pivot.SubtotalType.sum); * var pivotArea = { * dataOnly: false, * references: [ * { * fieldName: "Buyer", * items: ["Mom", "Dad"] * } * ] * }; * var style = new GC.Spread.Sheets.Style(); * redBack.backColor = '#ff0000'; * pivotTable.setStyle(pivotArea, style); * pivotTable.getStyle(pivotArea); * ``` */ getStyle(pivotArea: GC.Spread.Pivot.IPivotArea): GC.Spread.Sheets.Style; /** * Gets or sets a style name for the pivot table. * @returns {string} returns the pivot table style name. */ getThemeName(): string | undefined; /** * @description Group the items of field * @param {GC.Spread.Pivot.ITextGroupInfo | GC.Spread.Pivot.INumberGroupInfo | GC.Spread.Pivot.IDateGroupsInfo} groupInfo Indicates the grouped info. * @example * ```javascript * var spread = new GC.Spread.Sheets.Workbook(document.getElementById("ss"),{sheetCount:3}); * var sourceSheet = spread.getSheet(0); * var sheet = spread.getSheet(1); * var sourceData = [["Date","Buyer","Type","Amount"], * ["01-Jan","Mom","Fuel",74], * ["15-Jan","Mom","Food",235], * ["17-Jan","Dad","Sports",20], * ["19-Jan","David","Books",120], * ["20-Jan","Dad","Food",160], * ["21-Jan","David","Sports",15], * ["21-Jan","Kelly","Books",125]]; * sourceSheet.setArray(0, 0, sourceData ); * sourceSheet.tables.add('sourceData', 0, 0, 8, 4); * var layout = GC.Spread.Pivot.PivotTableLayoutType.compact; * var theme = GC.Spread.Pivot.PivotTableThemes.medium2; * var options = {showRowHeader: true, showColumnHeader: true}; * var pivotTable = sheet.pivotTables.add("pivotTable_1", 'sourceData', 1, 1, layout, theme, options); * var groupInfo = { * originFieldName: "Buyer", * textGroup: { * fieldName: "FamilyMembers", * groupItems: { * "parent": ["Mom", "Dad"], * "children": ["David", "Kelly"] * } * } * }; * pivotTable.group(groupInfo); * pivotTable.add("FamilyMembers", "FamilyMembers", GC.Spread.Pivot.PivotTableFieldType.rowField); * pivotTable.add("Buyer", "Buyer", GC.Spread.Pivot.PivotTableFieldType.rowField); * pivotTable.add("Amount", "Sum of Amount", GC.Spread.Pivot.PivotTableFieldType.valueField, GC.Pivot.SubtotalType.sum); * sheet.resumePaint(); * ``` */ group(groupInfo: GC.Spread.Pivot.ITextGroupInfo | GC.Spread.Pivot.INumberGroupInfo | GC.Spread.Pivot.IDateGroupsInfo): void; /** * Whether the slicer is connected with the PivotTable * @param {string} name name of slicer * @returns {boolean} Whether the slicer is connected with the PivotTable */ isConnectedSlicer(name: string): boolean; /** * Get or set label filter info for a field. * @param {string} fieldName Indicates the target field name of pivot table. * @param {object} [filterInfo] Indicates the label filter info when set. * @returns {GC.Spread.Pivot.IPivotTextFilterInfo | GC.Spread.Pivot.IPivotConditionFilterInfo} return pivot table labelFilter information * @example * ```javascript * var spread = new GC.Spread.Sheets.Workbook(document.getElementById("ss"),{sheetCount:3}); * var sourceSheet = spread.getSheet(0); * var sheet = spread.getSheet(1); * var sourceData = [["Date","Buyer","Type","Amount"], * ["01-Jan","Mom","Fuel",74], * ["15-Jan","Mom","Food",235], * ["17-Jan","Dad","Sports",20], * ["21-Jan","Kelly","Books",125]]; * sourceSheet.setArray(0, 0, sourceData ); * sourceSheet.tables.add('sourceData', 0, 0, 5, 4); * var layout = GC.Spread.Pivot.PivotTableLayoutType.compact; * var theme = GC.Spread.Pivot.PivotTableThemes.medium2; * var options = {showRowHeader: true, showColumnHeader: true}; * var pivotTable = sheet.pivotTables.add("pivotTable_1", 'sourceData', 1, 1, layout, theme, options); * pivotTable.suspendLayout(); * pivotTable.options.showRowHeader = true; * pivotTable.options.showColumnHeader = true; * pivotTable.add("Buyer", "Buyer", GC.Spread.Pivot.PivotTableFieldType.columnField); * pivotTable.add("Type", "Type", GC.Spread.Pivot.PivotTableFieldType.rowField); * var condition = { conType: GC.Pivot.PivotConditionType.caption, operator: GC.Pivot.PivotCaptionFilterOperator.contains, val: ["Mom"] }; * var filterInfo = { condition }; * pivotTable.labelFilter("Buyer", filterInfo); * pivotTable.add("Amount", "Sum of Amount", GC.Spread.Pivot.PivotTableFieldType.valueField, GC.Pivot.SubtotalType.sum); * pivotTable.resumeLayout(); * ``` */ labelFilter(fieldName: string, filterInfo?: GC.Spread.Pivot.IPivotTextFilterInfo | GC.Spread.Pivot.IPivotConditionFilterInfo | null): GC.Spread.Pivot.IPivotTextFilterInfo | GC.Spread.Pivot.IPivotConditionFilterInfo | void; /** * @description Get or set the layoutType of pivot table * @param {GC.Spread.Pivot.PivotTableLayoutType} [type] Indicates the pivot Table layout Type * @returns {GC.Spread.Pivot.PivotTableLayoutType} If no parameters are passed in, get the current layout type. * @example * ```javascript * var spread = new GC.Spread.Sheets.Workbook(document.getElementById("ss"),{sheetCount:3}); * var sourceSheet = spread.getSheet(0); * var sheet = spread.getSheet(1); * var sourceData = [["Date","Buyer","Type","Amount"], * ["01-Jan","Mom","Fuel",74], * ["15-Jan","Mom","Food",235], * ["17-Jan","Dad","Sports",20], * ["21-Jan","Kelly","Books",125]]; * sourceSheet.setArray(0, 0, sourceData ); * sourceSheet.tables.add('sourceData', 0, 0, 5, 4); * var layout = GC.Spread.Pivot.PivotTableLayoutType.compact; * var theme = GC.Spread.Pivot.PivotTableThemes.medium2; * var options = {showRowHeader: true, showColumnHeader: true}; * var pivotTable = sheet.pivotTables.add("pivotTable_1", 'sourceData', 1, 1, layout, theme, options); * var pivotTableLayoutType = GC.Spread.Pivot.PivotTableLayoutType.compact; * pivotTable.layoutType(pivotTableLayoutType); * pivotTable.layoutType();//GC.Spread.Pivot.PivotTableLayoutType.compact * ``` */ layoutType(type?: GC.Spread.Pivot.PivotTableLayoutType): GC.Spread.Pivot.PivotTableLayoutType; /** * @description Get or set pivot table name. * @param {string} name Indicates the pivot table name. * @returns {string | void} * @example * ```javascript * var spread = new GC.Spread.Sheets.Workbook(document.getElementById("ss"),{sheetCount:3}); * var sourceSheet = spread.getSheet(0); * var sheet = spread.getSheet(1); * var sourceData = [["Date","Buyer","Type","Amount"], * ["01-Jan","Mom","Fuel",74], * ["15-Jan","Mom","Food",235], * ["17-Jan","Dad","Sports",20], * ["21-Jan","Kelly","Books",125]]; * sourceSheet.setArray(0, 0, sourceData ); * sourceSheet.tables.add('sourceData', 0, 0, 5, 4); * var layout = GC.Spread.Pivot.PivotTableLayoutType.compact; * var theme = GC.Spread.Pivot.PivotTableThemes.medium2; * var options = {showRowHeader: true, showColumnHeader: true}; * var pivotTable = sheet.pivotTables.add("pivotTable_1", 'sourceData', 1, 1, layout, theme, options); * pivotTable.name("pivotTable_2") * console.log(pivotTable.name()); //pivotTable_2 * ``` */ name(name?: string): string | void; /** * @description Get or set pivot table start position, the position of pivot table will auto change when there are enough cells to put the pivot table * @param {number} [row] Indicates pivot table start row. * @param {number} [col] Indicates pivot table start col. * @param {string} [sheetName] Which sheet is pivot table on. * @returns {GC.Spread.Pivot.IPivotTablePosition | void} * @example * ```javascript * var spread = new GC.Spread.Sheets.Workbook(document.getElementById("ss"),{sheetCount:3}); * var sourceSheet = spread.getSheet(0); * var sheet = spread.getSheet(1); * var toSheet = spread.getSheet(2); * var sourceData = [["Date","Buyer","Type","Amount"], * ["01-Jan","Mom","Fuel",74], * ["15-Jan","Mom","Food",235], * ["17-Jan","Dad","Sports",20], * ["21-Jan","Kelly","Books",125]]; * sourceSheet.setArray(0, 0, sourceData ); * sourceSheet.tables.add('sourceData', 0, 0, 5, 4); * var layout = GC.Spread.Pivot.PivotTableLayoutType.compact; * var theme = GC.Spread.Pivot.PivotTableThemes.medium2; * var options = {showRowHeader: true, showColumnHeader: true}; * var pivotTable = sheet.pivotTables.add("pivotTable_1", 'sourceData', 1, 1, layout, theme, options); * pivotTable.position(10,10,toSheet.name()); * pivotTable.position(); //{row:10,col:10, sheetName: "Sheet3"} * ``` */ position(row?: number, col?: number, sheetName?: string): GC.Spread.Pivot.IPivotTablePosition | void; /** * @description Refresh fields Layout, re calc all field data in sheet. */ refresh(): void; /** * @description Delete a field by name. * @param {string} fieldName Indicates the fieldName which will be removed. * @example * ```javascript * var spread = new GC.Spread.Sheets.Workbook(document.getElementById("ss"),{sheetCount:3}); * var sourceSheet = spread.getSheet(0); * var sheet = spread.getSheet(1); * var sourceData = [["Date","Buyer","Type","Amount"], * ["01-Jan","Mom","Fuel",74], * ["15-Jan","Mom","Food",235], * ["17-Jan","Dad","Sports",20], * ["21-Jan","Kelly","Books",125]]; * sourceSheet.setArray(0, 0, sourceData ); * sourceSheet.tables.add('sourceData', 0, 0, 5, 4); * var layout = GC.Spread.Pivot.PivotTableLayoutType.compact; * var theme = GC.Spread.Pivot.PivotTableThemes.medium2; * var options = {showRowHeader: true, showColumnHeader: true}; * var pivotTable = sheet.pivotTables.add("pivotTable_1", 'sourceData', 1, 1, layout, theme, options); * pivotTable.add("Buyer", "Buyer", 1, GC.Pivot.SubtotalType.count, 0); * pivotTable.remove("Buyer"); * ``` */ remove(fieldName: string):void; /** * @description remove a calculated field * @param {string} fieldName Indicates the calculated field name. * @example * ```javascript * var spread = new GC.Spread.Sheets.Workbook(document.getElementById("ss"),{sheetCount:3}); * var sourceSheet = spread.getSheet(0); * var sheet = spread.getSheet(1); * var sourceData = [["Date","Buyer","Type","Amount"], * ["01-Jan","Mom","Fuel",74], * ["15-Jan","Mom","Food",235], * ["17-Jan","Dad","Sports",20], * ["21-Jan","Kelly","Books",125]]; * sourceSheet.setArray(0, 0, sourceData ); * sourceSheet.tables.add('sourceData', 0, 0, 5, 4); * var layout = GC.Spread.Pivot.PivotTableLayoutType.compact; * var theme = GC.Spread.Pivot.PivotTableThemes.medium2; * var pivotTable = sheet.pivotTables.add("pivotTable1", 'sourceData', 1, 1, layout, theme); * pivotTable.addCalcField("PercentOfEach", "=Amount/454"); * var calcFieldsInfo = pivotTable.getCalcFields(); * pivotTable.removeCalcField(calcFieldsInfo[0].fieldName); * ``` */ removeCalcField(fieldName: string): void; /** * @description remove a calcItem * @param {string} sourceName The name of sourceField name * @param {string} calcItemName The name of sourceField calcItem name * @returns {void} * @example * ```javascript * var spread = new GC.Spread.Sheets.Workbook(document.getElementById("ss")); * var sourceSheet = spread.getSheet(0) * var sheet = spread.getSheet(1); * var sourceData = [["Date","Buyer","Type","Amount"], * ["01-Jan","Mom","Fuel",74], * ["15-Jan","Mom","Food",235], * ["17-Jan","Dad","Sports",20], * ["21-Jan","Kelly","Books",125]]; * sourceSheet.setArray(0, 0, sourceData); * sourceSheet.tables.add('sourceData', 0, 0, 5, 4); * var layout = GC.Spread.Pivot.PivotTableLayoutType.compact; * var theme = GC.Spread.Pivot.PivotTableThemes.medium2; * var options = {showRowHeader: true, showColumnHeader: true}; * sheet.pivotTables.add("pivotTable_1", 'sourceData', 1, 1, layout, theme, options); * var pivotTable = sheet.pivotTables.get("pivotTable_1"); * pivotTable.add("Buyer","Buyer",GC.Spread.Pivot.PivotTableFieldType.rowField); * pivotTable.add("Type","Type",GC.Spread.Pivot.PivotTableFieldType.columnField); * pivotTable.add("Amount","Sum of Amount",GC.Spread.Pivot.PivotTableFieldType.valueField, GC.Pivot.SubtotalType.sum); * pivotTable.addCalcItem("Buyer", "formula1", "=Buyer[Mom]+Buyer[Dad]"); * pivotTable.removeCalcItem("Buyer", "formula1"); * ``` */ removeCalcItem(sourceName: string, calcItemName: string): void; /** * Remove the rule of the pivot table. * @param {GC.Spread.Sheets.ConditionalFormatting.ConditionRuleBase} conditionalRule The rules set to the pivot table. * @example * ```javascript * //This example uses the getRule method. * var pivotTable = activeSheet.pivotTables.all()[0]; * var rule = new GC.Spread.Sheets.ConditionalFormatting.ScaleRule(); * rule.ruleType(GC.Spread.Sheets.ConditionalFormatting.RuleType.threeScaleRule); * rule.midColor("#12ff34"); * rule.midType(GC.Spread.Sheets.ConditionalFormatting.ScaleValueType.number); * rule.midValue(50000); * rule.maxColor("#EE3344"); * rule.maxType(GC.Spread.Sheets.ConditionalFormatting.ScaleValueType.number); * rule.maxValue(400000); * rule.minColor("#AAff34"); * rule.minType(GC.Spread.Sheets.ConditionalFormatting.ScaleValueType.number); * rule.minValue(5000); * var AmericaPivotArea = { * dataOnly: true * references: [{ * fieldName: "Country", * items: ["America"] * }] * } * var BritainPivotArea = { * dataOnly: true * references: [{ * fieldName: "Country", * items: ["Britain"] * }] * } * pivotTable.addConditionalRule([AmericaPivotArea, BritainPivotArea], rule); * pivotTable.removeConditionalRule(rule); * ``` */ removeConditionalRule(conditionalRule: GC.Spread.Sheets.ConditionalFormatting.ConditionRuleBase): void; /** * @description Stop hold off update field, end of suspendLayout effect, it must be in pairs with suspendLayout. */ resumeLayout(): void; /** * @description get serialized pivot table data * @returns {GC.Spread.Pivot.ISerializeInfo} serialized pivot table data */ serialize(): GC.Spread.Pivot.ISerializeInfo; /** * Set overwrite value to pivot cache. * @param {GC.Spread.Pivot.IPivotNodeInfo} nodeInfo The node info to be set. * @param {number} [value] the value set to the node info, if value is null or undefined, will remove the node info's value. */ setNodeValue(nodeInfo: GC.Spread.Pivot.IPivotNodeInfo, value?: number): void; /** * @description Set or remove style to the specific pivotArea. * @param {GC.Spread.Pivot.IPivotArea} pivotArea the specific pivotArea * @param {GC.Spread.Sheets.Style} style the style set to the specific pivotArea, null or undefined to remove style of the specific pivotArea. * @example * ```javascript * var spread = new GC.Spread.Sheets.Workbook(document.getElementById("ss")); * var sourceSheet = spread.getSheet(0) * var sheet = spread.getSheet(1); * var sourceData = [["Date","Buyer","Type","Amount"], * ["01-Jan","Mom","Fuel",74], * ["15-Jan","Mom","Food",235], * ["17-Jan","Dad","Sports",20], * ["21-Jan","Kelly","Books",125]]; * sourceSheet.setArray(0, 0, sourceData); * sourceSheet.tables.add('sourceData', 0, 0, 5, 4); * var layout = GC.Spread.Pivot.PivotTableLayoutType.compact; * var theme = GC.Spread.Pivot.PivotTableThemes.medium2; * var options = {showRowHeader: true, showColumnHeader: true}; * var pivotTable = sheet.pivotTables.add("pivotTable1", 'sourceData', 1, 1, layout, theme, options); * pivotTable.add("Buyer", "Buyer", GC.Spread.Pivot.PivotTableFieldType.rowField); * pivotTable.add("Type", "Type", GC.Spread.Pivot.PivotTableFieldType.rowField); * pivotTable.add("Date", "Date", GC.Spread.Pivot.PivotTableFieldType.columnField); * pivotTable.add("Amount", "Amount", GC.Spread.Pivot.PivotTableFieldType.valueField, GC.Pivot.SubtotalType.sum); * var pivotArea = { * dataOnly: false, * references: [ * { * fieldName: "Buyer", * items: ["Mom", "Dad"] * } * ] * }; * var style = new GC.Spread.Sheets.Style(); * redBack.backColor = '#ff0000'; * pivotTable.setStyle(pivotArea, style); * ``` */ setStyle(pivotArea: GC.Spread.Pivot.IPivotArea, style: GC.Spread.Sheets.Style): void; /** * @description get or set a value field's showDataAs info. * @param {string} fieldName the value field name the show value as will apply. * @param {object} [showDataAsInfo] the show data as info apply to value field * @param {number} showDataAsInfo.showDataAs the show data as type. * @param {string} [showDataAsInfo.baseFieldName] the base on field name * @param {GC.Pivot.PivotShowDataAsBaseItemType} [showDataAsInfo.baseFieldItemType] the base on field item type * @param {string} [showDataAsInfo.baseFieldItem] the base on item name * @returns {GC.Spread.Pivot.IPivotShowDataAsInfo} */ showDataAs(fieldName: string, showDataAsInfo?: GC.Spread.Pivot.IPivotShowDataAsInfo): GC.Spread.Pivot.IPivotShowDataAsInfo | void; /** * @description set or get field 'show items with no data' information * @param {string} fieldName The name of cache field name * @param {boolean} isShow The flag indicates whether items without data need to be displayed * @returns {boolean} * @example * ```javascript * var spread = new GC.Spread.Sheets.Workbook(document.getElementById("ss")); * var sourceSheet = spread.getSheet(0) * var sheet = spread.getSheet(1); * var sourceData = [["Date","Buyer","Type","Amount"], * ["01-Jan","Mom","Fuel",74], * ["15-Jan","Mom","Food",235], * ["17-Jan","Dad","Sports",20], * ["21-Jan","Kelly","Books",125]]; * sourceSheet.setArray(0, 0, sourceData); * sourceSheet.tables.add('sourceData', 0, 0, 5, 4); * var layout = GC.Spread.Pivot.PivotTableLayoutType.compact; * var theme = GC.Spread.Pivot.PivotTableThemes.medium2; * var options = {showRowHeader: true, showColumnHeader: true}; * sheet.pivotTables.add("pivotTable_1", 'sourceData', 1, 1, layout, theme, options); * var pivotTable = sheet.pivotTables.get("pivotTable_1"); * pivotTable.add("Date","Date",GC.Spread.Pivot.PivotTableFieldType.rowField); * pivotTable.add("Buyer","Buyer",GC.Spread.Pivot.PivotTableFieldType.rowField); * pivotTable.add("Type","Type",GC.Spread.Pivot.PivotTableFieldType.columnField); * pivotTable.add("Amount","Sum of Amount",GC.Spread.Pivot.PivotTableFieldType.valueField, GC.Pivot.SubtotalType.sum); * pivotTable.showNoData("Buyer", true); * ``` */ showNoData(cacheFieldName: string, isShow: boolean): boolean; /** * @description get or set sort for a field of pivot table. * @param {string} fieldName Indicates the target field name. * @param {GC.Pivot.IPivotViewSortInfo} sortInfo Indicates the sort info. * @returns {GC.Pivot.IPivotViewSortInfo | void} * @example * ```javascript * var spread = new GC.Spread.Sheets.workbook(document.getElementById("ss")); * var sourceData = [["Date","Buyer","Type","Amount"], * ["01-Jan","Mom","Fuel",74], * ["15-Jan","Mom","Food",235], * ["17-Jan","Dad","Sports",20], * ["21-Jan","Kelly","Books",125]]; * var layout = GC.Spread.Pivot.PivotTableLayoutType.compact; * var theme = GC.Spread.Pivot.PivotTableThemes.medium2; * var options = {showRowHeader: true, showColumnHeader: true}; * var pivotTable = spread.getSheet(0).pivotTables.add("pivotTable_1",sourceData,1,1,layout,theme,option); * pivotTable.add("Buyer","Buyer",GC.Spread.Pivot.PivotTableFieldType.rowField); * pivotTable.add("Type","Type",GC.Spread.Pivot.PivotTableFieldType.columnField); * pivotTable.add("Type", { sortType: GC.Pivot.SortType.asc, sortValueFieldName: "Sum of Amount"}); * pivotTable.sort("Buyer", { sortType: GC.Pivot.SortType.asc }); * pivotTable.sort("Buyer", { customSortCallback: function(fieldItemNameArray) { * return fieldItemNameArray.sort((a, b) => a.length - b.length); * } * }); * ``` */ sort(fieldName: string, sortInfo: GC.Pivot.IPivotViewSortInfo): GC.Pivot.IPivotViewSortInfo | void; /** * @description set or get field show subtotal position information. * @param {string} fieldName Indicates the field name. * @param {GC.Spread.Pivot.SubtotalsPosition} position The indicates set whether subtotal position, only top and bottom is supported. * @returns {GC.Spread.Pivot.SubtotalsPosition} * @example * ```javascript * var spread = new GC.Spread.Sheets.Workbook(document.getElementById("ss")); * var sourceSheet = spread.getSheet(0) * var sheet = spread.getSheet(1); * var sourceData = [["Date","Buyer","Type","Amount"], * ["01-Jan","Mom","Fuel",74], * ["15-Jan","Mom","Food",235], * ["17-Jan","Dad","Sports",20], * ["21-Jan","Kelly","Books",125]]; * sourceSheet.setArray(0, 0, sourceData); * sourceSheet.tables.add('sourceData', 0, 0, 5, 4); * var layout = GC.Spread.Pivot.PivotTableLayoutType.compact; * var theme = GC.Spread.Pivot.PivotTableThemes.medium2; * var options = {showRowHeader: true, showColumnHeader: true}; * sheet.pivotTables.add("pivotTable_1", 'sourceData', 1, 1, layout, theme, options); * var pivotTable = sheet.pivotTables.get("pivotTable_1"); * pivotTable.add("Date","Date",GC.Spread.Pivot.PivotTableFieldType.rowField); * pivotTable.add("Buyer","Buyer",GC.Spread.Pivot.PivotTableFieldType.rowField); * pivotTable.add("Type","Type",GC.Spread.Pivot.PivotTableFieldType.columnField); * pivotTable.add("Amount","Sum of Amount",GC.Spread.Pivot.PivotTableFieldType.valueField, GC.Pivot.SubtotalType.sum); * pivotTable.subtotalPosition("Buyer", GC.Spread.Pivot.SubtotalsPosition.top); * ``` */ subtotalPosition(fieldName: string, position: GC.Spread.Pivot.SubtotalsPosition): GC.Spread.Pivot.SubtotalsPosition | void; /** * Get or set SubtotalType for a field. * @param {string} fieldName Indicates the target field name of pivot table. * @param {GC.Pivot.SubtotalType} type Indicates the subtotal type to set. * @returns {GC.Pivot.SubtotalType | void} * @example * ```javascript * var spread = new GC.Spread.Sheets.Workbook(document.getElementById("ss"),{sheetCount:3}); * var sourceSheet = spread.getSheet(0); * var sheet = spread.getSheet(1); * var sourceData = [["Date","Buyer","Type","Amount"], * ["01-Jan","Mom","Fuel",74], * ["15-Jan","Mom","Food",235], * ["17-Jan","Dad","Sports",20], * ["21-Jan","Kelly","Books",125]]; * sourceSheet.setArray(0, 0, sourceData); * sourceSheet.tables.add('sourceData', 0, 0, 5, 4); * var layout = GC.Spread.Pivot.PivotTableLayoutType.compact; * var theme = GC.Spread.Pivot.PivotTableThemes.medium2; * var options = {showRowHeader: true, showColumnHeader: true}; * var pivotTable = sheet.pivotTables.add("pivotTable_1", 'sourceData', 1, 1, layout, theme, options); * pivotTable.add("Buyer","Buyer",GC.Spread.Pivot.PivotTableFieldType.rowField); * pivotTable.add("Type","Type",GC.Spread.Pivot.PivotTableFieldType.columnField); * pivotTable.add("Amount","Sum of Amount",GC.Spread.Pivot.PivotTableFieldType.valueField, GC.Pivot.SubtotalType.sum); * var subtotalType = GC.Pivot.SubtotalType.average; * pivotTable.subtotalType("Buyer", subtotalType) //set a subtotalType for a Field of name is "fieldName" * ``` */ subtotalType(fieldName: string, type?:GC.Pivot.SubtotalType): GC.Pivot.SubtotalType | void; /** * @description set or get whether the field displays subtotal information. * @param {string} fieldName Indicates the field name. * @param {boolean} position Indicates whether to display subtotal information for the field. * @returns {boolean} * @example * ```javascript * var spread = new GC.Spread.Sheets.Workbook(document.getElementById("ss")); * var sourceSheet = spread.getSheet(0) * var sheet = spread.getSheet(1); * var sourceData = [["Date","Buyer","Type","Amount"], * ["01-Jan","Mom","Fuel",74], * ["15-Jan","Mom","Food",235], * ["17-Jan","Dad","Sports",20], * ["21-Jan","Kelly","Books",125]]; * sourceSheet.setArray(0, 0, sourceData); * sourceSheet.tables.add('sourceData', 0, 0, 5, 4); * var layout = GC.Spread.Pivot.PivotTableLayoutType.compact; * var theme = GC.Spread.Pivot.PivotTableThemes.medium2; * var options = {showRowHeader: true, showColumnHeader: true}; * sheet.pivotTables.add("pivotTable_1", 'sourceData', 1, 1, layout, theme, options); * var pivotTable = sheet.pivotTables.get("pivotTable_1"); * pivotTable.add("Date","Date",GC.Spread.Pivot.PivotTableFieldType.rowField); * pivotTable.add("Buyer","Buyer",GC.Spread.Pivot.PivotTableFieldType.rowField); * pivotTable.add("Type","Type",GC.Spread.Pivot.PivotTableFieldType.columnField); * pivotTable.add("Amount","Sum of Amount",GC.Spread.Pivot.PivotTableFieldType.valueField, GC.Pivot.SubtotalType.sum); * pivotTable.subtotalVisible("Buyer", false); * ``` */ subtotalVisible(fieldName: string, isVisible: boolean): boolean; /** * @description Stop update field util resumeFieldsLayout, it must be used in pairs with resumeFieldsLayout. */ suspendLayout(): void; /** * Get or set pivot table theme * @param {string | GC.Spread.Pivot.PivotTableTheme} [theme] Indicates the pivot table internal theme name or pivot table theme instance. * @returns {void | GC.Spread.Pivot.PivotTableTheme} If no parameters are passed in, get the current theme * @example * ```javascript * var spread = new GC.Spread.Sheets.Workbook(document.getElementById("ss"),{sheetCount:3}); * var sourceSheet = spread.getSheet(0); * var sheet = spread.getSheet(1); * var sourceData = [["Date","Buyer","Type","Amount"], * ["01-Jan","Mom","Fuel",74], * ["15-Jan","Mom","Food",235], * ["17-Jan","Dad","Sports",20], * ["21-Jan","Kelly","Books",125]]; * sourceSheet.setArray(0, 0, sourceData ); * sourceSheet.tables.add('sourceData', 0, 0, 5, 4); * var layout = GC.Spread.Pivot.PivotTableLayoutType.compact; * var theme = GC.Spread.Pivot.PivotTableThemes.medium2; * var options = {showRowHeader: true, showColumnHeader: true}; * var pivotTable = sheet.pivotTables.add("pivotTable_1", 'sourceData', 1, 1, layout, theme, options); * pivotTable.theme("light3"); * ``` */ theme(theme?: string | GC.Spread.Pivot.PivotTableTheme): void | GC.Spread.Pivot.PivotTableTheme; /** * @description Ungroup the field by field name. * @param {string} fieldName Indicates the ungroup field name. * @example * ```javascript * var spread = new GC.Spread.Sheets.Workbook(document.getElementById("ss"), { sheetCount: 3 }); * var sheet = spread.getActiveSheet(); * sheet.suspendPaint(); * var sourceDataArray = [["Date", "Buyer", "Type", "Amount"], * ["01-Jan", "Mom", "Fuel", 74], * ["15-Jan", "Mom", "Food", 235], * ["17-Jan", "Dad", "Sports", 20], * ["19-Jan", "David", "Books", 120], * ["20-Jan", "Dad", "Food", 160], * ["21-Jan", "David", "Sports", 15], * ["21-Jan", "Kelly", "Books", 125]]; * sheet.setArray(3, 0, sourceDataArray); * sheet.tables.add('Table1', 3, 0, 8, 4); * sheet.setColumnWidth(6, 130); * sheet.setColumnWidth(8, 100); * var layout = GC.Spread.Pivot.PivotTableLayoutType.compact; * var theme = GC.Spread.Pivot.PivotTableThemes.medium2; * var options = {showRowHeader: true, showColumnHeader: true}; * var pivotTable = sheet.pivotTables.add("PivotTable1", 'Table1', 3, 6, layout, theme, option); * var groupInfo = { * originFieldName: "Buyer", * textGroup: { * "parent": ["Mom", "Dad"], * "children": ["David", "Kelly"] * } * }; * pivotTable.group("FamilyMembers", groupInfo); * pivotTable.add("FamilyMembers", "FamilyMembers", GC.Spread.Pivot.PivotTableFieldType.rowField); * pivotTable.add("Buyer", "Buyer", GC.Spread.Pivot.PivotTableFieldType.rowField); * pivotTable.add("Amount", "Sum of Amount", GC.Spread.Pivot.PivotTableFieldType.valueField, GC.Pivot.SubtotalType.sum); * sheet.resumePaint(); * * pivotTable.ungroup("FamilyMembers"); * ``` */ ungroup(fieldName: string): void; /** * @description update calcItem Information * @param {string} sourceName The name of sourceField name * @param {string} calcItemName The name of sourceField calcItem name * @param {string} formula The new formula for this calcItem * @param {number} priority The new priority for this calcItem * @returns {void} * @example * ```javascript * var spread = new GC.Spread.Sheets.Workbook(document.getElementById("ss")); * var sourceSheet = spread.getSheet(0) * var sheet = spread.getSheet(1); * var sourceData = [["Date","Buyer","Type","Amount"], * ["01-Jan","Mom","Fuel",74], * ["15-Jan","Mom","Food",235], * ["17-Jan","Dad","Sports",20], * ["21-Jan","Kelly","Books",125]]; * sourceSheet.setArray(0, 0, sourceData); * sourceSheet.tables.add('sourceData', 0, 0, 5, 4); * var layout = GC.Spread.Pivot.PivotTableLayoutType.compact; * var theme = GC.Spread.Pivot.PivotTableThemes.medium2; * var options = {showRowHeader: true, showColumnHeader: true}; * sheet.pivotTables.add("pivotTable_1", 'sourceData', 1, 1, layout, theme, options); * var pivotTable = sheet.pivotTables.get("pivotTable_1"); * pivotTable.add("Buyer","Buyer",GC.Spread.Pivot.PivotTableFieldType.rowField); * pivotTable.add("Type","Type",GC.Spread.Pivot.PivotTableFieldType.columnField); * pivotTable.add("Amount","Sum of Amount",GC.Spread.Pivot.PivotTableFieldType.valueField, GC.Pivot.SubtotalType.sum); * pivotTable.addCalcItem("Buyer", "formula1", "=Buyer[Mom]+Buyer[Dad]"); * pivotTable.updateCalcItem("Buyer", "formula1", "=Buyer[Mom]+Buyer[Kelly]", 1); * ``` */ updateCalcItem(sourceName: string, calcItemName: string, formula: string, priority: number): void; /** * @description Update the field area and index * @param {string} name Indicates the field name. * @param {GC.Spread.Pivot.PivotTableFieldType} area Indicates which area the field to be put. * @param {number} [index] Indicates which index will be set. * @example * ```javascript * var spread = new GC.Spread.Sheets.Workbook(document.getElementById("ss"),{sheetCount:3}); * var sourceSheet = spread.getSheet(0); * var sheet = spread.getSheet(1); * var sourceData = [["Date","Buyer","Type","Amount"], * ["01-Jan","Mom","Fuel",74], * ["15-Jan","Mom","Food",235], * ["17-Jan","Dad","Sports",20], * ["21-Jan","Kelly","Books",125]]; * sourceSheet.setArray(0, 0, sourceData ); * sourceSheet.tables.add('sourceData', 0, 0, 5, 4); * var layout = GC.Spread.Pivot.PivotTableLayoutType.compact; * var theme = GC.Spread.Pivot.PivotTableThemes.medium2; * var options = {showRowHeader: true, showColumnHeader: true}; * var pivotTable = sheet.pivotTables.add("pivotTable_1", 'sourceData', 1, 1, layout, theme, options); * pivotTable.add("Buyer","Buyer",GC.Spread.Pivot.PivotTableFieldType.rowField); * pivotTable.add("Type","Type",GC.Spread.Pivot.PivotTableFieldType.columnField); * pivotTable.add("Amount","Sum of Amount",GC.Spread.Pivot.PivotTableFieldType.valueField, GC.Pivot.SubtotalType.sum); * pivotTable.updateField("Buyer", GC.Spread.Pivot.PivotTableFieldType.columnField, 0) //The Field of name is "Buyer" move to column area and Field index is 2 * ``` */ updateField(name: string, area: GC.Spread.Pivot.PivotTableFieldType, index?: number): void; /** * @description Update the exist field Name. * @param {string} oldName Indicates the old display name of field in pivot table. * @param {string} newName Indicates the new display name of field in pivot table. * @returns {void} * @example * ```javascript * var spread = new GC.Spread.Sheets.Workbook(document.getElementById("ss"),{sheetCount:3}); * var sourceSheet = spread.getSheet(0); * var sheet = spread.getSheet(1); * var sourceData = [["Date","Buyer","Type","Amount"], * ["01-Jan","Mom","Fuel",74], * ["15-Jan","Mom","Food",235], * ["17-Jan","Dad","Sports",20], * ["21-Jan","Kelly","Books",125]]; * sourceSheet.setArray(0, 0, sourceData ); * sourceSheet.tables.add('sourceData', 0, 0, 5, 4); * var layout = GC.Spread.Pivot.PivotTableLayoutType.compact; * var theme = GC.Spread.Pivot.PivotTableThemes.medium2; * var options = {showRowHeader: true, showColumnHeader: true}; * var pivotTable = sheet.pivotTables.add("pivotTable_1", 'sourceData', 1, 1, layout, theme, options); * pivotTable.add("Buyer","Buyer",GC.Spread.Pivot.PivotTableFieldType.rowField); * pivotTable.updateFieldName("Buyer", "newBuyer") * ``` */ updateFieldName(oldName: string, newName: string): void; /** * @description refresh pivotTable data source * @returns {void} * @example * ```javascript * var spread = new GC.Spread.Sheets.Workbook(document.getElementById("ss")); * var sourceSheet = spread.getSheet(0) * var sheet = spread.getSheet(1); * var sourceData = [["Date","Buyer","Type","Amount"], * ["01-Jan","Mom","Fuel",74], * ["15-Jan","Mom","Food",235], * ["17-Jan","Dad","Sports",20], * ["21-Jan","Kelly","Books",125]]; * sourceSheet.setArray(0, 0, sourceData); * sourceSheet.tables.add('sourceData', 0, 0, 5, 4); * var layout = GC.Spread.Pivot.PivotTableLayoutType.compact; * var theme = GC.Spread.Pivot.PivotTableThemes.medium2; * var options = {showRowHeader: true, showColumnHeader: true}; * sheet.pivotTables.add("pivotTable_1", 'sourceData', 1, 1, layout, theme, options); * var pivotTable = sheet.pivotTables.get("pivotTable_1"); * pivotTable.add("Buyer","Buyer",GC.Spread.Pivot.PivotTableFieldType.rowField); * pivotTable.add("Type","Type",GC.Spread.Pivot.PivotTableFieldType.columnField); * pivotTable.add("Amount","Sum of Amount",GC.Spread.Pivot.PivotTableFieldType.valueField, GC.Pivot.SubtotalType.sum); * sourceSheet.setValue(1,3,1000); * pivotTable.updateSource(); * var newSourceData = [["Salesman","ProductType","Product","Sales"], * ["SunLin","Drinks","Apple Juice",74], * ["JinShiPeng","Drinks","Milk",235], * ["ZhangShang","Dessert","Chocolate",20], * ["SunYang","Dessert","Beef Jerky",125]]; * sourceSheet.setArray(10, 0, newSourceData); * sourceSheet.tables.add('newSourceData', 10, 0, 5, 4); * pivotTable.updateSource('newSourceData'); * ``` */ updateSource(source?: string): void; /** * Get or set value filter info for a field. * @param {string} fieldName Indicates the target field name of pivot table. * @param {GC.Spread.Pivot.IPivotConditionFilterInfo | void} [filterInfo] Indicates the value filter info when set. * @returns {GC.Spread.Pivot.IPivotConditionFilterInfo} return the pivot table value information. * @example * ```javascript * var spread = new GC.Spread.Sheets.Workbook(document.getElementById("ss"),{sheetCount:3}); * var sourceSheet = spread.getSheet(0); * var sheet = spread.getSheet(1); * var sourceData = [["Date","Buyer","Type","Amount"], * ["01-Jan","Mom","Fuel",74], * ["15-Jan","Mom","Food",235], * ["17-Jan","Dad","Sports",20], * ["21-Jan","Kelly","Books",125]]; * sourceSheet.setArray(0, 0, sourceData ); * sourceSheet.tables.add('sourceData', 0, 0, 5, 4); * var layout = GC.Spread.Pivot.PivotTableLayoutType.compact; * var theme = GC.Spread.Pivot.PivotTableThemes.medium2; * var options = {showRowHeader: true, showColumnHeader: true}; * var pivotTable = sheet.pivotTables.add("pivotTable_1", 'sourceData', 1, 1, layout, theme, options); * pivotTable.suspendLayout(); * pivotTable.options.showRowHeader = true; * pivotTable.options.showColumnHeader = true; * pivotTable.add("Buyer", "Buyer", GC.Spread.Pivot.PivotTableFieldType.columnField); * pivotTable.add("Type", "Type", GC.Spread.Pivot.PivotTableFieldType.rowField); * pivotTable.add("Amount", "Sum of Amount", GC.Spread.Pivot.PivotTableFieldType.valueField, GC.Pivot.SubtotalType.sum); * let condition = { conType: GC.Pivot.PivotConditionType.value, operator: GC.Pivot.PivotValueFilterOperator.between, val: [0, 100] }; * let filterInfo = { condition: condition, conditionByName: "Sum of Amount" }; * pivotTable.valueFilter("Buyer", filterInfo); * pivotTable.resumeLayout(); * ``` */ valueFilter(fieldName: string, filterInfo?: GC.Spread.Pivot.IPivotConditionFilterInfo | null): GC.Spread.Pivot.IPivotConditionFilterInfo | void; } export class PivotTableItemSlicer{ /** * Represents a pivot slicer. * @class GC.Spread.Pivot.PivotTableItemSlicer */ constructor(); /** * Gets or sets the allowMove of the slicer. * @param {boolean} [value] The allowMove of the slicer. The allowMove property of a slicer specifies whether users are permitted to move the slicer, enabling or disabling the repositioning functionality. * @returns {boolean | GC.Spread.Sheets.Slicers.IItemSlicer} If no value is set, returns the allowMove of the slicer; otherwise, returns the slicer. * @example * ```javascript * var spread = new GC.Spread.Sheets.Workbook('ss'); * var activeSheet = spread.getActiveSheet(); * var dataSource = [ * { Name: "Bob", City: "NewYork", Birthday: "1968/6/8" }, * { Name: "Betty", City: "NewYork", Birthday: "1972/7/3" }, * { Name: "Alice", City: "Washington", Birthday: "2012/2/15" }, * ]; * var table = activeSheet.tables.addFromDataSource("table1", 1, 1, dataSource); * var pivotTable = activeSheet.pivotTables.add("pivotTable1", "table1", 6, 1); * var slicer = activeSheet.slicers.add("slicer", "pivotTable1", "Name", GC.Spread.Sheets.Slicers.SlicerStyles.dark1(), GC.Spread.Sheets.Slicers.SlicerType.pivotTable); * var oldValue = slicer.allowMove(); * console.log(oldValue); * slicer.allowMove(false); * var newValue = slicer.allowMove(); * console.log(newValue); * ``` */ allowMove(value?: boolean): any; /** * Gets or sets the allowResize of the slicer. * @param {boolean} [value] The allowResize of the slicer. The allowResize property of a slicer specifies whether users are permitted to adjust the size of the slicer, enabling or disabling the resizing functionality. * @returns {boolean | GC.Spread.Sheets.Slicers.IItemSlicer} If no value is set, returns the allowResize of the slicer; otherwise, returns the slicer. * @example * ```javascript * var spread = new GC.Spread.Sheets.Workbook('ss'); * var activeSheet = spread.getActiveSheet(); * var dataSource = [ * { Name: "Bob", City: "NewYork", Birthday: "1968/6/8" }, * { Name: "Betty", City: "NewYork", Birthday: "1972/7/3" }, * { Name: "Alice", City: "Washington", Birthday: "2012/2/15" }, * ]; * var table = activeSheet.tables.addFromDataSource("table1", 1, 1, dataSource); * var pivotTable = activeSheet.pivotTables.add("pivotTable1", "table1", 6, 1); * var slicer = activeSheet.slicers.add("slicer", "pivotTable1", "Name", GC.Spread.Sheets.Slicers.SlicerStyles.dark1(), GC.Spread.Sheets.Slicers.SlicerType.pivotTable); * var oldValue = slicer.allowResize(); * console.log(oldValue); * slicer.allowResize(false); * var newValue = slicer.allowResize(); * console.log(newValue); * ``` */ allowResize(value?: boolean): any; /** * Gets or sets the captionName of the slicer. * @param {string} [value] The captionName of the slicer. captionName property is displayed in the header of the slicer. * @returns {string | GC.Spread.Sheets.Slicers.IItemSlicer} If no value is set, returns the captionName of the slicer; otherwise, returns the slicer. * @example * ```javascript * var spread = new GC.Spread.Sheets.Workbook('ss'); * var activeSheet = spread.getActiveSheet(); * var dataSource = [ * { Name: "Bob", City: "NewYork", Birthday: "1968/6/8" }, * { Name: "Betty", City: "NewYork", Birthday: "1972/7/3" }, * { Name: "Alice", City: "Washington", Birthday: "2012/2/15" }, * ]; * var table = activeSheet.tables.addFromDataSource("table1", 1, 1, dataSource); * var pivotTable = activeSheet.pivotTables.add("pivotTable1", "table1", 6, 1); * var slicer = activeSheet.slicers.add("slicer", "pivotTable1", "Name", GC.Spread.Sheets.Slicers.SlicerStyles.dark1(), GC.Spread.Sheets.Slicers.SlicerType.pivotTable); * var oldValue = slicer.captionName(); * console.log(oldValue); * slicer.captionName('Slicer_Caption'); * var newValue = slicer.captionName(); * console.log(newValue); * ``` */ captionName(value?: string): any; /** * Gets or sets the columnCount of the slicer. * @param {number} [value] The columnCount of the slicer. * @returns {number | GC.Spread.Sheets.Slicers.IItemSlicer} If no value is set, returns the columnCount of the slicer; otherwise, returns the slicer. * @example * ```javascript * var spread = new GC.Spread.Sheets.Workbook('ss'); * var activeSheet = spread.getActiveSheet(); * var dataSource = [ * { Name: "Bob", City: "NewYork", Birthday: "1968/6/8" }, * { Name: "Betty", City: "NewYork", Birthday: "1972/7/3" }, * { Name: "Alice", City: "Washington", Birthday: "2012/2/15" }, * ]; * var table = activeSheet.tables.addFromDataSource("table1", 1, 1, dataSource); * var pivotTable = activeSheet.pivotTables.add("pivotTable1", "table1", 6, 1); * var slicer = activeSheet.slicers.add("slicer", "pivotTable1", "Name", GC.Spread.Sheets.Slicers.SlicerStyles.dark1(), GC.Spread.Sheets.Slicers.SlicerType.pivotTable); * var oldValue = slicer.columnCount(); * console.log(oldValue); * slicer.columnCount(3); * var newValue = slicer.columnCount(); * console.log(newValue); * ``` */ columnCount(value?: number): any; /** * Connect pivot table with the slicer * @param {string} ptName name of pivot table * @example * ```javascript * var spread = new GC.Spread.Sheets.Workbook('ss'); * var activeSheet = spread.getActiveSheet(); * var dataSource = [ * { Name: "Bob", City: "NewYork", Birthday: "1968/6/8" }, * { Name: "Betty", City: "NewYork", Birthday: "1972/7/3" }, * { Name: "Alice", City: "Washington", Birthday: "2012/2/15" }, * ]; * var table = activeSheet.tables.addFromDataSource("table1", 1, 1, dataSource); * var pivotTable = activeSheet.pivotTables.add("pivotTable1", "table1", 6, 1); * var slicer = activeSheet.slicers.add("slicer", "pivotTable1", "Name", GC.Spread.Sheets.Slicers.SlicerStyles.dark1(), GC.Spread.Sheets.Slicers.SlicerType.pivotTable); * * slicer.connectPivotTable('pivotTable1'); * slicer.isConnectedPivotTable('pivotTable1'); * slicer.disconnectPivotTable('pivotTable1'); * slicer.isConnectedPivotTable('pivotTable1'); * ``` */ connectPivotTable(ptName: string): void; /** * Gets or sets the disableResizingAndMoving of the slicer. * @param {boolean} [value] The disableResizingAndMoving of the slicer. The disableResizingAndMoving property of a slicer specifies whether the user is allowed to resize or move the slicer control, restricting any changes to its size or position. * @returns {boolean | GC.Spread.Sheets.Slicers.IItemSlicer} If no value is set, returns the disableResizingAndMoving of the slicer; otherwise, returns the slicer. * @example * ```javascript * var spread = new GC.Spread.Sheets.Workbook('ss'); * var activeSheet = spread.getActiveSheet(); * var dataSource = [ * { Name: "Bob", City: "NewYork", Birthday: "1968/6/8" }, * { Name: "Betty", City: "NewYork", Birthday: "1972/7/3" }, * { Name: "Alice", City: "Washington", Birthday: "2012/2/15" }, * ]; * var table = activeSheet.tables.addFromDataSource("table1", 1, 1, dataSource); * var pivotTable = activeSheet.pivotTables.add("pivotTable1", "table1", 6, 1); * var slicer = activeSheet.slicers.add("slicer", "pivotTable1", "Name", GC.Spread.Sheets.Slicers.SlicerStyles.dark1(), GC.Spread.Sheets.Slicers.SlicerType.pivotTable); * var oldValue = slicer.disableResizingAndMoving(); * console.log(oldValue); * slicer.disableResizingAndMoving(true); * var newValue = slicer.disableResizingAndMoving(); * console.log(newValue); * ``` */ disableResizingAndMoving(value?: boolean): any; /** * Disconnect pivot table with the slicer * @param {string} ptName name of pivot table * @example * ```javascript * var spread = new GC.Spread.Sheets.Workbook('ss'); * var activeSheet = spread.getActiveSheet(); * var dataSource = [ * { Name: "Bob", City: "NewYork", Birthday: "1968/6/8" }, * { Name: "Betty", City: "NewYork", Birthday: "1972/7/3" }, * { Name: "Alice", City: "Washington", Birthday: "2012/2/15" }, * ]; * var table = activeSheet.tables.addFromDataSource("table1", 1, 1, dataSource); * var pivotTable = activeSheet.pivotTables.add("pivotTable1", "table1", 6, 1); * var slicer = activeSheet.slicers.add("slicer", "pivotTable1", "Name", GC.Spread.Sheets.Slicers.SlicerStyles.dark1(), GC.Spread.Sheets.Slicers.SlicerType.pivotTable); * * slicer.connectPivotTable('pivotTable1'); * slicer.isConnectedPivotTable('pivotTable1'); * slicer.disconnectPivotTable('pivotTable1'); * slicer.isConnectedPivotTable('pivotTable1'); * ``` */ disconnectPivotTable(ptName: string): void; /** * Gets or sets the dynamicMove of the slicer. * @param {boolean} [value] The dynamicMove of the slicer. The dynamicMove property of a slicer specifies whether the slicer is configured to dynamically adjust its position or size based on changes in the associated data or PivotTable layout. * @returns {boolean | GC.Spread.Sheets.Slicers.IItemSlicer} If no value is set, returns the dynamicMove of the slicer; otherwise, returns the slicer. * @example * ```javascript * var spread = new GC.Spread.Sheets.Workbook('ss'); * var activeSheet = spread.getActiveSheet(); * var dataSource = [ * { Name: "Bob", City: "NewYork", Birthday: "1968/6/8" }, * { Name: "Betty", City: "NewYork", Birthday: "1972/7/3" }, * { Name: "Alice", City: "Washington", Birthday: "2012/2/15" }, * ]; * var table = activeSheet.tables.addFromDataSource("table1", 1, 1, dataSource); * var pivotTable = activeSheet.pivotTables.add("pivotTable1", "table1", 6, 1); * var slicer = activeSheet.slicers.add("slicer", "pivotTable1", "Name", GC.Spread.Sheets.Slicers.SlicerStyles.dark1(), GC.Spread.Sheets.Slicers.SlicerType.pivotTable); * var oldValue = slicer.dynamicMove(); * console.log(oldValue); * slicer.dynamicMove(false); * var newValue = slicer.dynamicMove(); * console.log(newValue); * ``` */ dynamicMove(value?: boolean): any; /** * Gets or sets the dynamicSize of the slicer. * @param {boolean} [value] The dynamicSize of the slicer. The dynamicSize property of a slicer specifies whether the slicer is configured to dynamically adjust its size based on changes in the associated data or PivotTable layout. * @returns {boolean | GC.Spread.Sheets.Slicers.IItemSlicer} If no value is set, returns the dynamicSize of the slicer; otherwise, returns the slicer. * @example * ```javascript * var spread = new GC.Spread.Sheets.Workbook('ss'); * var activeSheet = spread.getActiveSheet(); * var dataSource = [ * { Name: "Bob", City: "NewYork", Birthday: "1968/6/8" }, * { Name: "Betty", City: "NewYork", Birthday: "1972/7/3" }, * { Name: "Alice", City: "Washington", Birthday: "2012/2/15" }, * ]; * var table = activeSheet.tables.addFromDataSource("table1", 1, 1, dataSource); * var pivotTable = activeSheet.pivotTables.add("pivotTable1", "table1", 6, 1); * var slicer = activeSheet.slicers.add("slicer", "pivotTable1", "Name", GC.Spread.Sheets.Slicers.SlicerStyles.dark1(), GC.Spread.Sheets.Slicers.SlicerType.pivotTable); * var oldValue = slicer.dynamicSize(); * console.log(oldValue); * slicer.dynamicSize(false); * var newValue = slicer.dynamicSize(); * console.log(newValue); * ``` */ dynamicSize(value?: boolean): any; /** * Gets or sets the endColumn of the slicer. * @param {number} [value] The endColumn of the slicer. The endColumn property of a slicer specifies the ending column index or position within the worksheet where the slicer concludes or is bounded. * @returns {number | GC.Spread.Sheets.Slicers.IItemSlicer} If no value is set, returns the endColumn of the slicer; otherwise, returns the slicer. * @example * ```javascript * var spread = new GC.Spread.Sheets.Workbook('ss'); * var activeSheet = spread.getActiveSheet(); * var dataSource = [ * { Name: "Bob", City: "NewYork", Birthday: "1968/6/8" }, * { Name: "Betty", City: "NewYork", Birthday: "1972/7/3" }, * { Name: "Alice", City: "Washington", Birthday: "2012/2/15" }, * ]; * var table = activeSheet.tables.addFromDataSource("table1", 1, 1, dataSource); * var pivotTable = activeSheet.pivotTables.add("pivotTable1", "table1", 6, 1); * var slicer = activeSheet.slicers.add("slicer", "pivotTable1", "Name", GC.Spread.Sheets.Slicers.SlicerStyles.dark1(), GC.Spread.Sheets.Slicers.SlicerType.pivotTable); * var oldValue = slicer.endColumn(); * console.log(oldValue); * slicer.endColumn(20); * var newValue = slicer.endColumn(); * console.log(newValue); * ``` */ endColumn(value?: number): any; /** * Gets or sets the endColumnOffset of the slicer. * @param {number} [value] The endColumnOffset of the slicer. The endColumnOffset property of a slicer specifies the horizontal offset or distance from the ending column index where the slicer concludes its placement within the worksheet. * @returns {number | GC.Spread.Sheets.Slicers.IItemSlicer} If no value is set, returns the endColumnOffset of the slicer; otherwise, returns the slicer. * @example * ```javascript * var spread = new GC.Spread.Sheets.Workbook('ss'); * var activeSheet = spread.getActiveSheet(); * var dataSource = [ * { Name: "Bob", City: "NewYork", Birthday: "1968/6/8" }, * { Name: "Betty", City: "NewYork", Birthday: "1972/7/3" }, * { Name: "Alice", City: "Washington", Birthday: "2012/2/15" }, * ]; * var table = activeSheet.tables.addFromDataSource("table1", 1, 1, dataSource); * var pivotTable = activeSheet.pivotTables.add("pivotTable1", "table1", 6, 1); * var slicer = activeSheet.slicers.add("slicer", "pivotTable1", "Name", GC.Spread.Sheets.Slicers.SlicerStyles.dark1(), GC.Spread.Sheets.Slicers.SlicerType.pivotTable); * var oldValue = slicer.endColumnOffset(); * console.log(oldValue); * slicer.endColumnOffset(5); * var newValue = slicer.endColumnOffset(); * console.log(newValue); * ``` */ endColumnOffset(value?: number): any; /** * Gets or sets the endRow of the slicer. * @param {number} [value] The endRow of the slicer. The endRow property of a slicer specifies the ending row index or position within the worksheet where the slicer concludes or is bounded. * @returns {number | GC.Spread.Sheets.Slicers.IItemSlicer} If no value is set, returns the endRow of the slicer; otherwise, returns the slicer. * @example * ```javascript * var spread = new GC.Spread.Sheets.Workbook('ss'); * var activeSheet = spread.getActiveSheet(); * var dataSource = [ * { Name: "Bob", City: "NewYork", Birthday: "1968/6/8" }, * { Name: "Betty", City: "NewYork", Birthday: "1972/7/3" }, * { Name: "Alice", City: "Washington", Birthday: "2012/2/15" }, * ]; * var table = activeSheet.tables.addFromDataSource("table1", 1, 1, dataSource); * var pivotTable = activeSheet.pivotTables.add("pivotTable1", "table1", 6, 1); * var slicer = activeSheet.slicers.add("slicer", "pivotTable1", "Name", GC.Spread.Sheets.Slicers.SlicerStyles.dark1(), GC.Spread.Sheets.Slicers.SlicerType.pivotTable); * var oldValue = slicer.endRow(); * console.log(oldValue); * slicer.endRow(20); * var newValue = slicer.endRow(); * console.log(newValue); * ``` */ endRow(value?: number): any; /** * Gets or sets the endRowOffset of the slicer. * @param {number} [value] The endRowOffset of the slicer. The endRowOffset property of a slicer specifies the vertical offset or distance from the ending row index where the slicer concludes its placement within the worksheet. * @returns {number | GC.Spread.Sheets.Slicers.IItemSlicer} If no value is set, returns the endRowOffset of the slicer; otherwise, returns the slicer. * @example * ```javascript * var spread = new GC.Spread.Sheets.Workbook('ss'); * var activeSheet = spread.getActiveSheet(); * var dataSource = [ * { Name: "Bob", City: "NewYork", Birthday: "1968/6/8" }, * { Name: "Betty", City: "NewYork", Birthday: "1972/7/3" }, * { Name: "Alice", City: "Washington", Birthday: "2012/2/15" }, * ]; * var table = activeSheet.tables.addFromDataSource("table1", 1, 1, dataSource); * var pivotTable = activeSheet.pivotTables.add("pivotTable1", "table1", 6, 1); * var slicer = activeSheet.slicers.add("slicer", "pivotTable1", "Name", GC.Spread.Sheets.Slicers.SlicerStyles.dark1(), GC.Spread.Sheets.Slicers.SlicerType.pivotTable); * var oldValue = slicer.endRowOffset(); * console.log(oldValue); * slicer.endRowOffset(5); * var newValue = slicer.endRowOffset(); * console.log(newValue); * ``` */ endRowOffset(value?: number): any; /** * get all connected PivotTables * @returns {GC.Spread.Pivot.PivotTable[]} PivotTables connected with the slicer. * @example * ```javascript * var spread = new GC.Spread.Sheets.Workbook('ss'); * var activeSheet = spread.getActiveSheet(); * var dataSource = [ * { Name: "Bob", City: "NewYork", Birthday: "1968/6/8" }, * { Name: "Betty", City: "NewYork", Birthday: "1972/7/3" }, * { Name: "Alice", City: "Washington", Birthday: "2012/2/15" }, * ]; * var table = activeSheet.tables.addFromDataSource("table1", 1, 1, dataSource); * var pivotTable = activeSheet.pivotTables.add("pivotTable1", "table1", 6, 1); * var slicer = activeSheet.slicers.add("slicer", "pivotTable1", "Name", GC.Spread.Sheets.Slicers.SlicerStyles.dark1(), GC.Spread.Sheets.Slicers.SlicerType.pivotTable); * * slicer.connectPivotTable('pivotTable1'); * slicer.isConnectedPivotTable('pivotTable1'); * console.log(slicer.getAllConnectedPivotTables()); * slicer.disconnectPivotTable('pivotTable1'); * slicer.isConnectedPivotTable('pivotTable1'); * console.log(slicer.getAllConnectedPivotTables()); * ``` */ getAllConnectedPivotTables(): GC.Spread.Pivot.PivotTable[]; /** * get all PivotTables whether connected or not. * @returns {GC.Spread.Pivot.PivotTable[]} PivotTables whose source is same as the slicer. * @example * ```javascript * var spread = new GC.Spread.Sheets.Workbook('ss'); * var activeSheet = spread.getActiveSheet(); * var dataSource = [ * { Name: "Bob", City: "NewYork", Birthday: "1968/6/8" }, * { Name: "Betty", City: "NewYork", Birthday: "1972/7/3" }, * { Name: "Alice", City: "Washington", Birthday: "2012/2/15" }, * ]; * var table = activeSheet.tables.addFromDataSource("table1", 1, 1, dataSource); * var pivotTable = activeSheet.pivotTables.add("pivotTable1", "table1", 6, 1); * var slicer = activeSheet.slicers.add("slicer", "pivotTable1", "Name", GC.Spread.Sheets.Slicers.SlicerStyles.dark1(), GC.Spread.Sheets.Slicers.SlicerType.pivotTable); * * slicer.connectPivotTable('pivotTable1'); * slicer.isConnectedPivotTable('pivotTable1'); * console.log(slicer.getAllPivotTables()); * slicer.disconnectPivotTable('pivotTable1'); * slicer.isConnectedPivotTable('pivotTable1'); * console.log(slicer.getAllPivotTables()); * ``` */ getAllPivotTables(): GC.Spread.Pivot.PivotTable[]; /** * get all connected PivotTables' name. * @returns {string[]} name list of PivotTables connected with the slicer. * @example * ```javascript * var spread = new GC.Spread.Sheets.Workbook('ss'); * var activeSheet = spread.getActiveSheet(); * var dataSource = [ * { Name: "Bob", City: "NewYork", Birthday: "1968/6/8" }, * { Name: "Betty", City: "NewYork", Birthday: "1972/7/3" }, * { Name: "Alice", City: "Washington", Birthday: "2012/2/15" }, * ]; * var table = activeSheet.tables.addFromDataSource("table1", 1, 1, dataSource); * var pivotTable = activeSheet.pivotTables.add("pivotTable1", "table1", 6, 1); * var slicer = activeSheet.slicers.add("slicer", "pivotTable1", "Name", GC.Spread.Sheets.Slicers.SlicerStyles.dark1(), GC.Spread.Sheets.Slicers.SlicerType.pivotTable); * * slicer.connectPivotTable('pivotTable1'); * slicer.isConnectedPivotTable('pivotTable1'); * console.log(slicer.getConnectedPivotTableNameList()); * slicer.disconnectPivotTable('pivotTable1'); * slicer.isConnectedPivotTable('pivotTable1'); * console.log(slicer.getConnectedPivotTableNameList()); * ``` */ getConnectedPivotTableNameList(): string[]; /** * Gets or sets a style name for the pivot table item slicer. * @returns {string} returns the pivot table item slicer style name. */ getStyleName(): string | undefined; /** * Gets or sets the height of the slicer. * @param {number} [value] The height of the slicer. The height property of a slicer specifies the vertical dimension or height of the slicer, determining its size along the y-axis. * @returns {number | GC.Spread.Sheets.Slicers.IItemSlicer} If no value is set, returns the height of the slicer; otherwise, returns the slicer. * @example * ```javascript * var spread = new GC.Spread.Sheets.Workbook('ss'); * var activeSheet = spread.getActiveSheet(); * var dataSource = [ * { Name: "Bob", City: "NewYork", Birthday: "1968/6/8" }, * { Name: "Betty", City: "NewYork", Birthday: "1972/7/3" }, * { Name: "Alice", City: "Washington", Birthday: "2012/2/15" }, * ]; * var table = activeSheet.tables.addFromDataSource("table1", 1, 1, dataSource); * var pivotTable = activeSheet.pivotTables.add("pivotTable1", "table1", 6, 1); * var slicer = activeSheet.slicers.add("slicer", "pivotTable1", "Name", GC.Spread.Sheets.Slicers.SlicerStyles.dark1(), GC.Spread.Sheets.Slicers.SlicerType.pivotTable); * var oldValue = slicer.height(); * console.log(oldValue); * slicer.height(200); * var newValue = slicer.height(); * console.log(newValue); * ``` */ height(value?: number): any; /** * Check whether pivot table connect with the slicer * @param {string} ptName name of pivot table * @returns {boolean} whether pivot table is connected with slicer * @example * ```javascript * var spread = new GC.Spread.Sheets.Workbook('ss'); * var activeSheet = spread.getActiveSheet(); * var dataSource = [ * { Name: "Bob", City: "NewYork", Birthday: "1968/6/8" }, * { Name: "Betty", City: "NewYork", Birthday: "1972/7/3" }, * { Name: "Alice", City: "Washington", Birthday: "2012/2/15" }, * ]; * var table = activeSheet.tables.addFromDataSource("table1", 1, 1, dataSource); * var pivotTable = activeSheet.pivotTables.add("pivotTable1", "table1", 6, 1); * var slicer = activeSheet.slicers.add("slicer", "pivotTable1", "Name", GC.Spread.Sheets.Slicers.SlicerStyles.dark1(), GC.Spread.Sheets.Slicers.SlicerType.pivotTable); * * slicer.connectPivotTable('pivotTable1'); * slicer.isConnectedPivotTable('pivotTable1'); * slicer.disconnectPivotTable('pivotTable1'); * slicer.isConnectedPivotTable('pivotTable1'); * ``` */ isConnectedPivotTable(ptName: string): boolean; /** * Gets or sets the isLocked of the slicer. * @param {boolean} [value] The isLocked of the slicer. The isLocked property of a slicer specifies whether the slicer is currently locked or unlocked, indicating whether users can make changes to its settings or selections when Worksheet is protected. * @returns {boolean | GC.Spread.Sheets.Slicers.IItemSlicer} If no value is set, returns the isLocked of the slicer; otherwise, returns the slicer. * @example * ```javascript * var spread = new GC.Spread.Sheets.Workbook('ss'); * var activeSheet = spread.getActiveSheet(); * var dataSource = [ * { Name: "Bob", City: "NewYork", Birthday: "1968/6/8" }, * { Name: "Betty", City: "NewYork", Birthday: "1972/7/3" }, * { Name: "Alice", City: "Washington", Birthday: "2012/2/15" }, * ]; * var table = activeSheet.tables.addFromDataSource("table1", 1, 1, dataSource); * var pivotTable = activeSheet.pivotTables.add("pivotTable1", "table1", 6, 1); * var slicer = activeSheet.slicers.add("slicer", "pivotTable1", "Name", GC.Spread.Sheets.Slicers.SlicerStyles.dark1(), GC.Spread.Sheets.Slicers.SlicerType.pivotTable); * var oldValue = slicer.isLocked(); * console.log(oldValue); * slicer.isLocked(false); * var newValue = slicer.isLocked(); * console.log(newValue); * ``` */ isLocked(value?: boolean): any; /** * Gets or sets the isSelected of the slicer. * @param {boolean} [value] The isSelected of the slicer. The isSelected property of a slicer specifies whether a particular item within the slicer is currently selected or highlighted. * @returns {boolean | GC.Spread.Sheets.Slicers.IItemSlicer} If no value is set, returns the isSelected of the slicer; otherwise, returns the slicer. * @example * ```javascript * var spread = new GC.Spread.Sheets.Workbook('ss'); * var activeSheet = spread.getActiveSheet(); * var dataSource = [ * { Name: "Bob", City: "NewYork", Birthday: "1968/6/8" }, * { Name: "Betty", City: "NewYork", Birthday: "1972/7/3" }, * { Name: "Alice", City: "Washington", Birthday: "2012/2/15" }, * ]; * var table = activeSheet.tables.addFromDataSource("table1", 1, 1, dataSource); * var pivotTable = activeSheet.pivotTables.add("pivotTable1", "table1", 6, 1); * var slicer = activeSheet.slicers.add("slicer", "pivotTable1", "Name", GC.Spread.Sheets.Slicers.SlicerStyles.dark1(), GC.Spread.Sheets.Slicers.SlicerType.pivotTable); * var oldValue = slicer.isSelected(); * console.log(oldValue); * slicer.isSelected(true); * var newValue = slicer.isSelected(); * console.log(newValue); * ``` */ isSelected(value?: boolean): any; /** * Gets or sets the isVisible of the slicer. * @param {boolean} [value] The isVisible of the slicer. The isVisible property of a slicer specifies whether the slicer is currently visible or hidden within the workbook. * @returns {boolean | GC.Spread.Sheets.Slicers.IItemSlicer} If no value is set, returns the isVisible of the slicer; otherwise, returns the slicer. * @example * ```javascript * var spread = new GC.Spread.Sheets.Workbook('ss'); * var activeSheet = spread.getActiveSheet(); * var dataSource = [ * { Name: "Bob", City: "NewYork", Birthday: "1968/6/8" }, * { Name: "Betty", City: "NewYork", Birthday: "1972/7/3" }, * { Name: "Alice", City: "Washington", Birthday: "2012/2/15" }, * ]; * var table = activeSheet.tables.addFromDataSource("table1", 1, 1, dataSource); * var pivotTable = activeSheet.pivotTables.add("pivotTable1", "table1", 6, 1); * var slicer = activeSheet.slicers.add("slicer", "pivotTable1", "Name", GC.Spread.Sheets.Slicers.SlicerStyles.dark1(), GC.Spread.Sheets.Slicers.SlicerType.pivotTable); * var oldValue = slicer.isVisible(); * console.log(oldValue); * slicer.isVisible(false); * var newValue = slicer.isVisible(); * console.log(newValue); * ``` */ isVisible(value?: boolean): any; /** * Gets or sets the itemHeight of the slicer. * @param {number} [value] The itemHeight of the slicer. The itemHeight property of a slicer specifies the height of each item or row within the slicer control. * @returns {number | GC.Spread.Sheets.Slicers.IItemSlicer} If no value is set, returns the itemHeight of the slicer; otherwise, returns the slicer. * @example * ```javascript * var spread = new GC.Spread.Sheets.Workbook('ss'); * var activeSheet = spread.getActiveSheet(); * var dataSource = [ * { Name: "Bob", City: "NewYork", Birthday: "1968/6/8" }, * { Name: "Betty", City: "NewYork", Birthday: "1972/7/3" }, * { Name: "Alice", City: "Washington", Birthday: "2012/2/15" }, * ]; * var table = activeSheet.tables.addFromDataSource("table1", 1, 1, dataSource); * var pivotTable = activeSheet.pivotTables.add("pivotTable1", "table1", 6, 1); * var slicer = activeSheet.slicers.add("slicer", "pivotTable1", "Name", GC.Spread.Sheets.Slicers.SlicerStyles.dark1(), GC.Spread.Sheets.Slicers.SlicerType.pivotTable); * var oldValue = slicer.itemHeight(); * console.log(oldValue); * slicer.itemHeight(34); * var newValue = slicer.itemHeight(); * console.log(newValue); * ``` */ itemHeight(value?: number): any; /** * Gets or sets the multiSelect of the slicer. * @param {boolean} [value] The multiSelect of the slicer. The multiSelect property of a slicer specifies whether multiple items can be selected simultaneously within the slicer. * @returns {boolean} If no value is set, returns the multiSelect of the slicer * @example * ```javascript * var spread = GC.Spread.Sheets.findControl('ss'); * var activeSheet = spread.getActiveSheet(); * var dataSource = [ * { Name: "Bob", City: "NewYork", Birthday: "1968/6/8" }, * { Name: "Betty", City: "NewYork", Birthday: "1972/7/3" }, * { Name: "Alice", City: "Washington", Birthday: "2012/2/15" }, * ]; * var table = activeSheet.tables.addFromDataSource("table1", 1, 1, dataSource); * var pivotTable = activeSheet.pivotTables.add("pivotTable1", "table1", 6, 1); * var slicer = activeSheet.slicers.add("slicer", "pivotTable1", "Name", GC.Spread.Sheets.Slicers.SlicerStyles.dark1(), GC.Spread.Sheets.Slicers.SlicerType.pivotTable); * var oldValue = slicer.multiSelect(); * console.log(oldValue); * slicer.multiSelect(true); * var newValue = slicer.multiSelect(); * console.log(newValue); * ``` */ multiSelect(value?: boolean): any; /** * Gets or sets the name of the slicer. * @param {string} [value] The name of the slicer. The name property of a slicer specifies the unique identifier or label assigned to the slicer, allowing for identification and reference within the workbook or programmatic interactions. * @returns {string | GC.Spread.Sheets.Slicers.IItemSlicer} If no value is set, returns the name of the slicer; otherwise, returns the slicer. * @example * ```javascript * var spread = new GC.Spread.Sheets.Workbook('ss'); * var activeSheet = spread.getActiveSheet(); * var dataSource = [ * { Name: "Bob", City: "NewYork", Birthday: "1968/6/8" }, * { Name: "Betty", City: "NewYork", Birthday: "1972/7/3" }, * { Name: "Alice", City: "Washington", Birthday: "2012/2/15" }, * ]; * var table = activeSheet.tables.addFromDataSource("table1", 1, 1, dataSource); * var pivotTable = activeSheet.pivotTables.add("pivotTable1", "table1", 6, 1); * var slicer = activeSheet.slicers.add("slicer", "pivotTable1", "Name", GC.Spread.Sheets.Slicers.SlicerStyles.dark1(), GC.Spread.Sheets.Slicers.SlicerType.pivotTable); * var oldValue = slicer.name(); * console.log(oldValue); * slicer.name('SlicerA'); * var newValue = slicer.name(); * console.log(newValue); * ``` */ name(value?: string): any; /** * Gets the nameInFormula of the slicer. * @returns {string} returns the nameInFormula of the slicer. */ nameInFormula(): string; /** * Gets or sets the position of the slicer. * @param {GC.Spread.Sheets.Point} [value] The position of the slicer. The position property of a slicer specifies the placement of the slicer within the worksheet. * @returns {GC.Spread.Sheets.Point | GC.Spread.Sheets.Slicers.IItemSlicer} If no value is set, returns the position of the slicer; otherwise, returns the slicer. * @example * ```javascript * var spread = new GC.Spread.Sheets.Workbook('ss'); * var activeSheet = spread.getActiveSheet(); * var dataSource = [ * { Name: "Bob", City: "NewYork", Birthday: "1968/6/8" }, * { Name: "Betty", City: "NewYork", Birthday: "1972/7/3" }, * { Name: "Alice", City: "Washington", Birthday: "2012/2/15" }, * ]; * var table = activeSheet.tables.addFromDataSource("table1", 1, 1, dataSource); * var pivotTable = activeSheet.pivotTables.add("pivotTable1", "table1", 6, 1); * var slicer = activeSheet.slicers.add("slicer", "pivotTable1", "Name", GC.Spread.Sheets.Slicers.SlicerStyles.dark1(), GC.Spread.Sheets.Slicers.SlicerType.pivotTable); * var oldValue = slicer.position(); * console.log(oldValue); * slicer.position(new GC.Spread.Sheets.Point(100, 200)); * var newValue = slicer.position(); * console.log(newValue); * ``` */ position(value?: GC.Spread.Sheets.Point): any; /** * Refresh the slicer. */ refresh(): void; /** * Get the worksheet of the slicer. * @returns {GC.Spread.Sheets.Worksheet} returns the worksheet of the slicer. */ sheet(): GC.Spread.Sheets.Worksheet; /** * Gets or sets the showHeader of the slicer. * @param {boolean} [value] The showHeader of the slicer. The showHeader property of a slicer specifies whether the header, which includes the title and filter-related controls, is displayed in the slicer. * @returns {boolean | GC.Spread.Sheets.Slicers.IItemSlicer} If no value is set, returns the showHeader of the slicer; otherwise, returns the slicer. * @example * ```javascript * var spread = new GC.Spread.Sheets.Workbook('ss'); * var activeSheet = spread.getActiveSheet(); * var dataSource = [ * { Name: "Bob", City: "NewYork", Birthday: "1968/6/8" }, * { Name: "Betty", City: "NewYork", Birthday: "1972/7/3" }, * { Name: "Alice", City: "Washington", Birthday: "2012/2/15" }, * ]; * var table = activeSheet.tables.addFromDataSource("table1", 1, 1, dataSource); * var pivotTable = activeSheet.pivotTables.add("pivotTable1", "table1", 6, 1); * var slicer = activeSheet.slicers.add("slicer", "pivotTable1", "Name", GC.Spread.Sheets.Slicers.SlicerStyles.dark1(), GC.Spread.Sheets.Slicers.SlicerType.pivotTable); * var oldValue = slicer.showHeader(); * console.log(oldValue); * slicer.showHeader(false); * var newValue = slicer.showHeader(); * console.log(newValue); * ``` */ showHeader(value?: boolean): any; /** * Gets or sets the showNoDataItems of the slicer. * @param {boolean} [value] The showNoDataItems of the slicer. The showNoDataItems property of a slicer specifies whether to display items with no associated data in the connected PivotTable or data source within the slicer control. * @returns {boolean | GC.Spread.Sheets.Slicers.IItemSlicer} If no value is set, returns the showNoDataItems of the slicer; otherwise, returns the slicer. * @example * ```javascript * var spread = new GC.Spread.Sheets.Workbook('ss'); * var activeSheet = spread.getActiveSheet(); * var dataSource = [ * { Name: "Bob", City: "NewYork", Birthday: "1968/6/8" }, * { Name: "Betty", City: "NewYork", Birthday: "1972/7/3" }, * { Name: "Alice", City: "Washington", Birthday: "2012/2/15" }, * ]; * var table = activeSheet.tables.addFromDataSource("table1", 1, 1, dataSource); * var pivotTable = activeSheet.pivotTables.add("pivotTable1", "table1", 6, 1); * var slicer = activeSheet.slicers.add("slicer", "pivotTable1", "Name", GC.Spread.Sheets.Slicers.SlicerStyles.dark1(), GC.Spread.Sheets.Slicers.SlicerType.pivotTable); * var oldValue = slicer.showNoDataItems(); * console.log(oldValue); * slicer.showNoDataItems(false); * var newValue = slicer.showNoDataItems(); * console.log(newValue); * ``` */ showNoDataItems(value?: boolean): any; /** * Gets or sets the showNoDataItemsInLast of the slicer. * @param {boolean} [value] The showNoDataItemsInLast of the slicer. The showNoDataItemsInLast property of a slicer specifies whether to display items with no associated data at the end of the slicer control's list when presenting the items. * @returns {boolean | GC.Spread.Sheets.Slicers.IItemSlicer} If no value is set, returns the showNoDataItemsInLast of the slicer; otherwise, returns the slicer. * @example * ```javascript * var spread = new GC.Spread.Sheets.Workbook('ss'); * var activeSheet = spread.getActiveSheet(); * var dataSource = [ * { Name: "Bob", City: "NewYork", Birthday: "1968/6/8" }, * { Name: "Betty", City: "NewYork", Birthday: "1972/7/3" }, * { Name: "Alice", City: "Washington", Birthday: "2012/2/15" }, * ]; * var table = activeSheet.tables.addFromDataSource("table1", 1, 1, dataSource); * var pivotTable = activeSheet.pivotTables.add("pivotTable1", "table1", 6, 1); * var slicer = activeSheet.slicers.add("slicer", "pivotTable1", "Name", GC.Spread.Sheets.Slicers.SlicerStyles.dark1(), GC.Spread.Sheets.Slicers.SlicerType.pivotTable); * var oldValue = slicer.showNoDataItemsInLast(); * console.log(oldValue); * slicer.showNoDataItemsInLast(false); * var newValue = slicer.showNoDataItemsInLast(); * console.log(newValue); * ``` */ showNoDataItemsInLast(value?: boolean): any; /** * Gets or sets the sortState of the slicer. * @param {GC.Spread.Sheets.SortState} [value] The sortState of the slicer. The sortState property of a slicer specifies the current sorting state applied to the items within the slicer, indicating whether they are sorted in ascending, descending order, or not sorted. * @returns {GC.Spread.Sheets.SortState | GC.Spread.Sheets.Slicers.IItemSlicer} If no value is set, returns the sortState of the slicer; otherwise, returns the slicer. * @example * ```javascript * var spread = new GC.Spread.Sheets.Workbook('ss'); * var activeSheet = spread.getActiveSheet(); * var dataSource = [ * { Name: "Bob", City: "NewYork", Birthday: "1968/6/8" }, * { Name: "Betty", City: "NewYork", Birthday: "1972/7/3" }, * { Name: "Alice", City: "Washington", Birthday: "2012/2/15" }, * ]; * var table = activeSheet.tables.addFromDataSource("table1", 1, 1, dataSource); * var pivotTable = activeSheet.pivotTables.add("pivotTable1", "table1", 6, 1); * var slicer = activeSheet.slicers.add("slicer", "pivotTable1", "Name", GC.Spread.Sheets.Slicers.SlicerStyles.dark1(), GC.Spread.Sheets.Slicers.SlicerType.pivotTable); * var oldValue = slicer.sortState(); * console.log(oldValue); * slicer.sortState(GC.Spread.Sheets.SortState.descending); * var newValue = slicer.sortState(); * console.log(newValue); * ``` */ sortState(value?: GC.Spread.Sheets.SortState): any; /** * Get the sourceName of the slicer. The sourceName property of a slicer specifies the name of the source data field associated with the slicer. * @returns {string} returns the sourceName of the slicer. */ sourceName(): string; /** * Gets or sets the startColumn of the slicer. * @param {number} [value] The startColumn of the slicer. The startColumn property of a slicer specifies the starting column index or position within the worksheet where the slicer is anchored * @returns {number | GC.Spread.Sheets.Slicers.IItemSlicer} If no value is set, returns the startColumn of the slicer; otherwise, returns the slicer. * @example * ```javascript * var spread = new GC.Spread.Sheets.Workbook('ss'); * var activeSheet = spread.getActiveSheet(); * var dataSource = [ * { Name: "Bob", City: "NewYork", Birthday: "1968/6/8" }, * { Name: "Betty", City: "NewYork", Birthday: "1972/7/3" }, * { Name: "Alice", City: "Washington", Birthday: "2012/2/15" }, * ]; * var table = activeSheet.tables.addFromDataSource("table1", 1, 1, dataSource); * var pivotTable = activeSheet.pivotTables.add("pivotTable1", "table1", 6, 1); * var slicer = activeSheet.slicers.add("slicer", "pivotTable1", "Name", GC.Spread.Sheets.Slicers.SlicerStyles.dark1(), GC.Spread.Sheets.Slicers.SlicerType.pivotTable); * var oldValue = slicer.startColumn(); * console.log(oldValue); * slicer.startColumn(10); * var newValue = slicer.startColumn(); * console.log(newValue); * ``` */ startColumn(value?: number): any; /** * Gets or sets the startColumnOffset of the slicer. * @param {number} [value] The startColumnOffset of the slicer. The startColumnOffset property of a slicer specifies the horizontal offset or distance from the starting column index where the slicer begins its placement within the worksheet. * @returns {number | GC.Spread.Sheets.Slicers.IItemSlicer} If no value is set, returns the startColumnOffset of the slicer; otherwise, returns the slicer. * @example * ```javascript * var spread = new GC.Spread.Sheets.Workbook('ss'); * var activeSheet = spread.getActiveSheet(); * var dataSource = [ * { Name: "Bob", City: "NewYork", Birthday: "1968/6/8" }, * { Name: "Betty", City: "NewYork", Birthday: "1972/7/3" }, * { Name: "Alice", City: "Washington", Birthday: "2012/2/15" }, * ]; * var table = activeSheet.tables.addFromDataSource("table1", 1, 1, dataSource); * var pivotTable = activeSheet.pivotTables.add("pivotTable1", "table1", 6, 1); * var slicer = activeSheet.slicers.add("slicer", "pivotTable1", "Name", GC.Spread.Sheets.Slicers.SlicerStyles.dark1(), GC.Spread.Sheets.Slicers.SlicerType.pivotTable); * var oldValue = slicer.startColumnOffset(); * console.log(oldValue); * slicer.startColumnOffset(15); * var newValue = slicer.startColumnOffset(); * console.log(newValue); * ``` */ startColumnOffset(value?: number): any; /** * Gets or sets the startRow of the slicer. * @param {number} [value] The startRow of the slicer. The startRow property of a slicer specifies the starting row index or position within the worksheet where the slicer is anchored. * @returns {number | GC.Spread.Sheets.Slicers.IItemSlicer} If no value is set, returns the startRow of the slicer; otherwise, returns the slicer. * @example * ```javascript * var spread = new GC.Spread.Sheets.Workbook('ss'); * var activeSheet = spread.getActiveSheet(); * var dataSource = [ * { Name: "Bob", City: "NewYork", Birthday: "1968/6/8" }, * { Name: "Betty", City: "NewYork", Birthday: "1972/7/3" }, * { Name: "Alice", City: "Washington", Birthday: "2012/2/15" }, * ]; * var table = activeSheet.tables.addFromDataSource("table1", 1, 1, dataSource); * var pivotTable = activeSheet.pivotTables.add("pivotTable1", "table1", 6, 1); * var slicer = activeSheet.slicers.add("slicer", "pivotTable1", "Name", GC.Spread.Sheets.Slicers.SlicerStyles.dark1(), GC.Spread.Sheets.Slicers.SlicerType.pivotTable); * var oldValue = slicer.startRow(); * console.log(oldValue); * slicer.startRow(10); * var newValue = slicer.startRow(); * console.log(newValue); * ``` */ startRow(value?: number): any; /** * Gets or sets the startRowOffset of the slicer. * @param {number} [value] The startRowOffset of the slicer. The startRowOffset property of a slicer specifies the vertical offset or distance from the starting row index where the slicer begins its placement within the worksheet. * @returns {number | GC.Spread.Sheets.Slicers.IItemSlicer} If no value is set, returns the startRowOffset of the slicer; otherwise, returns the slicer. * @example * ```javascript * var spread = new GC.Spread.Sheets.Workbook('ss'); * var activeSheet = spread.getActiveSheet(); * var dataSource = [ * { Name: "Bob", City: "NewYork", Birthday: "1968/6/8" }, * { Name: "Betty", City: "NewYork", Birthday: "1972/7/3" }, * { Name: "Alice", City: "Washington", Birthday: "2012/2/15" }, * ]; * var table = activeSheet.tables.addFromDataSource("table1", 1, 1, dataSource); * var pivotTable = activeSheet.pivotTables.add("pivotTable1", "table1", 6, 1); * var slicer = activeSheet.slicers.add("slicer", "pivotTable1", "Name", GC.Spread.Sheets.Slicers.SlicerStyles.dark1(), GC.Spread.Sheets.Slicers.SlicerType.pivotTable); * var oldValue = slicer.startRowOffset(); * console.log(oldValue); * slicer.startRowOffset(15); * var newValue = slicer.startRowOffset(); * console.log(newValue); * ``` */ startRowOffset(value?: number): any; /** * Gets or sets the style of the slicer. * @param {string | GC.Spread.Sheets.Slicers.SlicerStyle} [value] The style or style name of the slicer. The style property of a slicer specifies the visual appearance and formatting style applied to the slicer, defining its overall look and presentation. * @returns {GC.Spread.Sheets.Slicers.SlicerStyle | GC.Spread.Sheets.Slicers.IItemSlicer} If no style is set, returns the style of the slicer; otherwise, returns the slicer. * @example * ```javascript * var spread = new GC.Spread.Sheets.Workbook('ss'); * var activeSheet = spread.getActiveSheet(); * var dataSource = [ * { Name: "Bob", City: "NewYork", Birthday: "1968/6/8" }, * { Name: "Betty", City: "NewYork", Birthday: "1972/7/3" }, * { Name: "Alice", City: "Washington", Birthday: "2012/2/15" }, * ]; * var table = activeSheet.tables.addFromDataSource("table1", 1, 1, dataSource); * var pivotTable = activeSheet.pivotTables.add("pivotTable1", "table1", 6, 1); * var slicer = activeSheet.slicers.add("slicer", "pivotTable1", "Name", GC.Spread.Sheets.Slicers.SlicerStyles.dark1(), GC.Spread.Sheets.Slicers.SlicerType.pivotTable); * * var style = new GC.Spread.Sheets.Slicers.SlicerStyle(); * style.wholeSlicerStyle(new GC.Spread.Sheets.Slicers.SlicerStyleInfo('red', 'blue', '16pt Calibri')); * style.headerStyle(new GC.Spread.Sheets.Slicers.SlicerStyleInfo(undefined, 'green')); * style.selectedItemWithDataStyle(new GC.Spread.Sheets.Slicers.SlicerStyleInfo(undefined, undefined, undefined, new GC.Spread.Sheets.LineBorder('pink', GC.Spread.Sheets.LineStyle.double))); * * var oldValue = slicer.style(); * console.log(oldValue); * slicer.style(style); * var newValue = slicer.style(); * console.log(newValue); * ``` */ style(value?: string | GC.Spread.Sheets.Slicers.SlicerStyle): any; /** * Gets or sets the visuallyNoDataItems of the slicer. * @param {boolean} [value] The visuallyNoDataItems of the slicer. The visuallyNoDataItems property of a slicer specifies the visual representation or handling of items with no associated data within the slicer control. * @returns {boolean | GC.Spread.Sheets.Slicers.IItemSlicer} If no value is set, returns the visuallyNoDataItems of the slicer; otherwise, returns the slicer. * @example * ```javascript * var spread = new GC.Spread.Sheets.Workbook('ss'); * var activeSheet = spread.getActiveSheet(); * var dataSource = [ * { Name: "Bob", City: "NewYork", Birthday: "1968/6/8" }, * { Name: "Betty", City: "NewYork", Birthday: "1972/7/3" }, * { Name: "Alice", City: "Washington", Birthday: "2012/2/15" }, * ]; * var table = activeSheet.tables.addFromDataSource("table1", 1, 1, dataSource); * var pivotTable = activeSheet.pivotTables.add("pivotTable1", "table1", 6, 1); * var slicer = activeSheet.slicers.add("slicer", "pivotTable1", "Name", GC.Spread.Sheets.Slicers.SlicerStyles.dark1(), GC.Spread.Sheets.Slicers.SlicerType.pivotTable); * var oldValue = slicer.visuallyNoDataItems(); * console.log(oldValue); * slicer.visuallyNoDataItems(false); * var newValue = slicer.visuallyNoDataItems(); * console.log(newValue); * ``` */ visuallyNoDataItems(value?: boolean): any; /** * Gets or sets the width of the slicer. * @param {number} [value] The width of the slicer. The width property of a slicer specifies the horizontal dimension or width of the slicer, determining its size along the x-axis. * @returns {number | GC.Spread.Sheets.Slicers.IItemSlicer} If no value is set, returns the width of the slicer; otherwise, returns the slicer. * @example * ```javascript * var spread = new GC.Spread.Sheets.Workbook('ss'); * var activeSheet = spread.getActiveSheet(); * var dataSource = [ * { Name: "Bob", City: "NewYork", Birthday: "1968/6/8" }, * { Name: "Betty", City: "NewYork", Birthday: "1972/7/3" }, * { Name: "Alice", City: "Washington", Birthday: "2012/2/15" }, * ]; * var table = activeSheet.tables.addFromDataSource("table1", 1, 1, dataSource); * var pivotTable = activeSheet.pivotTables.add("pivotTable1", "table1", 6, 1); * var slicer = activeSheet.slicers.add("slicer", "pivotTable1", "Name", GC.Spread.Sheets.Slicers.SlicerStyles.dark1(), GC.Spread.Sheets.Slicers.SlicerType.pivotTable); * var oldValue = slicer.width(); * console.log(oldValue); * slicer.width(200); * var newValue = slicer.width(); * console.log(newValue); * ``` */ width(value?: number): any; /** * Gets or sets the x of the slicer. * @param {number} [value] The x of the slicer. The x property of a slicer specifies the horizontal position or coordinate of the upper-left corner of the slicer within the worksheet. * @returns {number | GC.Spread.Sheets.Slicers.IItemSlicer} If no value is set, returns the x of the slicer; otherwise, returns the slicer. * @example * ```javascript * var spread = new GC.Spread.Sheets.Workbook('ss'); * var activeSheet = spread.getActiveSheet(); * var dataSource = [ * { Name: "Bob", City: "NewYork", Birthday: "1968/6/8" }, * { Name: "Betty", City: "NewYork", Birthday: "1972/7/3" }, * { Name: "Alice", City: "Washington", Birthday: "2012/2/15" }, * ]; * var table = activeSheet.tables.addFromDataSource("table1", 1, 1, dataSource); * var pivotTable = activeSheet.pivotTables.add("pivotTable1", "table1", 6, 1); * var slicer = activeSheet.slicers.add("slicer", "pivotTable1", "Name", GC.Spread.Sheets.Slicers.SlicerStyles.dark1(), GC.Spread.Sheets.Slicers.SlicerType.pivotTable); * var oldValue = slicer.x(); * console.log(oldValue); * slicer.x(100); * var newValue = slicer.x(); * console.log(newValue); * ``` */ x(value?: number): any; /** * Gets or sets the y of the slicer. * @param {number} [value] The y of the slicer. The y property of a slicer specifies the vertical position or coordinate of the upper-left corner of the slicer within the worksheet. * @returns {number | GC.Spread.Sheets.Slicers.IItemSlicer} If no value is set, returns the y of the slicer; otherwise, returns the slicer. * @example * ```javascript * var spread = new GC.Spread.Sheets.Workbook('ss'); * var activeSheet = spread.getActiveSheet(); * var dataSource = [ * { Name: "Bob", City: "NewYork", Birthday: "1968/6/8" }, * { Name: "Betty", City: "NewYork", Birthday: "1972/7/3" }, * { Name: "Alice", City: "Washington", Birthday: "2012/2/15" }, * ]; * var table = activeSheet.tables.addFromDataSource("table1", 1, 1, dataSource); * var pivotTable = activeSheet.pivotTables.add("pivotTable1", "table1", 6, 1); * var slicer = activeSheet.slicers.add("slicer", "pivotTable1", "Name", GC.Spread.Sheets.Slicers.SlicerStyles.dark1(), GC.Spread.Sheets.Slicers.SlicerType.pivotTable); * var oldValue = slicer.y(); * console.log(oldValue); * slicer.y(100); * var newValue = slicer.y(); * console.log(newValue); * ``` */ y(value?: number): any; } export class PivotTableStyle{ /** * Represents a PivotTable Style. * @class * @param {string} [backColor] Indicates the backColor of pivot table style. * @param {string} [foreColor] Indicates the foreColor of pivot table style. * @param {string} [font] Indicates the font of pivot table style. * @param {GC.Spread.Sheets.LineBorder} [borderLeft] Indicates the borderLeft of pivot table style. * @param {GC.Spread.Sheets.LineBorder} [borderTop] Indicates the borderTop of pivot table style. * @param {GC.Spread.Sheets.LineBorder} [borderRight] Indicates the borderRight of pivot table style. * @param {GC.Spread.Sheets.LineBorder} [borderBottom] Indicates the borderBottom of pivot table style. * @param {GC.Spread.Sheets.LineBorder} [borderHorizontal] Indicates the borderHorizontal of pivot table style. * @param {GC.Spread.Sheets.LineBorder} [borderVertical] Indicates the borderVertical of pivot table style. * @param {GC.Spread.Sheets.TextDecorationType} [textDecoration] Indicates the textDecoration of pivot table style. * @param {string} [fontStyle] The font style. * @param {string} [fontWeight] The font weight. * @param {string} [fontSize] The font size. * @param {string} [fontFamily] The font family. */ constructor(backColor?: string, foreColor?: string, font?: string, borderLeft?: GC.Spread.Sheets.LineBorder, borderTop?: GC.Spread.Sheets.LineBorder, borderRight?: GC.Spread.Sheets.LineBorder, borderBottom?: GC.Spread.Sheets.LineBorder, borderHorizontal?: GC.Spread.Sheets.LineBorder, borderVertical?: GC.Spread.Sheets.LineBorder, textDecoration?: GC.Spread.Sheets.TextDecorationType, fontStyle?: string, fontWeight?: string, fontSize?: string, fontFamily?: string); /** * Indicates the background color. * @type {string} */ backColor: string; /** * Indicates the bottom border. * @type {GC.Spread.Sheets.LineBorder} */ borderBottom: GC.Spread.Sheets.LineBorder; /** * Indicates the horizontal border. * @type {GC.Spread.Sheets.LineBorder} */ borderHorizontal: GC.Spread.Sheets.LineBorder; /** * Indicates the left border. * @type {GC.Spread.Sheets.LineBorder} */ borderLeft: GC.Spread.Sheets.LineBorder; /** * Indicates the right border. * @type {GC.Spread.Sheets.LineBorder} */ borderRight: GC.Spread.Sheets.LineBorder; /** * Indicates the top border. * @type {GC.Spread.Sheets.LineBorder} */ borderTop: GC.Spread.Sheets.LineBorder; /** * Indicates the vertical border. * @type {GC.Spread.Sheets.LineBorder} */ borderVertical: GC.Spread.Sheets.LineBorder; /** * Indicates the font. * @type {string} */ font: string; /** * Indicates the font family. * @type {string} * @example * ```javascript * //This example sets the fontFamily property. * var spread = new GC.Spread.Sheets.Workbook(document.getElementById("ss"),{sheetCount:3}); * var sourceSheet = spread.getSheet(0); * var sheet = spread.getSheet(1); * var sourceData = [["Date","Buyer","Type","Amount"], * ["01-Jan","Mom","Fuel",74], * ["15-Jan","Mom","Food",235], * ["17-Jan","Dad","Sports",20], * ["21-Jan","Kelly","Books",125]]; * sourceSheet.setArray(0, 0, sourceData ); * sourceSheet.tables.add('sourceData', 0, 0, 5, 4); * var layout = GC.Spread.Pivot.PivotTableLayoutType.compact; * var theme = GC.Spread.Pivot.PivotTableThemes.medium2; * var wholePivotTableStyle = new GC.Spread.Pivot.PivotTableStyle(); * wholePivotTableStyle.fontFamily = "Arial Black"; * theme.wholeTableStyle(wholePivotTableStyle); * var pivotTable = sheet.pivotTables.add("pivotTable_1", 'sourceData', 1, 1, layout, theme); * ``` */ fontFamily: string; /** * Indicates the font size. * @type {string} * @example * ```javascript * //This example sets the fontSize property. * var spread = new GC.Spread.Sheets.Workbook(document.getElementById("ss"),{sheetCount:3}); * var sourceSheet = spread.getSheet(0); * var sheet = spread.getSheet(1); * var sourceData = [["Date","Buyer","Type","Amount"], * ["01-Jan","Mom","Fuel",74], * ["15-Jan","Mom","Food",235], * ["17-Jan","Dad","Sports",20], * ["21-Jan","Kelly","Books",125]]; * sourceSheet.setArray(0, 0, sourceData ); * sourceSheet.tables.add('sourceData', 0, 0, 5, 4); * var layout = GC.Spread.Pivot.PivotTableLayoutType.compact; * var theme = GC.Spread.Pivot.PivotTableThemes.medium2; * var wholePivotTableStyle = new GC.Spread.Pivot.PivotTableStyle(); * wholePivotTableStyle.fontSize = "16px"; * theme.wholeTableStyle(wholePivotTableStyle); * var pivotTable = sheet.pivotTables.add("pivotTable_1", 'sourceData', 1, 1, layout, theme); * ``` */ fontSize: string; /** * Indicates the font style. * @type {string} * @example * ```javascript * //This example sets the fontStyle property. * var spread = new GC.Spread.Sheets.Workbook(document.getElementById("ss"),{sheetCount:3}); * var sourceSheet = spread.getSheet(0); * var sheet = spread.getSheet(1); * var sourceData = [["Date","Buyer","Type","Amount"], * ["01-Jan","Mom","Fuel",74], * ["15-Jan","Mom","Food",235], * ["17-Jan","Dad","Sports",20], * ["21-Jan","Kelly","Books",125]]; * sourceSheet.setArray(0, 0, sourceData ); * sourceSheet.tables.add('sourceData', 0, 0, 5, 4); * var layout = GC.Spread.Pivot.PivotTableLayoutType.compact; * var theme = GC.Spread.Pivot.PivotTableThemes.medium2; * var wholePivotTableStyle = new GC.Spread.Pivot.PivotTableStyle(); * wholePivotTableStyle.fontStyle = "italic"; * theme.wholeTableStyle(wholePivotTableStyle); * var pivotTable = sheet.pivotTables.add("pivotTable_1", 'sourceData', 1, 1, layout, theme); * ``` */ fontStyle: string; /** * Indicates the font weight. * @type {string} * @example * ```javascript * //This example sets the fontWeight property. * var spread = new GC.Spread.Sheets.Workbook(document.getElementById("ss"),{sheetCount:3}); * var sourceSheet = spread.getSheet(0); * var sheet = spread.getSheet(1); * var sourceData = [["Date","Buyer","Type","Amount"], * ["01-Jan","Mom","Fuel",74], * ["15-Jan","Mom","Food",235], * ["17-Jan","Dad","Sports",20], * ["21-Jan","Kelly","Books",125]]; * sourceSheet.setArray(0, 0, sourceData ); * sourceSheet.tables.add('sourceData', 0, 0, 5, 4); * var layout = GC.Spread.Pivot.PivotTableLayoutType.compact; * var theme = GC.Spread.Pivot.PivotTableThemes.medium2; * var wholePivotTableStyle = new GC.Spread.Pivot.PivotTableStyle(); * wholePivotTableStyle.fontWeight = "bold"; * theme.wholeTableStyle(wholePivotTableStyle); * var pivotTable = sheet.pivotTables.add("pivotTable_1", 'sourceData', 1, 1, layout, theme); * ``` */ fontWeight: string; /** * Indicates the fore color. * @type {string} */ foreColor: string; /** * Indicates the text decoration. * @type {GC.Spread.Sheets.TextDecorationType} */ textDecoration: GC.Spread.Sheets.TextDecorationType; } export class PivotTableTheme{ /** * Represents a PivotTableTheme class. * @class */ constructor(); /** * @description get or set the blankRowStyle of pivot table theme * @param {GC.Spread.Pivot.PivotTableStyle} [value] The default style of the blank row area. * @returns {GC.Spread.Pivot.PivotTableStyle | GC.Spread.Pivot.PivotTableTheme} If no value is set, returns the default style of the data area; otherwise, returns the pivot table theme. */ blankRowStyle(value?: GC.Spread.Pivot.PivotTableStyle): any; /** * @description get or set the columnSubheading1Style of pivot table theme * @param {GC.Spread.Pivot.PivotTableStyle} [value] The default style of the subheading column 1 area. * @returns {GC.Spread.Pivot.PivotTableStyle | GC.Spread.Pivot.PivotTableTheme} If no value is set, returns the default style of the data area; otherwise, returns the pivot table theme. */ columnSubheading1Style(value?: GC.Spread.Pivot.PivotTableStyle): any; /** * @description get or set the columnSubheading2Style of pivot table theme * @param {GC.Spread.Pivot.PivotTableStyle} [value] The default style of the subheading column 2 area. * @returns {GC.Spread.Pivot.PivotTableStyle | GC.Spread.Pivot.PivotTableTheme} If no value is set, returns the default style of the data area; otherwise, returns the pivot table theme. */ columnSubheading2Style(value?: GC.Spread.Pivot.PivotTableStyle): any; /** * @description get or set the columnSubheading3Style of pivot table theme * @param {GC.Spread.Pivot.PivotTableStyle} [value] The default style of the subheading column 3 area. * @returns {GC.Spread.Pivot.PivotTableStyle | GC.Spread.Pivot.PivotTableTheme} If no value is set, returns the default style of the data area; otherwise, returns the pivot table theme. */ columnSubheading3Style(value?: GC.Spread.Pivot.PivotTableStyle): any; /** * @description get or set the firstColumnStripeStyle of pivot table theme * @param {GC.Spread.Pivot.PivotTableStyle} [value] The first alternating column style. * @returns {GC.Spread.Pivot.PivotTableStyle | GC.Spread.Pivot.PivotTableTheme} If no value is set, returns the default style of the data area; otherwise, returns the pivot table theme. */ firstColumnStripeStyle(value?: GC.Spread.Pivot.PivotTableStyle): any; /** * @description get or set the firstColumnStripSize of pivot table theme * @param {number} [value] The size of the first alternating column. * @returns {number | GC.Spread.Pivot.PivotTableTheme} If no value is set, returns the size of the size of the first alternating column; otherwise, returns the pivot table theme. */ firstColumnStripSize(value?: number): any; /** * @description get or set the firstColumnStyle of pivot table theme * @param {GC.Spread.Pivot.PivotTableStyle} [value] The default style of the first column. * @returns {GC.Spread.Pivot.PivotTableStyle | GC.Spread.Pivot.PivotTableTheme} If no value is set, returns the default style of the data area; otherwise, returns the pivot table theme. */ firstColumnStyle(value?: GC.Spread.Pivot.PivotTableStyle): any; /** * @description get or set the firstHeaderCellStyle of pivot table theme * @param {GC.Spread.Pivot.PivotTableStyle} [value] The default style of the first header cell. * @returns {GC.Spread.Pivot.PivotTableStyle | GC.Spread.Pivot.PivotTableTheme} If no value is set, returns the default style of the data area; otherwise, returns the pivot table theme. */ firstHeaderCellStyle(value?: GC.Spread.Pivot.PivotTableStyle): any; /** * @description get or set the firstRowStripeStyle of pivot table theme * @param {GC.Spread.Pivot.PivotTableStyle} [value] The first alternating row style. * @returns {GC.Spread.Pivot.PivotTableStyle | GC.Spread.Pivot.PivotTableTheme} If no value is set, returns the default style of the data area; otherwise, returns the pivot table theme. */ firstRowStripeStyle(value?: GC.Spread.Pivot.PivotTableStyle): any; /** * @description get or set the firstRowStripSize of pivot table theme * @param {number} [value] The size of the first alternating row. * @returns {number | GC.Spread.Pivot.PivotTableTheme} If no value is set, returns the size of the first alternating row; otherwise, returns the pivot table theme. */ firstRowStripSize(value?: number): any; /** * Loads the object state from the specified JSON string. * @param {Object} data The pivot table theme data from deserialization. * @example * ```javascript * //This example uses the fromJSON method. * const light1 = GC.Spread.Pivot.PivotTableThemes.light1; * //export * const jsonStr = JSON.stringify(light1.toJSON()); * //import * const newTheme = new GC.Spread.Pivot.PivotTableTheme(); * newTheme.fromJSON(JSON.parse(jsonStr)); * newTheme.name('custom1'); * alert(jsonStr); * ``` */ fromJSON(data: Object): void; /** * @description get or set the grandTotalColumnStyle of pivot table theme * @param {GC.Spread.Pivot.PivotTableStyle} [value] The default style of the grandTotal column area. * @returns {GC.Spread.Pivot.PivotTableStyle | GC.Spread.Pivot.PivotTableTheme} If no value is set, returns the default style of the data area; otherwise, returns the pivot table theme. */ grandTotalColumnStyle(value?: GC.Spread.Pivot.PivotTableStyle): any; /** * @description get or set the grandTotalRowStyle of pivot table theme * @param {GC.Spread.Pivot.PivotTableStyle} [value] The default style of the grandTotal row area. * @returns {GC.Spread.Pivot.PivotTableStyle | GC.Spread.Pivot.PivotTableTheme} If no value is set, returns the default style of the data area; otherwise, returns the pivot table theme. */ grandTotalRowStyle(value?: GC.Spread.Pivot.PivotTableStyle): any; /** * @description get or set the headerRowStyle of pivot table theme * @param {GC.Spread.Pivot.PivotTableStyle} [value] The default style of the header area. * @returns {GC.Spread.Pivot.PivotTableStyle | GC.Spread.Pivot.PivotTableTheme} If no value is set, returns the default style of the data area; otherwise, returns the pivot table theme. */ headerRowStyle(value?: GC.Spread.Pivot.PivotTableStyle): any; /** * @description get or set the name of pivot table theme * @param {string} [value] name of pivot table theme * @returns {string | GC.Spread.Pivot.PivotTableTheme} If no value is set, returns the name of the style; otherwise, returns the table theme. */ name(value?: string): any; /** * @description get or set the reportFilterLabelsStyle of pivot table theme * @param {GC.Spread.Pivot.PivotTableStyle} [value] The default style of the report filter labels area. * @returns {GC.Spread.Pivot.PivotTableStyle | GC.Spread.Pivot.PivotTableTheme} If no value is set, returns the default style of the data area; otherwise, returns the pivot table theme. */ reportFilterLabelsStyle(value?: GC.Spread.Pivot.PivotTableStyle): any; /** * @description get or set the reportFilterValuesStyle of pivot table theme * @param {GC.Spread.Pivot.PivotTableStyle} [value] The default style of the report filter values area. * @returns {GC.Spread.Pivot.PivotTableStyle | GC.Spread.Pivot.PivotTableTheme} If no value is set, returns the default style of the data area; otherwise, returns the pivot table theme. */ reportFilterValuesStyle(value?: GC.Spread.Pivot.PivotTableStyle): any; /** * @description get or set the rowSubheading1Style of pivot table theme * @param {GC.Spread.Pivot.PivotTableStyle} [value] The default style of the subheading row 1 area. * @returns {GC.Spread.Pivot.PivotTableStyle | GC.Spread.Pivot.PivotTableTheme} If no value is set, returns the default style of the data area; otherwise, returns the pivot table theme. */ rowSubheading1Style(value?: GC.Spread.Pivot.PivotTableStyle): any; /** * @description get or set the rowSubheading2Style of pivot table theme * @param {GC.Spread.Pivot.PivotTableStyle} [value] The default style of the subheading row 2 area. * @returns {GC.Spread.Pivot.PivotTableStyle | GC.Spread.Pivot.PivotTableTheme} If no value is set, returns the default style of the data area; otherwise, returns the pivot table theme. */ rowSubheading2Style(value?: GC.Spread.Pivot.PivotTableStyle): any; /** * @description get or set the rowSubheading3Style of pivot table theme * @param {GC.Spread.Pivot.PivotTableStyle} [value] The default style of the subheading row 3 area. * @returns {GC.Spread.Pivot.PivotTableStyle | GC.Spread.Pivot.PivotTableTheme} If no value is set, returns the default style of the data area; otherwise, returns the pivot table theme. */ rowSubheading3Style(value?: GC.Spread.Pivot.PivotTableStyle): any; /** * @description get or set the secondColumnStripeStyle of pivot table theme * @param {GC.Spread.Pivot.PivotTableStyle} [value] The second alternating column style. * @returns {GC.Spread.Pivot.PivotTableStyle | GC.Spread.Pivot.PivotTableTheme} If no value is set, returns the default style of the data area; otherwise, returns the pivot table theme. */ secondColumnStripeStyle(value?: GC.Spread.Pivot.PivotTableStyle): any; /** * @description get or set the secondColumnStripSize of pivot table theme * @param {number} [value] The size of the second alternating column. * @returns {number | GC.Spread.Pivot.PivotTableTheme} If no value is set, returns the size of the second alternating column; otherwise, returns the pivot table theme. */ secondColumnStripSize(value?: number): any; /** * @description get or set the secondRowStripeStyle of pivot table theme * @param {GC.Spread.Pivot.PivotTableStyle} [value] The second alternating row style. * @returns {GC.Spread.Pivot.PivotTableStyle | GC.Spread.Pivot.PivotTableTheme} If no value is set, returns the default style of the data area; otherwise, returns the pivot table theme. */ secondRowStripeStyle(value?: GC.Spread.Pivot.PivotTableStyle): any; /** * @description get or set the secondRowStripSize of pivot table theme * @param {number} [value] The size of the second alternating row. * @returns {number | GC.Spread.Pivot.PivotTableTheme} If no value is set, returns the size of the second alternating row; otherwise, returns the pivot table theme. */ secondRowStripSize(value?: number): any; /** * @description get or set the subtotalColumn1Style of pivot table theme * @param {GC.Spread.Pivot.PivotTableStyle} [value] The default style of the subtotal column 1 area. * @returns {GC.Spread.Pivot.PivotTableStyle | GC.Spread.Pivot.PivotTableTheme} If no value is set, returns the default style of the data area; otherwise, returns the pivot table theme. */ subtotalColumn1Style(value?: GC.Spread.Pivot.PivotTableStyle): any; /** * @description get or set the subtotalColumn2Style of pivot table theme * @param {GC.Spread.Pivot.PivotTableStyle} [value] The default style of the subtotal column 2 area. * @returns {GC.Spread.Pivot.PivotTableStyle | GC.Spread.Pivot.PivotTableTheme} If no value is set, returns the default style of the data area; otherwise, returns the pivot table theme. */ subtotalColumn2Style(value?: GC.Spread.Pivot.PivotTableStyle): any; /** * @description get or set the subtotalColumn3Style of pivot table theme * @param {GC.Spread.Pivot.PivotTableStyle} [value] The default style of the subtotal column 3 area. * @returns {GC.Spread.Pivot.PivotTableStyle | GC.Spread.Pivot.PivotTableTheme} If no value is set, returns the default style of the data area; otherwise, returns the pivot table theme. */ subtotalColumn3Style(value?: GC.Spread.Pivot.PivotTableStyle): any; /** * @description get or set the subtotalRow1Style of pivot table theme * @param {GC.Spread.Pivot.PivotTableStyle} [value] The default style of the subtotal row 1 area. * @returns {GC.Spread.Pivot.PivotTableStyle | GC.Spread.Pivot.PivotTableTheme} If no value is set, returns the default style of the data area; otherwise, returns the pivot table theme. */ subtotalRow1Style(value?: GC.Spread.Pivot.PivotTableStyle): any; /** * @description get or set the subtotalRow2Style of pivot table theme * @param {GC.Spread.Pivot.PivotTableStyle} [value] The default style of the subtotal row 2 area. * @returns {GC.Spread.Pivot.PivotTableStyle | GC.Spread.Pivot.PivotTableTheme} If no value is set, returns the default style of the data area; otherwise, returns the pivot table theme. */ subtotalRow2Style(value?: GC.Spread.Pivot.PivotTableStyle): any; /** * @description get or set the subtotalRow3Style of pivot table theme * @param {GC.Spread.Pivot.PivotTableStyle} [value] The default style of the subtotal row 3 area. * @returns {GC.Spread.Pivot.PivotTableStyle | GC.Spread.Pivot.PivotTableTheme} If no value is set, returns the default style of the data area; otherwise, returns the pivot table theme. */ subtotalRow3Style(value?: GC.Spread.Pivot.PivotTableStyle): any; /** * Saves the object state to a JSON string. * @returns {Object} The pivot table theme data. * @example * ```javascript * //This example uses the toJSON method. * const light1 = GC.Spread.Pivot.PivotTableThemes.light1; * //export * const jsonStr = JSON.stringify(light1.toJSON()); * //import * const newTheme = new GC.Spread.Pivot.PivotTableTheme(); * newTheme.fromJSON(JSON.parse(jsonStr)); * newTheme.name('custom1'); * alert(jsonStr); * ``` */ toJSON(): Object; /** * @description get or set the wholeTableStyle of pivot table theme * @param {GC.Spread.Pivot.PivotTableStyle} [value] The default style of he data area. * @returns {GC.Spread.Pivot.PivotTableStyle | GC.Spread.Pivot.PivotTableTheme} If no value is set, returns the default style of the data area; otherwise, returns the pivot table theme. */ wholeTableStyle(value?: GC.Spread.Pivot.PivotTableStyle): any; } export class PivotTableThemes{ /** * Represents a built-in Pivot table theme collection. * @class */ constructor(); /** * Gets the dark1 style. * @returns {GC.Spread.Pivot.PivotTableTheme} */ static dark1: GC.Spread.Pivot.PivotTableTheme; /** * Gets the dark10 style. * @returns {GC.Spread.Pivot.PivotTableTheme} */ static dark10: GC.Spread.Pivot.PivotTableTheme; /** * Gets the dark11 style. * @returns {GC.Spread.Pivot.PivotTableTheme} */ static dark11: GC.Spread.Pivot.PivotTableTheme; /** * Gets the dark12 style. * @returns {GC.Spread.Pivot.PivotTableTheme} */ static dark12: GC.Spread.Pivot.PivotTableTheme; /** * Gets the dark13 style. * @returns {GC.Spread.Pivot.PivotTableTheme} */ static dark13: GC.Spread.Pivot.PivotTableTheme; /** * Gets the dark14 style. * @returns {GC.Spread.Pivot.PivotTableTheme} */ static dark14: GC.Spread.Pivot.PivotTableTheme; /** * Gets the dark15 style. * @returns {GC.Spread.Pivot.PivotTableTheme} */ static dark15: GC.Spread.Pivot.PivotTableTheme; /** * Gets the dark16 style. * @returns {GC.Spread.Pivot.PivotTableTheme} */ static dark16: GC.Spread.Pivot.PivotTableTheme; /** * Gets the dark17 style. * @returns {GC.Spread.Pivot.PivotTableTheme} */ static dark17: GC.Spread.Pivot.PivotTableTheme; /** * Gets the dark18 style. * @returns {GC.Spread.Pivot.PivotTableTheme} */ static dark18: GC.Spread.Pivot.PivotTableTheme; /** * Gets the dark19 style. * @returns {GC.Spread.Pivot.PivotTableTheme} */ static dark19: GC.Spread.Pivot.PivotTableTheme; /** * Gets the dark2 style. * @returns {GC.Spread.Pivot.PivotTableTheme} */ static dark2: GC.Spread.Pivot.PivotTableTheme; /** * Gets the dark20 style. * @returns {GC.Spread.Pivot.PivotTableTheme} */ static dark20: GC.Spread.Pivot.PivotTableTheme; /** * Gets the dark21 style. * @returns {GC.Spread.Pivot.PivotTableTheme} */ static dark21: GC.Spread.Pivot.PivotTableTheme; /** * Gets the dark22 style. * @returns {GC.Spread.Pivot.PivotTableTheme} */ static dark22: GC.Spread.Pivot.PivotTableTheme; /** * Gets the dark23 style. * @returns {GC.Spread.Pivot.PivotTableTheme} */ static dark23: GC.Spread.Pivot.PivotTableTheme; /** * Gets the dark24 style. * @returns {GC.Spread.Pivot.PivotTableTheme} */ static dark24: GC.Spread.Pivot.PivotTableTheme; /** * Gets the dark25 style. * @returns {GC.Spread.Pivot.PivotTableTheme} */ static dark25: GC.Spread.Pivot.PivotTableTheme; /** * Gets the dark26 style. * @returns {GC.Spread.Pivot.PivotTableTheme} */ static dark26: GC.Spread.Pivot.PivotTableTheme; /** * Gets the dark27 style. * @returns {GC.Spread.Pivot.PivotTableTheme} */ static dark27: GC.Spread.Pivot.PivotTableTheme; /** * Gets the dark28 style. * @returns {GC.Spread.Pivot.PivotTableTheme} */ static dark28: GC.Spread.Pivot.PivotTableTheme; /** * Gets the dark3 style. * @returns {GC.Spread.Pivot.PivotTableTheme} */ static dark3: GC.Spread.Pivot.PivotTableTheme; /** * Gets the dark4 style. * @returns {GC.Spread.Pivot.PivotTableTheme} */ static dark4: GC.Spread.Pivot.PivotTableTheme; /** * Gets the dark5 style. * @returns {GC.Spread.Pivot.PivotTableTheme} */ static dark5: GC.Spread.Pivot.PivotTableTheme; /** * Gets the dark6 style. * @returns {GC.Spread.Pivot.PivotTableTheme} */ static dark6: GC.Spread.Pivot.PivotTableTheme; /** * Gets the dark7 style. * @returns {GC.Spread.Pivot.PivotTableTheme} */ static dark7: GC.Spread.Pivot.PivotTableTheme; /** * Gets the dark8 style. * @returns {GC.Spread.Pivot.PivotTableTheme} */ static dark8: GC.Spread.Pivot.PivotTableTheme; /** * Gets the dark9 style. * @returns {GC.Spread.Pivot.PivotTableTheme} */ static dark9: GC.Spread.Pivot.PivotTableTheme; /** * Gets the light0 style. * @returns {GC.Spread.Pivot.PivotTableTheme} */ static light0: GC.Spread.Pivot.PivotTableTheme; /** * Gets the light1 style. * @returns {GC.Spread.Pivot.PivotTableTheme} */ static light1: GC.Spread.Pivot.PivotTableTheme; /** * Gets the light10 style. * @returns {GC.Spread.Pivot.PivotTableTheme} */ static light10: GC.Spread.Pivot.PivotTableTheme; /** * Gets the light11 style. * @returns {GC.Spread.Pivot.PivotTableTheme} */ static light11: GC.Spread.Pivot.PivotTableTheme; /** * Gets the light12 style. * @returns {GC.Spread.Pivot.PivotTableTheme} */ static light12: GC.Spread.Pivot.PivotTableTheme; /** * Gets the light13 style. * @returns {GC.Spread.Pivot.PivotTableTheme} */ static light13: GC.Spread.Pivot.PivotTableTheme; /** * Gets the light14 style. * @returns {GC.Spread.Pivot.PivotTableTheme} */ static light14: GC.Spread.Pivot.PivotTableTheme; /** * Gets the light15 style. * @returns {GC.Spread.Pivot.PivotTableTheme} */ static light15: GC.Spread.Pivot.PivotTableTheme; /** * Gets the light16 style. * @returns {GC.Spread.Pivot.PivotTableTheme} */ static light16: GC.Spread.Pivot.PivotTableTheme; /** * Gets the light17 style. * @returns {GC.Spread.Pivot.PivotTableTheme} */ static light17: GC.Spread.Pivot.PivotTableTheme; /** * Gets the light18 style. * @returns {GC.Spread.Pivot.PivotTableTheme} */ static light18: GC.Spread.Pivot.PivotTableTheme; /** * Gets the light19 style. * @returns {GC.Spread.Pivot.PivotTableTheme} */ static light19: GC.Spread.Pivot.PivotTableTheme; /** * Gets the light2 style. * @returns {GC.Spread.Pivot.PivotTableTheme} */ static light2: GC.Spread.Pivot.PivotTableTheme; /** * Gets the light20 style. * @returns {GC.Spread.Pivot.PivotTableTheme} */ static light20: GC.Spread.Pivot.PivotTableTheme; /** * Gets the light21 style. * @returns {GC.Spread.Pivot.PivotTableTheme} */ static light21: GC.Spread.Pivot.PivotTableTheme; /** * Gets the light22 style. * @returns {GC.Spread.Pivot.PivotTableTheme} */ static light22: GC.Spread.Pivot.PivotTableTheme; /** * Gets the light23 style. * @returns {GC.Spread.Pivot.PivotTableTheme} */ static light23: GC.Spread.Pivot.PivotTableTheme; /** * Gets the light24 style. * @returns {GC.Spread.Pivot.PivotTableTheme} */ static light24: GC.Spread.Pivot.PivotTableTheme; /** * Gets the light25 style. * @returns {GC.Spread.Pivot.PivotTableTheme} */ static light25: GC.Spread.Pivot.PivotTableTheme; /** * Gets the light26 style. * @returns {GC.Spread.Pivot.PivotTableTheme} */ static light26: GC.Spread.Pivot.PivotTableTheme; /** * Gets the light27 style. * @returns {GC.Spread.Pivot.PivotTableTheme} */ static light27: GC.Spread.Pivot.PivotTableTheme; /** * Gets the light28 style. * @returns {GC.Spread.Pivot.PivotTableTheme} */ static light28: GC.Spread.Pivot.PivotTableTheme; /** * Gets the light3 style. * @returns {GC.Spread.Pivot.PivotTableTheme} */ static light3: GC.Spread.Pivot.PivotTableTheme; /** * Gets the light4 style. * @returns {GC.Spread.Pivot.PivotTableTheme} */ static light4: GC.Spread.Pivot.PivotTableTheme; /** * Gets the light5 style. * @returns {GC.Spread.Pivot.PivotTableTheme} */ static light5: GC.Spread.Pivot.PivotTableTheme; /** * Gets the light6 style. * @returns {GC.Spread.Pivot.PivotTableTheme} */ static light6: GC.Spread.Pivot.PivotTableTheme; /** * Gets the light7 style. * @returns {GC.Spread.Pivot.PivotTableTheme} */ static light7: GC.Spread.Pivot.PivotTableTheme; /** * Gets the light8 style. * @returns {GC.Spread.Pivot.PivotTableTheme} */ static light8: GC.Spread.Pivot.PivotTableTheme; /** * Gets the light9 style. * @returns {GC.Spread.Pivot.PivotTableTheme} */ static light9: GC.Spread.Pivot.PivotTableTheme; /** * Gets the medium1 style. * @returns {GC.Spread.Pivot.PivotTableTheme} */ static medium1: GC.Spread.Pivot.PivotTableTheme; /** * Gets the medium10 style. * @returns {GC.Spread.Pivot.PivotTableTheme} */ static medium10: GC.Spread.Pivot.PivotTableTheme; /** * Gets the medium11 style. * @returns {GC.Spread.Pivot.PivotTableTheme} */ static medium11: GC.Spread.Pivot.PivotTableTheme; /** * Gets the medium12 style. * @returns {GC.Spread.Pivot.PivotTableTheme} */ static medium12: GC.Spread.Pivot.PivotTableTheme; /** * Gets the medium13 style. * @returns {GC.Spread.Pivot.PivotTableTheme} */ static medium13: GC.Spread.Pivot.PivotTableTheme; /** * Gets the medium14 style. * @returns {GC.Spread.Pivot.PivotTableTheme} */ static medium14: GC.Spread.Pivot.PivotTableTheme; /** * Gets the medium15 style. * @returns {GC.Spread.Pivot.PivotTableTheme} */ static medium15: GC.Spread.Pivot.PivotTableTheme; /** * Gets the medium16 style. * @returns {GC.Spread.Pivot.PivotTableTheme} */ static medium16: GC.Spread.Pivot.PivotTableTheme; /** * Gets the medium17 style. * @returns {GC.Spread.Pivot.PivotTableTheme} */ static medium17: GC.Spread.Pivot.PivotTableTheme; /** * Gets the medium18 style. * @returns {GC.Spread.Pivot.PivotTableTheme} */ static medium18: GC.Spread.Pivot.PivotTableTheme; /** * Gets the medium19 style. * @returns {GC.Spread.Pivot.PivotTableTheme} */ static medium19: GC.Spread.Pivot.PivotTableTheme; /** * Gets the medium2 style. * @returns {GC.Spread.Pivot.PivotTableTheme} */ static medium2: GC.Spread.Pivot.PivotTableTheme; /** * Gets the medium20 style. * @returns {GC.Spread.Pivot.PivotTableTheme} */ static medium20: GC.Spread.Pivot.PivotTableTheme; /** * Gets the medium21 style. * @returns {GC.Spread.Pivot.PivotTableTheme} */ static medium21: GC.Spread.Pivot.PivotTableTheme; /** * Gets the medium22 style. * @returns {GC.Spread.Pivot.PivotTableTheme} */ static medium22: GC.Spread.Pivot.PivotTableTheme; /** * Gets the medium23 style. * @returns {GC.Spread.Pivot.PivotTableTheme} */ static medium23: GC.Spread.Pivot.PivotTableTheme; /** * Gets the medium24 style. * @returns {GC.Spread.Pivot.PivotTableTheme} */ static medium24: GC.Spread.Pivot.PivotTableTheme; /** * Gets the medium25 style. * @returns {GC.Spread.Pivot.PivotTableTheme} */ static medium25: GC.Spread.Pivot.PivotTableTheme; /** * Gets the medium26 style. * @returns {GC.Spread.Pivot.PivotTableTheme} */ static medium26: GC.Spread.Pivot.PivotTableTheme; /** * Gets the medium27 style. * @returns {GC.Spread.Pivot.PivotTableTheme} */ static medium27: GC.Spread.Pivot.PivotTableTheme; /** * Gets the medium28 style. * @returns {GC.Spread.Pivot.PivotTableTheme} */ static medium28: GC.Spread.Pivot.PivotTableTheme; /** * Gets the medium3 style. * @returns {GC.Spread.Pivot.PivotTableTheme} */ static medium3: GC.Spread.Pivot.PivotTableTheme; /** * Gets the medium4 style. * @returns {GC.Spread.Pivot.PivotTableTheme} */ static medium4: GC.Spread.Pivot.PivotTableTheme; /** * Gets the medium5 style. * @returns {GC.Spread.Pivot.PivotTableTheme} */ static medium5: GC.Spread.Pivot.PivotTableTheme; /** * Gets the medium6 style. * @returns {GC.Spread.Pivot.PivotTableTheme} */ static medium6: GC.Spread.Pivot.PivotTableTheme; /** * Gets the medium7 style. * @returns {GC.Spread.Pivot.PivotTableTheme} */ static medium7: GC.Spread.Pivot.PivotTableTheme; /** * Gets the medium8 style. * @returns {GC.Spread.Pivot.PivotTableTheme} */ static medium8: GC.Spread.Pivot.PivotTableTheme; /** * Gets the medium9 style. * @returns {GC.Spread.Pivot.PivotTableTheme} */ static medium9: GC.Spread.Pivot.PivotTableTheme; } export class PivotTableTimelineSlicer{ /** * Represents a pivot timeline slicer. * @class GC.Spread.Pivot.PivotTableTimelineSlicer */ constructor(); /** * Gets or sets the allowMove of the slicer. * @param {boolean} [value] The allowMove of the slicer. The allowMove property of a timeline slicer specifies whether users are permitted to move the timeline, enabling or disabling the repositioning functionality. * @returns {boolean | GC.Spread.Pivot.PivotTableTimelineSlicer} If no value is set, returns the allowMove of the slicer; otherwise, returns the slicer. * @example * ```javascript * var spread = new GC.Spread.Sheets.Workbook('ss'); * var activeSheet = spread.getActiveSheet(); * var dataSource = [ * { Name: "Bob", City: "NewYork", Birthday: new Date("1968/6/8") }, * { Name: "Betty", City: "NewYork", Birthday: new Date("1972/7/3") }, * { Name: "Alice", City: "Washington", Birthday: new Date("2012/2/15") }, * ]; * var table = activeSheet.tables.addFromDataSource("table1", 1, 1, dataSource); * var pivotTable = activeSheet.pivotTables.add("pivotTable1", "table1", 6, 1); * var timeline = activeSheet.slicers.add("timeline", "pivotTable1", "Birthday", GC.Spread.Sheets.Slicers.TimelineStyles.dark1(), GC.Spread.Sheets.Slicers.SlicerType.pivotTimeline); * var oldValue = slicer.allowMove(); * console.log(oldValue); * slicer.allowMove(false); * var newValue = slicer.allowMove(); * console.log(newValue); * ``` */ allowMove(value?: boolean): any; /** * Gets or sets the allowResize of the slicer. * @param {boolean} [value] The allowResize of the slicer. The allowResize property of a timeline slicer specifies whether users are permitted to adjust the size of the timeline, enabling or disabling the resizing functionality. * @returns {boolean | GC.Spread.Pivot.PivotTableTimelineSlicer} If no value is set, returns the allowResize of the slicer; otherwise, returns the slicer. * @example * ```javascript * var spread = new GC.Spread.Sheets.Workbook('ss'); * var activeSheet = spread.getActiveSheet(); * var dataSource = [ * { Name: "Bob", City: "NewYork", Birthday: new Date("1968/6/8") }, * { Name: "Betty", City: "NewYork", Birthday: new Date("1972/7/3") }, * { Name: "Alice", City: "Washington", Birthday: new Date("2012/2/15") }, * ]; * var table = activeSheet.tables.addFromDataSource("table1", 1, 1, dataSource); * var pivotTable = activeSheet.pivotTables.add("pivotTable1", "table1", 6, 1); * var timeline = activeSheet.slicers.add("timeline", "pivotTable1", "Birthday", GC.Spread.Sheets.Slicers.TimelineStyles.dark1(), GC.Spread.Sheets.Slicers.SlicerType.pivotTimeline); * var oldValue = slicer.allowResize(); * console.log(oldValue); * slicer.allowResize(false); * var newValue = slicer.allowResize(); * console.log(newValue); * ``` */ allowResize(value?: boolean): any; /** * Gets or sets the captionName of the slicer. * @param {string} [value] The captionName of the slicer. captionName property is displayed in the header of the timeline slicer. * @returns {string | GC.Spread.Pivot.PivotTableTimelineSlicer} If no value is set, returns the captionName of the slicer; otherwise, returns the slicer. * @example * ```javascript * var spread = new GC.Spread.Sheets.Workbook('ss'); * var activeSheet = spread.getActiveSheet(); * var dataSource = [ * { Name: "Bob", City: "NewYork", Birthday: new Date("1968/6/8") }, * { Name: "Betty", City: "NewYork", Birthday: new Date("1972/7/3") }, * { Name: "Alice", City: "Washington", Birthday: new Date("2012/2/15") }, * ]; * var table = activeSheet.tables.addFromDataSource("table1", 1, 1, dataSource); * var pivotTable = activeSheet.pivotTables.add("pivotTable1", "table1", 6, 1); * var timeline = activeSheet.slicers.add("timeline", "pivotTable1", "Birthday", GC.Spread.Sheets.Slicers.TimelineStyles.dark1(), GC.Spread.Sheets.Slicers.SlicerType.pivotTimeline); * var oldValue = slicer.captionName(); * console.log(oldValue); * slicer.captionName('timeline_caption'); * var newValue = slicer.captionName(); * console.log(newValue); * ``` */ captionName(value?: string): any; /** * Connect pivot table with the slicer * @param {string} ptName name of pivot table * @example * ```javascript * var spread = new GC.Spread.Sheets.Workbook('ss'); * var activeSheet = spread.getActiveSheet(); * var dataSource = [ * { Name: "Bob", City: "NewYork", Birthday: new Date("1968/6/8") }, * { Name: "Betty", City: "NewYork", Birthday: new Date("1972/7/3") }, * { Name: "Alice", City: "Washington", Birthday: new Date("2012/2/15") }, * ]; * var table = activeSheet.tables.addFromDataSource("table1", 1, 1, dataSource); * var pivotTable = activeSheet.pivotTables.add("pivotTable1", "table1", 6, 1); * var timeline = activeSheet.slicers.add("timeline", "pivotTable1", "Birthday", GC.Spread.Sheets.Slicers.TimelineStyles.dark1(), GC.Spread.Sheets.Slicers.SlicerType.pivotTimeline); * * timeline.connectPivotTable('pivotTable1'); * timeline.isConnectedPivotTable('pivotTable1'); * timeline.disconnectPivotTable('pivotTable1'); * timeline.isConnectedPivotTable('pivotTable1'); * ``` */ connectPivotTable(ptName: string): void; /** * Gets or sets the disableResizingAndMoving of the slicer. * @param {boolean} [value] The disableResizingAndMoving of the slicer. The disableResizingAndMoving property of a timeline slicer specifies whether the user is allowed to resize or move the timeline slicer, restricting any changes to its size or position. * @returns {boolean | GC.Spread.Pivot.PivotTableTimelineSlicer} If no value is set, returns the disableResizingAndMoving of the slicer; otherwise, returns the slicer. * @example * ```javascript * var spread = new GC.Spread.Sheets.Workbook('ss'); * var activeSheet = spread.getActiveSheet(); * var dataSource = [ * { Name: "Bob", City: "NewYork", Birthday: new Date("1968/6/8") }, * { Name: "Betty", City: "NewYork", Birthday: new Date("1972/7/3") }, * { Name: "Alice", City: "Washington", Birthday: new Date("2012/2/15") }, * ]; * var table = activeSheet.tables.addFromDataSource("table1", 1, 1, dataSource); * var pivotTable = activeSheet.pivotTables.add("pivotTable1", "table1", 6, 1); * var timeline = activeSheet.slicers.add("timeline", "pivotTable1", "Birthday", GC.Spread.Sheets.Slicers.TimelineStyles.dark1(), GC.Spread.Sheets.Slicers.SlicerType.pivotTimeline); * var oldValue = slicer.disableResizingAndMoving(); * console.log(oldValue); * slicer.disableResizingAndMoving(false); * var newValue = slicer.disableResizingAndMoving(); * console.log(newValue); * ``` */ disableResizingAndMoving(value?: boolean): any; /** * Disconnect pivot table with the slicer * @param {string} ptName name of pivot table * @example * ```javascript * var spread = new GC.Spread.Sheets.Workbook('ss'); * var activeSheet = spread.getActiveSheet(); * var dataSource = [ * { Name: "Bob", City: "NewYork", Birthday: new Date("1968/6/8") }, * { Name: "Betty", City: "NewYork", Birthday: new Date("1972/7/3") }, * { Name: "Alice", City: "Washington", Birthday: new Date("2012/2/15") }, * ]; * var table = activeSheet.tables.addFromDataSource("table1", 1, 1, dataSource); * var pivotTable = activeSheet.pivotTables.add("pivotTable1", "table1", 6, 1); * var timeline = activeSheet.slicers.add("timeline", "pivotTable1", "Birthday", GC.Spread.Sheets.Slicers.TimelineStyles.dark1(), GC.Spread.Sheets.Slicers.SlicerType.pivotTimeline); * * timeline.connectPivotTable('pivotTable1'); * timeline.isConnectedPivotTable('pivotTable1'); * timeline.disconnectPivotTable('pivotTable1'); * timeline.isConnectedPivotTable('pivotTable1'); * ``` */ disconnectPivotTable(ptName: string): void; /** * Gets or sets the dynamicMove of the slicer. * @param {boolean} [value] The dynamicMove of the slicer. The dynamicMove property of a timeline slicer specifies whether the timeline slicer is configured to dynamically adjust its position or size based on changes in the associated data or PivotTable layout. * @returns {boolean | GC.Spread.Pivot.PivotTableTimelineSlicer} If no value is set, returns the dynamicMove of the slicer; otherwise, returns the slicer. * @example * ```javascript * var spread = new GC.Spread.Sheets.Workbook('ss'); * var activeSheet = spread.getActiveSheet(); * var dataSource = [ * { Name: "Bob", City: "NewYork", Birthday: new Date("1968/6/8") }, * { Name: "Betty", City: "NewYork", Birthday: new Date("1972/7/3") }, * { Name: "Alice", City: "Washington", Birthday: new Date("2012/2/15") }, * ]; * var table = activeSheet.tables.addFromDataSource("table1", 1, 1, dataSource); * var pivotTable = activeSheet.pivotTables.add("pivotTable1", "table1", 6, 1); * var timeline = activeSheet.slicers.add("timeline", "pivotTable1", "Birthday", GC.Spread.Sheets.Slicers.TimelineStyles.dark1(), GC.Spread.Sheets.Slicers.SlicerType.pivotTimeline); * var oldValue = slicer.dynamicMove(); * console.log(oldValue); * slicer.dynamicMove(false); * var newValue = slicer.dynamicMove(); * console.log(newValue); * ``` */ dynamicMove(value?: boolean): any; /** * Gets or sets the dynamicSize of the slicer. * @param {boolean} [value] The dynamicSize of the slicer. The dynamicSize property of a timeline slicer specifies whether the timeline is configured to dynamically adjust its size based on changes in the associated data or PivotTable layout. * @returns {boolean | GC.Spread.Pivot.PivotTableTimelineSlicer} If no value is set, returns the dynamicSize of the slicer; otherwise, returns the slicer. * @example * ```javascript * var spread = new GC.Spread.Sheets.Workbook('ss'); * var activeSheet = spread.getActiveSheet(); * var dataSource = [ * { Name: "Bob", City: "NewYork", Birthday: new Date("1968/6/8") }, * { Name: "Betty", City: "NewYork", Birthday: new Date("1972/7/3") }, * { Name: "Alice", City: "Washington", Birthday: new Date("2012/2/15") }, * ]; * var table = activeSheet.tables.addFromDataSource("table1", 1, 1, dataSource); * var pivotTable = activeSheet.pivotTables.add("pivotTable1", "table1", 6, 1); * var timeline = activeSheet.slicers.add("timeline", "pivotTable1", "Birthday", GC.Spread.Sheets.Slicers.TimelineStyles.dark1(), GC.Spread.Sheets.Slicers.SlicerType.pivotTimeline); * var oldValue = slicer.dynamicSize(); * console.log(oldValue); * slicer.dynamicSize(false); * var newValue = slicer.dynamicSize(); * console.log(newValue); * ``` */ dynamicSize(value?: boolean): any; /** * Gets or sets the endColumn of the slicer. * @param {number} [value] The endColumn of the slicer. The endColumn property of a timeline slicer specifies the ending column index or position within the worksheet where the timeline concludes or is bounded. * @returns {number | GC.Spread.Pivot.PivotTableTimelineSlicer} If no value is set, returns the endColumn of the slicer; otherwise, returns the slicer. * @example * ```javascript * var spread = new GC.Spread.Sheets.Workbook('ss'); * var activeSheet = spread.getActiveSheet(); * var dataSource = [ * { Name: "Bob", City: "NewYork", Birthday: new Date("1968/6/8") }, * { Name: "Betty", City: "NewYork", Birthday: new Date("1972/7/3") }, * { Name: "Alice", City: "Washington", Birthday: new Date("2012/2/15") }, * ]; * var table = activeSheet.tables.addFromDataSource("table1", 1, 1, dataSource); * var pivotTable = activeSheet.pivotTables.add("pivotTable1", "table1", 6, 1); * var timeline = activeSheet.slicers.add("timeline", "pivotTable1", "Birthday", GC.Spread.Sheets.Slicers.TimelineStyles.dark1(), GC.Spread.Sheets.Slicers.SlicerType.pivotTimeline); * var oldValue = slicer.endColumn(); * console.log(oldValue); * slicer.endColumn(9); * var newValue = slicer.endColumn(); * console.log(newValue); * ``` */ endColumn(value?: number): any; /** * Gets or sets the endColumnOffset of the slicer. * @param {number} [value] The endColumnOffset of the slicer. The endColumnOffset property of a timeline slicer specifies the horizontal offset or distance from the ending column index where the timeline concludes its placement within the worksheet. * @returns {number | GC.Spread.Pivot.PivotTableTimelineSlicer} If no value is set, returns the endColumnOffset of the slicer; otherwise, returns the slicer. * @example * ```javascript * var spread = new GC.Spread.Sheets.Workbook('ss'); * var activeSheet = spread.getActiveSheet(); * var dataSource = [ * { Name: "Bob", City: "NewYork", Birthday: new Date("1968/6/8") }, * { Name: "Betty", City: "NewYork", Birthday: new Date("1972/7/3") }, * { Name: "Alice", City: "Washington", Birthday: new Date("2012/2/15") }, * ]; * var table = activeSheet.tables.addFromDataSource("table1", 1, 1, dataSource); * var pivotTable = activeSheet.pivotTables.add("pivotTable1", "table1", 6, 1); * var timeline = activeSheet.slicers.add("timeline", "pivotTable1", "Birthday", GC.Spread.Sheets.Slicers.TimelineStyles.dark1(), GC.Spread.Sheets.Slicers.SlicerType.pivotTimeline); * var oldValue = slicer.endColumnOffset(); * console.log(oldValue); * slicer.endColumnOffset(10); * var newValue = slicer.endColumnOffset(); * console.log(newValue); * ``` */ endColumnOffset(value?: number): any; /** * Gets or sets the endRow of the slicer. * @param {number} [value] The endRow of the slicer. The endRow property of a timeline slicer specifies the ending row index or position within the worksheet where the timeline concludes or is bounded. * @returns {number | GC.Spread.Pivot.PivotTableTimelineSlicer} If no value is set, returns the endRow of the slicer; otherwise, returns the slicer. * @example * ```javascript * var spread = new GC.Spread.Sheets.Workbook('ss'); * var activeSheet = spread.getActiveSheet(); * var dataSource = [ * { Name: "Bob", City: "NewYork", Birthday: new Date("1968/6/8") }, * { Name: "Betty", City: "NewYork", Birthday: new Date("1972/7/3") }, * { Name: "Alice", City: "Washington", Birthday: new Date("2012/2/15") }, * ]; * var table = activeSheet.tables.addFromDataSource("table1", 1, 1, dataSource); * var pivotTable = activeSheet.pivotTables.add("pivotTable1", "table1", 6, 1); * var timeline = activeSheet.slicers.add("timeline", "pivotTable1", "Birthday", GC.Spread.Sheets.Slicers.TimelineStyles.dark1(), GC.Spread.Sheets.Slicers.SlicerType.pivotTimeline); * var oldValue = slicer.endRow(); * console.log(oldValue); * slicer.endRow(7); * var newValue = slicer.endRow(); * console.log(newValue); * ``` */ endRow(value?: number): any; /** * Gets or sets the endRowOffset of the slicer. * @param {number} [value] The endRowOffset of the slicer. The endRowOffset property of a timeline slicer specifies the vertical offset or distance from the ending row index where the timeline concludes its placement within the worksheet. * @returns {number | GC.Spread.Pivot.PivotTableTimelineSlicer} If no value is set, returns the endRowOffset of the slicer; otherwise, returns the slicer. * @example * ```javascript * var spread = new GC.Spread.Sheets.Workbook('ss'); * var activeSheet = spread.getActiveSheet(); * var dataSource = [ * { Name: "Bob", City: "NewYork", Birthday: new Date("1968/6/8") }, * { Name: "Betty", City: "NewYork", Birthday: new Date("1972/7/3") }, * { Name: "Alice", City: "Washington", Birthday: new Date("2012/2/15") }, * ]; * var table = activeSheet.tables.addFromDataSource("table1", 1, 1, dataSource); * var pivotTable = activeSheet.pivotTables.add("pivotTable1", "table1", 6, 1); * var timeline = activeSheet.slicers.add("timeline", "pivotTable1", "Birthday", GC.Spread.Sheets.Slicers.TimelineStyles.dark1(), GC.Spread.Sheets.Slicers.SlicerType.pivotTimeline); * var oldValue = slicer.endRowOffset(); * console.log(oldValue); * slicer.endRowOffset(5); * var newValue = slicer.endRowOffset(); * console.log(newValue); * ``` */ endRowOffset(value?: number): any; /** * get all connected PivotTables * @returns {GC.Spread.Pivot.PivotTable[]} PivotTables connected with the slicer. * @example * ```javascript * var spread = new GC.Spread.Sheets.Workbook('ss'); * var activeSheet = spread.getActiveSheet(); * var dataSource = [ * { Name: "Bob", City: "NewYork", Birthday: new Date("1968/6/8") }, * { Name: "Betty", City: "NewYork", Birthday: new Date("1972/7/3") }, * { Name: "Alice", City: "Washington", Birthday: new Date("2012/2/15") }, * ]; * var table = activeSheet.tables.addFromDataSource("table1", 1, 1, dataSource); * var pivotTable = activeSheet.pivotTables.add("pivotTable1", "table1", 6, 1); * var timeline = activeSheet.slicers.add("timeline", "pivotTable1", "Birthday", GC.Spread.Sheets.Slicers.TimelineStyles.dark1(), GC.Spread.Sheets.Slicers.SlicerType.pivotTimeline); * * timeline.connectPivotTable('pivotTable1'); * timeline.isConnectedPivotTable('pivotTable1'); * console.log(timeline.getAllPivotTables()); * timeline.disconnectPivotTable('pivotTable1'); * timeline.isConnectedPivotTable('pivotTable1'); * console.log(timeline.getAllPivotTables()); * ``` */ getAllConnectedPivotTables(): GC.Spread.Pivot.PivotTable[]; /** * get all PivotTables whether connected or not. * @returns {GC.Spread.Pivot.PivotTable[]} PivotTables whose source is same as the slicer. * @example * ```javascript * var spread = new GC.Spread.Sheets.Workbook('ss'); * var activeSheet = spread.getActiveSheet(); * var dataSource = [ * { Name: "Bob", City: "NewYork", Birthday: new Date("1968/6/8") }, * { Name: "Betty", City: "NewYork", Birthday: new Date("1972/7/3") }, * { Name: "Alice", City: "Washington", Birthday: new Date("2012/2/15") }, * ]; * var table = activeSheet.tables.addFromDataSource("table1", 1, 1, dataSource); * var pivotTable = activeSheet.pivotTables.add("pivotTable1", "table1", 6, 1); * var timeline = activeSheet.slicers.add("timeline", "pivotTable1", "Birthday", GC.Spread.Sheets.Slicers.TimelineStyles.dark1(), GC.Spread.Sheets.Slicers.SlicerType.pivotTimeline); * * timeline.connectPivotTable('pivotTable1'); * timeline.isConnectedPivotTable('pivotTable1'); * console.log(timeline.getAllPivotTables()); * timeline.disconnectPivotTable('pivotTable1'); * timeline.isConnectedPivotTable('pivotTable1'); * console.log(timeline.getAllPivotTables()); * ``` */ getAllPivotTables(): GC.Spread.Pivot.PivotTable[]; /** * get all connected PivotTables' name. * @returns {string[]} name list of PivotTables connected with the slicer. * @example * ```javascript * var spread = new GC.Spread.Sheets.Workbook('ss'); * var activeSheet = spread.getActiveSheet(); * var dataSource = [ * { Name: "Bob", City: "NewYork", Birthday: new Date("1968/6/8") }, * { Name: "Betty", City: "NewYork", Birthday: new Date("1972/7/3") }, * { Name: "Alice", City: "Washington", Birthday: new Date("2012/2/15") }, * ]; * var table = activeSheet.tables.addFromDataSource("table1", 1, 1, dataSource); * var pivotTable = activeSheet.pivotTables.add("pivotTable1", "table1", 6, 1); * var timeline = activeSheet.slicers.add("timeline", "pivotTable1", "Birthday", GC.Spread.Sheets.Slicers.TimelineStyles.dark1(), GC.Spread.Sheets.Slicers.SlicerType.pivotTimeline); * * timeline.connectPivotTable('pivotTable1'); * timeline.isConnectedPivotTable('pivotTable1'); * console.log(timeline.getAllPivotTables()); * timeline.disconnectPivotTable('pivotTable1'); * timeline.isConnectedPivotTable('pivotTable1'); * console.log(timeline.getAllPivotTables()); * ``` */ getConnectedPivotTableNameList(): string[]; /** * Gets or sets a style name for the pivot table timeline slicer. * @returns {string} returns the pivot table timeline slicer style name. */ getStyleName(): string | undefined; /** * Gets or sets the height of the slicer. * @param {number} [value] The height of the slicer. The height property of a timeline slicer specifies the vertical dimension or height of the timeline, determining its size along the y-axis. * @returns {number | GC.Spread.Pivot.PivotTableTimelineSlicer} If no value is set, returns the height of the slicer; otherwise, returns the slicer. * @example * ```javascript * var spread = new GC.Spread.Sheets.Workbook('ss'); * var activeSheet = spread.getActiveSheet(); * var dataSource = [ * { Name: "Bob", City: "NewYork", Birthday: new Date("1968/6/8") }, * { Name: "Betty", City: "NewYork", Birthday: new Date("1972/7/3") }, * { Name: "Alice", City: "Washington", Birthday: new Date("2012/2/15") }, * ]; * var table = activeSheet.tables.addFromDataSource("table1", 1, 1, dataSource); * var pivotTable = activeSheet.pivotTables.add("pivotTable1", "table1", 6, 1); * var timeline = activeSheet.slicers.add("timeline", "pivotTable1", "Birthday", GC.Spread.Sheets.Slicers.TimelineStyles.dark1(), GC.Spread.Sheets.Slicers.SlicerType.pivotTimeline); * var oldValue = slicer.height(); * console.log(oldValue); * slicer.height(120); * var newValue = slicer.height(); * console.log(newValue); * ``` */ height(value?: number): any; /** * Check whether pivot table connect with the slicer * @param {string} ptName name of pivot table * @returns {boolean} whether pivot table is connected with timeline slicer * @example * ```javascript * var spread = new GC.Spread.Sheets.Workbook('ss'); * var activeSheet = spread.getActiveSheet(); * var dataSource = [ * { Name: "Bob", City: "NewYork", Birthday: new Date("1968/6/8") }, * { Name: "Betty", City: "NewYork", Birthday: new Date("1972/7/3") }, * { Name: "Alice", City: "Washington", Birthday: new Date("2012/2/15") }, * ]; * var table = activeSheet.tables.addFromDataSource("table1", 1, 1, dataSource); * var pivotTable = activeSheet.pivotTables.add("pivotTable1", "table1", 6, 1); * var timeline = activeSheet.slicers.add("timeline", "pivotTable1", "Birthday", GC.Spread.Sheets.Slicers.TimelineStyles.dark1(), GC.Spread.Sheets.Slicers.SlicerType.pivotTimeline); * * timeline.connectPivotTable('pivotTable1'); * timeline.isConnectedPivotTable('pivotTable1'); * timeline.disconnectPivotTable('pivotTable1'); * timeline.isConnectedPivotTable('pivotTable1'); * ``` */ isConnectedPivotTable(ptName: string): boolean; /** * Gets or sets the isLocked of the slicer. * @param {boolean} [value] The isLocked of the slicer. The isLocked property of a timeline slicer specifies whether the timeline is currently locked or unlocked, indicating whether users can make changes to its settings or selections when Worksheet is protected. * @returns {boolean | GC.Spread.Pivot.PivotTableTimelineSlicer} If no value is set, returns the isLocked of the slicer; otherwise, returns the slicer. * @example * ```javascript * var spread = new GC.Spread.Sheets.Workbook('ss'); * var activeSheet = spread.getActiveSheet(); * var dataSource = [ * { Name: "Bob", City: "NewYork", Birthday: new Date("1968/6/8") }, * { Name: "Betty", City: "NewYork", Birthday: new Date("1972/7/3") }, * { Name: "Alice", City: "Washington", Birthday: new Date("2012/2/15") }, * ]; * var table = activeSheet.tables.addFromDataSource("table1", 1, 1, dataSource); * var pivotTable = activeSheet.pivotTables.add("pivotTable1", "table1", 6, 1); * var timeline = activeSheet.slicers.add("timeline", "pivotTable1", "Birthday", GC.Spread.Sheets.Slicers.TimelineStyles.dark1(), GC.Spread.Sheets.Slicers.SlicerType.pivotTimeline); * var oldValue = slicer.isLocked(); * console.log(oldValue); * slicer.isLocked(false); * var newValue = slicer.isLocked(); * console.log(newValue); * ``` */ isLocked(value?: boolean): any; /** * Gets or sets the isSelected of the slicer. * @param {boolean} [value] The isSelected of the slicer. The isSelected property of a timeline slicer specifies whether a particular time period within the timeline slicer is currently selected or highlighted. * @returns {boolean | GC.Spread.Pivot.PivotTableTimelineSlicer} If no value is set, returns the isSelected of the slicer; otherwise, returns the slicer. * @example * ```javascript * var spread = new GC.Spread.Sheets.Workbook('ss'); * var activeSheet = spread.getActiveSheet(); * var dataSource = [ * { Name: "Bob", City: "NewYork", Birthday: new Date("1968/6/8") }, * { Name: "Betty", City: "NewYork", Birthday: new Date("1972/7/3") }, * { Name: "Alice", City: "Washington", Birthday: new Date("2012/2/15") }, * ]; * var table = activeSheet.tables.addFromDataSource("table1", 1, 1, dataSource); * var pivotTable = activeSheet.pivotTables.add("pivotTable1", "table1", 6, 1); * var timeline = activeSheet.slicers.add("timeline", "pivotTable1", "Birthday", GC.Spread.Sheets.Slicers.TimelineStyles.dark1(), GC.Spread.Sheets.Slicers.SlicerType.pivotTimeline); * var oldValue = slicer.isSelected(); * console.log(oldValue); * slicer.isSelected(false); * var newValue = slicer.isSelected(); * console.log(newValue); * ``` */ isSelected(value?: boolean): any; /** * Gets or sets the isVisible of the slicer. * @param {boolean} [value] The isVisible of the slicer. The isVisible property of a timeline slicer specifies whether the timeline slicer is currently visible or hidden within the workbook. * @returns {boolean | GC.Spread.Pivot.PivotTableTimelineSlicer} If no value is set, returns the isVisible of the slicer; otherwise, returns the slicer. * @example * ```javascript * var spread = new GC.Spread.Sheets.Workbook('ss'); * var activeSheet = spread.getActiveSheet(); * var dataSource = [ * { Name: "Bob", City: "NewYork", Birthday: new Date("1968/6/8") }, * { Name: "Betty", City: "NewYork", Birthday: new Date("1972/7/3") }, * { Name: "Alice", City: "Washington", Birthday: new Date("2012/2/15") }, * ]; * var table = activeSheet.tables.addFromDataSource("table1", 1, 1, dataSource); * var pivotTable = activeSheet.pivotTables.add("pivotTable1", "table1", 6, 1); * var timeline = activeSheet.slicers.add("timeline", "pivotTable1", "Birthday", GC.Spread.Sheets.Slicers.TimelineStyles.dark1(), GC.Spread.Sheets.Slicers.SlicerType.pivotTimeline); * var oldValue = slicer.isVisible(); * console.log(oldValue); * slicer.isVisible(false); * var newValue = slicer.isVisible(); * console.log(newValue); * ``` */ isVisible(value?: boolean): any; /** * Gets or sets the level of the slicer. * @param {GC.Spread.Sheets.Slicers.TimelineLevel} [value] The level of the slicer. The level property of a timeline slicer specifies the temporal granularity or time unit (e.g., year, quarter, month) at which the timeline is currently operating, determining the level of detail for date-based filtering and selection. * @returns {GC.Spread.Sheets.Slicers.TimelineLevel | GC.Spread.Pivot.PivotTableTimelineSlicer} If no value is set, returns the level of the slicer; otherwise, returns the slicer. * @example * ```javascript * var spread = new GC.Spread.Sheets.Workbook('ss'); * var activeSheet = spread.getActiveSheet(); * var dataSource = [ * { Name: "Bob", City: "NewYork", Birthday: new Date("1968/6/8") }, * { Name: "Betty", City: "NewYork", Birthday: new Date("1972/7/3") }, * { Name: "Alice", City: "Washington", Birthday: new Date("2012/2/15") }, * ]; * var table = activeSheet.tables.addFromDataSource("table1", 1, 1, dataSource); * var pivotTable = activeSheet.pivotTables.add("pivotTable1", "table1", 6, 1); * var timeline = activeSheet.slicers.add("timeline", "pivotTable1", "Birthday", GC.Spread.Sheets.Slicers.TimelineStyles.dark1(), GC.Spread.Sheets.Slicers.SlicerType.pivotTimeline); * var oldValue = slicer.level(); * console.log(oldValue); * slicer.level(GC.Spread.Sheets.Slicers.TimelineLevel.years); * var newValue = slicer.level(); * console.log(newValue); * ``` */ level(value?: GC.Spread.Sheets.Slicers.TimelineLevel): any; /** * Gets or sets the name of the slicer. * @param {string} [value] The name of the slicer. The name property of a timeline slicer specifies the unique identifier or label assigned to the timeline, allowing for identification and reference within the workbook or programmatic interactions. * @returns {string | GC.Spread.Pivot.PivotTableTimelineSlicer} If no value is set, returns the name of the slicer; otherwise, returns the slicer. * @example * ```javascript * var spread = new GC.Spread.Sheets.Workbook('ss'); * var activeSheet = spread.getActiveSheet(); * var dataSource = [ * { Name: "Bob", City: "NewYork", Birthday: new Date("1968/6/8") }, * { Name: "Betty", City: "NewYork", Birthday: new Date("1972/7/3") }, * { Name: "Alice", City: "Washington", Birthday: new Date("2012/2/15") }, * ]; * var table = activeSheet.tables.addFromDataSource("table1", 1, 1, dataSource); * var pivotTable = activeSheet.pivotTables.add("pivotTable1", "table1", 6, 1); * var timeline = activeSheet.slicers.add("timeline", "pivotTable1", "Birthday", GC.Spread.Sheets.Slicers.TimelineStyles.dark1(), GC.Spread.Sheets.Slicers.SlicerType.pivotTimeline); * var oldValue = slicer.name(); * console.log(oldValue); * slicer.name('timeline2'); * var newValue = slicer.name(); * console.log(newValue); * ``` */ name(value?: string): any; /** * Gets the nameInFormula of the slicer. * @returns {string} returns the nameInFormula of the slicer. */ nameInFormula(): string; /** * Gets or sets the position of the slicer. * @param {GC.Spread.Sheets.Point} [value] The position of the slicer. The position property of a timeline slicer specifies the placement of the timeline within the worksheet. * @returns {GC.Spread.Sheets.Point | GC.Spread.Pivot.PivotTableTimelineSlicer} If no value is set, returns the position of the slicer; otherwise, returns the slicer. * @example * ```javascript * var spread = new GC.Spread.Sheets.Workbook('ss'); * var activeSheet = spread.getActiveSheet(); * var dataSource = [ * { Name: "Bob", City: "NewYork", Birthday: new Date("1968/6/8") }, * { Name: "Betty", City: "NewYork", Birthday: new Date("1972/7/3") }, * { Name: "Alice", City: "Washington", Birthday: new Date("2012/2/15") }, * ]; * var table = activeSheet.tables.addFromDataSource("table1", 1, 1, dataSource); * var pivotTable = activeSheet.pivotTables.add("pivotTable1", "table1", 6, 1); * var timeline = activeSheet.slicers.add("timeline", "pivotTable1", "Birthday", GC.Spread.Sheets.Slicers.TimelineStyles.dark1(), GC.Spread.Sheets.Slicers.SlicerType.pivotTimeline); * var oldValue = slicer.position(); * console.log(oldValue); * slicer.position(new GC.Spread.Sheets.Point(10, 20)); * var newValue = slicer.position(); * console.log(newValue); * ``` */ position(value?: GC.Spread.Sheets.Point): any; /** * Refresh the slicer. */ refresh(): void; /** * Gets or sets the scrollPosition of the slicer. * @param {Date} [value] The scrollPosition of the slicer. The scrollPosition property of a timeline slicer specifies the current scroll position or offset within the timeline, indicating the point where the visible time range begins in relation to the overall timeline data. * @returns {Date | GC.Spread.Pivot.PivotTableTimelineSlicer} If no value is set, returns the scrollPosition of the slicer; otherwise, returns the slicer. * @example * ```javascript * var spread = new GC.Spread.Sheets.Workbook('ss'); * var activeSheet = spread.getActiveSheet(); * var dataSource = [ * { Name: "Bob", City: "NewYork", Birthday: new Date("1968/6/8") }, * { Name: "Betty", City: "NewYork", Birthday: new Date("1972/7/3") }, * { Name: "Alice", City: "Washington", Birthday: new Date("2012/2/15") }, * ]; * var table = activeSheet.tables.addFromDataSource("table1", 1, 1, dataSource); * var pivotTable = activeSheet.pivotTables.add("pivotTable1", "table1", 6, 1); * var timeline = activeSheet.slicers.add("timeline", "pivotTable1", "Birthday", GC.Spread.Sheets.Slicers.TimelineStyles.dark1(), GC.Spread.Sheets.Slicers.SlicerType.pivotTimeline); * var oldValue = slicer.showHeader(); * console.log(oldValue); * slicer.showHeader(new Date('1973/7/3')); * var newValue = slicer.showHeader(); * console.log(newValue); * ``` */ scrollPosition(value?: Date): any; /** * Get the worksheet of the slicer. * @returns {GC.Spread.Sheets.Worksheet} returns the worksheet of the slicer. */ sheet(): GC.Spread.Sheets.Worksheet; /** * Gets or sets the showHeader of the slicer. * @param {boolean} [value] The showHeader of the slicer. The showHeader property of a timeline slicer specifies whether the header, which includes the title and filter-related controls, is displayed in the timeline slicer. * @returns {boolean | GC.Spread.Pivot.PivotTableTimelineSlicer} If no value is set, returns the showHeader of the slicer; otherwise, returns the slicer. * @example * ```javascript * var spread = new GC.Spread.Sheets.Workbook('ss'); * var activeSheet = spread.getActiveSheet(); * var dataSource = [ * { Name: "Bob", City: "NewYork", Birthday: new Date("1968/6/8") }, * { Name: "Betty", City: "NewYork", Birthday: new Date("1972/7/3") }, * { Name: "Alice", City: "Washington", Birthday: new Date("2012/2/15") }, * ]; * var table = activeSheet.tables.addFromDataSource("table1", 1, 1, dataSource); * var pivotTable = activeSheet.pivotTables.add("pivotTable1", "table1", 6, 1); * var timeline = activeSheet.slicers.add("timeline", "pivotTable1", "Birthday", GC.Spread.Sheets.Slicers.TimelineStyles.dark1(), GC.Spread.Sheets.Slicers.SlicerType.pivotTimeline); * var oldValue = slicer.showHeader(); * console.log(oldValue); * slicer.showHeader(false); * var newValue = slicer.showHeader(); * console.log(newValue); * ``` */ showHeader(value?: boolean): any; /** * Gets or sets the showHorizontalScrollbar of the slicer. * @param {boolean} [value] The showHorizontalScrollbar of the slicer. The showHorizontalScrollbar property of a timeline slicer specifies whether a horizontal scrollbar is displayed, allowing users to navigate through the content. * @returns {boolean | GC.Spread.Pivot.PivotTableTimelineSlicer} If no value is set, returns the showHorizontalScrollbar of the slicer; otherwise, returns the slicer. * @example * ```javascript * var spread = new GC.Spread.Sheets.Workbook('ss'); * var activeSheet = spread.getActiveSheet(); * var dataSource = [ * { Name: "Bob", City: "NewYork", Birthday: new Date("1968/6/8") }, * { Name: "Betty", City: "NewYork", Birthday: new Date("1972/7/3") }, * { Name: "Alice", City: "Washington", Birthday: new Date("2012/2/15") }, * ]; * var table = activeSheet.tables.addFromDataSource("table1", 1, 1, dataSource); * var pivotTable = activeSheet.pivotTables.add("pivotTable1", "table1", 6, 1); * var timeline = activeSheet.slicers.add("timeline", "pivotTable1", "Birthday", GC.Spread.Sheets.Slicers.TimelineStyles.dark1(), GC.Spread.Sheets.Slicers.SlicerType.pivotTimeline); * var oldValue = slicer.showHorizontalScrollbar(); * console.log(oldValue); * slicer.showHorizontalScrollbar(false); * var newValue = slicer.showHorizontalScrollbar(); * console.log(newValue); * ``` */ showHorizontalScrollbar(value?: boolean): any; /** * Gets or sets the showSelectionLabel of the slicer. * @param {boolean} [value] The showSelectionLabel of the slicer. The showSelectionLabel property of a timeline slicer specifies whether a label indicating the selected time range is displayed, providing users with information about the currently chosen period on the timeline. * @returns {boolean | GC.Spread.Pivot.PivotTableTimelineSlicer} If no value is set, returns the showSelectionLabel of the slicer; otherwise, returns the slicer. * @example * ```javascript * var spread = new GC.Spread.Sheets.Workbook('ss'); * var activeSheet = spread.getActiveSheet(); * var dataSource = [ * { Name: "Bob", City: "NewYork", Birthday: new Date("1968/6/8") }, * { Name: "Betty", City: "NewYork", Birthday: new Date("1972/7/3") }, * { Name: "Alice", City: "Washington", Birthday: new Date("2012/2/15") }, * ]; * var table = activeSheet.tables.addFromDataSource("table1", 1, 1, dataSource); * var pivotTable = activeSheet.pivotTables.add("pivotTable1", "table1", 6, 1); * var timeline = activeSheet.slicers.add("timeline", "pivotTable1", "Birthday", GC.Spread.Sheets.Slicers.TimelineStyles.dark1(), GC.Spread.Sheets.Slicers.SlicerType.pivotTimeline); * var oldValue = slicer.showSelectionLabel(); * console.log(oldValue); * slicer.showSelectionLabel(false); * var newValue = slicer.showSelectionLabel(); * console.log(newValue); * ``` */ showSelectionLabel(value?: boolean): any; /** * Gets or sets the showTimeLevel of the slicer. * @param {boolean} [value] The showTimeLevel of the slicer. The showTimeLevel property of a timeline slicer specifies whether different time levels (e.g., years, quarters, months) are displayed as options for users to select and filter data on the timeline. * @returns {boolean | GC.Spread.Pivot.PivotTableTimelineSlicer} If no value is set, returns the showTimeLevel of the slicer; otherwise, returns the slicer. * @example * ```javascript * var spread = new GC.Spread.Sheets.Workbook('ss'); * var activeSheet = spread.getActiveSheet(); * var dataSource = [ * { Name: "Bob", City: "NewYork", Birthday: new Date("1968/6/8") }, * { Name: "Betty", City: "NewYork", Birthday: new Date("1972/7/3") }, * { Name: "Alice", City: "Washington", Birthday: new Date("2012/2/15") }, * ]; * var table = activeSheet.tables.addFromDataSource("table1", 1, 1, dataSource); * var pivotTable = activeSheet.pivotTables.add("pivotTable1", "table1", 6, 1); * var timeline = activeSheet.slicers.add("timeline", "pivotTable1", "Birthday", GC.Spread.Sheets.Slicers.TimelineStyles.dark1(), GC.Spread.Sheets.Slicers.SlicerType.pivotTimeline); * var oldValue = slicer.showTimeLevel(); * console.log(oldValue); * slicer.showTimeLevel(false); * var newValue = slicer.showTimeLevel(); * console.log(newValue); * ``` */ showTimeLevel(value?: boolean): any; /** * Get the sourceName of the slicer. * @returns {string} returns the sourceName of the slicer. The sourceName property of a timeline slicer specifies the name of the source data field associated with the timeline. */ sourceName(): string; /** * Gets or sets the startColumn of the slicer. * @param {number} [value] The startColumn of the slicer. The startColumn property of a timeline slicer specifies the starting column index or position within the worksheet where the timeline is anchored. * @returns {number | GC.Spread.Pivot.PivotTableTimelineSlicer} If no value is set, returns the startColumn of the slicer; otherwise, returns the slicer. * @example * ```javascript * var spread = new GC.Spread.Sheets.Workbook('ss'); * var activeSheet = spread.getActiveSheet(); * var dataSource = [ * { Name: "Bob", City: "NewYork", Birthday: new Date("1968/6/8") }, * { Name: "Betty", City: "NewYork", Birthday: new Date("1972/7/3") }, * { Name: "Alice", City: "Washington", Birthday: new Date("2012/2/15") }, * ]; * var table = activeSheet.tables.addFromDataSource("table1", 1, 1, dataSource); * var pivotTable = activeSheet.pivotTables.add("pivotTable1", "table1", 6, 1); * var timeline = activeSheet.slicers.add("timeline", "pivotTable1", "Birthday", GC.Spread.Sheets.Slicers.TimelineStyles.dark1(), GC.Spread.Sheets.Slicers.SlicerType.pivotTimeline); * var oldValue = slicer.startColumn(); * console.log(oldValue); * slicer.startColumn(5); * var newValue = slicer.startColumn(); * console.log(newValue); * ``` */ startColumn(value?: number): any; /** * Gets or sets the startColumnOffset of the slicer. * @param {number} [value] The startColumnOffset of the slicer. The startColumnOffset property of a timeline slicer specifies the horizontal offset or distance from the starting column index where the timeline begins its placement within the worksheet. * @returns {number | GC.Spread.Pivot.PivotTableTimelineSlicer} If no value is set, returns the startColumnOffset of the slicer; otherwise, returns the slicer. * @example * ```javascript * var spread = new GC.Spread.Sheets.Workbook('ss'); * var activeSheet = spread.getActiveSheet(); * var dataSource = [ * { Name: "Bob", City: "NewYork", Birthday: new Date("1968/6/8") }, * { Name: "Betty", City: "NewYork", Birthday: new Date("1972/7/3") }, * { Name: "Alice", City: "Washington", Birthday: new Date("2012/2/15") }, * ]; * var table = activeSheet.tables.addFromDataSource("table1", 1, 1, dataSource); * var pivotTable = activeSheet.pivotTables.add("pivotTable1", "table1", 6, 1); * var timeline = activeSheet.slicers.add("timeline", "pivotTable1", "Birthday", GC.Spread.Sheets.Slicers.TimelineStyles.dark1(), GC.Spread.Sheets.Slicers.SlicerType.pivotTimeline); * var oldValue = slicer.startColumnOffset(); * console.log(oldValue); * slicer.startColumnOffset(15); * var newValue = slicer.startColumnOffset(); * console.log(newValue); * ``` */ startColumnOffset(value?: number): any; /** * Gets or sets the startRow of the slicer. * @param {number} [value] The startRow of the slicer. The startRow property of a timeline slicer specifies the starting row index or position within the worksheet where the timeline is anchored. * @returns {number | GC.Spread.Pivot.PivotTableTimelineSlicer} If no value is set, returns the startRow of the slicer; otherwise, returns the slicer. * @example * ```javascript * var spread = new GC.Spread.Sheets.Workbook('ss'); * var activeSheet = spread.getActiveSheet(); * var dataSource = [ * { Name: "Bob", City: "NewYork", Birthday: new Date("1968/6/8") }, * { Name: "Betty", City: "NewYork", Birthday: new Date("1972/7/3") }, * { Name: "Alice", City: "Washington", Birthday: new Date("2012/2/15") }, * ]; * var table = activeSheet.tables.addFromDataSource("table1", 1, 1, dataSource); * var pivotTable = activeSheet.pivotTables.add("pivotTable1", "table1", 6, 1); * var timeline = activeSheet.slicers.add("timeline", "pivotTable1", "Birthday", GC.Spread.Sheets.Slicers.TimelineStyles.dark1(), GC.Spread.Sheets.Slicers.SlicerType.pivotTimeline); * var oldValue = slicer.startRow(); * console.log(oldValue); * slicer.startRow(3); * var newValue = slicer.startRow(); * console.log(newValue); * ``` */ startRow(value?: number): any; /** * Gets or sets the startRowOffset of the slicer. * @param {number} [value] The startRowOffset of the slicer. The startRowOffset property of a timeline slicer specifies the vertical offset or distance from the starting row index where the timeline begins its placement within the worksheet. * @returns {number | GC.Spread.Pivot.PivotTableTimelineSlicer} If no value is set, returns the startRowOffset of the slicer; otherwise, returns the slicer. * @example * ```javascript * var spread = new GC.Spread.Sheets.Workbook('ss'); * var activeSheet = spread.getActiveSheet(); * var dataSource = [ * { Name: "Bob", City: "NewYork", Birthday: new Date("1968/6/8") }, * { Name: "Betty", City: "NewYork", Birthday: new Date("1972/7/3") }, * { Name: "Alice", City: "Washington", Birthday: new Date("2012/2/15") }, * ]; * var table = activeSheet.tables.addFromDataSource("table1", 1, 1, dataSource); * var pivotTable = activeSheet.pivotTables.add("pivotTable1", "table1", 6, 1); * var timeline = activeSheet.slicers.add("timeline", "pivotTable1", "Birthday", GC.Spread.Sheets.Slicers.TimelineStyles.dark1(), GC.Spread.Sheets.Slicers.SlicerType.pivotTimeline); * var oldValue = slicer.startRowOffset(); * console.log(oldValue); * slicer.startRowOffset(10); * var newValue = slicer.startRowOffset(); * console.log(newValue); * ``` */ startRowOffset(value?: number): any; /** * Gets or sets the style of the slicer. * @param {string | GC.Spread.Sheets.Slicers.TimelineStyle} [value] The style or style name of the slicer. The style property of a timeline slicer specifies the visual appearance and formatting style applied to the timeline, defining its overall look and presentation. * @returns {GC.Spread.Sheets.Slicers.TimelineStyle | GC.Spread.Pivot.PivotTableTimelineSlicer} If no style is set, returns the style of the slicer; otherwise, returns the slicer. * @example * ```javascript * var spread = new GC.Spread.Sheets.Workbook('ss'); * var activeSheet = spread.getActiveSheet(); * var dataSource = [ * { Name: "Bob", City: "NewYork", Birthday: "1968/6/8" }, * { Name: "Betty", City: "NewYork", Birthday: "1972/7/3" }, * { Name: "Alice", City: "Washington", Birthday: "2012/2/15" }, * ]; * var table = activeSheet.tables.addFromDataSource("table1", 1, 1, dataSource); * var pivotTable = activeSheet.pivotTables.add("pivotTable1", "table1", 6, 1); * var timeline = activeSheet.slicers.add("timeline", "pivotTable1", "Birthday", GC.Spread.Sheets.Slicers.TimelineStyles.dark1(), GC.Spread.Sheets.Slicers.SlicerType.pivotTimeline); * * var style = new GC.Spread.Sheets.Slicers.TimelineStyle() * style.wholeSlicerStyle(new GC.Spread.Sheets.Slicers.SlicerStyleInfo('red', 'blue', '12pt Calibri')); * style.headerStyle(new GC.Spread.Sheets.Slicers.SlicerStyleInfo(undefined, 'green', '14pt Calibri')); * style.timeLevelStyle(new GC.Spread.Sheets.Slicers.SlicerStyleInfo('yellow')); * * var oldValue = slicer.style(); * console.log(oldValue); * timeline.style(style); * var newValue = slicer.style(); * console.log(newValue); * ``` */ style(value?: string | GC.Spread.Sheets.Slicers.TimelineStyle): GC.Spread.Sheets.Slicers.TimelineStyle | GC.Spread.Pivot.PivotTableTimelineSlicer; /** * Gets or sets the width of the slicer. * @param {number} [value] The width of the slicer. The width property of a timeline slicer specifies the horizontal dimension or width of the timeline, determining its size along the x-axis. * @returns {number | GC.Spread.Pivot.PivotTableTimelineSlicer} If no value is set, returns the width of the slicer; otherwise, returns the slicer. * @example * ```javascript * var spread = new GC.Spread.Sheets.Workbook('ss'); * var activeSheet = spread.getActiveSheet(); * var dataSource = [ * { Name: "Bob", City: "NewYork", Birthday: new Date("1968/6/8") }, * { Name: "Betty", City: "NewYork", Birthday: new Date("1972/7/3") }, * { Name: "Alice", City: "Washington", Birthday: new Date("2012/2/15") }, * ]; * var table = activeSheet.tables.addFromDataSource("table1", 1, 1, dataSource); * var pivotTable = activeSheet.pivotTables.add("pivotTable1", "table1", 6, 1); * var timeline = activeSheet.slicers.add("timeline", "pivotTable1", "Birthday", GC.Spread.Sheets.Slicers.TimelineStyles.dark1(), GC.Spread.Sheets.Slicers.SlicerType.pivotTimeline); * var oldValue = slicer.width(); * console.log(oldValue); * slicer.width(150); * var newValue = slicer.width(); * console.log(newValue); * ``` */ width(value?: number): any; /** * Gets or sets the x of the slicer. * @param {number} [value] The x of the slicer. The x property of a timeline slicer specifies the horizontal position or coordinate of the upper-left corner of the timeline within the worksheet. * @returns {number | GC.Spread.Pivot.PivotTableTimelineSlicer} If no value is set, returns the x of the slicer; otherwise, returns the slicer. * @example * ```javascript * var spread = new GC.Spread.Sheets.Workbook('ss'); * var activeSheet = spread.getActiveSheet(); * var dataSource = [ * { Name: "Bob", City: "NewYork", Birthday: new Date("1968/6/8") }, * { Name: "Betty", City: "NewYork", Birthday: new Date("1972/7/3") }, * { Name: "Alice", City: "Washington", Birthday: new Date("2012/2/15") }, * ]; * var table = activeSheet.tables.addFromDataSource("table1", 1, 1, dataSource); * var pivotTable = activeSheet.pivotTables.add("pivotTable1", "table1", 6, 1); * var timeline = activeSheet.slicers.add("timeline", "pivotTable1", "Birthday", GC.Spread.Sheets.Slicers.TimelineStyles.dark1(), GC.Spread.Sheets.Slicers.SlicerType.pivotTimeline); * var oldValue = slicer.x(); * console.log(oldValue); * slicer.x(30); * var newValue = slicer.x(); * console.log(newValue); * ``` */ x(value?: number): any; /** * Gets or sets the y of the slicer. * @param {number} [value] The y of the slicer. The y property of a timeline slicer specifies the vertical position or coordinate of the upper-left corner of the timeline within the worksheet. * @returns {number | GC.Spread.Pivot.PivotTableTimelineSlicer} If no value is set, returns the y of the slicer; otherwise, returns the slicer. * @example * ```javascript * var spread = new GC.Spread.Sheets.Workbook('ss'); * var activeSheet = spread.getActiveSheet(); * var dataSource = [ * { Name: "Bob", City: "NewYork", Birthday: new Date("1968/6/8") }, * { Name: "Betty", City: "NewYork", Birthday: new Date("1972/7/3") }, * { Name: "Alice", City: "Washington", Birthday: new Date("2012/2/15") }, * ]; * var table = activeSheet.tables.addFromDataSource("table1", 1, 1, dataSource); * var pivotTable = activeSheet.pivotTables.add("pivotTable1", "table1", 6, 1); * var timeline = activeSheet.slicers.add("timeline", "pivotTable1", "Birthday", GC.Spread.Sheets.Slicers.TimelineStyles.dark1(), GC.Spread.Sheets.Slicers.SlicerType.pivotTimeline); * var oldValue = slicer.y(); * console.log(oldValue); * slicer.y(50); * var newValue = slicer.y(); * console.log(newValue); * ``` */ y(value?: number): any; } module PivotTable{ export class PivotTableViewManager{ /** * Represents a PivotTableViewManager. * @class */ constructor(applyCallback: Function, saveCallback: Function); /** * @description Add a view to pivot table views. * @param {IPivotTableView} view Indicates the view to add. * @example * ```javascript * var viewsManager = pivotTable.views; * viewsManager.add({ * name: 'config1', * config: pivotTable.serialize() * }); * viewsManager.get('config1'); * ``` */ add(view: IPivotTableView): boolean; /** * @description get all views from pivot table views. * @example * ```javascript * var viewsManager = pivotTable.views; * viewsManager.save('config1'); * console.log(viewsManager.all()); * ``` */ all(): IPivotTableView[]; /** * @description apply a view to current pivot table. * @param {string} name Indicates the name of view to apply. * @example * ```javascript * var viewsManager = pivotTable.views; * viewsManager.save('config1'); * viewsManager.apply('config1'); * ``` */ apply(name: string): void; /** * @description get a view from pivot table views. * @param {string} name Indicates the name of view to query. * @example * ```javascript * var viewsManager = pivotTable.views; * viewsManager.save('config1'); * viewsManager.get('config1'); * ``` */ get(name: string): IPivotTableView; /** * @description remove a view from pivot table views. * @param {string} name Indicates the name of view to remove. * @example * ```javascript * var viewsManager = pivotTable.views; * viewsManager.remove('config1'); * viewsManager.get('config1'); * ``` */ remove(name: string): void; /** * @description Add a view to pivot table views. * @param {string} name Indicates the name of view to save. * @example * ```javascript * var viewsManager = pivotTable.views; * viewsManager.save('config1'); * viewsManager.get('config1'); * ``` */ save(name: string): boolean; } } } module Report{ export interface IColumnLayoutSetting{ type: 'ColumnLayout'; dataRange: string; columnCount: number; repeatCols?: { start: number; end: number; }; } export interface IConditionRuleCellType{ cell: string; } export interface IConditionRuleDataColumnType{ dataColumn: GC.Spread.Report.IDataColumn; } export interface IConditionRuleFormulaType{ formula: string; } export interface IConditionRuleParameterType{ parameter: string; } export interface IConditionRuleValueType{ value: string | boolean | number | Date; } export interface IDataCell{ value: any; row: number; col: number; rowCount: number; colCount: number; } export interface IDataCellBase{ binding?: GC.Spread.Report.Binding; spillDirection?: GC.Spread.Report.SpillDirection; filter?: GC.Spread.Report.IFilter; sortOptions?: GC.Spread.Report.SortOption[]; showCollapseButton?: boolean; initialExpansionState?: 'Expanded' | 'Collapsed'; alias?: string; autoExpand?: 'Both' | 'Horizontal' | 'Vertical' | 'None'; } export interface IDataColumn{ tableName: string; columnName: string; } export interface IEntityFieldInfo{ oldValue: GC.Spread.Report.DataType | GC.Spread.Report.DataType[]; state: GC.Spread.Report.FieldState; row: number; col: number; depRowCols?: { row: number; col: number; }[]; } export interface IFailedRecord extends GC.Spread.Report.IRecord{ /** * the reason is the DataManager table submitChanges failed records reason. */ reason?: string; } export interface IField{ dbColumnName: string; formula: string; isPrimary?: boolean; } export interface IFilter{ condition?: GC.Spread.Report.FilterCondition; } export interface IFilterConditionAndRelationType{ and?: GC.Spread.Report.FilterCondition[]; } export interface IFilterConditionOrRelationType{ or?: GC.Spread.Report.FilterCondition[]; } export interface IGroupBin{ caption: string; groupBy: string; stopIfTrue?: boolean; alwaysVisible?: boolean; } export interface IPaginationSetting{ titleRow?: { start: number; end: number; }; endRow?: { start: number; end: number; }; titleCol?: { start: number; end: number; }; endCol?: { start: number; end: number; }; rowPagination?: { paginationDataCell: string; rowCountPerPage: number; }; paginationOrder?: GC.Spread.Report.PaginationOrder; paperSizePagination?: boolean; } export interface IParameterChangedArgs{ tag: string; oldValue: string | number | boolean | Date; newValue: string | number | boolean | Date; } export interface IRecord{ /** * record key-value object. */ entity: { [key: string]: DataType; }; /** * record property info. */ info: { [key: string]: GC.Spread.Report.IEntityFieldInfo }; } export interface IReportOptions{ dirtyStyle?: GC.Spread.Sheets.Style; printAllPages?: boolean; showHiddenRowCol?: boolean; hiddenRowColStyle?: GC.Spread.Sheets.Style; } export interface IReportSheetDataChangedEventArgs{ sheet: GC.Spread.Report.ReportSheet; sheetName: string; type: "update" | "insert" | "delete"; row: number; col: number; } export interface IReportSheetDataChangingEventArgs{ sheet: GC.Spread.Report.ReportSheet; sheetName: string; type: "update" | "insert" | "delete"; row: number; col: number; cancel: boolean; oldValue?: any; newValue?: any; } export interface IReportSheetRecordsSubmittedEventArgs{ sheet: GC.Spread.Report.ReportSheet; sheetName: string; /** * include updated and inserted records. */ updateSuccessRecords: GC.Spread.Report.IRecord[]; updateFailedRecords: GC.Spread.Report.IFailedRecord[]; /** * include deleted records. */ deleteSuccessRecords: GC.Spread.Report.IRecord[]; deleteFailedRecords: GC.Spread.Report.IFailedRecord[]; } export interface IReportSheetRecordsSubmittingEventArgs{ sheet: GC.Spread.Report.ReportSheet; sheetName: string; cancel: boolean; } export interface IRowLayoutSetting{ type: 'RowLayout'; dataRange: string; rowCount: number; repeatRows?: { start: number; end: number; }; } export interface ITemplateCellCommonSetting{ context?: { horizontal?: GC.Spread.Report.CellAddress; vertical?: GC.Spread.Report.CellAddress; }, paginateBeforeRow?: boolean; paginateAfterRow?: boolean; paginateBeforeColumn?: boolean; paginateAfterColumn?: boolean; canBreakWhenPaging?: boolean; repeatContentWhenPaging?: boolean; defaultValue?: GC.Spread.Report.Formula; autoFit?: 'None' | 'Row' | 'Column'; } export interface ITemplateOptions{ expansionDirectionArrowColor: string; parentArrowColor: string; } export interface IWriteBackRule{ name: string; fields: GC.Spread.Report.IField[]; tableName: string; includeUnmodified?: boolean; skipRecordWithEmptyValue?: boolean; } /** * @typedef GC.Spread.Report.Binding * @type {string} */ export type Binding = string /** * @typedef GC.Spread.Report.CellAddress * @type {string} */ export type CellAddress = string /** * @typedef GC.Spread.Report.Change * @property {GC.Spread.Report.IRecord[]} records - The updated and inserted records. * @property {GC.Spread.Report.IRecord[]} deleteRecords - The deleted records. * @property {GC.Spread.Report.IWriteBackRule} rule - The report sheet dataEntry write back rule. */ export type Change = { /** * The updated and inserted records. */ records: GC.Spread.Report.IRecord[]; /** * The deleted records. */ deleteRecords: GC.Spread.Report.IRecord[]; /** * The report sheet dataEntry write back rule. */ rule: GC.Spread.Report.IWriteBackRule; } /** * @typedef GC.Spread.Report.ChartCell * @type {{type: 'Chart'; dataChartName: string;chartPreviewVisible: boolean;}} */ export type ChartCell = {type: 'Chart'; dataChartName: string; chartPreviewVisible?: boolean;} /** * @typedef GC.Spread.Report.ConditionRule * @type {{ column: string; operator: GC.Spread.Report.ConditionRuleOperator; } & (GC.Spread.Report.IConditionRuleValueType | GC.Spread.Report.IConditionRuleCellType | GC.Spread.Report.IConditionRuleDataColumnType | GC.Spread.Report.IConditionRuleParameterType | GC.Spread.Report.IConditionRuleFormulaType)} */ export type ConditionRule = { column: string; operator: GC.Spread.Report.ConditionRuleOperator; } & (GC.Spread.Report.IConditionRuleValueType | GC.Spread.Report.IConditionRuleCellType | GC.Spread.Report.IConditionRuleDataColumnType | GC.Spread.Report.IConditionRuleParameterType | GC.Spread.Report.IConditionRuleFormulaType) /** * @typedef GC.Spread.Report.ConditionRuleOperator * @type {'Equal' | 'NotEqual' | 'GreaterThanOrEqual' | 'GreaterThan' | 'LessThanOrEqual' | 'LessThan' | 'StartWith' | 'NotStartWith' | 'EndWith' | 'NotEndWith' | 'Contains' | 'NotContains' | 'In' | 'NotIn'} */ export type ConditionRuleOperator = 'Equal' | 'NotEqual' | 'GreaterThanOrEqual' | 'GreaterThan' | 'LessThanOrEqual' | 'LessThan' | 'StartWith' | 'NotStartWith' | 'EndWith' | 'NotEndWith' | 'Contains' | 'NotContains' | 'In' | 'NotIn' /** * @typedef GC.Spread.Report.DataEntrySetting * @type {GC.Spread.Report.IWriteBackRule[]} */ export type DataEntrySetting = GC.Spread.Report.IWriteBackRule[] /** * @typedef GC.Spread.Report.DataType * @type {number | string | Date | boolean} */ export type DataType = number | string | Date | boolean /** * @typedef GC.Spread.Report.FieldState * @type {'normal' | 'new' | 'updated' | 'deleted'} */ export type FieldState = 'normal' | 'new' | 'updated' | 'deleted' /** * @typedef GC.Spread.Report.FilterCondition * @type {GC.Spread.Report.ConditionRule | GC.Spread.Report.FilterConditionFormulaRule | GC.Spread.Report.IFilterConditionAndRelationType | GC.Spread.Report.IFilterConditionOrRelationType} */ export type FilterCondition = GC.Spread.Report.ConditionRule | GC.Spread.Report.FilterConditionFormulaRule | GC.Spread.Report.IFilterConditionAndRelationType | GC.Spread.Report.IFilterConditionOrRelationType /** * @typedef GC.Spread.Report.FilterConditionFormulaRule * @type { formula: string; } */ export type FilterConditionFormulaRule = { formula: string; } /** * @typedef GC.Spread.Report.Formula * @type {string} */ export type Formula = string /** * @typedef GC.Spread.Report.GroupCell * @type {GC.Spread.Report.IDataCellBase & { type: 'Group'; bins?: GC.Spread.Report.IGroupBin[]; formula?: GC.Spread.Report.Formula; }} */ export type GroupCell = GC.Spread.Report.IDataCellBase & { type: 'Group'; bins?: GC.Spread.Report.IGroupBin[]; formula?: GC.Spread.Report.Formula; } /** * @typedef GC.Spread.Report.InitParametersUIFunctionType * @param {GC.Spread.Sheets.Worksheet} sheet - The init parametersUI sheet, users can update the parameterUI sheet here. * @description The callback when parameterUI sheet is rendering. */ export type InitParametersUIFunctionType = (sheet: GC.Spread.Sheets.Worksheet) => void; /** * @typedef GC.Spread.Report.LayoutSetting * @type {GC.Spread.Report.IRowLayoutSetting | GC.Spread.Report.IColumnLayoutSetting} */ export type LayoutSetting = GC.Spread.Report.IRowLayoutSetting | GC.Spread.Report.IColumnLayoutSetting /** * @typedef GC.Spread.Report.ListCell * @type {GC.Spread.Report.IDataCellBase & { type: 'List'; spillMode?: 'Insert' | 'Overwrite'; }} */ export type ListCell = GC.Spread.Report.IDataCellBase & { type: 'List'; spillMode?: 'Insert' | 'Overwrite'; } /** * @typedef GC.Spread.Report.OnChangeFunctionType * @param {GC.Spread.Report.ReportSheet} sheet - The parametersUI bound reportSheet. * @param {GC.Spread.Report.IParameterChangedArgs} changedArgs - The changed parameter values. * @description The callback when the parameterUI value changed. */ export type OnChangeFunctionType = (sheet: GC.Spread.Report.ReportSheet, changedArgs: GC.Spread.Report.IParameterChangedArgs) => void; /** * @typedef GC.Spread.Report.PaginationOrder * @type {'DownThenOver' | 'OverThenDown'} */ export type PaginationOrder = 'DownThenOver' | 'OverThenDown' /** * @typedef GC.Spread.Report.RenderMode * @type {'Design' | 'PaginatedPreview' | 'Preview'} */ export type RenderMode = 'Design' | 'PaginatedPreview' | 'Preview' /** */ export type SheetNameGenerator = (pageIndex: number) => string /** * @typedef GC.Spread.Report.SortOption * @type {({ asc: string } | { desc: string }) & { list?: string[] }} */ export type SortOption = ({ asc: string } | { desc: string }) & { list?: string[] }; /** * @typedef GC.Spread.Report.SpillDirection * @type {'Horizontal' | 'Vertical' | 'None'} */ export type SpillDirection = 'Horizontal' | 'Vertical' | 'None' /** * @typedef GC.Spread.Report.StaticCell * @type {{type: 'Static'; pin?: 'None' | 'Row' | 'Column' | 'Both'; autoExpand?: 'Both' | 'Horizontal' | 'Vertical' | 'None'; showCollapseButton?: boolean; initialExpansionState?: 'Expanded' | 'Collapsed';}} */ export type StaticCell = {type: 'Static'; pin?: 'None' | 'Row' | 'Column' | 'Both'; autoExpand?: 'Both' | 'Horizontal' | 'Vertical' | 'None'; showCollapseButton?: boolean; initialExpansionState?: 'Expanded' | 'Collapsed';} /** * @typedef GC.Spread.Report.SummaryAggregate * @type {'Sum' | 'Avg' | 'Max' | 'Min' | 'Count'} */ export type SummaryAggregate = 'Sum' | 'Avg' | 'Max' | 'Min' | 'Count' /** * @typedef GC.Spread.Report.SummaryCell * @type {GC.Spread.Report.IDataCellBase & { type: 'Summary'; aggregate: GC.Spread.Report.SummaryAggregate; }} */ export type SummaryCell = GC.Spread.Report.IDataCellBase & { type: 'Summary'; aggregate: GC.Spread.Report.SummaryAggregate; } /** * @typedef GC.Spread.Report.ReportTemplateCell * @type {(GC.Spread.Report.ListCell | GC.Spread.Report.GroupCell | GC.Spread.Report.SummaryCell | GC.Spread.Report.StaticCell | GC.Spread.Report.ChartCell) & GC.Spread.Report.ITemplateCellCommonSetting} */ export type TemplateCell = (GC.Spread.Report.ListCell | GC.Spread.Report.GroupCell | GC.Spread.Report.SummaryCell | GC.Spread.Report.StaticCell | GC.Spread.Report.ChartCell) & GC.Spread.Report.ITemplateCellCommonSetting export class ReportSheet{ /** * Represents a ReportSheet. * @class * @param {string} name The name of the ReportSheet. * @example * ```javascript * const spread = new GC.Spread.Sheets.Workbook('spread-host', { sheetCount: 0 }); * const reportSheet = spread.addSheetTab(0, 'orders-report', GC.Spread.Sheets.SheetType.reportSheet); * const templateSheet = reportSheet.getTemplate(); * * const ordersTable = spread.dataManager().addTable('Orders', { * remote: { * read: { * url: 'https://demodata.mescius.io/northwind/api/v1/orders' * } * } * }); * * // load the data from remote. * ordersTable.fetch().then(() => { * // set style for the template. * const headerStyle = new GC.Spread.Sheets.Style(); * headerStyle.backColor = '#80CBC4'; * headerStyle.foreColor = '#424242'; * headerStyle.hAlign = GC.Spread.Sheets.HorizontalAlign.right; * headerStyle.font = '12px Maine'; * const dataStyle = new GC.Spread.Sheets.Style(); * dataStyle.foreColor = '#424242'; * dataStyle.hAlign = GC.Spread.Sheets.HorizontalAlign.right; * dataStyle.font = '12px Maine'; * const border = new GC.Spread.Sheets.LineBorder('#E0E0E0', 1); * dataStyle.borderBottom = border; * dataStyle.borderTop = border; * dataStyle.borderLeft = border; * dataStyle.borderRight = border; * const colWidthArray = [90, 90, 90, 80, 220, 150, 110]; * colWidthArray.forEach((width, i) => { * templateSheet.setColumnWidth(i, width); * }); * templateSheet.getRange('A1:G1').setStyle(headerStyle); * templateSheet.getRange('A2:G2').setStyle(dataStyle); * templateSheet.setFormatter(1, 2, 'yyyy-MM-dd'); * * // set value and binding for the template. * const columns = ['orderId', 'customerId', 'orderDate', 'freight', 'shipName', 'shipCity', 'shipCountry']; * columns.forEach((columnName, i) => { * templateSheet.setValue(0, i, `${columnName[0].toUpperCase()}${columnName.substring(1)}`); * templateSheet.setTemplateCell(1, i, { * type: 'List', * binding: `Orders[${columnName}]`, * }); * }); * * reportSheet.refresh(); * }); * ``` */ constructor(name: string); /** * Indicates the options of the ReportSheet. * @type {Object} * @property {GC.Spread.Sheets.Style} [dirtyStyle] The style will be used to paint the modified cells in the preview mode. * @property {boolean} [printAllPages] Indicates whether print all pages. * @property {boolean} [showHiddenRowCol] Indicates whether to show hidden rows or columns. * @property {GC.Spread.Sheets.Style} [hiddenRowColStyle] This style will be used to style the header when displaying hidden rows and columns. */ options: GC.Spread.Report.IReportOptions; /** * Add record based on the specified cell. * @param {number} row The row index. * @param {number} col The column index. * @example * ```javascript * // add record at A2 cell. * reportSheet.addRecordAt(1, 0); * ``` */ addRecordAt(row: number, col: number): void; /** * Binds an event to the report sheet. * @param {string} type The event type. * @param {Object} data Optional. Specifies additional data to pass along to the function. * @param {Function} fn Specifies the function to run when the event occurs. * @example * ```javascript * //This example bind the ReportSheetDataChanged event into report sheet. * const report = spread.addSheetTab(0, "Report", GC.Spread.Sheets.SheetType.reportSheet); * report.renderMode("Design"); * const templateSheet = report.getTemplate(); * templateSheet.setTemplateCell(0, 0, { * binding: "Orders[orderId]", * type: "Group", * }); * templateSheet.setTemplateCell(0, 1, { * binding: "Orders[customerId]", * type: "Group", * }); * templateSheet.setDataEntrySetting([ { * name: "Write Back Rule 1", * tableName: "Orders", * fields: [ * { dbColumnName: "orderId", formula: "A1", isPrimary: true }, * { dbColumnName: "customerId", formula: "B1" }, * ], * includeUnmodified: false, * skipRecordWithEmptyValue: false * } ]); * report.renderMode("Preview"); * report.bind(GC.Spread.Sheets.Events.ReportSheetDataChanged, (event, args) => { * let reportsheet = args.sheet, changes = reportsheet.getChanges(); * if (allowSubmit(changes)) { // users can submit or drop this changing. * reportsheet.submit(); // submit changes. * } else { * reportsheet.refresh(); // drop changes. * } * }); * // after reportsheet edit / update / delete records in UI will trigger ReportSheetDataChanged event. * ``` */ bind(type: string, data?: any, fn?: Function): void; /** * Get or set the current page index. * @param {number} page The page index (0 base). * @returns {number} Return the current page index. * @example * ```javascript * // get the current page index. * const page = reportSheet.currentPage(); * * // go to the next page. * reportSheet.currentPage(page + 1); * ``` */ currentPage(page?: number): number; /** * Delete record based on the specified cell. * @param {number} row The row index. * @param {number} col The column index. * @example * ```javascript * // delete record at A2 cell. * reportSheet.deleteRecordAt(1, 0); * ``` */ deleteRecordAt(row: number, col: number): void; /** * Generate the every page of the current report as a worksheet, and return them in an array. * @param {boolean} addToSpread Control whether add the page sheets to the current spread. * @param {Function} sheetNameGenerator The optional sheet name generator. * @returns {GC.Spread.Sheets.Worksheet[]} Return the generated worksheets. * @example * ```javascript * // generate the pages and add them to the spread. * const pageSheets = reportSheet.generatePageSheets(true); * * // generate the pages and add them to the spread, and customize the sheet name. * const pageSheets = reportSheet.generatePageSheets(true, (i) => `report-page-${i + 1}`); * ``` */ generatePageSheets(addToSpread: boolean, sheetNameGenerator?: GC.Spread.Report.SheetNameGenerator): GC.Spread.Sheets.Worksheet[]; /** * Get the actual style of the cell in current render mode. * @param {number} row The row index. * @param {number} col The column index. * @returns {GC.Spread.Sheets.Style} Return actual style of the cell. * @example * ```javascript * const report = spread.addSheetTab(0, "Report", GC.Spread.Sheets.SheetType.reportSheet); * report.renderMode("Design"); * const templateSheet = report.getTemplate(); * templateSheet.setTemplateCell(0, 0, { * binding: "Orders[customerId]", * type: "Group", * }); * templateSheet.getCell(0, 0).backColor("red"); * templateSheet.setTemplateCell(1, 0, { * binding: "Orders[orderId]", * type: "Group", * }); * templateSheet.getCell(1, 0).backColor("green"); * const designActualStyle1 = report.getActualStyle(0, 0); // backColor: red * const designActualStyle2 = report.getActualStyle(1, 0); // backColor: green * report.renderMode("Preview"); * const previewActualStyle1 = report.getActualStyle(0, 0); // backColor: red * const previewActualStyle2 = report.getActualStyle(1, 0); // backColor: red * report.renderMode("PaginatedPreview"); * const paginatedPreviewActualStyle1 = report.getActualStyle(0, 0); // backColor: red * const paginatedPreviewActualStyle2 = report.getActualStyle(1, 0); // backColor: red * ``` */ getActualStyle(row: number, col: number): GC.Spread.Sheets.Style; /** * Get expanded cells of the template cell base on the current cell in preview. * @param {number} templateRow The row index in template. * @param {number} templateCol The column index in template. * @param {number} currentRow The row index of current cell in preview. * @param {number} currentCol The column index of current cell in preview. * @returns {GC.Spread.Report.IDataCell[]} Return expanded cells of the template cell base on the current cell. * @example * ```javascript * const report = spread.addSheetTab(0, "Report", GC.Spread.Sheets.SheetType.reportSheet); * const templateSheet = report.getTemplate(); * templateSheet.setTemplateCell(0, 0, { * binding: "Orders[customerId]", * type: "Group", * }); * templateSheet.setTemplateCell(1, 0, { * binding: "Orders[orderId]", * type: "Group", * }); * report.regenerateReport(); * const allCustomerIdCells = report.getCells(0, 0); // all 89 cells * const fistCustomerIdCell = report.getCells(0, 0, 0, 0); // value: VINET * const allOrderIdCells = report.getCells(1, 0); // all 830 cells * const firstOrderIdCell = report.getCells(1, 0, 89, 0); // value: 10248 * ``` */ getCells(templateRow: number, templateCol: number, currentRow?: number, currentCol?: number): GC.Spread.Report.IDataCell[]; /** * Return the report sheet data entry mode update insert and delete data changes. * @returns {GC.Spread.Report.Change[]} Returns the reportsheet update insert and delete data changes. * @example * ```javascript * const report = spread.addSheetTab(0, "Report", GC.Spread.Sheets.SheetType.reportSheet); * report.renderMode("Design"); * const templateSheet = report.getTemplate(); * templateSheet.setTemplateCell(0, 0, { * binding: "Orders[customerId]", * type: "Group", * showCollapseButton: true * }); * templateSheet.setTemplateCell(0, 1, { * binding: "Orders[orderId]", * type: "Group", * }); * templateSheet.setDataEntrySetting([ { * name: "Write Back Rule 1", * tableName: "Orders", * fields: [ * { dbColumnName: "orderId", formula: "A1", isPrimary: true }, * { dbColumnName: "customerId", formula: "B1" }, * ], * includeUnmodified: false, * skipRecordWithEmptyValue: false * } ]); * report.renderMode("Preview"); * report.updateCellValue(0, 1, "test"); * report.addRecordAt(1, 0); * report.updateCellValue(2, 0, 111); * report.updateCellValue(2, 1, "test2"); * report.deleteRecordAt(3, 0); * report.getChanges(); // one delete record and two update records. * ``` */ getChanges(): GC.Spread.Report.Change[]; /** * Return the collapse state of the specified cell. * @param {number} row The row index. * @param {number} col The column index. * @example * ```javascript * const report = spread.addSheetTab(0, "Report", GC.Spread.Sheets.SheetType.reportSheet); * report.renderMode("Design"); * const templateSheet = report.getTemplate(); * templateSheet.setTemplateCell(0, 0, { * binding: "Orders[customerId]", * type: "Group", * showCollapseButton: true * }); * templateSheet.setTemplateCell(0, 1, { * binding: "Orders[orderId]", * type: "Group", * }); * templateSheet.addSpan(0, 0, 2, 1); * report.renderMode("Preview"); * report.getCollapseState(0, 0); // false * report.toggleCollapseState(0, 0); * report.getCollapseState(0, 0); // true * ``` */ getCollapseState(row: number, col: number): boolean; /** * Get the column width by col index. * @param {number} col The column index. * @returns {number} Return column width. * @example * ```javascript * const report = spread.addSheetTab(0, "Report", GC.Spread.Sheets.SheetType.reportSheet); * report.renderMode("Design"); * const templateSheet = report.getTemplate(); * templateSheet.setTemplateCell(0, 0, { * binding: "Orders[customerId]", * type: "Group", * spillDirection: "Horizontal" * }); * templateSheet.setColumnWidth(0, 100); * const designColumnWidth1 = report.getColumnWidth(0); // ColumnWidth: 100 * const designColumnWidth2 = report.getColumnWidth(1); // ColumnWidth: 62 * report.renderMode("Preview"); * const previewColumnWidth1 = report.getColumnWidth(0); // ColumnWidth: 100 * const previewColumnWidth2 = report.getColumnWidth(1); // ColumnWidth: 100 * report.renderMode("PaginatedPreview"); * const paginatedPreviewColumnWidth1 = report.getColumnWidth(0); // ColumnWidth: 100 * const paginatedPreviewColumnWidth2 = report.getColumnWidth(1); // ColumnWidth: 100 * ``` */ getColumnWidth(col: number): number; /** * Get the pages count of the report. * @returns {number} Return the pages count of the report. * @example * ```javascript * // get the pages count. * const pagesCount = reportSheet.getPagesCount(); * ``` */ getPagesCount(): number; /** * @returns {GC.Spread.Sheets.Range} Return the report sheet range. * If the render mode is Design, return the template sheet range. * If the render mode is Preview, return the whole report range. * If the render mode is PaginatedPreview, return the current page's range. * @example * ```javascript * const report = spread.addSheetTab(0, "Report", GC.Spread.Sheets.SheetType.reportSheet); * report.renderMode("Design"); * const templateSheet = report.getTemplate(); * templateSheet.setTemplateCell(199, 0, { * binding: "Orders[customerId]", * type: "Group", * }); * const designRange = report.getRange(); // row: 0, col: 0, rowCount: 200, colCount: 20. * report.renderMode("Preview"); * const previewRange = report.getRange(); // row: 0, col: 0, rowCount: 288, colCount: 1. * report.renderMode("PaginatedPreview"); * const paginatedPreviewRange = report.getRange(); // row: 0, col: 0, rowCount: 45, colCount: 1. * ``` */ getRange(): GC.Spread.Sheets.Range; /** * Get the row height by row index. * @param {number} row The row index. * @returns {number} Return row height. * @example * ```javascript * const report = spread.addSheetTab(0, "Report", GC.Spread.Sheets.SheetType.reportSheet); * report.renderMode("Design"); * const templateSheet = report.getTemplate(); * templateSheet.setTemplateCell(0, 0, { * binding: "Orders[customerId]", * type: "Group", * }); * templateSheet.setRowHeight(0, 30); * const designRowHeight1 = report.getRowHeight(0); // RowHeight: 30 * const designRowHeight2 = report.getRowHeight(1); // RowHeight: 20 * report.renderMode("Preview"); * const previewRowHeight1 = report.getRowHeight(0); // RowHeight: 30 * const previewRowHeight2 = report.getRowHeight(1); // RowHeight: 30 * report.renderMode("PaginatedPreview"); * const paginatedPreviewRowHeight1 = report.getRowHeight(0); // RowHeight: 30 * const paginatedPreviewRowHeight2 = report.getRowHeight(1); // RowHeight: 30 * ``` */ getRowHeight(row: number): number; /** * Get the range of the cell in current render mode. * @param {number} row The row index. * @param {number} col The column index. * @returns {GC.Spread.Sheets.Range} Return range of the cell. * @example * ```javascript * const report = spread.addSheetTab(0, "Report", GC.Spread.Sheets.SheetType.reportSheet); * report.renderMode("Design"); * const templateSheet = report.getTemplate(); * templateSheet.setTemplateCell(0, 0, { * binding: "Orders[customerId]", * type: "Group", * }); * templateSheet.addSpan(0, 0, 2, 1); * const designSpan1 = report.getSpan(0, 0); // span: row: 0, col: 0, rowCount: 2, colCount: 1 * const designSpan2 = report.getSpan(2, 0); // span: null * report.renderMode("Preview"); * const previewSpan1 = report.getSpan(0, 0); // span: row: 0, col: 0, rowCount: 2, colCount: 1 * const previewSpan2 = report.getSpan(2, 0); // span: row: 2, col: 0, rowCount: 2, colCount: 1 * report.renderMode("PaginatedPreview"); * const paginatedPreviewSpan1 = report.getSpan(0, 0); // span: row: 0, col: 0, rowCount: 2, colCount: 1 * const paginatedPreviewSpan2 = report.getSpan(2, 0); // span: row: 2, col: 0, rowCount: 2, colCount: 1 * ``` */ getSpan(row: number, col: number): GC.Spread.Sheets.Range; /** * Get the style of the cell in current render mode. * @param {number} row The row index. * @param {number} col The column index. * @returns {GC.Spread.Sheets.Style} Return style of the cell. * @example * ```javascript * const report = spread.addSheetTab(0, "Report", GC.Spread.Sheets.SheetType.reportSheet); * report.renderMode("Design"); * const templateSheet = report.getTemplate(); * templateSheet.setTemplateCell(0, 0, { * binding: "Orders[customerId]", * type: "Group", * }); * templateSheet.getCell(0, 0).backColor("red"); * templateSheet.setTemplateCell(1, 0, { * binding: "Orders[orderId]", * type: "Group", * }); * templateSheet.getCell(1, 0).backColor("green"); * const designStyle1 = report.getStyle(0, 0); // backColor: red * const designStyle2 = report.getStyle(1, 0); // backColor: green * report.renderMode("Preview"); * const previewStyle1 = report.getStyle(0, 0); // backColor: red * const previewStyle2 = report.getStyle(1, 0); // backColor: red * report.renderMode("PaginatedPreview"); * const paginatedPreviewStyle1 = report.getStyle(0, 0); // backColor: red * const paginatedPreviewStyle2 = report.getStyle(1, 0); // backColor: red * ``` */ getStyle(row: number, col: number): GC.Spread.Sheets.Style; /** * get the template sheet of the current report sheet. * @returns {GC.Spread.Report.TemplateSheet} Return the template sheet of the current report sheet. * @example * ```javascript * const report = spread.addSheetTab(0, "Report", GC.Spread.Sheets.SheetType.reportSheet); * report.renderMode("Design"); * const templateSheet = report.getTemplate(); // get the reportSheet templateSheet * templateSheet.setTemplateCell(0, 0, { * binding: "Orders[customerId]", * type: "Group", * }); * report.renderMode("Preview"); * ``` */ getTemplate(): GC.Spread.Report.TemplateSheet; /** * Get template cell of specified cell. * @param {number} row The row index. * @param {number} col The column index. * @returns {GC.Spread.Report.TemplateCell} Return the template cell of specified cell. * If the render mode is Design, return the template cell of the template sheet in the specified row col. * If the render mode is Preview, return the template cell of the specified cell. * If the render mode is PaginatedPreview, return the template cell of the specified cell. * @example * ```javascript * const report = spread.addSheetTab(0, "Report", GC.Spread.Sheets.SheetType.reportSheet); * report.renderMode("Design"); * const templateSheet = report.getTemplate(); * templateSheet.setTemplateCell(0, 0, { * binding: "Orders[customerId]", * type: "Group", * }); * templateSheet.setTemplateCell(1, 0, { * binding: "Orders[orderId]", * type: "Group", * }); * const designTemplateCell1 = report.getTemplateCell(0, 0); // binding: Orders[customerId] * const designTemplateCell2 = report.getTemplateCell(1, 0); // binding: Orders[orderId] * report.renderMode("Preview"); * const previewTemplateCell1 = report.getTemplateCell(0, 0); // binding: Orders[customerId] * const previewTemplateCell2 = report.getTemplateCell(1, 0); // binding: Orders[customerId] * const previewTemplateCell3 = report.getTemplateCell(89, 0); // binding: Orders[orderId] * report.renderMode("PaginatedPreview"); * const paginatedPreviewTemplateCell1 = report.getTemplateCell(0, 0); // binding: Orders[customerId] * const paginatedPreviewTemplateCell2 = report.getTemplateCell(1, 0); // binding: Orders[customerId] * ``` */ getTemplateCell(row: number, col: number): GC.Spread.Report.TemplateCell; /** * Get the value of the cell in current render mode. * @param {number} row The row index. * @param {number} col The column index. * @returns {any} Return value of the cell. * @example * ```javascript * const report = spread.addSheetTab(0, "Report", GC.Spread.Sheets.SheetType.reportSheet); * report.renderMode("Design"); * const templateSheet = report.getTemplate(); * templateSheet.setTemplateCell(0, 0, { * binding: "Orders[customerId]", * type: "Group", * }); * templateSheet.setValue(1, 0, "test"); * const designValue = report.getValue(1, 0); // test * report.renderMode("Preview"); * const previewValue = report.getValue(1, 0); // TOMSP * report.renderMode("PaginatedPreview"); * const paginatedPreviewValue = report.getValue(1, 0); // TOMSP * ``` */ getValue(row: number, col: number): any; /** * Return a boolean value indicate wether the report has un-submit changes. * @returns {boolean} Return true if the report has un-submit changes, otherwise return false. * @example * ```javascript * // if the current reportSheet has un-submit changes, isDirty will be true. * const isDirty = reportSheet.isDirty(); * ``` */ isDirty(): boolean; /** * Update the report sheet template, and also the report will be regenerated based on the new template and parameter values. * @param {Object} templateJson The template json. * @example * ```javascript * const report = spread.addSheetTab(0, "Report", GC.Spread.Sheets.SheetType.reportSheet); * const templateSheet = new GC.Spread.Report.TemplateSheet("Template"); * templateSheet.setTemplateCell(0, 0, { * binding: "Orders[customerId]", * type: "Group", * }); * report.loadTemplate(templateSheet.toJSON()); * ``` */ loadTemplate(templateJson: Object): void; /** * Gets or sets the name of the ReportSheet. * @param {string} [value] The name of the ReportSheet. * @returns {string} returns the ReportSheet name. * @example * ```javascript * // get the report sheet name * const name = reportSheet.name(); * * // set the report sheet name * reportSheet.name('new-name'); * ``` */ name(value?: string): any; /** * Get or set the parameter in reportsheet. * @param {GC.Spread.Sheets.IParameter} [parameter] Set new parameter into reportsheet. * @returns {GC.Spread.Sheets.IParameter} Returns the reportsheet current working parameter. * @example * ```javascript * const report = spread.addSheetTab(0, "Report", GC.Spread.Sheets.SheetType.reportSheet); * report.renderMode("Design"); * report.getTemplate().setTemplateCell(0, 0, { * binding: "Orders[customerId]", * type: "Group", * filter: { * condition: { * column: "customerId", * operator: "Equal", * parameter: "customerId" * } * } * }); * report.renderMode("Preview"); * * let parameter = report.parameter(); // get the reportsheet parameter * parameter.customerId = "VINET"; * report.parameter(parameter); // set the parameter. * report.regenerateReport(); // regenerate reportsheet according to the new parameter. * ``` */ parameter(parameter?: GC.Spread.Sheets.IParameter): GC.Spread.Sheets.IParameter; /** * Gets or sets the print information for the report sheet. * @param {GC.Spread.Sheets.Print.PrintInfo} [value] The print information for the report sheet. * @returns {GC.Spread.Sheets.Print.PrintInfo | GC.Spread.Report.ReportSheet} If no value is set, returns the print information for the report sheet; otherwise, returns the report sheet. * @example * ```javascript * // set the paper size. * const printInfo = reportSheet.printInfo(); * printInfo.paperSize(new GC.Spread.Sheets.Print.PaperSize(GC.Spread.Sheets.Print.PaperKind.a3)); * ``` */ printInfo(value?: GC.Spread.Sheets.Print.PrintInfo): GC.Spread.Sheets.Print.PrintInfo | GC.Spread.Report.ReportSheet; /** * Get or set the page index array that will be print. empty array indicates print all the pages. * @param {number[]} pageIndexes The print page index array (0 base). * @returns {number[]} Return the page index array that will be print. * @example * ```javascript * // print only the first and fifth pages of the current report. * reportSheet.printPageIndexes([0, 4]); * reportSheet.options.printAllPages = true; * spread.print(); * * // clear the print page indexes setting. * reportSheet.printPageIndexes([]); * ``` */ printPageIndexes(pageIndexes?: number[]): number[]; /** * Refresh the current report sheet, all the render modes can support this function. * Design: Refresh the cache of the template sheet and repaint. * Preview: Regenerate the report base on the current template sheet and repaint. * PaginatedPreview: Regenerate the report base on the current template sheet and repaint. * @example * ```javascript * const report = spread.addSheetTab(0, "Report", GC.Spread.Sheets.SheetType.reportSheet); * const templateSheet = report.getTemplate(); * templateSheet.setTemplateCell(0, 0, { * binding: "Orders[customerId]", * type: "Group", * }); * report.refresh(); * ``` */ refresh(): void; /** * Regenerate the report base on the current template. * @example * ```javascript * const report = spread.addSheetTab(0, "Report", GC.Spread.Sheets.SheetType.reportSheet); * const templateSheet = report.getTemplate(); * templateSheet.setTemplateCell(0, 0, { * binding: "Orders[customerId]", * type: "Group", * }); * report.regenerateReport(); * ``` */ regenerateReport(): void; /** * Get or set the render mode. * @param {GC.Spread.Report.RenderMode} renderMode The render mode. * @returns {GC.Spread.Report.RenderMode} Return the render mode. * @example * ```javascript * // switch to design mode. * reportSheet.renderMode('Design'); * * // switch to preview mode. * reportSheet.renderMode('Preview'); * * // switch to paginated preview mode. * reportSheet.renderMode('PaginatedPreview'); * ``` */ renderMode(renderMode?: GC.Spread.Report.RenderMode): GC.Spread.Report.RenderMode; /** * Repaint the current report sheet. */ repaint(): void; /** * Reset specified cell's value. * @param {number} row The row index. * @param {number} col The column index. * @example * ```javascript * // If the A2 cell's value is modified, resetCellValue can reset the A2 cell to its original value. * reportSheet.resetCellValue(1, 0); * ``` */ resetCellValue(row: number, col: number): void; /** * Set the reportSheet parametersUI. * @param {HTMLElement | string} host - The parameterUI host element or host id. * @param {GC.Spread.Report.InitParametersUIFunctionType} initParametersUI - The callback to modify the parameterUI sheet. * @param {GC.Spread.Report.OnChangeFunctionType} onChange - The callback when the parameterUI value changed or button clicked. * @example * ```javascript * const report = spread.addSheetTab(0, "Report", GC.Spread.Sheets.SheetType.reportSheet); * report.renderMode("Design"); * report.parameter({ customerId: "VINET" }); * report.getTemplate().setTemplateCell(0, 0, { * binding: "Orders[customerId]", * type: "Group", * filter: { * condition: { * column: "customerId", * operator: "Equal", * parameter: "customerId" * } * } * }); * report.renderMode("Preview"); * * const host = document.getElementById("parameterUIHost"); * report.setParametersUI(host, initParametersUI, onChanged); * function initParametersUI (sheet) { * sheet.getCell(3, 3).value("CustomerId:"); // add static label cell * sheet.getCell(3, 4).bindingPath("customerId").tag("customerId"); // add parameter binding path and tag to this cell * const submitButton = new GC.Spread.Sheets.CellTypes.Button(); // add submit button * submitButton.text("Submit"); * sheet.getCell(3, 5).cellType(submitButton).tag("submitButton"); // set button cell type and tag to this cell * } * function onChanged (reportSheet, changedArgs) { * if (changedArgs.tag === "submitButton") { // submit button clicked. * reportSheet.regenerateReport(); * } * if (changedArgs.tag === "customerId") { * changedArgs.newValue = changedArgs.newValue.toUpperCase(); // update newValue here. * } * } * ``` */ setParametersUI(host: HTMLElement | string, initParametersUI: GC.Spread.Report.InitParametersUIFunctionType, onChange: GC.Spread.Report.OnChangeFunctionType): void; /** * Submit the changes to the remote database based on your data entry setting through the DataManger. * @example * ```javascript * // submit the changes. * reportSheet.submit(); * ``` */ submit(): void; /** * Toggle the collapse state of the specified cell. * @param {number} row The row index. * @param {number} col The column index. * @param {'Collapsed' | 'Expanded'} targetState The target state, collapse or expand the specific cell. * @param {boolean} recursive True will update the state of the current cell and all the descendant cells, false will only update the current cell. * @example * ```javascript * const report = spread.addSheetTab(0, "Report", GC.Spread.Sheets.SheetType.reportSheet); * report.renderMode("Design"); * const templateSheet = report.getTemplate(); * templateSheet.setTemplateCell(0, 0, { * binding: "Orders[customerId]", * type: "Group", * showCollapseButton: true * }); * templateSheet.setTemplateCell(0, 1, { * binding: "Orders[orderId]", * type: "Group", * }); * templateSheet.addSpan(0, 0, 2, 1); * report.renderMode("Preview"); * report.toggleCollapseState(0, 0); * ``` */ toggleCollapseState(row: number, col: number, targetState?: 'Collapsed' | 'Expanded', recursive?: boolean): void; /** * Generated a static worksheet(no formula, no cell binding) base on the current report sheet. * @returns {GC.Spread.Sheets.Worksheet} Return the generated worksheet. * @example * ```javascript * const report = spread.addSheetTab(0, "Report", GC.Spread.Sheets.SheetType.reportSheet); * report.renderMode("Design"); * const templateSheet = report.getTemplate(); * templateSheet.setTemplateCell(0, 0, { * binding: "Orders[customerId]", * type: "Group", * }); * report.renderMode("Preview"); * const reportWorksheet = report.toWorksheet(); * ``` */ toWorksheet(): GC.Spread.Sheets.Worksheet; /** * Removes the binding of an event to the report sheet. * @param {string} type The event type. * @param {Function} fn Specifies the function for which to remove the binding. * @example * ```javascript * //This example unbind the ReportSheetDataChanged event after first data changing. * const report = spread.addSheetTab(0, "Report", GC.Spread.Sheets.SheetType.reportSheet); * report.renderMode("Design"); * const templateSheet = report.getTemplate(); * templateSheet.setTemplateCell(0, 0, { * binding: "Orders[orderId]", * type: "Group", * }); * templateSheet.setTemplateCell(0, 1, { * binding: "Orders[customerId]", * type: "Group", * }); * templateSheet.setDataEntrySetting([ { * name: "Write Back Rule 1", * tableName: "Orders", * fields: [ * { dbColumnName: "orderId", formula: "A1", isPrimary: true }, * { dbColumnName: "customerId", formula: "B1" }, * ], * includeUnmodified: false, * skipRecordWithEmptyValue: false * } ]); * report.renderMode("Preview"); * report.bind(GC.Spread.Sheets.Events.ReportSheetDataChanged, (event, args) => { * let reportsheet = args.sheet, changes = reportsheet.getChanges(); * console.log(changes); * reportsheet.unbind(GC.Spread.Sheets.Events.ReportSheetDataChanged); * }); * // after reportsheet edit / update / delete records in UI will trigger ReportSheetDataChanged event. * ``` */ unbind(type: string, fn?: Function): void; /** * Update the specified cell's value. * @param {number} row The row index. * @param {number} col The column index. * @param {any} value The new value of the cell. * @example * ```javascript * // update the A2 cell's value. * reportSheet.updateCellValue(1, 0, 'test'); * ``` */ updateCellValue(row: number, col: number, value: any): void; } export class TemplateSheet extends GC.Spread.Sheets.Worksheet{ /** * Represents a TemplateSheet. * @class * @param {string} name The name of the TemplateSheet. * @example * ```javascript * const spread = new GC.Spread.Sheets.Workbook('spread-host', { sheetCount: 0 }); * const reportSheet = spread.addSheetTab(0, 'orders-report', GC.Spread.Sheets.SheetType.reportSheet); * const templateSheet = reportSheet.getTemplate(); * templateSheet.setValue(0, 0, 'test'); * ``` */ constructor(name: string); /** * Get the data entry setting. * @returns {GC.Spread.Report.DataEntrySetting} Return the data entry setting. * @example * ```javascript * // get the data entry setting. * const dataEntrySetting = templateSheet.getDataEntrySetting(); * ``` */ getDataEntrySetting(): GC.Spread.Report.DataEntrySetting; /** * Get the layout setting. * @returns {GC.Spread.Report.LayoutSetting} Return the layout setting. * @example * ```javascript * // get the layout setting. * const layoutSetting = templateSheet.getLayoutSetting(); * ``` */ getLayoutSetting(): GC.Spread.Report.LayoutSetting; /** * Get the pagination setting. * @returns {GC.Spread.Report.IPaginationSetting} Return the pagination setting. * @example * ```javascript * // get the pagination setting. * const paginationSetting = templateSheet.getPaginationSetting(); * ``` */ getPaginationSetting(): GC.Spread.Report.IPaginationSetting; /** * Get the template cell. * @param {number} row The row index. * @param {number} col The column index. * @returns {GC.Spread.Report.TemplateCell} Returns the template cell. * @example * ```javascript * // get the A2 template cell's setting. * const templateCell = templateSheet.getTemplateCell(1, 0); * ``` */ getTemplateCell(row: number, col: number): GC.Spread.Report.TemplateCell; /** * Set the data entry setting. * @param {GC.Spread.Report.DataEntrySetting} dataEntrySetting The data entry setting. * @example * ```javascript * // add the customers table. * const customersTable = spread.dataManager().addTable('Customers', { * remote: { * read: { url: 'https://demodata.mescius.io/northwind/api/v1/customers' }, * batch: (data) => { * // sync the changes to the server here. * console.log('changes: ', data); * return Promise.resolve(data.map((item) => ({ succeed: true }))); * }, * }, * batch: true, * }); * * // set binding for the template * const columns = ['customerId', 'companyName', 'contactName', 'contactTitle', 'address', 'region', 'country', 'city', 'postalCode', 'phone', 'fax']; * columns.forEach((columnName, i) => { * templateSheet.setValue(0, i, `${columnName[0].toUpperCase()}${columnName.substring(1)}`); * templateSheet.setTemplateCell(1, i, { * type: 'List', * binding: `Customers[${columnName}]`, * }); * }); * * // config the data entry setting * const customerRule = { * name: 'customers', * tableName: 'Customers', * fields: [ * { formula: 'A2', dbColumnName: 'customerId', isPrimary: true }, * { formula: 'B2', dbColumnName: 'companyName' }, * { formula: 'C2', dbColumnName: 'contactName' }, * { formula: 'D2', dbColumnName: 'contactTitle' }, * { formula: 'E2', dbColumnName: 'address' }, * { formula: 'F2', dbColumnName: 'region' }, * { formula: 'G2', dbColumnName: 'country' }, * { formula: 'H2', dbColumnName: 'city' }, * { formula: 'I2', dbColumnName: 'postalCode' }, * { formula: 'J2', dbColumnName: 'phone' }, * { formula: 'K2', dbColumnName: 'fax' }, * ], * }; * templateSheet.setDataEntrySetting([customerRule]); * ``` */ setDataEntrySetting(dataEntrySetting: GC.Spread.Report.DataEntrySetting): void; /** * Set the layout setting. * @param {GC.Spread.Report.LayoutSetting} setting The layout setting. * @example * ```javascript * const dataManager = spread.dataManager(); * dataManager.addTable("orders", * { * remote: { * read: { * url: "https://demodata.mescius.io/northwind/api/v1/orders" * } * } * } * ); * templateSheet.setTemplateCell(1, 0, { type: 'List', binding: 'orders[orderId]' }); * const setting = { * dataRange: "A2", * type: "RowLayout", * rowCount: 10 * } * templateSheet.setLayoutSetting(setting); * ``` */ setLayoutSetting(setting: GC.Spread.Report.LayoutSetting): void; /** * Set the pagination setting. * @param {GC.Spread.Report.IPaginationSetting} setting The pagination setting. * @example * ```javascript * // set the paper size pagination. * const printInfo = templateSheet.printInfo(); * printInfo.paperSize().kind(GC.Spread.Sheets.Print.PaperKind.a4); * templateSheet.setPaginationSetting({ * paperSizePagination: true, * titleRow: { * start: 0, * end: 0, * }, * titleCol: { * start: 0, * end: 0, * }, * paginationOrder: 'OverThenDown', * }); * * // set row pagination, row pagination only can work for the list template cell. * templateSheet.setTemplateCell(1, 0, { type: 'List', binding: 'orders[orderId]' }); * templateSheet.setPaginationSetting({ * rowPagination: { * paginationDataCell: 'A2', * rowCountPerPage: 20, * }, * titleRow: { * start: 0, * end: 0, * }, * }); * ``` */ setPaginationSetting(setting: GC.Spread.Report.IPaginationSetting): void; /** * Set the template cell. * @param {number} row The row index. * @param {number} col The column index. * @param {GC.Spread.Report.TemplateCell} templateCell The template cell. * @example * ```javascript * const dataManager = spread.dataManager(); * dataManager.addTable("orders", * { * remote: { * read: { * url: "https://demodata.mescius.io/northwind/api/v1/orders" * } * } * } * ); * // set the template cell setting for the A2 cell. * templateSheet.setTemplateCell(1, 0, { type: 'List', binding: 'orders[shipCity]' }); * ``` */ setTemplateCell(row: number, col: number, templateCell: GC.Spread.Report.TemplateCell): void; } } module Sheets{ /** * Represents the license key for evaluation version and production version. */ var LicenseKey: string; /** * Gets the Workbook instance by the host element. * @param {HTMLElement|string} host The host element or the host element id. * @returns {GC.Spread.Sheets.Workbook} The Workbook instance. */ function findControl(host: HTMLElement|string): GC.Spread.Sheets.Workbook; /** * Gets the type from the type string. This method is used for supporting the serialization of the custom object. * @param {string} typeString The type string. * @returns {Object} The type. */ function getTypeFromString(typeString: string): any; export interface FloatingObjectLoadedEventArgs{ sheet: GC.Spread.Sheets.Worksheet; sheetName: string; floatingObject: FloatingObjects.FloatingObject; element: HTMLElement; } export interface FormattedData{ conditionalForeColor?: string | CanvasGradient | CanvasPattern; value?: string | CanvasGradient | CanvasPattern; content?: { type: string; value: string; }[]; } export interface IActiveSheetChangedEventArgs{ oldSheet: GC.Spread.Sheets.Worksheet; newSheet: GC.Spread.Sheets.Worksheet; } export interface IActiveSheetChangingEventArgs{ oldSheet: GC.Spread.Sheets.Worksheet; newSheet: GC.Spread.Sheets.Worksheet; cancel: boolean; } export interface IAddColumnButtonOption{ visible?: boolean; command?: string; style?: GC.Spread.Sheets.Style; width?: number; tooltip?: string; } export interface IAddRowButtonOption{ visible?: boolean; command?: string; style?: GC.Spread.Sheets.Style; height?: number; tooltip?: string; } export interface IAppDocProps{ manager?: string; company?: string; hyperlinkBase?: string; totalTime?: number; template?: string; } export interface IBaseSpreadOption{ width?: number; height?: number; } export interface IBounds{ x?: number; y?: number; width: number; height: number; } export interface IBuiltInFileIcons{ [key: string]: string; } export interface IButtonClickedEventArgs{ sheet: GC.Spread.Sheets.Worksheet; sheetName: string; row: number; col: number; sheetArea: SheetArea; } export interface ICalendarDateRange{ start: Date; end: Date; } export interface ICalendarOption{ startDay?: GC.Spread.Sheets.CalendarStartDay; calendarPage?: GC.Spread.Sheets.CalendarPage; showTime?: boolean; showDateRange?: boolean; showBuiltInDateRange?: boolean; defaultDateTime?: Date | GC.Spread.Sheets.ICalendarDateRange; maxDate?: Date; minDate?: Date; } export interface ICellButton{ position?: GC.Spread.Sheets.ButtonPosition; useButtonStyle?: boolean; enabled?: boolean; width?: number; caption?: string; imageSrc?: string; imageSize?: GC.Spread.Sheets.IImageSize; captionAlign?: GC.Spread.Sheets.CaptionAlignment; command?: string | ((sheet: GC.Spread.Sheets.Worksheet, row: number, col: number, option: any) => void); imageType?: GC.Spread.Sheets.ButtonImageType; visibility?: GC.Spread.Sheets.ButtonVisibility; hoverBackColor?: string; buttonBackColor?: string; } export interface ICellChangedEventArgs{ sheet: GC.Spread.Sheets.Worksheet; sheetName: string; row: number; col: number; sheetArea: SheetArea; propertyName: string; oldValue: any; newValue: any; isUndo?: boolean; } export interface ICellClickEventArgs{ sheet: GC.Spread.Sheets.Worksheet; sheetName: string; sheetArea: SheetArea; row: number; col: number; } export interface ICellColorSortInfo{ order: "top" | "bottom"; backColor: string | GC.Spread.Sheets.IGradientFill | GC.Spread.Sheets.IGradientPathFill | GC.Spread.Sheets.IPatternFill | undefined; index: number; } export interface ICellDoubleClickEventArgs{ sheet: GC.Spread.Sheets.Worksheet; sheetName: string; sheetArea: SheetArea; row: number; col: number; } export interface ICellPosition{ row: number; col: number; } export interface ICellsInfo{ row: number; col: number; rowCount?: number; colCount?: number; sheetName: string; } export interface IClearChangeInfo{ row?: number; col?: number; rowCount?: number; colCount?: number; clearType?: GC.Spread.Sheets.ClearPendingChangeType; } export interface IClipboardChangedEventArgs{ sheet: GC.Spread.Sheets.Worksheet; sheetName: string; copyData: GC.Spread.Sheets.ICopyData; } export interface IClipboardChangingEventArgs{ sheet: GC.Spread.Sheets.Worksheet; sheetName: string; copyData: GC.Spread.Sheets.ICopyData; cancel: boolean; action: GC.Spread.Sheets.ClipboardActionType; } export interface IClipboardPastedEventArgs{ sheet: GC.Spread.Sheets.Worksheet; sheetName: string; cellRange: GC.Spread.Sheets.Range; pasteOption: ClipboardPasteOptions; pasteData: GC.Spread.Sheets.IPasteData; fromSheet?: GC.Spread.Sheets.Worksheet; fromRange?: GC.Spread.Sheets.Range; isCutting: boolean; objects?: any[]; shiftCells?: GC.Spread.Sheets.InsertShiftCell; action: GC.Spread.Sheets.ClipboardActionType; } export interface IClipboardPastingEventArgs{ sheet: GC.Spread.Sheets.Worksheet; sheetName: string; cellRange: GC.Spread.Sheets.Range; pasteOption: ClipboardPasteOptions; pasteData: GC.Spread.Sheets.IPasteData; fromSheet?: GC.Spread.Sheets.Worksheet; fromRange?: GC.Spread.Sheets.Range; isCutting: boolean; objects?: any[]; cancel: boolean; shiftCells?: GC.Spread.Sheets.InsertShiftCell; action: GC.Spread.Sheets.ClipboardActionType; } export interface IColorPickerGroup{ name?: string; colors: string[][]; needScaleColor?: boolean; } export interface IColorPickerOption{ colorBlockSize?: number; groups?: GC.Spread.Sheets.IColorPickerGroup[]; } export interface IColumn{ name?: string; formatter?: string; cellType?: GC.Spread.Sheets.CellTypes.Base; width?: number; visible?: boolean; resizable?: boolean; pageBreak?: boolean; displayName?: string; size?: number | string; value?: Function; starSize?: string; } export interface IColumnBindingInfo{ name: string; displayName?: string; formatter?: string; size?: number | string; visible?: boolean; } export interface IColumnChangedEventArgs{ sheet: GC.Spread.Sheets.Worksheet; sheetName: string; col: number; sheetArea: SheetArea; propertyName: string; oldValue: any; newValue: any; count?: number; isUndo?: boolean; } export interface IColumnChangingEventArgs{ sheet: GC.Spread.Sheets.Worksheet; sheetName: string; col: number; sheetArea: SheetArea; propertyName: string; oldValue: any; newValue: any; count?: number; cancel: boolean; } export interface IColumnWidthChangedEventArgs{ sheet: GC.Spread.Sheets.Worksheet; sheetName: string; colList: number[]; header: boolean; } export interface IColumnWidthChangingEventArgs{ sheet: GC.Spread.Sheets.Worksheet; sheetName: string; colList: any[]; header: boolean; cancel: boolean; } export interface ICommandMetaData{ viewModePermissions: GC.Spread.Sheets.Collaboration.PermissionTypes; } export interface ICommentChangedEventArgs{ sheet: GC.Spread.Sheets.Worksheet; sheetName: string; comment: Comments.Comment; propertyName: string; row: number; col: number; } export interface ICommentRemovedEventArgs{ sheet: GC.Spread.Sheets.Worksheet; sheetName: string; comment: Comments.Comment; row: number; col: number; } export interface ICommentRemovingEventArgs{ sheet: GC.Spread.Sheets.Worksheet; sheetName: string; comment: Comments.Comment; cancel: boolean; row: number; col: number; } export interface ICopyData{ text?: string; html?: string } export interface ICoreDocProps{ title?: string; subject?: string; creator?: string; keywords?: string; description?: string; category?: string; contentStatus?: string; modified?: Date; created?: Date; lastModifiedBy?: string; lastPrinted?: Date; revision?: number; } export interface ICornerFold{ size?: number; position?: GC.Spread.Sheets.CornerPosition; color?: string; } export interface ICustomDocPropsManager{ all: (props?: GC.Spread.Sheets.ICustomDocumentProperty[]) => GC.Spread.Sheets.ICustomDocumentProperty[]; get: (propName: string) => GC.Spread.Sheets.ICustomDocumentProperty; add: (propName: string, value: GC.Spread.Sheets.CustomDocumentPropertyValueType, isLinkTarget?: boolean) => void; remove: (propName: string) => void; clear: () => void; } export interface ICustomDocumentProperty{ name: string; value?: GC.Spread.Sheets.CustomDocumentPropertyValueType; linkTarget?: string; } export interface ICustomSortInfo{ compareFunction: (value1: any, value2: any) => number; ascending: boolean; index: number; } export interface IDecoration{ cornerFold?: GC.Spread.Sheets.ICornerFold; icons?: GC.Spread.Sheets.IIcon[]; } export interface IDeserializationOptions{ /** * Whether to ignore the style when converting json to the workbook. */ ignoreStyle?: boolean; /** * Whether to ignore the formula when converting json to the workbook. */ ignoreFormula?: boolean; /** * Whether to treat the frozen columns as row headers when converting json to the workbook. */ frozenColumnsAsRowHeaders?: boolean; /** * Whether to treat the frozen rows as column headers when converting json to the workbook. */ frozenRowsAsColumnHeaders?: boolean; /** * Whether to prevent recalculation after loading the json data. */ doNotRecalculateAfterLoad?: boolean; /** * Whether to use the incremental loading or the callbacks of incremental loading when converting json to the workbook. */ incrementalLoading?: boolean | GC.Spread.Sheets.IIncrementalLoadingOptions; } export interface IDirtyCellInfo{ row: number; col: number; newValue: any; oldValue: any; } export interface IDocProps{ coreDocProps?: GC.Spread.Sheets.ICoreDocProps; appDocProps?: GC.Spread.Sheets.IAppDocProps; customDocPropsManager: GC.Spread.Sheets.ICustomDocPropsManager; } export interface IDragDropBlockCompletedEventArgs{ sheet: GC.Spread.Sheets.Worksheet; sheetName: string; fromRow: number; fromCol: number; toRow: number; toCol: number; rowCount: number; colCount: number; copy: boolean; insert: boolean; copyOption: CopyToOptions; } export interface IDragDropBlockEventArgs{ sheet: GC.Spread.Sheets.Worksheet; sheetName: string; fromRow: number; fromCol: number; toRow: number; toCol: number; rowCount: number; colCount: number; copy: boolean; insert: boolean; copyOption: CopyToOptions; cancel: boolean; } export interface IDragFillBlockCompletedEventArgs{ sheet: GC.Spread.Sheets.Worksheet; sheetName: string; fillRange: GC.Spread.Sheets.Range; autoFillType: GC.Spread.Sheets.Fill.AutoFillType; fillDirection: GC.Spread.Sheets.Fill.FillDirection; } export interface IDragFillBlockEventArgs{ sheet: GC.Spread.Sheets.Worksheet; sheetName: string; fillRange: GC.Spread.Sheets.Range; autoFillType: GC.Spread.Sheets.Fill.AutoFillType; fillDirection: GC.Spread.Sheets.Fill.FillDirection; cancel: boolean; } export interface IDropdown{ type: GC.Spread.Sheets.DropDownType; option?: ICalendarOption | IColorPickerOption | IListOption | IMonthPickerOption | ISliderOption | ITimePickerOption | IWorkFlowOption | IMultiColumnOption; submitCommand?: string | ((sheet: GC.Spread.Sheets.Worksheet, value:any, option: any) => void); } export interface IEditChangeEventArgs{ sheet: GC.Spread.Sheets.Worksheet; sheetName: string; row: number; col: number; editingText: any; } export interface IEditEndedEventArgs{ sheet: GC.Spread.Sheets.Worksheet; sheetName: string; row: number; col: number; editingText: Object; } export interface IEditEndingEventArgs{ sheet: GC.Spread.Sheets.Worksheet; sheetName: string; row: number; col: number; editor: Object; editingText: Object; cancel: boolean; } export interface IEditorStatusChangedEventArgs{ sheet: GC.Spread.Sheets.Worksheet; sheetName: string; oldStatus: EditorStatus; newStatus: EditorStatus; } export interface IEditStartingEventArgs{ sheet: GC.Spread.Sheets.Worksheet; sheetName: string; row: number; col: number; cancel: boolean; } export interface IEnterCellEventArgs{ sheet: GC.Spread.Sheets.Worksheet; sheetName: string; row: number; col: number; } export interface IExternalReference{ name: string; filePath?: string; items?: GC.Spread.Sheets.IExternalReferenceDetail[]; } export interface IExternalReferenceDetail{ target: GC.Spread.Sheets.ICellsInfo; source: GC.Spread.Sheets.ICellsInfo | GC.Spread.Sheets.ICellsInfo[]; } export interface IFilterButtonHitInfo{ rowFilter: GC.Spread.Sheets.Filter.RowFilterBase; row?: number; col?: number; x?: number; y?: number; width?: number; height?: number; sheetArea?: GC.Spread.Sheets.SheetArea; } export interface IFloatingObjectChangedEventArgs{ sheet: GC.Spread.Sheets.Worksheet; sheetName: string; floatingObject: FloatingObjects.FloatingObject; propertyName: string; } export interface IFloatingObjectRemovedEventArgs{ sheet: GC.Spread.Sheets.Worksheet; sheetName: string; floatingObject: FloatingObjects.FloatingObject; } export interface IFloatingObjectRemovingEventArgs{ sheet: GC.Spread.Sheets.Worksheet; sheetName: string; floatingObject: FloatingObjects.FloatingObject; cancel: boolean; } export interface IFloatingObjectSelectionChangedEventArgs{ sheet: GC.Spread.Sheets.Worksheet; sheetName: string; floatingObject: FloatingObjects.FloatingObject; } export interface IFontColorSortInfo{ order: "top" | "bottom"; fontColor?: string; index: number; } export interface IFormulaInfo{ hasFormula?: boolean; baseRange?: GC.Spread.Sheets.Range; isArrayFormula?: boolean; formula?: string; formulaWithCulture?: string; isDynamicArray?: boolean; } export interface IFormulaRangeHitInfo{ /** * param range info */ paramRange: GC.Spread.Sheets.IParamRange; inTopLeft?: boolean; inTopRight?: boolean; inBottomLeft?: boolean; inBottomRight?: boolean; inBorder?: boolean; } export interface IGradientFill{ degree?: number; stops: { color: string; position: number }[]; } export interface IGradientPathFill{ type: string; left?: number; right?: number; top?: number; bottom?: number; stops: { color: string; position: number }[]; } export interface IHitTestCellTypeHitInfo{ x?: number; y?: number; row?: number; col?: number; cellRect?: GC.Spread.Sheets.Rect; sheetArea?: GC.Spread.Sheets.SheetArea; sheet?: GC.Spread.Sheets.Worksheet; isReservedLocation?: boolean; } export interface IHitTestCommentHitInfo{ x?: number; y?: number; comment?: GC.Spread.Sheets.Comments.Comment; area?: string; } export interface IHitTestDragInfo{ action?: string; side?: string; outside?: boolean; } export interface IHitTestFloatingObjectHitInfo{ x?: number; y?: number; floatingObject?: GC.Spread.Sheets.FloatingObjects.FloatingObject; } export interface IHitTestFooterCornerInfo{ element?: string, } export interface IHitTestInformation{ x?: number; y?: number; rowViewportIndex?: number; colViewportIndex?: number; row?: number; col?: number; hitTestType?: GC.Spread.Sheets.SheetArea; resizeInfo?: GC.Spread.Sheets.IHitTestResizeInfo; outlineHitInfo?: GC.Spread.Sheets.IHitTestOutlineHitInfo; filterButtonHitInfo?: GC.Spread.Sheets.IFilterButtonHitInfo; dragInfo?: GC.Spread.Sheets.IHitTestDragInfo; cellTypeHitInfo?: GC.Spread.Sheets.IHitTestCellTypeHitInfo; floatingObjectHitInfo?: GC.Spread.Sheets.IHitTestFloatingObjectHitInfo; shapeHitInfo?: GC.Spread.Sheets.IHitTestShapeHitInfo; formulaRangeHitInfo?: GC.Spread.Sheets.IFormulaRangeHitInfo; commentHitInfo?: GC.Spread.Sheets.IHitTestCommentHitInfo; pivotTableInfo?: any; pivotTableCellInfo?: any; } export interface IHitTestOutlineHitInfo{ what?: string; info?: GC.Spread.Sheets.IOutlineHitInfo; } export interface IHitTestResizeInfo{ action?: string; index?: number; sheetArea?: GC.Spread.Sheets.SheetArea; startY?: number; movingY?: number; startX?: number; movingX?: number; } export interface IHitTestScrollBarInfo{ element?: string, } export interface IHitTestShapeHitInfo{ x?: number; y?: number; type?: GC.Spread.Sheets.Shapes.HitTestType; shape?: GC.Spread.Sheets.Shapes.ShapeBase; target?: GC.Spread.Sheets.Shapes.ShapeBase; connectionPointIndex?: number; lineEnd?: GC.Spread.Sheets.Shapes.HitTestLineEnd; resizeHandle?: GC.Spread.Sheets.Shapes.IHitTestResizeHandle; adjustmentHandle?: GC.Spread.Sheets.Shapes.IHitTestAdjustmentHandle; } export interface IHyperlink{ url: string; tooltip?: string; linkColor?: string; visitedLinkColor?: string; target?: number; drawUnderline?: boolean; command?: string | ((sheet: GC.Spread.Sheets.Worksheet, row: number, col: number, sheetArea?: GC.Spread.Sheets.SheetArea) => void); } export interface IIcon{ src: string; position?: GC.Spread.Sheets.IconPosition; width?: number; height?: number; } export interface IIHitTestTabStripInfo{ navButton?: string; sheetTab?: GC.Spread.Sheets.SheetTabInfo; resize?: boolean; blank?: boolean; } export interface IImageSize{ /** * Specific the image's width, default value is 16, unit is px. */ width: number; /** * Specific the image's height, default value is 16, unit is px. */ height: number; } export interface IIncrementalLoadingOptions{ /** * The callback when of the incremental loading finished. */ loaded?: () => void; /** * The callback when of the incremental loading progress. */ loading?: (progress: number, args: { sheet: GC.Spread.Sheets.Worksheet }) => void; } export interface IInvalidOperationEventArgs{ sheet: GC.Spread.Sheets.Worksheet; sheetName: string; invalidType: InvalidOperationType; message: string; } export interface ILabelOptions{ /** * The cell label position. */ alignment?: GC.Spread.Sheets.LabelAlignment; /** * The cell label visibility. */ visibility?: GC.Spread.Sheets.LabelVisibility; /** * The cell label font. */ font?: string; /** * The cell label foreColor. */ foreColor?: string; /** * The cell label margin. */ margin?: string; } export interface ILeaveCellEventArgs{ sheet: GC.Spread.Sheets.Worksheet; sheetName: string; row: number; col: number; cancel: boolean; } export interface ILeftColumnChangedEventArgs{ sheet: GC.Spread.Sheets.Worksheet; sheetName: string; oldLeftCol: number; newLeftCol: number; oldOffset: number; newOffset: number; } export interface IListItem{ text?: string; value?: string; icon?: string; } export interface IListLayout{ direction?: GC.Spread.Sheets.LayoutDirection; displayAs?: GC.Spread.Sheets.LayoutDisplayAs; collapsible?: boolean; } export interface IListOption{ text?: string; layout?: GC.Spread.Sheets.IListLayout; multiSelect?: boolean; valueType?: GC.Spread.Sheets.DropdownListValue; onItemSelected?: (e: MouseEvent) => string; /** * a function returns a DOM element */ items: GC.Spread.Sheets.IListItem[] | GC.Spread.Sheets.IListOption[] | (() => HTMLElement); } export interface IMaskType{ pattern: string; excludeLiteral?: boolean; excludePlaceholder?: boolean; placeholder?: string; } export interface IMonthPickerOption{ startYear?: number; stopYear?: number; height?: number; } export interface IMultiColumnOption extends GC.Spread.Sheets.IBaseSpreadOption{ width?: number; height?: number; dataSource: string | any[]; bindingInfos?: GC.Spread.Sheets.IColumnBindingInfo[]; valuePath?: string; } export interface IOutlineColumnCheckStatusChanged{ sheet: GC.Spread.Sheets.Worksheet; sheetName: string; row: number, col: number, status: boolean } export interface IOutlineHitInfo{ index?: number; isExpanded?: boolean; level?: number; lineDirection?: GC.Spread.Sheets.Outlines.OutlineDirection; paintLine?: boolean; } export interface IParameter{ [parameterName: string]: string | number | boolean | Date; } export interface IParamRange{ /** * range text offset in formulatextbox's value */ textOffset: number; /** * range text */ text: string; /** * index in all ranges */ index: number; } export interface IPasteData{ text?: string; html?: string; image?: string; } export interface IPatternFill{ type: GC.Spread.Sheets.PatternType; patternColor: string; backgroundColor?: string; } export interface IPictureChangedEventArgs{ sheet: GC.Spread.Sheets.Worksheet; sheetName: string; picture: FloatingObjects.Picture; propertyName: string; } export interface IPictureSelectionChangedEventArgs{ sheet: GC.Spread.Sheets.Worksheet; sheetName: string; picture: FloatingObjects.Picture; } export interface IPivotTableChangedEventArgs{ pivotTableName: string; type: "filter" | "sort" | "collapse" | "fieldChanged" | "summarizedValueBy" | "showValueAs" | "dataPositionChanged" | "viewChanged" | "grandTotal" | "showNoData" | "group"; fieldName: string; value?: boolean; sortType?: number; area?: GC.Spread.Pivot.PivotTableFieldType; index?: number; } export interface IProtectionOptions{ /** * True or undefined if the user can select locked cells. */ allowSelectLockedCells?: boolean; /** * True or undefined if the user can select unlocked cells. */ allowSelectUnlockedCells?: boolean; /** * True if the user can sort ranges. */ allowSort?: boolean; /** * True if the user can filter ranges. */ allowFilter?: boolean; /** * True if the user can edit floating objects. */ allowEditObjects?: boolean; /** * True if the user can resize rows. */ allowResizeRows?: boolean; /** * True if the user can resize columns. */ allowResizeColumns?: boolean; /** * True if the user can drag to insert rows. */ allowDragInsertRows?: boolean; /** * True if the user can drag to insert columns. */ allowDragInsertColumns?: boolean; /** * True if the user can insert rows. */ allowInsertRows?: boolean; /** * True if the user can insert columns. */ allowInsertColumns?: boolean; /** * True if the user can delete rows. */ allowDeleteRows?: boolean; /** * True if the user can delete columns. */ allowDeleteColumns?: boolean; /** * True if the user can expand or collapse the column groups. */ allowOutlineColumns?: boolean; /** * True if the user can expand or collapse the row groups. */ allowOutlineRows?: boolean; } export interface IRange{ row: number; col: number; rowCount: number; colCount: number; } export interface IRangeChangedEventArgs{ sheet: GC.Spread.Sheets.Worksheet; sheetName: string; row: number; col: number; rowCount: number; colCount: number; changedCells: ICellPosition[]; action: RangeChangedAction; tableNames?: string[]; isUndo?: boolean; } export interface IRangeFilterClearedEventArgs{ sheet: GC.Spread.Sheets.Worksheet; sheetName: string; col: number; } export interface IRangeFilterClearingEventArgs{ sheet: GC.Spread.Sheets.Worksheet; sheetName: string; col: number; } export interface IRangeFilteredEventArgs{ sheet: GC.Spread.Sheets.Worksheet; sheetName: string; col: number; filterValues: any[]; } export interface IRangeFilteringEventArgs{ sheet: GC.Spread.Sheets.Worksheet; sheetName: string; col: number; filterValues: any[]; conditionInfo : Object; } export interface IRangeGroupStateChangedEventArgs{ sheet: GC.Spread.Sheets.Worksheet; sheetName: string; isRowGroup: boolean; index: number; level: number; } export interface IRangeGroupStateChangingEventArgs{ sheet: GC.Spread.Sheets.Worksheet; sheetName: string; isRowGroup: boolean; index: number; level: number; cancel: boolean; } export interface IRangeSortedEventArgs{ sheet: GC.Spread.Sheets.Worksheet; sheetName: string; col: number; ascending: boolean; } export interface IRangeSortingEventArgs{ sheet: GC.Spread.Sheets.Worksheet; sheetName: string; col: number; ascending: boolean; compareFunction?: ((value1: any, value2: any) => number); groupSort: GC.Spread.Sheets.GroupSort; } export interface IRowChangedEventArgs{ sheet: GC.Spread.Sheets.Worksheet; sheetName: string; row: number; sheetArea: SheetArea; propertyName: string; oldValue: any; newValue: any; count?: number; isUndo?: boolean; } export interface IRowChangingEventArgs{ sheet: GC.Spread.Sheets.Worksheet; sheetName: string; row: number; sheetArea: SheetArea; propertyName: string; oldValue: any; newValue: any; count?: number; cancel: boolean; } export interface IRowHeightChangedEventArgs{ sheet: GC.Spread.Sheets.Worksheet; sheetName: string; rowList: number[]; header: boolean; } export interface IRowHeightChangingEventArgs{ sheet: GC.Spread.Sheets.Worksheet; sheetName: string; rowList: any[]; header: boolean; cancel: boolean; } export interface ISelectionChangedEventArgs{ sheet: GC.Spread.Sheets.Worksheet; sheetName: string; oldSelections: Sheets.Range[]; newSelections: Sheets.Range[]; } export interface ISelectionChangingEventArgs{ sheet: GC.Spread.Sheets.Worksheet; sheetName: string; oldSelections: GC.Spread.Sheets.Range[]; newSelections: GC.Spread.Sheets.Range[]; } export interface ISerializationOption{ /** * Whether to include the binding source when converting the workbook to json. */ includeBindingSource?: boolean; /** * Whether to ignore the style when converting the workbook to json. */ ignoreStyle?: boolean; /** * Whether to ignore the formula when converting the workbook to json. */ ignoreFormula?: boolean; /** * Whether to apply the format string to exporting value when converting the workbook to json, default false. */ saveAsView?: boolean; /** * Whether to treat the row headers as frozen columns when converting the workbook to json. */ rowHeadersAsFrozenColumns?: boolean; /** * Whether to treat the column headers as frozen rows when converting the workbook to json. */ columnHeadersAsFrozenRows?: boolean; /** * Whether to include the automatically merged cells when converting the workbook to json. */ includeAutoMergedCells?: boolean; /** * Whether to save the r1c1 formula in the file. */ saveR1C1Formula?: boolean; } export interface ISetBorderOptions{ all?: boolean; left?: boolean; top?: boolean; right?: boolean; bottom?: boolean; outline?: boolean; inside?: boolean; innerHorizontal?: boolean; innerVertical?: boolean; diagonalUp?:boolean; diagonalDown?:boolean; } export interface IShapeChangedEventArgs{ sheet: GC.Spread.Sheets.Worksheet; sheetName: string; shape: GC.Spread.Sheets.Shapes.Shape; propertyName: string; } export interface IShapeRemovedEventArgs{ sheet: GC.Spread.Sheets.Worksheet; sheetName: string; shape: Shapes.Shape; } export interface IShapeRemovingEventArgs{ sheet: GC.Spread.Sheets.Worksheet; sheetName: string; shape: Shapes.Shape; cancel: boolean; } export interface IShapeSelectionChangedEventArgs{ sheet: GC.Spread.Sheets.Worksheet; sheetName: string; shape: Shapes.Shape; } export interface ISheetChangedEventArgs{ sheetName: string; propertyName: string; sheetIndex: number; newValue?: boolean; oldValue?: boolean; } export interface ISheetChangingEventArgs{ sheetName: string; propertyName: string; sheetIndex: number; cancel: boolean; newValue?: boolean; oldValue?: boolean; } export interface ISheetDefaultOption{ rowHeight?: number; colHeaderRowHeight?: number; colWidth?: number; rowHeaderColWidth?: number; } export interface ISheetNameChangedEventArgs{ sheet: GC.Spread.Sheets.Worksheet; oldValue: string; newValue: string; } export interface ISheetNameChangingEventArgs{ sheet: GC.Spread.Sheets.Worksheet; oldValue: string; newValue: string; cancel: boolean; } export interface ISheetNameTabStyleMap{ [sheetName: string]: GC.Spread.Sheets.SheetTabStyles; } export interface ISheetTabClickEventArgs{ sheet: GC.Spread.Sheets.Worksheet; sheetName: string; sheetTabIndex: number; } export interface ISheetTabDoubleClickEventArgs{ sheet: GC.Spread.Sheets.Worksheet; sheetName: string; sheetTabIndex: number; } export interface ISheetTabStyle{ backColor?: string; foreColor?: string; font?: string; icons?: GC.Spread.Sheets.IIcon[]; } export interface ISlicerChangedEventArgs{ sheet: GC.Spread.Sheets.Worksheet; sheetName: string; slicer: GC.Spread.Sheets.Slicers.ISlicer; propertyName: string; } export interface ISliderOption{ max?: number; min?: number; step?: number; direction? :GC.Spread.Sheets.LayoutDirection; tooltipVisible?: boolean; showNumberRange?: boolean; scaleVisible ?: boolean; marks?: number[]; width?: number; height?: number; formatString?: string; } export interface ISortOptions{ groupSort?: GC.Spread.Sheets.GroupSort; ignoreHidden?: boolean; } export interface ISortState{ row: number; col: number; rowCount: number; colCount: number; byRow?: boolean; sortConditions?: Array; } export interface ISparklineChangedEventArgs{ sheet: GC.Spread.Sheets.Worksheet; sheetName: string; sparkline: Sparklines.Sparkline; } export interface ITableFilterClearedEventArgs{ sheet: GC.Spread.Sheets.Worksheet; sheetName: string; table: GC.Spread.Sheets.Tables.Table; tableCol: number; } export interface ITableFilterClearingEventArgs{ sheet: GC.Spread.Sheets.Worksheet; sheetName: string; table: GC.Spread.Sheets.Tables.Table; tableCol: number; } export interface ITableFilteredEventArgs{ sheet: GC.Spread.Sheets.Worksheet; sheetName: string; table: GC.Spread.Sheets.Tables.Table; tableCol: number; filterValues: any[]; } export interface ITableFilteringEventArgs{ sheet: GC.Spread.Sheets.Worksheet; sheetName: string; table: GC.Spread.Sheets.Tables.Table; tableCol: number; filterValues: any[]; conditionInfo: Object; } export interface ITimePickerOption{ min?: GC.Spread.Sheets.ITimePickerValue; max?: GC.Spread.Sheets.ITimePickerValue; step?: GC.Spread.Sheets.ITimePickerValue; formatString?: string; height?: number; } export interface ITimePickerValue{ hour?: number; minute?: number; second?: number; } export interface ITopRowChangedEventArgs{ sheet: GC.Spread.Sheets.Worksheet; sheetName: string; oldTopRow: number; newTopRow: number; oldOffset: number; newOffset: number; } export interface ITouchToolStripOpeningEventArgs{ x: number; y: number; handled: boolean; } export interface IUserFormulaEnteredEventArgs{ sheet: GC.Spread.Sheets.Worksheet; sheetName: string; row: number; col: number; formula: string; isCircularReference: boolean; } export interface IUserZoomingEventArgs{ sheet: GC.Spread.Sheets.Worksheet; sheetName: string; oldZoomFactor: number; newZoomFactor: number; } export interface IValidationErrorEventArgs{ sheet: GC.Spread.Sheets.Worksheet; sheetName: string; row: number; col: number; validator: DataValidation.DefaultDataValidator; validationResult: DataValidation.DataValidationResult; } export interface IValueChangedEventArgs{ sheet: GC.Spread.Sheets.Worksheet; sheetName: string; row: number; col: number; oldValue: any; newValue: any; } export interface IValueSortInfo{ ascending: boolean; index: number; } export interface IWorkBookDefaultOptions{ allowDragHeaderToMove?: GC.Spread.Sheets.AllowDragHeaderToMove; allowUserDragDrop?: boolean; allowUserDragFill?: boolean; allowUserZoom?: boolean; allowUndo?: boolean; allowUserResize?: boolean; allowSheetReorder?: boolean; allowContextMenu?: boolean; allowUserDeselect?: boolean; defaultDragFillType?: GC.Spread.Sheets.Fill.AutoFillType; showDragFillSmartTag?: boolean; showHorizontalScrollbar?: boolean; showVerticalScrollbar?: boolean; scrollbarShowMax?: boolean; scrollbarMaxAlign?: boolean; tabStripVisible?: boolean; tabStripRatio?: number; tabEditable?: boolean; newTabVisible?: boolean; allSheetsListVisible?: GC.Spread.Sheets.AllSheetsListVisibility; cutCopyIndicatorVisible?: boolean; cutCopyIndicatorBorderColor?: string; tabNavigationVisible?: boolean; backColor?: string; backgroundImage?: null | string; backgroundImageLayout?: GC.Spread.Sheets.ImageLayout; showResizeTip?: GC.Spread.Sheets.ShowResizeTip; showDragDropTip?: boolean; showDragFillTip?: boolean; scrollIgnoreHidden?: boolean; highlightInvalidData?: boolean; showScrollTip?: GC.Spread.Sheets.ShowScrollTip; columnResizeMode?: GC.Spread.Sheets.ResizeMode; rowResizeMode?: GC.Spread.Sheets.ResizeMode; grayAreaBackColor?: null | string; useTouchLayout?: boolean; hideSelection?: boolean; resizeZeroIndicator?: GC.Spread.Sheets.ResizeZeroIndicator; allowUserEditFormula?: boolean; pivotAreaReference ?: GC.Spread.Pivot.PivotAreaReference; enableFormulaTextbox?: boolean; referenceStyle?: number; allowDynamicArray?: boolean; iterativeCalculation?: boolean; iterativeCalculationMaximumIterations?: number; iterativeCalculationMaximumChange?: number; autoFitType?: GC.Spread.Sheets.AutoFitType; calcOnDemand?: boolean; incrementalCalculation?: boolean; allowCopyPasteExcelStyle?: boolean; allowExtendPasteRange?: boolean; copyPasteHeaderOptions?: GC.Spread.Sheets.CopyPasteHeaderOptions; calculationMode?: GC.Spread.Sheets.CalculationMode; pasteSkipInvisibleRange?: boolean; allowAutoExtendFilterRange?: boolean; allowUserDragMerge?: boolean; scrollByPixel?: boolean; scrollPixel?: number; sheetCount?: number; allowAutoCreateHyperlink?: boolean; enableAccessibility?: boolean; font?: string; customList?: string[][]; defaultSheetTabStyles?: GC.Spread.Sheets.SheetTabStyles; builtInFileIcons?: GC.Spread.Sheets.IBuiltInFileIcons; } export interface IWorkbookHitTestInformation{ x?: number; y?: number; worksheetHitInfo: GC.Spread.Sheets.IHitTestInformation; tabStripHitInfo: GC.Spread.Sheets.IIHitTestTabStripInfo; horizontalScrollBarHitInfo: GC.Spread.Sheets.IHitTestScrollBarInfo; verticalScrollBarHitInfo: GC.Spread.Sheets.IHitTestScrollBarInfo; footerCornerHitInfo: GC.Spread.Sheets.IHitTestFooterCornerInfo; } export interface IWorkbookOptions{ /** * Whether to allow the user to drag merge cells. */ allowUserDragMerge: boolean; /** * Whether to allow the user to drag and drop range data. */ allowUserDragDrop: boolean; /** * Specifies how to allow drag header to move. */ allowDragHeaderToMove: GC.Spread.Sheets.AllowDragHeaderToMove; /** * Whether to allow the user to drag fill a range. */ allowUserDragFill: boolean; /** * Whether to zoom the display by scrolling the mouse wheel while pressing the Ctrl key. */ allowUserZoom: boolean; /** * Whether to allow the user to resize columns and rows. */ allowUserResize: boolean; /** * Whether to allow the user to undo edits. */ allowUndo: boolean; /** * Whether the user can reorder the sheets in the Spread component. */ allowSheetReorder: boolean; /** * Whether to allow the user to open the built-in context menu. */ allowContextMenu: boolean; /** * Whether to allow the user to can use deselect in selection. */ allowUserDeselect: boolean; /** * The default fill type. */ defaultDragFillType: GC.Spread.Sheets.Fill.AutoFillType; /** * Whether to display the drag fill dialog. */ showDragFillSmartTag: boolean; /** * Whether to display the horizontal scroll bar. */ showHorizontalScrollbar: boolean; /** * Whether to display the vertical scroll bar. */ showVerticalScrollbar: boolean; /** * Whether the displayed scroll bars are based on the entire number of columns and rows in the sheet. */ scrollbarShowMax: boolean; /** * Whether the scroll bar aligns with the last row and column of the active sheet. */ scrollbarMaxAlign: boolean; /** * Whether to display the sheet tab strip. */ tabStripVisible: boolean; /** * The width of the tab strip expressed as a percentage of the overall horizontal scroll bar width. */ tabStripRatio: number; /** * The width of the tab strip when it is at the left or right position. The default and minimum is 80. */ tabStripWidth: number; /** * Whether to allow the user to edit the sheet tab strip. */ tabEditable: boolean; /** * The position of tab strip. The default is bottom. */ tabStripPosition: GC.Spread.Sheets.TabStripPosition; /** * Whether the spreadsheet displays the special tab to let users insert new sheets. */ newTabVisible: boolean; /** * Whether the spreadsheet shows a special tab to allow the user to open the dialog to display all sheets. */ allSheetsListVisible: GC.Spread.Sheets.AllSheetsListVisibility; /** * Whether to display the sheet tab navigation. */ tabNavigationVisible: boolean; /** * Whether to display an indicator when copying or cutting the selected item. */ cutCopyIndicatorVisible: boolean; /** * The border color for the indicator displayed when the user cuts or copies the selection. */ cutCopyIndicatorBorderColor: string; /** * A color string used to represent the background color of the Spread component, such as "red", "#FFFF00", "rgb(255,0,0)", "Accent 5", and so on. */ backColor: string; /** * The background image of the Spread component. */ backgroundImage: string; /** * The background image layout for the Spread component. */ backgroundImageLayout: GC.Spread.Sheets.ImageLayout; /** * A color string used to represent the background color of the gray area , such as "red", "#FFFF00", "rgb(255,0,0)", "Accent 5", and so on. */ grayAreaBackColor: string; /** * How to display the resize tip. */ showResizeTip: GC.Spread.Sheets.ShowResizeTip; /** * Whether to display the drag-drop tip. */ showDragDropTip: boolean; /** * Whether to display the drag-fill tip. */ showDragFillTip: boolean; /** * How to display the scroll tip. */ showScrollTip: GC.Spread.Sheets.ShowScrollTip; /** * Whether the scroll bar ignores hidden rows or columns. */ scrollIgnoreHidden: boolean; /** * Whether to highlight invalid data. */ highlightInvalidData: boolean; /** * Whether to use touch layout to present the Spread component. */ useTouchLayout: boolean; /** * Whether to display the selection highlighting when the Spread component does not have focus. */ hideSelection: boolean; /** * The drawing policy when the row or column is resized to zero. */ resizeZeroIndicator: GC.Spread.Sheets.ResizeZeroIndicator; /** * Whether the user can edit formulas in a cell in the spreadsheet. */ allowUserEditFormula: boolean; /** * Whether to enable the formula text box in the spreadsheet. */ enableFormulaTextbox: boolean; /** * Whether content will be formatted to fit in cells or in cells and headers. */ autoFitType: GC.Spread.Sheets.AutoFitType; /** * the style for cell and range references in cell formulas on the workbook. */ referenceStyle: GC.Spread.Sheets.ReferenceStyle; /** * Whether to enable the dynamic array. */ allowDynamicArray: boolean; /** * Whether to enable the iterative calculation. */ iterativeCalculation: boolean; /** * The Maximum Iterations when iterative calculation. */ iterativeCalculationMaximumIterations: number; /** * The Maximum Change when iterative calculation. */ iterativeCalculationMaximumChange: number; /** * Whether to calculate formulas only when they are demanded. */ calcOnDemand: boolean; /** * Whether to incremental calculate formulas without blocking UI. */ incrementalCalculation: boolean; /** * Whether to calculate functions with dynamic reference. */ dynamicReferences: boolean; /** * Whether the user can copy style from Spread Sheets then paste to Excel, or copy style from Excel then paste to Spread Sheets. */ allowCopyPasteExcelStyle: boolean; /** * Whether extend paste range if the paste range is not enough for pasting. */ allowExtendPasteRange: boolean; /** * Which headers are included when data is copied to or pasted. */ copyPasteHeaderOptions: GC.Spread.Sheets.CopyPasteHeaderOptions; /** * The recalculation behavior of the workbook. The default is auto. */ calculationMode: GC.Spread.Sheets.CalculationMode; /** * Whether to enable the precision scrolling by pixel. */ scrollByPixel: boolean; /** * Decides scrolling by that number of pixels at a time when scrollByPixel is true. The final scrolling pixels are the result of scrolling delta multiply scrollPixel. For example, the scrolling delta is 3, and the scrollPixel is 5, the final scrolling pixels are 15. */ scrollPixel: number; /** * Whether to enable the accessibility support in the spreadsheet. */ enableAccessibility: boolean; /** * Whether to enable auto creating hyperlink in the spreadsheet. */ allowAutoCreateHyperlink: boolean; /** * Specifies the way to resize column. */ columnResizeMode: GC.Spread.Sheets.ResizeMode; /** * Specifies the way to resize row. */ rowResizeMode: GC.Spread.Sheets.ResizeMode; /** * The list for user to customize drag fill, prioritize matching this list in each fill. Each array item is type of string array. */ customList?: string[][]; /** * The scrollbar appearance, contains skin and mobile two enums. Default is skin. */ scrollbarAppearance?: GC.Spread.Sheets.ScrollbarAppearance; /** * Whether paste skip invisible range. Default is false. */ pasteSkipInvisibleRange: boolean; /** * indicates whether filter can auto extend range like Excel. */ allowAutoExtendFilterRange: boolean; /** * indicates whether allow input invalid formula string. */ allowInvalidFormula: boolean; /** * Whether automatically generate the getPivotData formula or cell reference when choose pivot table data area. Default is getPivotData. */ pivotAreaReference : GC.Spread.Pivot.PivotAreaReference; /** * indicates whether automatically generate the format when formula inputs. */ formulaFormatHint: boolean; /** * The default sheet tab styles. */ defaultSheetTabStyles: GC.Spread.Sheets.SheetTabStyles; /** * All built-in file icons. */ builtInFileIcons: GC.Spread.Sheets.IBuiltInFileIcons; } export interface IWorkFlowItem{ value: string; transitions: number[]|string[]; } export interface IWorkFlowOption{ items:GC.Spread.Sheets.IWorkFlowItem[]; } export interface IWorkSheetGridlineOption{ /** * The grid line color */ color?: string; /** * Whether to show the vertical grid line. */ showVerticalGridline?: boolean; /** * Whether to show the horizontal grid line. */ showHorizontalGridline?: boolean; } export interface IWorksheetOptions{ /** * indicates whether data can overflow into adjacent empty cells. */ allowCellOverflow: boolean; /** * indicates whether display the formulas string not the formula result. */ showFormulas: boolean; /** * indicates whether display the 0 in cells containing zero value. Default is true. */ showZeros: boolean; /** * A color string used to represent the sheet tab color, such as "red", "#FFFF00", "rgb(255,0,0)", "Accent 5", and so on. */ sheetTabColor: string; /** * A color string used to represent the frozen line color, such as "red", "#FFFF00", "rgb(255,0,0)", "Accent 5", and so on. */ frozenlineColor: string; /** * The clipboard option. */ clipBoardOptions: GC.Spread.Sheets.ClipboardPasteOptions; /** * The grid line's options. */ gridline: GC.Spread.Sheets.IWorkSheetGridlineOption; /** * Indicates whether the row header is visible. */ rowHeaderVisible: boolean; /** * Indicates whether the column header is visible. */ colHeaderVisible: boolean; /** * Indicates whether the row header displays letters or numbers or is blank. */ rowHeaderAutoText: GC.Spread.Sheets.HeaderAutoText; /** * Indicates whether the column header displays letters or numbers or is blank. */ colHeaderAutoText: GC.Spread.Sheets.HeaderAutoText; /** * Specifies which row header column displays the automatic text when there are multiple row header columns. */ rowHeaderAutoTextIndex: GC.Spread.Sheets.HeaderAutoText; /** * Specifies which column header row displays the automatic text when there are multiple column header rows. */ colHeaderAutoTextIndex: GC.Spread.Sheets.HeaderAutoText; /** * Indicates whether cells on this sheet that are marked as protected cannot be edited. */ isProtected: boolean; /** * A value that indicates the elements that you want users to be able to change. */ protectionOptions: GC.Spread.Sheets.IProtectionOptions; /** * The selection's background color for the sheet. */ selectionBackColor: string; /** * The selection's border color for the sheet. */ selectionBorderColor: string; /** * The sheetAreaOffset's options. */ sheetAreaOffset: GC.Spread.Sheets.IWorkSheetSheetAreaOffsetOption; /** * Indicates whether the unknown formulas could be included in sheet json data. */ keepUnknownFormulas: boolean; /** * The add row button's options. */ addRowButtonOption?: GC.Spread.Sheets.IAddRowButtonOption; /** * The add column button's options. */ addColumnButtonOption?: GC.Spread.Sheets.IAddColumnButtonOption; /** * Indicates whether the sheet is rendered from right to left. */ rightToLeft: boolean; /** * Indicates the URL of the background image. */ backgroundImage?: string; } export interface IWorkSheetSheetAreaOffsetOption{ /** * The offset left of sheet from host. */ left?: number; /** * The offset top of sheet from host */ top?: number; } export interface SheetTabInfo{ sheetName?: string; sheetIndex?: number; sheetType?: GC.Spread.Sheets.SheetType; } /** * @typedef GC.Spread.Sheets.CellValue - Indicates the cell value in col data. * @property {any} col - A key-value collection, which key is a col number, and value is cell value with any type. */ export type CellValue = { [col: number]: any; } /** * @typedef GC.Spread.Sheets.CustomDocumentPropertyValueType * @type {string|number|boolean|Date} * @description Custom Document property type. */ export type CustomDocumentPropertyValueType = string|number|boolean|Date /** * @typedef GC.Spread.Sheets.ExcelFileType * @type {"XLSX" | "XLSM" | "XLTM"} * @description Represents the fileType of Excel. */ export type ExcelFileType = "XLSX" | "XLSM" | "XLTM" /** * @typedef GC.Spread.Sheets.ExportCsvOptions * @property {GC.Spread.Sheets.FileType} fileType - The file type. * @property {string} [encoding] - Deprecated: Currently only support to export in UTF-8 encoding, set the `encoding` attribute will take no effect. * @property {string} [rowDelimiter] - The row delimiter that is appended to the end of the row, the default row delimiter is '\r\n'. * @property {string} [columnDelimiter] - The column delimiter that is appended to the end of the column, the default column delimiter is ','. * @property {object} [range] - The range info. * @param {number} [range.sheetIndex] - The sheet index, the default sheet index is current active sheet index. * @param {number} [range.row] - The start row, the default row index is 0. * @param {number} [range.column] - The start column, the default column index is 0. * @param {number} [range.rowCount] - The row count, the default row count is current active sheet row count. * @param {number} [range.columnCount] - The column count, the default column count is current active sheet column count. */ export type ExportCsvOptions = { encoding?: string; rowDelimiter?: string; columnDelimiter?: string; range?: { sheetIndex: number; row: number; column: number; rowCount: number; columnCount: number; } } /** * @typedef {GC.Spread.Sheets.ExportCsvOptions | GC.Spread.Sheets.ExportSSJsonOptions | GC.Spread.Sheets.ExportXlsxOptions} GC.Spread.Sheets.ExportOptions - The options for export function. */ export type ExportOptions = GC.Spread.Sheets.FileOptions & (GC.Spread.Sheets.ExportCsvOptions | GC.Spread.Sheets.ExportSSJsonOptions | GC.Spread.Sheets.ExportXlsxOptions) /** * @typedef GC.Spread.Sheets.ExportSSJsonOptions * @property {GC.Spread.Sheets.FileType} fileType - The file type. * @property {boolean} [includeBindingSource] - Whether to include the binding source when converting the workbook to json, default false. * @property {boolean} [includeStyles] - Whether to include the style when converting the workbook to json, default true. * @property {boolean} [includeFormulas] - Whether to include the formula when converting the workbook to json, default true. * @property {boolean} [saveAsView] - Whether to apply the format string to exporting value when converting the workbook to json, default false. * @property {boolean} [rowHeadersAsFrozenColumns] - Whether to treat the row headers as frozen columns when converting the workbook to json, default false. * @property {boolean} [columnHeadersAsFrozenRows] - Whether to treat the column headers as frozen rows when converting the workbook to json, default false. * @property {boolean} [includeAutoMergedCells] - Whether to include the automatically merged cells when converting the workbook to json, default false. */ export type ExportSSJsonOptions = { includeBindingSource?: boolean; includeStyles?: boolean; includeFormulas?: boolean; saveAsView?: boolean; rowHeadersAsFrozenColumns?: boolean; columnHeadersAsFrozenRows?: boolean; includeAutoMergedCells?: boolean; saveR1C1Formula?: boolean; } /** * @typedef GC.Spread.Sheets.ExportXlsxOptions * @property {GC.Spread.Sheets.FileType} fileType - The file type. * @property {boolean} [includeBindingSource] - Whether to include the binding source when do save, default false. * @property {boolean} [includeStyles] - Whether to include the style when do save, default true. * @property {boolean} [includeFormulas] - Whether to include the formula when do save, default true. * @property {boolean} [saveAsView] - Whether to apply the format string to exporting value when do save, default false. * @property {boolean} [rowHeadersAsFrozenColumns] - Whether to treat the row headers as frozen columns when do save, default false. * @property {boolean} [columnHeadersAsFrozenRows] - Whether to treat the column headers as frozen rows when do save, default false. * @property {boolean} [includeAutoMergedCells] - Whether to include the automatically merged cells when do save, default false. * @property {boolean} [includeCalcModelCache] - [deprecated] Whether to include the extra data of calculation. Can be faster when open the file with those data, default false. * @property {boolean} [includeUnusedNames] - Whether to include the unused custom name when do save, default true. * @property {boolean} [exportSharedFormula] - Whether to include the shared formula when do save, default true. * @property {boolean} [includeEmptyRegionCells] - Whether to include any empty cells(cells with no data or only style) outside the used data range, default true. * @property {boolean} [losslessEditing] - Whether to include lossless editing content, default true. * @property {string} [password] - Set the password to open the workbook. * @property {GC.Spread.Sheets.ExcelFileType} [excelFileType] - The exporting excel file type ('XLSX' | 'XLSM' | 'XLTM'), default by XLSX. */ export type ExportXlsxOptions = { includeBindingSource?: boolean; includeStyles?: boolean; includeFormulas?: boolean; saveAsView?: boolean; rowHeadersAsFrozenColumns?: boolean; columnHeadersAsFrozenRows?: boolean; includeUnusedNames?: boolean; exportSharedFormula?: boolean; includeEmptyRegionCells?: boolean; includeAutoMergedCells?: boolean; includeCalcModelCache?: boolean; losslessEditing?: boolean; password?: string; excelFileType?: GC.Spread.Sheets.ExcelFileType; } /** * @typedef GC.Spread.Sheets.ExternalPartialValues - Indicates the partial values in each referenced files. * @property {GC.Spread.Sheets.PartialValues} filePath - A key-value collection, which key is a file path string, and value is type of GC.Spread.Sheets.PartialValues. */ export type ExternalPartialValues = { [filePath: string]: GC.Spread.Sheets.PartialValues; } /** * @typedef GC.Spread.Sheets.FileOptions - The file options for export. * @property {GC.Spread.Sheets.FileType} fileType - The file type. */ export type FileOptions = { /** * The file type. */ fileType: GC.Spread.Sheets.FileType } /** * @typedef GC.Spread.Sheets.ImportCsvOptions * @property {GC.Spread.Sheets.FileType} fileType - The file type. * @property {string} [encoding] - The csv encoding type, the default encoding type is 'UTF-8'. * @property {string} [rowDelimiter] - The row delimiter that is appended to the end of the row, the default row delimiter is '\r\n'. * @property {string} [columnDelimiter] - The column delimiter that is appended to the end of the column, the default column delimiter is ','. */ export type ImportCsvOptions = { rowDelimiter?: string; columnDelimiter?: string; encoding?: string; } /** */ export type ImportOptions = GC.Spread.Sheets.FileOptions & (GC.Spread.Sheets.ImportCsvOptions | GC.Spread.Sheets.ImportSSJsonOptions | GC.Spread.Sheets.ImportXlsxOptions) /** * @typedef GC.Spread.Sheets.ImportSSJsonOptions * @property {GC.Spread.Sheets.FileType} fileType - The file type. * @property {boolean} [includeStyles] - Whether to include the style when converting json to the workbook, default true. * @property {boolean} [includeFormulas] - Whether to include the formula when converting json to the workbook, default true. * @property {boolean} [frozenColumnsAsRowHeaders] - Whether to treat the frozen columns as row headers when converting json to the workbook, default false. * @property {boolean} [frozenRowsAsColumnHeaders] - Whether to treat the frozen rows as column headers when converting json to the workbook, default false. * @property {boolean} [fullRecalc] - Whether to do full recalculation after loading the json data, default true. * @property {boolean | object} [incrementalLoad] - Whether to use the incremental loading or the callbacks of incremental loading when converting json to the workbook, default false. * @param {function} [incrementalLoad.loading] - The callback when of the incremental loading progress. * @param {function} [incrementalLoad.loaded] - The callback when of the incremental loading finished. */ export type ImportSSJsonOptions = { includeStyles?: boolean; incrementalLoad?: any; frozenColumnsAsRowHeaders?: boolean; frozenRowsAsColumnHeaders?: boolean; includeFormulas?: boolean; fullRecalc?: boolean; } /** * @typedef GC.Spread.Sheets.ImportXlsxOptions * @property {GC.Spread.Sheets.FileType} fileType - The file type. * @property {boolean} [includeStyles] - Whether to include the style when loading, default true. * @property {boolean} [includeFormulas] - Whether to include the formula when loading, default true. * @property {boolean} [frozenColumnsAsRowHeaders] - Whether to treat the frozen columns as row headers when loading, default false. * @property {boolean} [frozenRowsAsColumnHeaders] - Whether to treat the frozen rows as column headers when loading, default false. * @property {boolean} [fullRecalc] - Whether to calculate after loading the json data, false by default. * @property {boolean} [dynamicReferences] - Whether to calculate functions with dynamic reference, default true. * @property {boolean} [calcOnDemand] - Whether to calculate formulas only when they are demanded, default false. * @property {boolean} [incrementalCalculation] - Whether to incremental calculate formulas without blocking UI, default false. * @property {boolean} [includeUnusedStyles] - Whether to include the unused name style when converting excel xml to the json, default true. * @property {boolean} [convertSheetTableToDataTable] - Whether to convert the sheet tables to data manager tables, default false. * @property {string} [password] - The password to open the workbook. * @property {GC.Spread.Sheets.OpenMode} [openMode] - The open mode of normal, lazy and incremental. By default is normal. * @property {GC.Spread.Sheets.ProgressFunctionType} [progress] - The progress callback function for each open mode. * @property {GC.Spread.Sheets.ExcelFileType} [excelFileType] - The importing excel file type ('XLSX' | 'XLSM' | 'XLTM'), default by XLSX. */ export type ImportXlsxOptions = { includeStyles?: boolean; frozenColumnsAsRowHeaders?: boolean; frozenRowsAsColumnHeaders?: boolean; includeFormulas?: boolean; fullRecalc?: boolean; dynamicReferences?: boolean; calcOnDemand?: boolean; incrementalCalculation?: boolean; includeUnusedStyles?: boolean; convertSheetTableToDataTable?: boolean; password?: string; openMode?: GC.Spread.Sheets.OpenMode; progress?: GC.Spread.Sheets.ProgressFunctionType; excelFileType?: GC.Spread.Sheets.ExcelFileType; } /** * @typedef GC.Spread.Sheets.OpenOptions * @property {boolean} [includeStyles] - Whether to include the style when loading, default true. * @property {boolean} [includeFormulas] - Whether to include the formula when loading, default true. * @property {boolean} [fullRecalc] - Whether to calculate after loading the json data, false by default. * @property {boolean} [dynamicReferences] - Whether to calculate functions with dynamic reference, default true. * @property {boolean} [calcOnDemand] - Whether to calculate formulas only when they are demanded, default false. * @property {boolean} [incrementalCalculation] - Whether to incremental calculate formulas without blocking UI, default false. * @property {boolean} [includeUnusedStyles] - Whether to include the unused name style when converting excel xml to the json, default true. * @property {GC.Spread.Sheets.OpenMode} [openMode] - The open mode of normal, lazy and incremental. By default is normal. * @property {GC.Spread.Sheets.ProgressFunctionType} [progress] - The progress callback function for each open mode. */ export type OpenOptions = { includeStyles?: boolean; includeFormulas?: boolean; fullRecalc?: boolean; dynamicReferences?: boolean; calcOnDemand?: boolean; incrementalCalculation?: boolean; includeUnusedStyles?: boolean; openMode?: GC.Spread.Sheets.OpenMode; progress?: GC.Spread.Sheets.ProgressFunctionType; } /** * @typedef GC.Spread.Sheets.PartialValues - Indicates the cell data in row data. * @property {GC.Spread.Sheets.CellValue} row - A key-value collection, which key is a row number, and value is type of GC.Spread.Sheets.CellValue. */ export type PartialValues = { [row: number]: GC.Spread.Sheets.CellValue; } /** * @typedef GC.Spread.Sheets.ProgressArgs * @property {string} sheetName - the current loading sheet's name. * @property {string} step - the current loading step. * @property {number} progress - the current loading progress, from 0 ~ 1. */ export type ProgressArgs = { /** * the current loading sheet's name. */ sheetName?: string; /** * the current loading step. */ step: string; /** * the current loading progress, from 0 ~ 1. */ progress: number; } /** * @typedef GC.Spread.Sheets.ProgressFunctionType * @param {object} progressArgs - the progress arguments. * @param {string} [progressArgs.sheetName] - the current loading sheet's name. * @param {string} progressArgs.step - the current loading step. * @param {number} progressArgs.progress - the current loading progress, from 0 ~ 1. * @description The callback when of the incremental loading progress. */ export type ProgressFunctionType = (progressArgs: GC.Spread.Sheets.ProgressArgs) => void /** * @typedef GC.Spread.Sheets.SaveOptions * @property {boolean} [includeBindingSource] - Whether to include the binding source when do save, default false. * @property {boolean} [includeStyles] - Whether to include the style when do save, default true. * @property {boolean} [includeFormulas] - Whether to include the formula when do save, default true. * @property {boolean} [saveAsView] - Whether to apply the format string to exporting value when do save, default false. * @property {boolean} [includeAutoMergedCells] - Whether to include the automatically merged cells when do save, default false. * @property {boolean} [includeCalcModelCache] - Whether to include the extra data of calculation. Can be faster when open the file with those data, default false. * @property {boolean} [includeUnusedNames] - Whether to include the unused custom name when do save, default true. * @property {boolean} [includeEmptyRegionCells] - Whether to include any empty cells(cells with no data or only style) outside the used data range, default true. * @property {boolean} [saveR1C1Formula] - Whether to save the r1c1 formula in the file, only works in sjs file type, default false. */ export type SaveOptions = { includeBindingSource?: boolean; includeStyles?: boolean; includeFormulas?: boolean; saveAsView?: boolean; includeUnusedNames?: boolean; includeEmptyRegionCells?: boolean; includeAutoMergedCells?: boolean; includeCalcModelCache?: boolean; saveR1C1Formula?: boolean; } /** * @typedef {object} GC.Spread.Sheets.SheetTabStyles * @property {GC.Spread.Sheets.SheetTabState} sheetTabState */ export type SheetTabStyles = { [sheetTabState in GC.Spread.Sheets.SheetTabState]?: GC.Spread.Sheets.ISheetTabStyle; } /** * Specifies how to allow drag header to move. * @enum {number} */ export enum AllowDragHeaderToMove{ /** * Specifies that no drag header to move allowed. */ none= 0, /** * Specifies that only the column header allow to move. */ column= 1, /** * Specifies that only the row header allow to move. */ row= 2, /** * Specifies that both column and row header allow to move. */ both= 3 } /** * Sheet tab all sheets list button visible option. * @enum {number} */ export enum AllSheetsListVisibility{ /** * All sheets list button is hide */ hide= 0, /** * All sheets list button is show */ show= 1, /** * All sheets list button is auto */ auto= 2 } /** * Represents whether the component automatically resizes cells or headers. * @enum {number} * @example * ```javascript * //This example uses the AutoFitType enumeration. * spread.options.autoFitType = GC.Spread.Sheets.AutoFitType.cellWithHeader; * ``` */ export enum AutoFitType{ /** * The component autofits cells. */ cell= 0, /** * The component autofits cells and headers. */ cellWithHeader= 1 } /** * Specifies the type of cellbutton. * @enum {number} * @example * ```javascript * //This example sets the type of cellbutton. * //create config * leftButtonConfig1 = { * caption: "left", * enabled: true, * isLeft: true, * imageType:GC.Spread.Sheets.ButtonImageType.left, * }; * rightButtonConfig1 = { * caption: "left", * enabled: true, * isLeft: false, * imageType:GC.Spread.Sheets.ButtonImageType.right, * }; * //create style * var style = new GC.Spread.Sheets.Style(); * style.cellButtons=[ * leftButtonConfig1, * rightButtonConfig1 * ]; * sheet.setStyle(0, 0, style); * ``` */ export enum ButtonImageType{ /** Indicates the cellbutton image type is none. * @type {number} */ none= 0, /** Indicates the cellbutton type is custom. * @type {number} */ custom= 1, /** Indicates the cellbutton type is clear. * @type {number} */ clear= 2, /** Indicates the cellbutton type is cancel. * @type {number} */ cancel= 3, /** Indicates the cellbutton type is ok. * @type {number} */ ok= 4, /** Indicates the cellbutton type is dropdown. * @type {number} */ dropdown= 5, /** Indicates the cellbutton type is ellipsis. * @type {number} */ ellipsis= 6, /** Indicates the cellbutton type is left. * @type {number} */ left= 7, /** Indicates the cellbutton type is right. * @type {number} */ right= 8, /** Indicates the cellbutton type is plus. * @type {number} */ plus= 9, /** Indicates the cellbutton type is minus. * @type {number} */ minus= 10, /** Indicates the cellbutton type is undo. * @type {number} */ undo= 11, /** Indicates the cellbutton type is redo. * @type {number} */ redo= 12, /** Indicates the cellbutton type is search. * @type {number} */ search= 13, /** Indicates the cellbutton type is separator. * @type {number} */ separator= 14, /** Indicates the cellbutton type is spinLeft. * @type {number} */ spinLeft= 15, /** Indicates the cellbutton type is spinRight. * @type {number} */ spinRight= 16, /** Indicates the cellbutton type is collapse. * @type {number} */ collapse= 17, /** Indicates the cellbutton type is expand. * @type {number} */ expand= 18 } /** * Specifies the position of cellbutton. * @enum {number} * @example * ```javascript * //This example sets the position of cellbutton. * //create config * leftButtonConfig1 = { * caption: "left", * enabled: true, * position: GC.Spread.Sheets.ButtonPosition.right, * visibility:GC.Spread.Sheets.ButtonVisibility.always, * }; * rightButtonConfig1 = { * caption: "left", * enabled: true, * position: GC.Spread.Sheets.ButtonPosition.left, * visibility:GC.Spread.Sheets.ButtonVisibility.onSelected, * }; * //create style * var style = new GC.Spread.Sheets.Style(); * style.cellButtons=[ * leftButtonConfig1, * rightButtonConfig1 * ]; * sheet.setStyle(0, 0, style); * ``` */ export enum ButtonPosition{ /** Indicates the cellbutton is in left of the cell. * @type {number} */ left= 0, /** Indicates the cellbutton is in right of the cell. * @type {number} */ right= 1 } /** * Specifies the visibility of cellbutton. * @enum {number} * @example * ```javascript * //This example sets the visibility of cellbutton. * //create config * leftButtonConfig1 = { * caption: "left", * enabled: true, * isLeft: true, * visibility:GC.Spread.Sheets.ButtonVisibility.always, * }; * rightButtonConfig1 = { * caption: "left", * enabled: true, * isLeft: false, * visibility:GC.Spread.Sheets.ButtonVisibility.onSelected, * }; * //create style * var style = new GC.Spread.Sheets.Style(); * style.cellButtons=[ * leftButtonConfig1, * rightButtonConfig1 * ]; * sheet.setStyle(0, 0, style); * ``` */ export enum ButtonVisibility{ /** Indicates the cellbutton alway visible. * @type {number} */ always= 0, /** Indicates the cellbutton visible when the cell is active. * @type {number} */ onSelected= 1, /** Indicates the cellbutton visible when the cell enter edit. * @type {number} */ onEditing= 2 } /** * Specifies the recalculation behavior of the workbook. * @enum {number} * @example * ```javascript * spread.options.calculationMode = GC.Spread.Sheets.CalculationMode.manual; * ``` */ export enum CalculationMode{ /** * The default recalculation behavior that calculates formulas every time the relevant data is changed. */ auto= 0, /** * Calculations only occur when the user requests them. */ manual= 1 } /** * Specifies the calculation type of the calculate function. * @enum {number} * spread.calculate(GC.Spread.Sheets.CalculationType.manual); */ export enum CalculationType{ /** * The default calculation type that mark cells in the range as dirty for calculate. */ all= 0, /** * This will rebuild all the formulas model in the range and then mark them as dirty for calculate. */ rebuild= 1, /** * Keep the current calc dirty status, and won't mark the volatile cells, circular reference cells. */ minimal= 2, /** * Keep the current calc dirty status, and mark the volatile cells and circular reference cells as dirty for calculate. */ regular= 3 } /** * Specifies the calendar's default page. * @enum {number} */ export enum CalendarPage{ /** * Specifies the calendar's default page is year. */ year= 1, /** * Specifies the calendar's default page is month. */ month= 2, /** * Specifies the calendar's default page is day. */ day= 3 } /** * Specifies the calendar's start day. * @enum {number} */ export enum CalendarStartDay{ /** * Specifies the calendar's start day is Monday. */ monday= 1, /** * Specifies the calendar's start day is Tuesday. */ tuesday= 2, /** * Specifies the calendar's start day is Wednesday. */ wednesday= 3, /** * Specifies the calendar's start day is Thursday. */ thursday= 4, /** * Specifies the calendar's start day is Friday. */ friday= 5, /** * Specifies the calendar's start day is Saturday. */ saturday= 6, /** * Specifies the calendar's start day is Sunday. */ sunday= 7 } /** * Specifies the position of caption. * @enum {number} * @example * ```javascript * //This example sets the position of caption. * //create config * leftButtonConfig1 = { * caption: "left", * enabled: true, * position: GC.Spread.Sheets.ButtonPosition.right, * captionAlign:GC.Spread.Sheets.CaptionAlignment.right, * }; * rightButtonConfig1 = { * caption: "left", * enabled: true, * position: GC.Spread.Sheets.ButtonPosition.left, * captionAlign:GC.Spread.Sheets.CaptionAlignment.left, * }; * //create style * var style = new GC.Spread.Sheets.Style(); * style.cellButtons=[ * leftButtonConfig1, * rightButtonConfig1 * ]; * sheet.setStyle(0, 0, style); * ``` */ export enum CaptionAlignment{ /** Indicates the caption is in left of the button. * @type {number} */ left= 0, /** Indicates the caption is in right of the button. * @type {number} */ right= 1 } /** * Specifies the type of CellState. * @enum {number} */ export enum CellStatesType{ /** When mouse hover on the cell , cell state include "hover" state. * @type {number} */ hover= 1, /** When the data-validation conditional evaluate fail, cell state include "invalid" state. * @type {number} */ invalid= 2, /** When the cell is locked in protect worksheet , cell state include "readonly" state. * @type {number} */ readonly= 4, /** When the cell is editing, cell state include "edit" state. * @type {number} */ edit= 8, /** When the cell is focus, cell state include "active" state. * @type {number} */ active= 16, /** When the cell is in the selection range, cell state include "selected" state. * @type {number} */ selected= 32, /** When cell value is changed, cell state include "dirty" state. * @type {number} */ dirty= 64, /** When cell value is invalid formula string, cell state include "invalidFormula" state. * @type {number} */ invalidFormula= 128 } /** * Specifies the type of clearing pending change. * @enum {number} */ export enum ClearPendingChangeType{ /** * Clear dirty change. */ dirty= 1, /** * Clear insert change. */ insert= 2, /** * Clear deleted change. */ delete= 4 } /** * Present the type of clipboard event action * @enum {number} */ export enum ClipboardActionType{ /** * Indicates a paste action */ copy= 1, /** * Indicates a cut action */ cut= 2, /** * Indicates a reset action, the clipboard is reset at this point */ reset= 3 } /** * Specifies what data is pasted from the Clipboard. * @enum {number} * @example * ```javascript * //This example uses the ClipboardPasteOptions enumeration. * activeSheet.options.clipBoardOptions = GC.Spread.Sheets.ClipboardPasteOptions.values; * ``` */ export enum ClipboardPasteOptions{ /** * Pastes all data objects, including values, formatting, and formulas. */ all= 0, /** * Pastes only values. */ values= 1, /** * Pastes only formatting. */ formatting= 2, /** * Pastes only formulas. */ formulas= 3, /** * Pastes values and formatting. */ valuesAndFormatting= 4, /** * Pastes formulas and formatting. */ formulasAndFormatting= 5, /** * Pastes only comments. */ comments= 6, /** * Paste only validation. */ validation= 7, /** * Paste all data object and apply source theme to style/ */ usingSourceTheme= 8, /** * Pastes all cell contents except borders. */ noBorder= 9, /** * Pastes the column widths. */ columnWidths= 10, /** * Paste formulas and number formatting options */ formulasAndNumberFormatting= 11, /** * Paste values and number formatting options */ valuesAndNumberFormatting= 12, /** * Paste values and source formatting options */ valuesAndSourceFormatting= 13, /** * Pastes all data objects and keep column width */ allAndColumnWidth= 14 } /** * Specifies which headers are included when data is copied to or pasted. * @enum {number} * @example * ```javascript * //This example allows you to copy and paste headers. * spread.options.copyPasteHeaderOptions = GC.Spread.Sheets.CopyPasteHeaderOptions.allHeaders; * activeSheet.setRowCount(2,GC.Spread.Sheets.SheetArea.colHeader); * activeSheet.setColumnCount(2,GC.Spread.Sheets.SheetArea.rowHeader); * activeSheet.setValue(0, 2,"Column",GC.Spread.Sheets.SheetArea.colHeader); * activeSheet.setValue(1, 0,"Row",GC.Spread.Sheets.SheetArea.rowHeader); * ``` */ export enum CopyPasteHeaderOptions{ /** * Includes neither column nor row headers when data is copied; does not overwrite selected column or row headers when data is pasted. */ noHeaders= 0, /** * Includes selected row headers when data is copied; overwrites selected row headers when data is pasted. */ rowHeaders= 1, /** * Includes selected column headers when data is copied; overwrites selected column headers when data is pasted. */ columnHeaders= 2, /** * Includes selected headers when data is copied; overwrites selected headers when data is pasted. */ allHeaders= 3 } /** * Specifies the copy to option. * @enum {number} * @example * ```javascript * //This example uses the CopyToOption enumeration. * activeSheet.getCell(0,0).value("1"); * activeSheet.copyTo(0,0,1,1,2,2,GC.Spread.Sheets.CopyToOptions.value); * ``` */ export enum CopyToOptions{ /** * Indicates the type of data is pure data. */ value= 1, /** * Indicates the type of data is a formula. */ formula= 2, /** * Indicates the type of data is a comment. */ comment= 4, /** * Indicates to copy a range group. */ outline= 8, /** * Indicates the type of data is a sparkline. */ sparkline= 16, /** * Indicates to copy a span. */ span= 32, /** * Indicates the type of data is a style. */ style= 64, /** * Indicates the type of data is a tag. */ tag= 128, /** * Indicates the type of data is a binding path. */ bindingPath= 256, /** * Indicates the type of data is a conditional format. */ conditionalFormat= 512, /** * Indicates the type of data is a hyperlink. */ hyperlink= 1024, /** * Indicates the type of data is a defaultValue. */ defaultValue= 2048, /** * Indicates the type of data is an alternative text. */ altText= 4096, /** * Indicates all types of data. */ all= 16383 } /** * Describe the position of the corner fold in a cell. * @enum {number} */ export enum CornerPosition{ /** * Indicates that the folded corner is in the upper left corner */ leftTop= 1, /** * Indicates that the folded corner is in the upper right corner */ rightTop= 2, /** * indicates that the folded corner is in the lower left corner */ leftBottom= 4, /** * Indicates that the folded corner is in the lower right corner */ rightBottom= 8 } /** * Specifies the cell value type of dropdown list result. * @enum {number} */ export enum DropdownListValue{ /** * Use the string of list select result, use comma to split. */ string= 0, /** * Specifies the sort will move the group. */ array= 1 } /** * Specifies the type of dropdown. * @enum {number} * @example * ```javascript * //This example sets the type of dropdown. * //create style * var style = new GC.Spread.Sheets.Style(); * style.dropDowns=[ * { * type:GC.Spread.Sheets.DropDownType.dateTimePicker, * option: { * showTime:false * } * } * ]; * sheet.setStyle(0, 0, style); * ``` */ export enum DropDownType{ /** Indicates the type of dropdown is colorpicker. * @type {number} */ colorPicker= 0, /** Indicates the type of dropdown is dateTimePicker. * @type {number} */ dateTimePicker= 1, /** Indicates the type of dropdown is timePicker. * @type {number} */ timePicker= 2, /** Indicates the type of dropdown is monthPicker. * @type {number} */ monthPicker= 3, /** Indicates the type of dropdown is list. * @type {number} */ list= 4, /** Indicates the type of dropdown is slider. * @type {number} */ slider= 5, /** Indicates the type of dropdown is calculator. * @type {number} */ calculator= 6, /** Indicates the type of dropdown is workflowList. * @type {number} */ workflowList= 7, /** Indicates the type of dropdown is multiColumn. * @type {number} */ multiColumn= 8 } /** * Specifies the editor status. * @enum {number} */ export enum EditorStatus{ /** * Cell is in Ready mode. */ ready= 0, /** * Cell is in editing mode and can commit the input value and navigate to or select other cells when invoking navigation or selection actions. */ enter= 1, /** * Cell is in editing mode and cannot commit the input value and navigate to or select other cells. */ edit= 2 } /** * The file type for import/export excel file or csv file or ssjson file. * @enum {number} */ export enum FileType{ /** * Import/export excel type file. */ excel= 0, /** * Import/export ssjson type file. */ ssjson= 1, /** * Import/export csv type file. */ csv= 2 } /** * Specifies the method when sort with group. * @enum {number} */ export enum GroupSort{ /** * Specifies the sort don't move the group. */ none= 0, /** * Specifies the sort will move the group. */ group= 1, /** * Specifies that only sort inner the group. */ child= 2, /** * Specifies that sort will do with the group and inner the group. */ full= 3 } /** * Specifies which default labels are displayed in headers. * @enum {number} */ export enum HeaderAutoText{ /** * Displays blanks in the headers. */ blank= 0, /** * Displays numbers in the headers. */ numbers= 1, /** * Displays letters in the headers. */ letters= 2 } /** * Specifies which headers are included when export range data to HTML. * @enum {number} * @example * ```javascript * //This example shows you how to export range data to HTML with row header and column header. * activeSheet.getRange(-1, -1, -1, -1).toHtml(GC.Spread.Sheets.HeaderOptions.allHeaders); * ``` */ export enum HeaderOptions{ /** * Includes neither column nor row headers when export range data to HTML. */ noHeaders= 0, /** * Includes selected row headers when export range data to HTML. */ rowHeaders= 1, /** * Includes selected column headers when export range data to HTML. */ columnHeaders= 2, /** * Includes selected headers when export range data to HTML. */ allHeaders= 3 } /** * Specifies the horizontal alignment. * @enum {number} * @example * ```javascript * //This example uses the HorizontalAlign type. * var style = new GC.Spread.Sheets.Style(); * style.font = "8pt Arial"; * style.hAlign = GC.Spread.Sheets.HorizontalAlign.center; * style.vAlign = GC.Spread.Sheets.VerticalAlign.center; * activeSheet.setStyle(1,1,style,GC.Spread.Sheets.SheetArea.viewport); * activeSheet.getCell(1,1).value("B2"); * ``` */ export enum HorizontalAlign{ /** * Indicates that the cell content is left-aligned. */ left= 0, /** * Indicates that the cell content is centered. */ center= 1, /** * Indicates that the cell content is right-aligned. */ right= 2, /** * Indicates that the horizontal alignment is based on the value type. */ general= 3, /** * Indicates that the cell content is center across selection. */ centerContinuous= 4, /** * Indicates that each 'word' in each line of text inside the cell is evenly distributed across the width of the cell, with flush right and left margins. */ distributed= 5 } /** * Specifies the horizontal position of the cell or column in the component. * @enum {number} * @example * ```javascript * //This example uses the HorizontalPosition enumeration. * activeSheet.setActiveCell(10,5); * activeSheet.showCell(10, 5, GC.Spread.Sheets.VerticalPosition.top, GC.Spread.Sheets.HorizontalPosition.center); * ``` */ export enum HorizontalPosition{ /** * Positions the cell or column to the left. */ left= 0, /** * Positions the cell or column in the center. */ center= 1, /** * Positions the cell or column to the right. */ right= 2, /** * Positions the cell or column to the nearest edge. */ nearest= 3 } /** * Present the way that user open the hyperlinked document. Default is blank. * @enum {number} */ export enum HyperlinkTargetType{ /** * Opens the hyperlinked document in a new window or tab. */ blank= 0, /** * Opens the hyperlinked document in the same frame where the user clicked. */ self= 1, /** * Opens the hyperlinked document in the parent frame. */ parent= 2, /** * Opens the hyperlinked document in the full body of the window. */ top= 3 } /** * Describe the position of the icon base on a cell. * @enum {number} */ export enum IconPosition{ /** * Indicates that the icon is on left side of the cell */ left= 0, /** * Indicates that the icon is on right side of the cell */ right= 1, /** * Indicates that the icon is on left side of the text in the cell */ leftOfText= 2, /** * Indicates that the icon is on right side of the text in the cell */ rightOfText= 3, /** * Indicates that the icon is on the left outside of the cell */ outsideLeft= 4, /** * Indicates that the icon is on the right outside of the cell */ outsideRight= 5 } /** * Defines the background image layout. * @enum {number} * @example * ```javascript * var rowImage = "./css/images/quarter1.png"; * sheet.getCell(1, -1).backgroundImage(rowImage); * sheet.getCell(1, -1).backgroundImageLayout(GC.Spread.Sheets.ImageLayout.center); * ``` */ export enum ImageLayout{ /** Specifies that the background image fills the area. * @type {number} */ stretch= 0, /** Specifies that the background image displays in the center of the area. * @type {number} */ center= 1, /** Specifies that the background image displays in the area with its original aspect ratio. * @type {number} */ zoom= 2, /** Specifies that the background image displays in the upper left corner of the area with its original size. * @type {number} */ none= 3 } /** * Defines the IME mode to control the state of the Input Method Editor (IME). * @enum {number} * @deprecated This enum currently only works in Internet Explorer. * @example * ```javascript * //This example uses the imeMode method. * activeSheet.getRange(-1, 2, -1, 1).imeMode(GC.Spread.Sheets.ImeMode.auto); * ``` */ export enum ImeMode{ /** * No change is made to the current input method editor state. */ auto= 1, /** All characters are entered through the IME. Users can still deactivate the IME. */ active= 2, /** * All characters are entered without IME. Users can still activate the IME. */ inactive= 4, /** * The input method editor is disabled and may not be activated by the user. */ disabled= 0 } /** * Specifies paste the direction of the insertion finger. * @enum {number} */ export enum InsertShiftCell{ /** Specifies paste the direction right. * @type {number} */ right= 0, /** Specifies paste the direction down. * @type {number} */ down= 1 } /** * Identifies which operation was invalid. * @enum {number} * @example * ```javascript * //This example gets the invalid type. * activeSheet.getCell(1,1).locked(true); * activeSheet.options.isProtected = true; * activeSheet.getCell(1,1).value(2); * //Bind event * activeSheet.bind(GC.Spread.Sheets.Events.InvalidOperation, function (e, info) { * alert("Message (" + info.invalidType + ")"); * }); * ``` */ export enum InvalidOperationType{ /** * Specifies the formula is invalid. */ setFormula= 0, /** * Specifies the copy paste is invalid. */ copyPaste= 1, /** * Specifies the drag fill is invalid. */ dragFill= 2, /** * Specifies the drag drop is invalid. */ dragDrop= 3, /** * Specifies the insert row is invalid. */ changePartOfArrayFormula= 4, /** * Specifies the changed sheet name is invalid. */ changeSheetName= 5, /** * Specifies the table action is invalid. */ table= 6, /** * Specifies the add filter is invalid. */ filter= 7, /** * Specifies sort is invalid. */ sort= 9, /** * Specifies the change affect existed pivot table. */ pivotTable= 10, /** * Specifies the pivotTable change will overlap the valued cell. */ ptOverlapValue= 11, /** * Specifies the group can expand and collapse when sheet is unprotected. */ groupProtected= 12, /** * Specifies edit value when cell is locked and sheet is protected. */ editProtected= 13, /** * Specifies cut value when cell is locked and sheet is protected. */ cutProtected= 14, /** * Specifies the value to be set as a custom name is valid. */ customName= 15, /** * Specifies a data object cell type can't insert a data to its adjacent cells on the right. */ dataObjectCellTypeInsertData= 16, /** * The specific event type that is triggered when the size of a file uploaded via the file picker exceeds the limit. */ sizeLimitExceeded= 18 } /** * Specifies the cell label position. * @enum {number} * @example * ```javascript * //This example sets cell padding, alignment, and other options. * var type = new GC.Spread.Sheets.Style(); * type.watermark = "User name"; * type.cellPadding = "20"; * type.labelOptions = {alignment:GC.Spread.Sheets.LabelAlignment.topLeft, visibility: GC.Spread.Sheets.LabelVisibility.visible}; * activeSheet.setStyle(0, 1, type); * activeSheet.getRange(0, -1, 1, -1, GC.Spread.Sheets.SheetArea.viewport).height(60); * activeSheet.getRange(-1, 1, -1, 1).width(150); * var combo = new GC.Spread.Sheets.CellTypes.ComboBox(); * combo.items([{ text: "Oranges", value: "11k" }, { text: "Apples", value: "15k" }, { text: "Grape", value: "100k" }]); * combo.editorValueType(GC.Spread.Sheets.CellTypes.EditorValueType.text); * activeSheet.setCellType(2, 1, combo, GC.Spread.Sheets.SheetArea.viewport); * activeSheet.getCell(2, 1, GC.Spread.Sheets.SheetArea.viewport).watermark("ComboBox Cell Type").cellPadding('10 10 20 10'); * activeSheet.getCell(2, 1, GC.Spread.Sheets.SheetArea.viewport).labelOptions({alignment: GC.Spread.Sheets.LabelAlignment.bottomCenter, foreColor: 'yellowgreen', font: 'bold 15px Arial'}); * activeSheet.getRange(2, -1, 1, -1, GC.Spread.Sheets.SheetArea.viewport).height(60); * ``` */ export enum LabelAlignment{ /** * Indicates that the cell label position is top-left. */ topLeft= 0, /** * Indicates that the cell label position is top-center. */ topCenter= 1, /** * Indicates that the cell label position is top-right. */ topRight= 2, /** * Indicates that the cell label position is bottom-left. */ bottomLeft= 3, /** * Indicates that the cell label position is bottom-center. */ bottomCenter= 4, /** * Indicates that the cell label position is bottom-right. */ bottomRight= 5 } /** * Specifies the cell label visibility. * @enum {number} * @example * ```javascript * //This example sets label options for the watermark. * var type = new GC.Spread.Sheets.Style(); * type.watermark = "User name"; * type.cellPadding = "20"; * type.labelOptions = {alignment:GC.Spread.Sheets.LabelAlignment.topLeft, visibility: GC.Spread.Sheets.LabelVisibility.visible}; * activeSheet.setStyle(0, 1, type); * activeSheet.getRange(0, -1, 1, -1, GC.Spread.Sheets.SheetArea.viewport).height(60); * activeSheet.getRange(-1, 1, -1, 1).width(150); * var combo = new GC.Spread.Sheets.CellTypes.ComboBox(); * combo.items([{ text: "Oranges", value: "11k" }, { text: "Apples", value: "15k" }, { text: "Grape", value: "100k" }]); * combo.editorValueType(GC.Spread.Sheets.CellTypes.EditorValueType.text); * activeSheet.setCellType(2, 1, combo, GC.Spread.Sheets.SheetArea.viewport); * activeSheet.getCell(2, 1, GC.Spread.Sheets.SheetArea.viewport).watermark("ComboBox Cell Type").cellPadding('10 10 20 10'); * activeSheet.getCell(2, 1, GC.Spread.Sheets.SheetArea.viewport).labelOptions({alignment: GC.Spread.Sheets.LabelAlignment.bottomCenter, foreColor: 'yellowgreen', font: 'bold 15px Arial'}); * activeSheet.getRange(2, -1, 1, -1, GC.Spread.Sheets.SheetArea.viewport).height(60); * ``` */ export enum LabelVisibility{ /** * Specifies to always show the watermark in the padding area and not to show the watermark in the cell area, regardless of the cell value. */ visible= 0, /** * Specifies to not show the watermark in the padding area, but to show the watermark in the cell area based on a value condition. */ hidden= 1, /** * Specifies to show the watermark in the padding area when the cell has a value or to show the watermark in the cell area if the cell does not have a value. */ auto= 2 } /** * Specifies the layout direction. * @enum {number} */ export enum LayoutDirection{ /** * Specifies layout direction is horizontal. */ horizontal= 0, /** * Specifies layout direction is vertical. */ vertical= 1 } /** * Specifies the layout display. * @enum {number} */ export enum LayoutDisplayAs{ /** * Specifies layout display is inline. */ inline= 0, /** * Specifies layout display is popup */ popup= 1, /** * Specifies layout display is tree */ tree= 2 } /** * Specifies the line drawing style for the border. * @enum {number} * @example * ```javascript * //This example creates a border. * var border = new GC.Spread.Sheets.LineBorder * border.color = "#7FFFD4"; * border.style = GC.Spread.Sheets.LineStyle.double; * var cell = activeSheet.getCell(1, 1, GC.Spread.Sheets.SheetArea.viewport); * cell.borderLeft(border); * ``` */ export enum LineStyle{ /** * Indicates a border line without a style. */ empty= 0, /** * Indicates a border line with a solid thin line. */ thin= 1, /** * Indicates a medium border line with a solid line. */ medium= 2, /** * Indicates a border line with dashes. */ dashed= 3, /** * Indicates a border line with dots. */ dotted= 4, /** * Indicates a thick border line with a solid line. */ thick= 5, /** * Indicates a double border line. */ double= 6, /** * Indicates a border line with all dots. */ hair= 7, /** * Indicates a medium border line with dashes. */ mediumDashed= 8, /** * Indicates a border line with dash-dot. */ dashDot= 9, /** * Indicates a medium border line with dash-dot-dot. */ mediumDashDot= 10, /** * Indicates a border line with dash-dot-dot. */ dashDotDot= 11, /** * Indicates a medium border line with dash-dot-dot. */ mediumDashDotDot= 12, /** * Indicates a slanted border line with dash-dot. */ slantedDashDot= 13 } /** * Represent the list style type of rich text list item * @enum {number} */ export enum ListType{ /** * Indicates the unordered list item, list style type is disc. */ disc= 0, /** * Indicates the unordered list item, list style type is circle. */ circle= 1, /** * Indicates the unordered list item, list style type is square. */ square= 2, /** * Indicates the ordered list item, list style type is decimal. */ decimal= 3, /** * Indicates the ordered list item, list style type is lowerAlpha. */ lowerAlpha= 4, /** * Indicates the ordered list item, list style type is upperAlpha. */ upperAlpha= 5, /** * Indicates the ordered list item, list style type is lowerRoman. */ lowerRoman= 6, /** * Indicates the ordered list item, list style type is upperRoman. */ upperRoman= 7, /** * Indicates the ordered list item, list style type is lowerGreek. */ lowerGreek= 8 } /** * Change display mode when date/number data width longer than column width. * @enum {number} * @example * ```javascript * //This example uses the NumbersFitMode enumeration. * spread.options.numbersFitMode = GC.Spread.Sheets.NumbersFitMode.overflow; * ``` */ export enum NumbersFitMode{ /** Indicates replacing data content with "###" and show tip. * @type {number} */ mask= 0, /** Indicates display data content as a string, if next cell is empty, overflow the content. * @type {number} */ overflow= 1 } /** * The open mode for open sjs function. * @enum {number} */ export enum OpenMode{ /** * normal open mode, without lazy and incremental. When opening file, UI and UI event could be refreshed and responsive at specific time points. */ normal= 0, /** * lazy open mode. When opening file, only the active sheet will be loaded directly. Other sheets will be loaded only when they are be used. */ lazy= 1, /** * incremental open mode. When opening file, UI and UI event could be refreshed and responsive directly. */ incremental= 2 } /** * Specifies the operation options mathematically combine values between the copy and paste ranges * @enum {number} * @example * ```javascript * //This example uses the PasteOperationOptions enumeration. * activeSheet.getCell(0,0).value("1"); * activeSheet.setSelection(0, 0, 1, 1); * spread.commandManager().execute({cmd:"copy", sheetName: activeSheet.name()}); * activeSheet.setSelection(0, 0, 3, 3); * spread.commandManager().execute( * { * cmd:"paste", * sheetName: activeSheet.name(), * pasteSpecialOptions: { * operationOptions: GC.Spread.Sheets.PasteOperationOptions.add * } * } * ); * ``` */ export enum PasteOperationOptions{ /** * Paste the contents of the copy ranges without an operation. */ none= 0, /** * Add the values in the copy ranges to the values in the paste ranges. */ add= 1, /** * Subtract the values in the copy ranges from the values in the paste ranges. */ subtract= 2, /** * Multiply the values in the paste ranges by the values in the copy ranges. */ multiply= 3, /** * Divide the values in the paste ranges by the values in the copy ranges. */ divide= 4, /** * Transform the values in the paste ranges by the formula in the copy ranges. */ transform= 5 } /** * Specifies the cell value type of dropdown list result. * @enum {number} */ export enum PatternType{ /** * Specifies the pattern type is solid. */ solid= 1, /** * Specifies the pattern type is darkGray. */ darkGray= 2, /** * Specifies the pattern type is mediumGray. */ mediumGray= 3, /** * Specifies the pattern type is lightGray. */ lightGray= 4, /** * Specifies the pattern type is gray125. */ gray125= 5, /** * Specifies the pattern type is gray0625. */ gray0625= 6, /** * Specifies the pattern type is darkHorizontal. */ darkHorizontal= 7, /** * Specifies the pattern type is darkVertical. */ darkVertical= 8, /** * Specifies the pattern type is darkDown. */ darkDown= 9, /** * Specifies the pattern type is darkUp. */ darkUp= 10, /** * Specifies the pattern type is darkGrid. */ darkGrid= 11, /** * Specifies the pattern type is darkTrellis. */ darkTrellis= 12, /** * Specifies the pattern type is lightHorizontal. */ lightHorizontal= 13, /** * Specifies the pattern type is lightVertical. */ lightVertical= 14, /** * Specifies the pattern type is lightDown. */ lightDown= 15, /** * Specifies the pattern type is lightUp. */ lightUp= 16, /** * Specifies the pattern type is lightGrid. */ lightGrid= 17, /** * Specifies the pattern type is lightTrellis. */ lightTrellis= 18 } /** * Defines the type of action that raised the RangeChanged event. * @enum {number} */ export enum RangeChangedAction{ /** * Indicates drag drop undo action. */ dragDrop= 0, /** * Indicates drag fill undo action. */ dragFill= 1, /** * Indicates clear range value undo action. */ clear= 2, /** * Indicates paste undo action. */ paste= 3, /** * Indicates sorting a range of cells. */ sort= 4, /** * Indicates setting a formula in a specified range of cells . */ setArrayFormula= 5, /** * Indicates setting a formula in a specified range of cells . */ evaluateFormula= 6 } /** * Specifies the formula reference style. * @enum {number} * @example * ```javascript * //This example sets the reference style for the workbook. * workbook.options.referenceStyle = GC.Spread.Sheets.ReferenceStyle.r1c1; * ``` */ export enum ReferenceStyle{ /** * Indicates a1 style. */ a1= 0, /** * Indicates r1c1 style. */ r1c1= 1 } /** * Specifies the way resizing use. * @enum {number} * @example * ```javascript * //This example shows you how to specify the resize way. * spread.options.columnResizeMode = GC.Spread.Sheets.ResizeMode.split; * spread.options.rowResizeMode = GC.Spread.Sheets.ResizeMode.normal; * ``` */ export enum ResizeMode{ /** Specifies use normal way to resize. * @type {number} */ normal= 0, /** Specifies use split way to resize. * @type {number} */ split= 1 } /** * Specifies the drawing policy of the row or column when it is resized to zero. * @enum {number} * @example * ```javascript * //This example displays double grid lines for the column or row with zero width or height. * spread.options.resizeZeroIndicator = GC.Spread.Sheets.ResizeZeroIndicator.enhanced; * activeSheet.getRange(-1, 2, -1, 1).width(0); * activeSheet.getRange(1, -1, 1, -1).height(0); * ``` */ export enum ResizeZeroIndicator{ /** * Uses the current drawing policy when the row or column is resized to zero. */ default= 0, /** * Draws two short lines when the row or column is resized to zero. */ enhanced= 1 } /** * Specifies the type of row and column state. * @enum {number} */ export enum RowColumnStates{ /** When mouse hover on the row and the column , its state include "hover" state. * @type {number} */ hover= 1, /** When the data-validation conditional evaluate fail, its row and column state include "invalid" state. * @type {number} */ invalid= 2, /** When the cell is editing, the cell row and column state include "edit" state. * @type {number} */ edit= 8, /** When the row or the column is focus, its state include "active" state. * @type {number} */ active= 16, /** When the cell is in the selection range, the cell row and column state include "selected" state. * @type {number} */ selected= 32, /** When cell value is changed, cell row and column state include "dirty" state. * @type {number} */ dirty= 64, /** When inserted a row, its state include "inserted" state. This state only support for row. * @type {number} */ inserted= 128, /** When cell value is invalid formula string, cell state include "invalidFormula" state. * @type {number} */ invalidFormula= 512 } /** * Specifies the appearance of both vertical and horizontal scrollbar. * @enum {number} * @example * ```javascript * //This example displays a mobile scrollbar mode. * spread.options.scrollbarAppearance = GC.Spread.Sheets.ScrollbarAppearance.mobile; * ``` */ export enum ScrollbarAppearance{ /** Specifies the excel-like classic scrollbars appearance. * @type {number} */ skin= 0, /** Specifies the fashionable mobile scrollbars appearance which could be customized. * @type {number} */ mobile= 1 } /** * Specifies how users can select items in the control. * @enum {number} * @example * ```javascript * //This example sets the selection policy. * activeSheet.selectionUnit(GC.Spread.Sheets.SelectionUnit.row); * activeSheet.selectionPolicy(GC.Spread.Sheets.SelectionPolicy.range); * ``` */ export enum SelectionPolicy{ /** * Allows users to only select single items. */ single= 0, /** * Allows users to select single items and ranges of items, but not multiple ranges. */ range= 1, /** * Allows users to select single items and ranges of items, including multiple ranges. */ multiRange= 2 } /** * Specifies the smallest unit users or the application can select. * @enum {number} * @example * ```javascript * //This example sets the unit type. * activeSheet.selectionUnit(GC.Spread.Sheets.SelectionUnit.row); * activeSheet.selectionPolicy(GC.Spread.Sheets.SelectionPolicy.range); * ``` */ export enum SelectionUnit{ /** * Indicates that the smallest unit that can be selected is a cell. */ cell= 0, /** * Indicates that the smallest unit that can be selected is a row. */ row= 1, /** * Indicates that the smallest unit that can be selected is a column. */ column= 2 } /** * Specifies the sheet area. * @enum {number} * @example * ```javascript * //Creates log text describing which area in the sheet was clicked. * // Use web browser to see the console log text * activeSheet.bind(GC.Spread.Sheets.Events.CellClick, function (sender, args) { * if(args.sheetArea === GC.Spread.Sheets.SheetArea.colHeader){ * console.log("The column header was clicked."); * } * if(args.sheetArea === GC.Spread.Sheets.SheetArea.rowHeader){ * console.log("The row header was clicked."); * } * if(args.sheetArea === GC.Spread.Sheets.SheetArea.corner){ * console.log("The corner header was clicked."); * } * console.log("Clicked column index: " + args.col); * console.log("Clicked row index: " + args.row); * }); * //Bind event * activeSheet.bind(GC.Spread.Sheets.Events.CellDoubleClick, function (sender, args) { * if(args.sheetArea === GC.Spread.Sheets.SheetArea.colHeader){ * console.log("The column header was double clicked."); * } * if(args.sheetArea === GC.Spread.Sheets.SheetArea.rowHeader){ * console.log("The row header was double clicked."); * } * if(args.sheetArea === GC.Spread.Sheets.SheetArea.corner){ * console.log("The corner header was double clicked."); * } * console.log("Double clicked column index: " + args.col); * console.log("Double clicked row index: " + args.row); * }); * ``` */ export enum SheetArea{ /** * Indicates the sheet corner. */ corner= 0, /** * Indicates the column header. */ colHeader= 1, /** * Indicates the row header. */ rowHeader= 2, /** * Indicates the viewport. */ viewport= 3 } /** * Different states of sheet tab * The smaller the value, the higher the style priority for this state * @enum {number} */ export enum SheetTabState{ /** * Indicates hover sheet tab state. */ hover= 1, /** * Indicates selected sheet tab state. */ selected= 2, /** * Indicates active sheet tab state. */ active= 4, /** * Indicates protected sheet tab state. */ protected= 8, /** * Indicates Normal sheet tab state. */ normal= 16 } /** * Worksheet tab visible option. * @enum {number} */ export enum SheetTabVisible{ /** * Sheet tab is hidden */ hidden= 0, /** * Sheet tab is visible */ visible= 1, /** * Sheet tab is veryHidden */ veryHidden= 2 } /** * Present the type of sheet tab. * @enum {number} */ export enum SheetType{ /** * Specifies the sheet tab is table sheet. */ tableSheet= 0, /** * Specifies the sheet tab is gantt sheet. */ ganttSheet= 1, /** * Specifies the sheet tab is report sheet. */ reportSheet= 3 } /** * Defines how the resize tip is displayed. * @enum {number} * @example * ```javascript * //This example displays both resize tips. * spread.options.showDragDropTip = true; * spread.options.showDragFillTip = true; * spread.options.showScrollTip = GC.Spread.Sheets.ShowScrollTip.both; * spread.options.showResizeTip = GC.Spread.Sheets.ShowResizeTip.both; * ``` */ export enum ShowResizeTip{ /** Specifies that no resize tip is displayed. * @type {number} */ none= 0, /** Specifies that only the horizontal resize tip is displayed. * @type {number} */ column= 1, /** Specifies that only the vertical resize tip is displayed. * @type {number} */ row= 2, /** Specifies that horizontal and vertical resize tips are displayed. * @type {number} */ both= 3 } /** * Specifies how the scroll tip is displayed. * @enum {number} * @example * ```javascript * //This example displays both resize tips. * spread.options.showDragDropTip = true; * spread.options.showDragFillTip = true; * spread.options.showScrollTip = GC.Spread.Sheets.ShowScrollTip.both; * spread.options.showResizeTip = GC.Spread.Sheets.ShowResizeTip.both; * ``` */ export enum ShowScrollTip{ /** Specifies that no scroll tip is displayed. * @type {number} */ none= 0, /** Specifies that only the horizontal scroll tip is displayed. * @type {number} */ horizontal= 1, /** Specifies that only the vertical scroll tip is displayed. * @type {number} */ vertical= 2, /** Specifies that horizontal and vertical scroll tips are displayed. * @type {number} */ both= 3 } /** * Specifies the type of sorting to perform. * @enum {number} * @example * ```javascript * //This example sets the sort order of the items in the slicer. * //create a table * datas = [ * ["1", "NewYork", "1968/6/8", "80", "180"], * ["4", "NewYork", "1972/7/3", "72", "168"], * ["4", "NewYork", "1964/3/2", "71", "179"], * ["5", "Washington", "1972/8/8","80", "171"], * ["6", "Washington", "1986/2/2", "89", "161"], * ["7", "Washington", "2012/2/15", "71", "240"]]; * var table = activeSheet.tables.addFromDataSource("table1", 2, 2, datas); * dataColumns = ["Name", "City", "Birthday", "Weight", "Height"]; * table.setColumnName(0, dataColumns[0]); * table.setColumnName(1, dataColumns[1]); * table.setColumnName(2, dataColumns[2]); * table.setColumnName(3, dataColumns[3]); * table.setColumnName(4, dataColumns[4]); * //create style * var style1 = new GC.Spread.Sheets.Slicers.SlicerStyles.light4(); * //add a slicer to the sheet and return the slicer instance * var slicer = activeSheet.slicers.add("slicer1",table.name(),"Height"); * //set slicer properties * slicer.position(new GC.Spread.Sheets.Point(100, 200)); * slicer.sortState(GC.Spread.Sheets.SortState.descending); * slicer.style(style1); * ``` */ export enum SortState{ /** Indicates the sorting is disabled. * @type {number} */ none= 0, /** Indicates the sorting is ascending. * @type {number} */ ascending= 1, /** Indicates the sorting is descending. * @type {number} */ descending= 2 } /** * Represents the storage data type. * @enum {number} * @example * ```javascript * //This example uses the StorageType enumeration. * activeSheet.getCell(0,0).value("A1"); * activeSheet.clear(0,0,3,3,GC.Spread.Sheets.SheetArea.viewport,GC.Spread.Sheets.StorageType.data); * ``` */ export enum StorageType{ /** * Indicates the storage data type is pure value. */ data= 1, /** * Indicates the storage data type is style. */ style= 2, /** * Indicates the storage data type is comment. */ comment= 4, /** * Indicates the storage data type is tag. */ tag= 8, /** * Indicates the storage data type is sparkline. */ sparkline= 16, /** * Indicates the storage data type is the axis information. */ axis= 32, /** * Indicates the storage data type is data binding path. */ bindingPath= 64, /** * Indicates the storage data type is hyperlink. */ hyperlink= 256, /** * Indicates the storage data type is alternative text. */ altText= 512 } /** * Specifies the position of the tab strip relative to the workbook. * @enum {number} */ export enum TabStripPosition{ /** * Specifies the position of the tab strip relative to the bottom of the workbook. */ bottom= 0, /** * Specifies the position of the tab strip relative to the top of the workbook. */ top= 1, /** * Specifies the position of the tab strip relative to the left of the workbook. */ left= 2, /** * Specifies the position of the tab strip relative to the right of the workbook. */ right= 3 } /** * Defines the type of the text decoration. * @enum {number} * @example * ```javascript * //This example uses the TextDecorationType enumeration. * activeSheet.getCell(0, 0).textDecoration(GC.Spread.Sheets.TextDecorationType.underline); * activeSheet.getRange(1, -1, 1, -1).textDecoration(GC.Spread.Sheets.TextDecorationType.overline | GC.Spread.Sheets.TextDecorationType.underline); * activeSheet.getRange(-1, 1, -1, 1).textDecoration(GC.Spread.Sheets.TextDecorationType.overline | GC.Spread.Sheets.TextDecorationType.lineThrough | GC.Spread.Sheets.TextDecorationType.underline); * var style = new GC.Spread.Sheets.Style(); * style.textDecoration = GC.Spread.Sheets.TextDecorationType.overline | GC.Spread.Sheets.TextDecorationType.underline; * activeSheet.setStyle(1, 1, style, GC.Spread.Sheets.SheetArea.viewport); * activeSheet.getCell(0, 0).value("Test"); * activeSheet.getCell(1, 0).value("Test"); * activeSheet.getCell(0, 1).value("Test"); * ``` */ export enum TextDecorationType{ /** Specifies to display a line below the text. */ underline= 1, /** Specifies to display a line through the text. */ lineThrough= 2, /** Specifies to display a line above the text. */ overline= 4, /** Specifies to display double line below the text. */ doubleUnderline= 8, /** Specifies normal text. */ none= 0 } /** * Defines the type of the text direction. * @enum {number} * @example * ```javascript * //This example uses the TextDirectionType enumeration. * activeSheet.getCell(0, 0).textDirection(GC.Spread.Sheets.TextDirectionType.rightToLeft); * activeSheet.getRange(1, -1, 1, -1).textDirection(GC.Spread.Sheets.TextDirectionType.rightToLeft); * var style = new GC.Spread.Sheets.Style(); * style.textDirection = GC.Spread.Sheets.TextDirectionType.rightToLeft; * activeSheet.setStyle(1, 1, style, GC.Spread.Sheets.SheetArea.viewport); * ``` */ export enum TextDirectionType{ /** Specifies the text direction is context dependent, which is determined by scanning the text for the first non-whitespace character: if it is a strong right-to-left character, the text direction is right-to-left; otherwise, the text direction is left-to-right. */ context= 0, /** Specifies the text direction is left-to-right in the cell, as in English. */ leftToRight= 1, /** Specifies the text direction is right-to-left in the cell, as in Arabic or Hebrew. */ rightToLeft= 2 } /** * Specifies the scope of transform. * @enum {number} */ export enum TransformScope{ /** * Each cell is considered as a transformation unit. */ byCell= 0, /** * Each row is considered as a transformation unit. */ byRow= 1, /** * Each column is considered as a transformation unit. */ byColumn= 2, /** * The entire cell range is considered as one transformation unit. */ byRange= 3 } /** * Worksheet used range * @enum {number} */ export enum UsedRangeType{ /** * Sheet all used range type */ all= 4294967295, /** * Sheet header used range */ axis= 1, /** * Sheet cell style used range */ style= 2, /** * Sheet row style used range */ rowStyle= 4, /** * Sheet column style used range */ colStyle= 8, /** * Sheet data used range */ data= 16, /** * Sheet formula used range */ formula= 32, /** * Sheet span used range */ span= 64, /** * Sheet shape used range */ shape= 128, /** * Sheet table used range */ table= 256, /** * Sheet sparkLine used range */ sparkLine= 512, /** * Sheet comment used range */ comment= 1024, /** * Sheet slicer used range */ slicer= 2048, /** * Sheet pivot table used range */ pivottable= 4096, /** * Sheet filter used range */ filter= 8192, /** * Sheet dataValidation used range */ dataValidation= 16384, /** * Sheet conditionFormat used range */ conditionFormat= 32768, /** * Sheet chart used range */ chart= 65536, /** * Sheet picture used range */ picture= 131072, /** * Sheet tag used range */ tag= 262144, /** * Sheet data range used range */ dataRange= 524288 } /** * Specifies cell value's type. * @enum {number} */ export enum ValueType{ /** * indicate normal value type. */ normal= 0, /** * indicate rich text value type. */ richText= 1 } /** * Defines the type of the text vertAlign. * @enum {number} * @example * ```javascript * //This example uses the VertAlign enumeration. * activeSheet.setValue(1, 1, {richText:[{style:{vertAlign:GC.Spread.Sheets.VertAlign.subscript},text:'SpreadJS'}]}, GC.Spread.Sheets.SheetArea.viewport); * ``` */ export enum VertAlign{ /** * indicate normal text align. */ normal= 0, /** * indicate superscript. */ superscript= 1, /** * indicate subscript. */ subscript= 2 } /** * Specifies the vertical alignment. * @enum {number} * @example * ```javascript * //This example uses the VerticalAlign type. * var style = new GC.Spread.Sheets.Style(); * style.font = "8pt Arial"; * style.hAlign = GC.Spread.Sheets.HorizontalAlign.center; * style.vAlign = GC.Spread.Sheets.VerticalAlign.center; * activeSheet.setStyle(1,1,style,GC.Spread.Sheets.SheetArea.viewport); * activeSheet.getCell(1,1).value("B2"); * ``` */ export enum VerticalAlign{ /** * Indicates that the cell content is top-aligned. */ top= 0, /** * Indicates that the cell content is centered. */ center= 1, /** * Indicates that the cell content is bottom-aligned. */ bottom= 2 } /** * Specifies the vertical position of the cell or row in the component. * @enum {number} * @example * ```javascript * //This example uses the VerticalPosition enumeration. * activeSheet.setActiveCell(10,5); * activeSheet.showCell(10, 5, GC.Spread.Sheets.VerticalPosition.top, GC.Spread.Sheets.HorizontalPosition.center); * ``` */ export enum VerticalPosition{ /** * Positions the cell or row at the top. */ top= 0, /** * Positions the cell or row in the center. */ center= 1, /** * Positions the cell or row at the bottom. */ bottom= 2, /** * Positions the cell or row at the nearest edge. */ nearest= 3 } /** * Specifies the visual state. * @enum {number} */ export enum VisualState{ /** * Indicates normal visual state. */ normal= 0, /** * Indicates highlight visual state. */ highlight= 1, /** * Indicates selected visual state. */ selected= 2, /** * Indicates active visual state. */ active= 3, /** * Indicates hover visual state. */ hover= 4 } export class CellRange{ /** * Represents a cell range in a sheet. * @class * @param {GC.Spread.Sheets.Worksheet} sheet The sheet that contains this cell range. * @param {number} row The row index of the cell. * @param {number} col The column index of the cell. * @param {number} [rowCount] The row count of the cell. If you do not provide this parameter, it defaults to `1`. * @param {number} [colCount] The column count of the cell. If you do not provide this parameter, it defaults to `1`. * @param {GC.Spread.Sheets.SheetArea} [sheetArea] The sheet area. If you do not provide this parameter, it defaults to `viewport`. * If row is -1 and rowCount is -1, the range represents columns. For example, new GC.Spread.Sheets.CellRange(-1,4,-1,6) represents columns "E:J". * If col is -1 and colCount is -1, the range represents rows. For example, new GC.Spread.Sheets.CellRange(4,-1,6,-1) represents rows "5:10". */ constructor(sheet: GC.Spread.Sheets.Worksheet, row: number, col: number, rowCount?: number, colCount?: number, sheetArea?: GC.Spread.Sheets.SheetArea); /** * Gets the starting column index. * @type {number} */ col: number; /** * Gets the column count. * @type {number} */ colCount: number; /** * Gets the starting row index. * @type {number} */ row: number; /** * Gets the row count. * @type {number} */ rowCount: number; /** * Gets the sheet that contains this cell range. * @type {GC.Spread.Sheets.Worksheet} */ sheet: GC.Spread.Sheets.Worksheet; /** * Gets the area that contains this cell range. * @type {GC.Spread.Sheets.SheetArea} */ sheetArea: GC.Spread.Sheets.SheetArea; /** * Gets or sets whether the cell can enter edit mode for editing. * @param {boolean} [value] Set to `false` to disallow the cell enter edit mode for editing. * @returns {boolean|GC.Spread.Sheets.CellRange} If no value is set, returns whether the cell can enter edit mode for editing; otherwise, returns the cell. * @example * ```javascript * activeSheet.getRange(0, 0, 2, 3, GC.Spread.Sheets.SheetArea.viewport).allowEditInCell(false); * ``` * @example * ```javascript * activeSheet.getCell(1,1).allowEditInCell(false); * ``` */ allowEditInCell(value?: boolean): any; /** * Gets or sets the alternative text of the cell for screen readers. * @param {string} value The alternative text of the cell. * @returns {string|GC.Spread.Sheets.CellRange} If no value is set, returns the alternative text of the cell; otherwise, returns the cell. * @example * ```javascript * var SpreadIcon = { * FolderOpen: '\ue685', * InfoFilled: '\ue718', * Library: '\ue69d', * NotebookFilled: '\uD800\uDC0F', * Browse: '\ue626' * }; * activeSheet.getCell(1, 1).value(SpreadIcon.FolderOpen).altText("Folder Open Icon"); * * // Besides plain text, the alternative text could also contain placeholder {value} or {formatted}, which represents cell value or cell formatted value. * // For example, if the cell value is 1000, and the alt text is "Sales amount is {value}", the final accessible content should be "Sales amount is 1000". * activeSheet.getCell(1, 1).value(1000).altText("Sales amount is {value}"); * ``` */ altText(value?: any): any; /** * Gets or sets the background color for the cell, such as "red", "#FFFF00", "rgb(255,0,0)", "Accent 5", and so on. * @param {string|undefined|GC.Spread.Sheets.IPatternFill|GC.Spread.Sheets.IGradientFill|GC.Spread.Sheets.IGradientPathFill} [value] The cell background color. * @returns {string|undefined|GC.Spread.Sheets.IPatternFill|GC.Spread.Sheets.IGradientFill|GC.Spread.Sheets.IGradientPathFill|GC.Spread.Sheets.CellRange} If no value is set, returns the cell background color; otherwise, returns the cell. * @example * ```javascript * activeSheet.getRange(-1, 3, -1, 1, GC.Spread.Sheets.SheetArea.viewport).backColor("pink"); * ``` */ backColor(value?: string | GC.Spread.Sheets.IPatternFill | GC.Spread.Sheets.IGradientFill | GC.Spread.Sheets.IGradientPathFill): any; /** * Gets or sets the background image for the cell. * @param {string} [value] The cell background image. * @returns {string|GC.Spread.Sheets.CellRange} If no value is set, returns the cell background image; otherwise, returns the cell. * @example * ```javascript * activeSheet.getCell(1,1).backgroundImage("images/example.jpg"); * ``` */ backgroundImage(value?: string): any; /** * Gets or sets the background image layout for the cell. * @param {GC.Spread.Sheets.ImageLayout} [value] The cell background image layout. * @returns {GC.Spread.Sheets.ImageLayout|GC.Spread.Sheets.CellRange} If no value is set, returns the cell background image layout; otherwise, returns the cell. * @example * ```javascript * var layout = GC.Spread.Sheets.ImageLayout.stretch; * activeSheet.getRange(-1, 1, -1, 1, GC.Spread.Sheets.SheetArea.viewport).backgroundImageLayout(layout); * ``` */ backgroundImageLayout(value?: GC.Spread.Sheets.ImageLayout): any; /** * Gets or sets the binding path for cell binding. * @param {string} path The binding path for cell binding. * @returns {string | GC.Spread.Sheets.CellRange} If no value is set, returns the binding path for cell binding; otherwise, returns the worksheet. * @example * ```javascript * //This example uses the bindingPath method. * var test = {name: "John"}; * activeSheet.getCell(0,0).bindingPath( "name"); * activeSheet.setDataSource(new GC.Spread.Sheets.Bindings.CellBindingSource(test)); * ``` */ bindingPath(path?: string): any; /** * Gets or sets the bottom border of the cell. * @param {GC.Spread.Sheets.LineBorder} [value] The cell bottom border line. * @returns {GC.Spread.Sheets.LineBorder|GC.Spread.Sheets.CellRange} If no value is set, returns the cell bottom border line; otherwise, returns the cell. * @example * ```javascript * activeSheet.getRange(-1, 3, -1, 1, GC.Spread.Sheets.SheetArea.viewport).borderBottom(new GC.Spread.Sheets.LineBorder("blue", GC.Spread.Sheets.LineStyle.mediumDashed)); * ``` */ borderBottom(value?: GC.Spread.Sheets.LineBorder): any; /** * Gets or sets the left border of the cell. * @param {GC.Spread.Sheets.LineBorder} [value] The cell left border line. * @returns {GC.Spread.Sheets.LineBorder|GC.Spread.Sheets.CellRange} If no value is set, returns the cell left border line; otherwise, returns the cell. * @example * ```javascript * activeSheet.getRange(2, -1, 1, -1, GC.Spread.Sheets.SheetArea.viewport).borderLeft(new GC.Spread.Sheets.LineBorder("green", GC.Spread.Sheets.LineStyle.mediumDashed)); * ``` * @example * ```javascript * activeSheet.getCell(1,1).borderLeft(new GC.Spread.Sheets.LineBorder("red", GC.Spread.Sheets.LineStyle.double)); * ``` * @example * ```javascript * activeSheet.getRange(-1, 3, -1, 1, GC.Spread.Sheets.SheetArea.viewport).borderLeft(new GC.Spread.Sheets.LineBorder("blue", GC.Spread.Sheets.LineStyle.mediumDashed)); * ``` */ borderLeft(value?: GC.Spread.Sheets.LineBorder): any; /** * Gets or sets the right border of the cell. * @param {GC.Spread.Sheets.LineBorder} [value] The cell right border line. * @returns {GC.Spread.Sheets.LineBorder|GC.Spread.Sheets.CellRange} If no value is set, returns the cell right border line; otherwise, returns the cell. * @example * ```javascript * activeSheet.getRange(2, -1, 1, -1, GC.Spread.Sheets.SheetArea.viewport).borderRight(new GC.Spread.Sheets.LineBorder("green", GC.Spread.Sheets.LineStyle.mediumDashed)); * ``` * @example * ```javascript * activeSheet.getCell(1,1).borderRight(new GC.Spread.Sheets.LineBorder("red", GC.Spread.Sheets.LineStyle.double)); * ``` * @example * ```javascript * activeSheet.getRange(-1, 3, -1, 1, GC.Spread.Sheets.SheetArea.viewport).borderRight(new GC.Spread.Sheets.LineBorder("blue", GC.Spread.Sheets.LineStyle.mediumDashed)); * ``` */ borderRight(value?: GC.Spread.Sheets.LineBorder): any; /** * Gets or sets the top border of the cell. * @param {GC.Spread.Sheets.LineBorder} [value] The cell top border line. * @returns {GC.Spread.Sheets.LineBorder|GC.Spread.Sheets.CellRange} If no value is set, returns the cell top border line; otherwise, returns the cell. * @example * ```javascript * activeSheet.getRange(2, -1, 1, -1, GC.Spread.Sheets.SheetArea.viewport).borderTop(new GC.Spread.Sheets.LineBorder("green", GC.Spread.Sheets.LineStyle.mediumDashed)); * ``` * @example * ```javascript * activeSheet.getCell(1,1).borderTop(new GC.Spread.Sheets.LineBorder("red", GC.Spread.Sheets.LineStyle.double)); * ``` * @example * ```javascript * activeSheet.getRange(-1, 3, -1, 1, GC.Spread.Sheets.SheetArea.viewport).borderTop(new GC.Spread.Sheets.LineBorder("blue", GC.Spread.Sheets.LineStyle.mediumDashed)); * ``` */ borderTop(value?: GC.Spread.Sheets.LineBorder): any; /** * Gets or sets the cellButtons of the cell. * @param {Object[]} value the cellButtons of the cell. * @returns {Object[] |GC.Spread.Sheets.CellRange} If no value is set, returns the cellButtons of the cell; otherwise, returns the cell. * @example * ```javascript * activeSheet.getRange(2,-1, 1, -1, GC.Spread.Sheets.SheetArea.viewport).cellButtons([caption:"Text"]]); * ``` * @example * ```javascript * var cellButtons = activeSheet.getRange(-1, 3, -1, 1, GC.Spread.Sheets.SheetArea.viewport).cellButtons(); * ``` */ cellButtons(value?: GC.Spread.Sheets.ICellButton[]): any; /** * Gets or sets the cell padding. * @param {string} [value] The cell padding. * @returns {string|GC.Spread.Sheets.CellRange} If no value is set, returns the value of the cell padding; otherwise, returns the cell. * @example * ```javascript * // This example adds cell padding around the watermark. * var type = new GC.Spread.Sheets.Style(); * type.watermark = "User name"; * type.cellPadding = "20"; * type.labelOptions = {alignment:GC.Spread.Sheets.LabelAlignment.topLeft, visibility: GC.Spread.Sheets.LabelVisibility.visible}; * activeSheet.setStyle(0, 1, type); * activeSheet.getRange(0, -1, 1, -1, GC.Spread.Sheets.SheetArea.viewport).height(60); * activeSheet.getRange(-1, 1, -1, 1).width(150); * var combo = new GC.Spread.Sheets.CellTypes.ComboBox(); * combo.items([{ text: "Oranges", value: "11k" }, { text: "Apples", value: "15k" }, { text: "Grape", value: "100k" }]); * combo.editorValueType(GC.Spread.Sheets.CellTypes.EditorValueType.text); * activeSheet.setCellType(2, 1, combo, GC.Spread.Sheets.SheetArea.viewport); * activeSheet.getCell(2, 1, GC.Spread.Sheets.SheetArea.viewport).watermark("ComboBox Cell Type").cellPadding('10 10 20 10'); * activeSheet.getCell(2, 1, GC.Spread.Sheets.SheetArea.viewport).labelOptions({alignment: GC.Spread.Sheets.LabelAlignment.bottomCenter, foreColor: 'yellowgreen', font: 'bold 15px Arial'}); * activeSheet.getRange(2, -1, 1, -1, GC.Spread.Sheets.SheetArea.viewport).height(60); * ``` */ cellPadding(value?: string): any; /** * Gets or sets the cell type of the cell. * @param {GC.Spread.Sheets.CellTypes.Base} [value] The cell type. * @returns {GC.Spread.Sheets.CellTypes.Base|GC.Spread.Sheets.CellRange} If no value is set, returns the cell type; otherwise, returns the cell. * @example * ```javascript * activeSheet.getRange(-1, 1, -1, 1, GC.Spread.Sheets.SheetArea.viewport).cellType(new GC.Spread.Sheets.CellTypes.CheckBox()); * ``` */ cellType(value?: GC.Spread.Sheets.CellTypes.Base): any; /** * Clears the specified area. * @param {GC.Spread.Sheets.StorageType} type The clear type. */ clear(type: GC.Spread.Sheets.StorageType): void; /** * Gets or sets the comment for the cell. * @param {GC.Spread.Sheets.Comments.Comment} value The comment to set in the cell. * @returns {GC.Spread.Sheets.Comments.Comment | GC.Spread.Sheets.CellRange} If no value is set, returns the comment in the cell; otherwise, returns the cell range. * @example * ```javascript * // This example creates a cell comment. * var comment = new GC.Spread.Sheets.Comments.Comment(); * comment.text("new comment!"); * comment.backColor("yellow"); * comment.foreColor("green"); * comment.displayMode(GC.Spread.Sheets.Comments.DisplayMode.alwaysShown); * activeSheet.getCell(5,5).comment(comment); * ``` */ comment(value?: GC.Spread.Sheets.Comments.Comment): any; /** * Gets or sets the default value of the cell. * @param {Object} [value] The cell default value. * @returns {Object|GC.Spread.Sheets.CellRange} If no value is set, returns the cell default value; otherwise, returns the cell. * @example * ```javascript * activeSheet.getCell(1,1).defaultValue(10); * activeSheet.getCell(1,3).defaultValue("=LastYear+1000"); * ``` */ defaultValue(value?: any): any; /** * Gets or sets the diagonalDown of the cell. * @param {GC.Spread.Sheets.LineBorder} [value] The cell diagonalDown line. * @returns {GC.Spread.Sheets.LineBorder|GC.Spread.Sheets.CellRange} If no value is set, returns the cell diagonalDown line; otherwise, returns the cell. * @example * ```javascript * activeSheet.getRange(-1, 3, -1, 1, GC.Spread.Sheets.SheetArea.viewport).diagonalDown(new GC.Spread.Sheets.LineBorder("blue", GC.Spread.Sheets.LineStyle.mediumDashed)); * ``` */ diagonalDown(value?: GC.Spread.Sheets.LineBorder): any; /** * Gets or sets the diagonalUp of the cell. * @param {GC.Spread.Sheets.LineBorder} [value] The cell diagonalUp line. * @returns {GC.Spread.Sheets.LineBorder|GC.Spread.Sheets.CellRange} If no value is set, returns the cell diagonalUp line; otherwise, returns the cell. * @example * ```javascript * activeSheet.getRange(-1, 3, -1, 1, GC.Spread.Sheets.SheetArea.viewport).diagonalUp(new GC.Spread.Sheets.LineBorder("blue", GC.Spread.Sheets.LineStyle.mediumDashed)); * ``` */ diagonalUp(value?: GC.Spread.Sheets.LineBorder): any; /** * Gets or sets the dropDowns of the cell. * @param {Object[]} [value] the dropDowns of the cell. * @returns {Object[] |GC.Spread.Sheets.CellRange} If no value is set, returns the dropDowns of the cell; otherwise, returns the cell. * @example * ```javascript * activeSheet.getRange(2,-1, 1, -1, GC.Spread.Sheets.SheetArea.viewport).dropDowns([caption:"Text"]]); * ``` * @example * ```javascript * var dropDowns = activeSheet.getRange(-1, 3, -1, 1, GC.Spread.Sheets.SheetArea.viewport).dropDowns(); * ``` */ dropDowns(value?: GC.Spread.Sheets.IDropdown[]): any; /** * Gets or sets the font for the cell, such as "normal normal normal 20px/normal Arial". * @param {string} [value] The cell font. * @returns {string|GC.Spread.Sheets.CellRange} If no value is set, returns the cell's font; otherwise, returns the cell. * @example * ```javascript * activeSheet.getRange(2, -1, 1, -1, GC.Spread.Sheets.SheetArea.viewport).font("12pt Arial"); * ``` * @example * ```javascript * activeSheet.getCell(1,1).font("8pt Arial"); * ``` * @example * ```javascript * activeSheet.getRange(-1, 3, -1, 1, GC.Spread.Sheets.SheetArea.viewport).font("12pt Arial"); * ``` */ font(value?: string): any; /** * Gets or sets the fontFamily for the cell, such as "Arial". * @param {string} [value] The cell fontFamily. * @returns {string|GC.Spread.Sheets.CellRange} If no value is set, returns the cell's fontFamily; otherwise, returns the cell. * @example * ```javascript * activeSheet.getRange(2, -1, 1, -1, GC.Spread.Sheets.SheetArea.viewport).fontFamily("Arial"); * ``` * @example * ```javascript * activeSheet.getCell(1,1).fontFamily("Arial"); * ``` * @example * ```javascript * activeSheet.getRange(-1, 3, -1, 1, GC.Spread.Sheets.SheetArea.viewport).fontFamily("Arial"); * ``` */ fontFamily(value?: string): any; /** * Gets or sets the fontSize for the cell, such as "16px". * @param {string} [value] The cell fontSize. * @returns {string|GC.Spread.Sheets.CellRange} If no value is set, returns the cell's fontSize; otherwise, returns the cell. * @example * ```javascript * activeSheet.getRange(2, -1, 1, -1, GC.Spread.Sheets.SheetArea.viewport).fontSize("16px"); * ``` * @example * ```javascript * activeSheet.getCell(1,1).fontSize("16px"); * ``` * @example * ```javascript * activeSheet.getRange(-1, 3, -1, 1, GC.Spread.Sheets.SheetArea.viewport).fontSize("16px"); * ``` */ fontSize(value?: string): any; /** * Gets or sets the fontStyle for the cell, such as "italic". * @param {string} [value] The cell fontStyle. * @returns {string|GC.Spread.Sheets.CellRange} If no value is set, returns the cell's fontStyle; otherwise, returns the cell. * @example * ```javascript * activeSheet.getRange(2, -1, 1, -1, GC.Spread.Sheets.SheetArea.viewport).fontStyle("italic"); * ``` * @example * ```javascript * activeSheet.getCell(1,1).fontStyle("italic"); * ``` * @example * ```javascript * activeSheet.getRange(-1, 3, -1, 1, GC.Spread.Sheets.SheetArea.viewport).fontStyle("italic"); * ``` */ fontStyle(value?: string): any; /** * Gets or sets the fontWeight for the cell, such as "bold". * @param {string} [value] The cell fontWeight. * @returns {string|GC.Spread.Sheets.CellRange} If no value is set, returns the cell's fontWeight; otherwise, returns the cell. * @example * ```javascript * activeSheet.getRange(2, -1, 1, -1, GC.Spread.Sheets.SheetArea.viewport).fontWeight("bold"); * ``` * @example * ```javascript * activeSheet.getCell(1,1).fontWeight("bold"); * ``` * @example * ```javascript * activeSheet.getRange(-1, 3, -1, 1, GC.Spread.Sheets.SheetArea.viewport).fontWeight("bold"); * ``` */ fontWeight(value?: string): any; /** * Gets or sets the color of the text in the cell, such as "red", "#FFFF00", "rgb(255,0,0)", "Accent 5", and so on. * @param {string} [value] The color of the text. * @returns {string|GC.Spread.Sheets.CellRange} If no value is set, returns the cell foreground color; otherwise, returns the cell. * @example * ```javascript * activeSheet.getRange(-1, 3, -1, 1, GC.Spread.Sheets.SheetArea.viewport).foreColor("blue"); * ``` */ foreColor(value?: string): any; /** * Gets or sets the formatter for the cell. * @param {string | GC.Spread.Formatter.GeneralFormatter} [value] The cell formatter string or object. * @returns {string | GC.Spread.Formatter.GeneralFormatter |GC.Spread.Sheets.CellRange} If no value is set, returns the cell formatter string or object; otherwise, returns the cell. * @example * ```javascript * activeSheet.getCell(1,1).formatter("0.000%"); * ``` * @example * ```javascript * activeSheet.getCell(1, -1).formatter("0.000%"); * activeSheet.getCell(1,0).value("2"); * ``` * @example * ```javascript * activeSheet.getCell(-1, 0).formatter("0.000%"); * activeSheet.getCell(0,0).value("2"); * ``` */ formatter(value?: string | GC.Spread.Formatter.GeneralFormatter): any; /** * Gets or sets the formula for the cell. * @param {string} [value] The cell formula. * @param {boolean} [autoAdjustReference] Whether to adjust the relative reference of each cell. It's false if omitted. * @returns {string|GC.Spread.Sheets.CellRange} If no value is set, returns the cell formula; otherwise, returns the cell. * @example * ```javascript * activeSheet.getCell(0,2).formula("DATEDIF(DATE(2003,1,1),DATE(2016,1,1),\"Y\")"); * activeSheet.getRange(2,2,100,1).formula("=A3+$A$1"); // all the cells are "=A3+$A$1" * activeSheet.getRange(2,2,100,1).formula("=A3+$A$1", true); // the first cell is "=A3+$A$1", the second cell is "=A4+$A$1", ... * ``` */ formula(value?: string, autoAdjustReference?: boolean): any; /** * Gets or sets the horizontal alignment of the contents of the cell. * @param {GC.Spread.Sheets.HorizontalAlign} [value] The horizontal alignment. * @returns {GC.Spread.Sheets.HorizontalAlign|GC.Spread.Sheets.CellRange} If no value is set, returns the horizontal alignment of the contents of the cell; otherwise, returns the cell. * @example * ```javascript * activeSheet.getRange(-1, 3, -1, 1, GC.Spread.Sheets.SheetArea.viewport).hAlign(GC.Spread.Sheets.HorizontalAlign.right); * ``` */ hAlign(value?: GC.Spread.Sheets.HorizontalAlign): any; /** * Gets or sets the height of the row in pixels. * @param {number} [value] The cell row height. * @returns {number|GC.Spread.Sheets.CellRange} If no value is set, returns the row height; otherwise, returns the row. * @example * ```javascript * activeSheet.getRange(0, -1, 1, -1, GC.Spread.Sheets.SheetArea.viewport).height(90); * ``` */ height(value?: number): any; /** * Gets or sets whether the cell formula is visible. * @param {boolean} [value] Set to `true` to hidden the cell formula. * @returns {boolean|GC.Spread.Sheets.CellRange} If no value is set, returns whether the cell formula is hidden; otherwise, returns the cell. * @example * ```javascript * activeSheet.getRange(-1, 3, -1, 1, GC.Spread.Sheets.SheetArea.viewport).hidden(true); * ``` */ hidden(value?: boolean): any; /** * Gets or sets the imeMode of the cell. * @param {GC.Spread.Sheets.ImeMode} [value] The cell imeMode. * @deprecated This property currently only works in Internet Explorer. * @returns {GC.Spread.Sheets.ImeMode|GC.Spread.Sheets.CellRange} If no value is set, returns the cell imeMode; otherwise, returns the cell. * @example * ```javascript * activeSheet.getCell(0, 0).imeMode(GC.Spread.Sheets.ImeMode.disabled); * //or * var style = new GC.Spread.Sheets.Style(); * style.imeMode = GC.Spread.Sheets.ImeMode.disabled; * activeSheet.setStyle(0, 0, style); * ``` * @example * ```javascript * activeSheet.getRange(2, -1, 1, -1).imeMode(GC.Spread.Sheets.ImeMode.active); * ``` * @example * ```javascript * activeSheet.getRange(-1, 2, -1, 1).imeMode(GC.Spread.Sheets.ImeMode.auto); * ``` */ imeMode(value?: GC.Spread.Sheets.ImeMode): any; /** * Gets or sets whether the cell's text is vertical. * @param {boolean} [value] Set to `true` to have the cell's text vertical. * @returns {boolean|GC.Spread.Sheets.CellRange} If no value is set, returns whether the cell's text vertical; otherwise, returns the cell. * @example * ```javascript * activeSheet.getRange(2,-1, 1, -1, GC.Spread.Sheets.SheetArea.viewport).isVerticalText(false); * activeSheet.setText(2,0,"This is a test"); * ``` * @example * ```javascript * activeSheet.getCell(1,1).isVerticalText(true); * ``` * @example * ```javascript * activeSheet.getRange(-1, 3, -1, 1, GC.Spread.Sheets.SheetArea.viewport).isVerticalText(true); * ``` */ isVerticalText(value?: boolean): any; /** * Gets or sets the cell label options. * @param {Object} [value] The cell label options. * @param {GC.Spread.Sheets.LabelAlignment} [value.alignment] - The cell label position. * @param {GC.Spread.Sheets.LabelVisibility} [value.visibility] - The cell label visibility. * @param {string} [value.font] - The cell label font. * @param {string} [value.foreColor] - The cell label forecolor. * @param {string} [value.margin] - The cell label margin. * @returns {Object|GC.Spread.Sheets.CellRange} If no value is set, returns the value of the cell label options; otherwise, returns the cell. * @example * ```javascript * //This example sets label options for the watermark. * var type = new GC.Spread.Sheets.Style(); * type.watermark = "User name"; * type.cellPadding = "20"; * type.labelOptions = {alignment:GC.Spread.Sheets.LabelAlignment.topLeft, visibility: GC.Spread.Sheets.LabelVisibility.visible}; * activeSheet.setStyle(0, 1, type); * activeSheet.getRange(0, -1, 1, -1, GC.Spread.Sheets.SheetArea.viewport).height(60); * activeSheet.getRange(-1, 1, -1, 1).width(150); * var combo = new GC.Spread.Sheets.CellTypes.ComboBox(); * combo.items([{ text: "Oranges", value: "11k" }, { text: "Apples", value: "15k" }, { text: "Grape", value: "100k" }]); * combo.editorValueType(GC.Spread.Sheets.CellTypes.EditorValueType.text); * activeSheet.setCellType(2, 1, combo, GC.Spread.Sheets.SheetArea.viewport); * activeSheet.getCell(2, 1, GC.Spread.Sheets.SheetArea.viewport).watermark("ComboBox Cell Type").cellPadding('10 10 20 10'); * activeSheet.getCell(2, 1, GC.Spread.Sheets.SheetArea.viewport).labelOptions({alignment: GC.Spread.Sheets.LabelAlignment.bottomCenter, foreColor: 'yellowgreen', font: 'bold 15px Arial'}); * activeSheet.getRange(2, -1, 1, -1, GC.Spread.Sheets.SheetArea.viewport).height(60); * ``` */ labelOptions(value?: GC.Spread.Sheets.ILabelOptions): any; /** * Gets or sets whether the cell is locked. When the sheet is protected, the locked cell cannot be edited. * @param {boolean} [value] Set to `true` to lock the cell. * @returns {boolean|GC.Spread.Sheets.CellRange} If no value is set, returns whether the cell is locked; otherwise, returns the cell. * @example * ```javascript * activeSheet.getRange(-1, 3, -1, 1, GC.Spread.Sheets.SheetArea.viewport).locked(true); * ``` */ locked(value?: boolean): any; /** * Gets or sets the cell mask. * @param {Object} [value] The cell mask. * @param {string} [value.pattern] - The cell mask pattern. * @param {string} [value.placeholder] - The cell mask placeholder. * @param {string} [value.excludeLiteral] - The cell mask excludeLiteral. * @param {string} [value.excludePlaceholder] - The cell mask excludePlaceholder. * @returns {Object|GC.Spread.Sheets.CellRange} If no value is set, returns the value of the cell mask; otherwise, returns the cell. * @example * ```javascript * //This example sets mask of the cell. * var style = new GC.Spread.Sheets.Style(); * var pattern = "[a0_]{8}"; * style.pattern = pattern; * activeSheet.setStyle(0, 1, style); * activeSheet.getCell(0, 1, GC.Spread.Sheets.SheetArea.viewport).mask({ pattern: pattern}); * ``` */ mask(value?: GC.Spread.Sheets.IMaskType): any; /** * Gets or sets the quote prefix of the cell. * @param {boolean} [value] The value of the quote Prefix. * @returns {boolean|GC.Spread.Sheets.CellRange} If no value is set, returns the content of the quotePrefix; otherwise, returns the cell. * @example * ```javascript * activeSheet.getCell(1,1).quotePrefix(true); * ``` */ quotePrefix(value?: boolean): any; /** * Gets or sets whether the row or column can be resized by the user. * @param {boolean} [value] Set to `true` to make the row resizable. * @returns {boolean|GC.Spread.Sheets.CellRange} If no value is set, returns whether the user can resize the row; otherwise, returns the row or column. * @example * ```javascript * activeSheet.getRange(-1, 3, -1, 1. GC.Spread.Sheets.SheetArea.viewport).resizable(true); * ``` */ resizable(value?: boolean): any; /** * Sets the border for the specified area. * @param {GC.Spread.Sheets.LineBorder} border The border line. * @param {Object} option Determines which part of the cell range to set, the option object contains {all:true, left:true, top:true, right:true, bottom:true, diagonalUp:true, diagonalDown:true, outline:true,inside:true, innerHorizontal:true, innerVertical:true} * @param {boolean} [options.all] - all border. * @param {boolean} [options.left] - left border. * @param {boolean} [options.top] - top border. * @param {boolean} [options.right] - right border. * @param {boolean} [options.bottom] - bottom border. * @param {boolean} [options.outline] - outline border. * @param {boolean} [options.inside] - inside border. * @param {boolean} [options.innerHorizontal] - innerHorizontal border. * @param {boolean} [options.innerVertical] - innerVertical border. * @param {boolean} [options.diagonalUp] - diagonalUp border. * @param {boolean} [options.diagonalDown] - diagonalDown border. * @example * ```javascript * //This example creates borders. * sheet.getCell(1, 1).borderTop(new GC.Spread.Sheets.LineBorder("#F0F8FF",GC.Spread.Sheets.LineStyle.double)); * sheet.getCell(1, 1).borderLeft(new GC.Spread.Sheets.LineBorder("#F0F8FF",GC.Spread.Sheets.LineStyle.hair)); * sheet.getCell(1, 1).borderRight(new GC.Spread.Sheets.LineBorder("#FAEBD7",GC.Spread.Sheets.LineStyle.dashDot)); * sheet.getCell(1, 1).borderBottom(new GC.Spread.Sheets.LineBorder("#00FFFF",GC.Spread.Sheets.LineStyle.medium)); * sheet.getRange(-1, 5, -1, 1, GC.Spread.Sheets.SheetArea.viewport).borderTop(new GC.Spread.Sheets.LineBorder("#F0FFFF",GC.Spread.Sheets.LineStyle.medium)); * sheet.getRange(-1, 5, -1, 1, GC.Spread.Sheets.SheetArea.viewport).borderLeft(new GC.Spread.Sheets.LineBorder("#F5F5DC",GC.Spread.Sheets.LineStyle.medium)); * sheet.getRange(-1, 5, -1, 1, GC.Spread.Sheets.SheetArea.viewport).borderRight(new GC.Spread.Sheets.LineBorder("#FF02FF", GC.Spread.Sheets.LineStyle.dashDot)); * sheet.getRange(-1, 5, -1, 1, GC.Spread.Sheets.SheetArea.viewport).borderBottom (new GC.Spread.Sheets.LineBorder("#FFE4C4",GC.Spread.Sheets.LineStyle.thin)); * sheet.getRange(2, 2, 2, 2, GC.Spread.Sheets.SheetArea.viewport).setBorder(new GC.Spread.Sheets.LineBorder("#8A2BE2",GC.Spread.Sheets.LineStyle.thick), { all:true }); * sheet.getRange(5, -1, 1, -1, GC.Spread.Sheets.SheetArea.viewport).borderTop( new GC.Spread.Sheets.LineBorder("#A52A2A",GC.Spread.Sheets.LineStyle.mediumDashed)); * sheet.getRange(5, -1, 1, -1, GC.Spread.Sheets.SheetArea.viewport).borderLeft( new GC.Spread.Sheets.LineBorder("#FF02FF",GC.Spread.Sheets.LineStyle.medium)); * sheet.getRange(5, -1, 1, -1, GC.Spread.Sheets.SheetArea.viewport).borderRight(new GC.Spread.Sheets.LineBorder("#5F9EA0", GC.Spread.Sheets.LineStyle.dashDot)); * sheet.getRange(5, -1, 1, -1, GC.Spread.Sheets.SheetArea.viewport).borderBottom(new GC.Spread.Sheets.LineBorder("#6495ED",GC.Spread.Sheets.LineStyle.dotted)); * sheet.getRange(5, -1, 1, -1, GC.Spread.Sheets.SheetArea.viewport).diagonalUp(new GC.Spread.Sheets.LineBorder("#FF02FF",GC.Spread.Sheets.LineStyle.dotted)); * sheet.getRange(5, -1, 1, -1, GC.Spread.Sheets.SheetArea.viewport).diagonalDown(new GC.Spread.Sheets.LineBorder("#6495ED",GC.Spread.Sheets.LineStyle.medium)); * ``` */ setBorder(border: GC.Spread.Sheets.LineBorder, option: GC.Spread.Sheets.ISetBorderOptions): void; /** * Sets the style for the cell. * @param {GC.Spread.Sheets.Style} value The style. * @example * ```javascript * let style = new GC.Spread.Sheets.Style(); * style.formatter = "#,##0.00"; * sheet.getRange("E5:F10").setStyle(style); * sheet.getRange(0,0,4,4).setStyle(style); * ``` */ setStyle(value: GC.Spread.Sheets.Style): void; /** * Sets the style name for the cell. * @param {string} value The style name. * @example * ```javascript * let style = new GC.Spread.Sheets.Style(); * style.name = "bold_style"; * style.font = "bold 12px sans-serif"; * sheet.addNamedStyle(style); * sheet.getRange("A1:D3").setStyleName("bold_style"); * sheet.getRange(5,5,10,10).setStyleName("bold_style"); * ``` */ setStyleName(value: string): void; /** * Gets or sets the cell ellipsis property. * @param {boolean} [value] Set to `true` to have the cell test show ellipsis. * @returns {boolean|GC.Spread.Sheets.CellRange} If no value is set, returns whether the cell ellipsis property. * @example * ```javascript * activeSheet.getRange(2,-1, 1, -1, GC.Spread.Sheets.SheetArea.viewport).showEllipsis(false); * activeSheet.setText(2,0,"This is a test"); * ``` * @example * ```javascript * activeSheet.getCell(1,1).showEllipsis(true); * ``` */ showEllipsis(value?: boolean): any; /** * Gets or sets whether the cell shrinks the text to fit the cell size. * @param {boolean} [value] Set to `true` to have the cell shrink text to fit. * @returns {boolean|GC.Spread.Sheets.CellRange} If no value is set, returns whether the cell shrinks the text to fit; otherwise, returns the cell. * @example * ```javascript * activeSheet.getRange(2,-1, 1, -1, GC.Spread.Sheets.SheetArea.viewport).shrinkToFit(false); * activeSheet.setText(2,0,"This is a test"); * ``` * @example * ```javascript * activeSheet.getCell(1,1).shrinkToFit(true); * ``` * @example * ```javascript * activeSheet.getRange(-1, 3, -1, 1, GC.Spread.Sheets.SheetArea.viewport).shrinkToFit(true); * ``` */ shrinkToFit(value?: boolean): any; /** * Gets or sets a value that indicates whether the user can set focus to the cell using the Tab key. * @param {boolean} [value] Set to `true` to set focus to the cell using the Tab key. * @returns {boolean|GC.Spread.Sheets.CellRange} If no value is set, returns whether the user can set focus to the cell using the Tab key; otherwise, returns the cell. * @example * ```javascript * activeSheet.getCell(1,1).tabStop(false); * activeSheet.getRange(1, -1, 1, -1, GC.Spread.Sheets.SheetArea.viewport).tabStop(false); * activeSheet.getRange(-1, 1, -1, 1, GC.Spread.Sheets.SheetArea.viewport).tabStop(false); * ``` */ tabStop(value?: boolean): any; /** * Gets or sets the tag for the cell. * @param {Object} [value] The tag value. * @returns {Object|GC.Spread.Sheets.CellRange} If no value is set, returns the tag value; otherwise, returns the cell. * @example * ```javascript * activeSheet.getCell(1,1).tag("cell tag"); * ``` */ tag(value?: any): any; /** * Gets or sets the formatted text for the cell. * @param {string} [value] The cell text. * @returns {string|GC.Spread.Sheets.CellRange} If no value is set, returns the cell text; otherwise, returns the cell. * @example * ```javascript * activeSheet.getCell(1,1).text("cell object"); * ``` */ text(value?: string): any; /** * Gets or sets the type of the decoration added to the cell's text. * @param {GC.Spread.Sheets.TextDecorationType} [value] The type of the decoration. * @returns {GC.Spread.Sheets.TextDecorationType|GC.Spread.Sheets.CellRange} If no value is set, returns the type of the decoration; otherwise, returns the cell. * @example * ```javascript * activeSheet.getRange(1, -1, 1, -1).textDecoration(GC.Spread.Sheets.TextDecorationType.overline | GC.Spread.Sheets.TextDecorationType.underline); * ``` */ textDecoration(value?: GC.Spread.Sheets.TextDecorationType): any; /** * Gets or sets the type of the direction added to the cell's text. * @param {GC.Spread.Sheets.TextDirectionType} [value] The type of the direction. * @returns {GC.Spread.Sheets.TextDirectionType|GC.Spread.Sheets.CellRange} If no value is set, returns the type of the direction; otherwise, returns the cell. * @example * ```javascript * activeSheet.getRange(1, -1, 1, -1).textDirection(GC.Spread.Sheets.TextDirectionType.rightToLeft); * ``` */ textDirection(value?: GC.Spread.Sheets.TextDirectionType): any; /** * Gets or sets the text indent of the cell. * @param {number} [value] The cell text indent. * @returns {number|GC.Spread.Sheets.CellRange} If no value is set, returns the cell text indent; otherwise, returns the cell. * @example * ```javascript * activeSheet.getRange(-1, 3, -1, 1, GC.Spread.Sheets.SheetArea.viewport).textIndent(1); * ``` */ textIndent(value?: number): any; /** * Gets or sets the text rotation angle of the cell. * @param {number} [value] The cell text rotation angle, form -90 to 90 angle. * @returns {number|GC.Spread.Sheets.CellRange} If no value is set, returns the cell text rotation angle; otherwise, returns the cell. * @example * ```javascript * activeSheet.getRange(-1, 3, -1, 1, GC.Spread.Sheets.SheetArea.viewport).textOrientation(66); * ``` */ textOrientation(value?: number): any; /** * Gets or sets the theme font for the cell. * @param {string} [value] The cell's theme font. * @returns {string|GC.Spread.Sheets.CellRange} If no value is set, returns the cell's theme font; otherwise, returns the cell. * @example * ```javascript * activeSheet.getCell(-1, 0).themeFont("Body"); * activeSheet.getCell(0,0).value("Test"); * ``` */ themeFont(value?: string): any; /** * Gets the HTML content from the specified area. * @param {GC.Spread.Sheets.HeaderOptions} [headerOptions] Indicates whether to include row header and column header or not, when cell range is whole rows or whole columns in viewport area, it defaults to `noHeaders`. * @param {boolean} [includeStyle] Indicates whether to include style and span or not, it defaults to `true`. * @returns {string} The HTML content that contains cell text, cell span and cell style. * @example * ```javascript * activeSheet.getRange(0, 0, 10, 10).toHtml(); * ``` */ toHtml(headerOptions?: GC.Spread.Sheets.HeaderOptions, includeStyle?: boolean): string; /** * Gets or sets the data validator for the cell. * @param {GC.Spread.Sheets.DataValidation.DefaultDataValidator} [value] The cell data validator. * @returns {GC.Spread.Sheets.DataValidation.DefaultDataValidator|GC.Spread.Sheets.CellRange} If no value is set, returns the cell data validator; otherwise, returns the cell. * @example * ```javascript * spread.options.highlightInvalidData = true; * var dv = GC.Spread.Sheets.DataValidation.createDateValidator(GC.Spread.Sheets.ConditionalFormatting.ComparisonOperators.between, new Date(2012, 11, 31), new Date(2013, 11, 31)); * dv.showInputMessage(true); * dv.inputMessage("Enter a date between 12/31/2012 and 12/31/2013."); * dv.inputTitle("Tip"); * activeSheet.getCell(0,0).validator(dv); * ``` * @example * ```javascript * spread.options.highlightInvalidData = true; * var dv = GC.Spread.Sheets.DataValidation.createDateValidator(GC.Spread.Sheets.ConditionalFormatting.ComparisonOperators.between, new Date(2012, 11, 31), new Date(2013, 11, 31)); * dv.showInputMessage(true); * dv.inputMessage("Enter a date between 12/31/2012 and 12/31/2013."); * dv.inputTitle("Tip"); * activeSheet.getCell(1, -1).validator(dv); * ``` * @example * ```javascript * spread.options.highlightInvalidData = true; * var dv = GC.Spread.Sheets.DataValidation.createListValidator("1,2,3"); * dv.showInputMessage(true); * dv.inputMessage("Value must be 1,2 or 3"); * dv.inputTitle("tip"); * activeSheet.setDataValidator(-1,0,dv); * ``` */ validator(value?: GC.Spread.Sheets.DataValidation.DefaultDataValidator): any; /** * Gets or sets the vertical alignment of the contents of the cell. * @param {GC.Spread.Sheets.VerticalAlign} [value] The vertical alignment. * @returns {GC.Spread.Sheets.VerticalAlign|GC.Spread.Sheets.CellRange} If no value is set, returns the vertical alignment of the contents of the cell; otherwise, returns the cell. * @example * ```javascript * activeSheet.getRange(-1, 3, -1, 1, GC.Spread.Sheets.SheetArea.viewport).vAlign(GC.Spread.Sheets.VerticalAlign.top); * ``` */ vAlign(value?: GC.Spread.Sheets.VerticalAlign): any; /** * Gets or sets the unformatted value of the cell. * @param {Object} [value] The cell value. * @returns {Object|GC.Spread.Sheets.CellRange} If no value is set, returns the cell value; otherwise, returns the cell. * @example * ```javascript * activeSheet.getCell(1,1).value(10); * ``` */ value(value?: any): any; /** * Gets or sets whether the row or column is displayed. * @param {boolean} [value] Set to `true` to make the row visible. * @returns {boolean|GC.Spread.Sheets.CellRange} If no value is set, returns the visible of the row or column; otherwise, returns the row or column. * @example * ```javascript * activeSheet.getCell(-1, 0).visible(false); * ``` */ visible(value?: boolean): any; /** * Gets or sets the content of the cell watermark. * @param {string} [value] The content of the watermark. * @returns {string|GC.Spread.Sheets.CellRange} If no value is set, returns the content of the watermark; otherwise, returns the cell. * @example * ```javascript * activeSheet.getCell(1,1).watermark("lightgreen"); * ``` */ watermark(value?: string): any; /** * Gets or sets the width of the column in pixels. * @param {number} [value] The column width. * @returns {number|GC.Spread.Sheets.CellRange} If no value is set, returns the column width; otherwise, returns the column. * @example * ```javascript * activeSheet.getCell(-1, 0).width(20); * ``` */ width(value?: number): any; /** * Gets or sets whether the cell lets text wrap. * @param {boolean} [value] Set to `true` to let text wrap within the cell. * @returns {boolean|GC.Spread.Sheets.CellRange} If no value is set, returns whether the cell lets text wrap; otherwise, returns the cell. * @example * ```javascript * activeSheet.getRange(-1, 3, -1, 1, GC.Spread.Sheets.SheetArea.viewport).wordWrap(true); * ``` */ wordWrap(value?: boolean): any; } export class ColorScheme{ /** * Creates a ColorScheme instance. * @constructor * @class * @classdesc Represents the theme color. * @param {string} name The owner that contains the named variable. * @param {string} background1 The theme color for background1. * @param {string} background2 The theme color for background2. * @param {string} text1 The theme color for text1. * @param {string} text2 The theme color for text2. * @param {string} accent1 The theme color for accent1. * @param {string} accent2 The theme color for accent2. * @param {string} accent3 The theme color for accent3. * @param {string} accent4 The theme color for accent4. * @param {string} accent5 The theme color for accent5. * @param {string} accent6 The theme color for accent6. * @param {string} link The color of the link. * @param {string} followedLink The color of the followedLink. * @example * ```javascript * //This example creates colors for the theme. * var ntheme = new GC.Spread.Sheets.Theme("customThemeColor"); * ntheme.colors().accent1("lightgreen"); * activeSheet.currentTheme(ntheme); * activeSheet.getCell(0, 0).backColor("accent 1"); * activeSheet.getCell(1, 0).backColor("accent 1 30"); * ``` */ constructor(name: string, background1: string, background2: string, text1: string, text2: string, accent1: string, accent2: string, accent3: string, accent4: string, accent5: string, accent6: string, link: string, followedLink: string); /** * Gets or sets the accent1 theme color of the color scheme. * @param {string} value The accent1 theme color string. * @returns {string|GC.Spread.Sheets.ColorScheme} If no value is set, returns the accent1 theme color; otherwise, returns the color scheme. * @example * ```javascript * //This example sets the accent1 color. * var ntheme = new GC.Spread.Sheets.Theme("customThemeColor"); * ntheme.colors().accent1("lightgreen"); * activeSheet.currentTheme(ntheme); * activeSheet.getCell(0, 0).backColor("accent 1"); * activeSheet.getCell(1, 0).backColor("accent 1 30"); * ``` */ accent1(value?: string): any; /** * Gets or sets the accent2 theme color of the color scheme. * @param {string} value The accent2 theme color string. * @returns {string|GC.Spread.Sheets.ColorScheme} If no value is set, returns the accent2 theme color; otherwise, returns the color scheme. * @example * ```javascript * //This example sets the accent2 color. * var ntheme = new GC.Spread.Sheets.Theme("customThemeColor"); * ntheme.colors().accent1("lightgreen"); * ntheme.colors().accent2("red"); * activeSheet.currentTheme(ntheme); * activeSheet.getCell(0, 0).backColor("accent 1"); * activeSheet.getCell(1, 0).backColor("accent 2"); * ``` */ accent2(value?: string): any; /** * Gets or sets the accent3 theme color of the color scheme. * @param {string} value The accent3 theme color string. * @returns {string|GC.Spread.Sheets.ColorScheme} If no value is set, returns the accent3 theme color; otherwise, returns the color scheme. * @example * ```javascript * //This example sets the accent3 color. * var ntheme = new GC.Spread.Sheets.Theme("customThemeColor"); * ntheme.colors().accent1("lightgreen"); * ntheme.colors().accent3("yellow"); * activeSheet.currentTheme(ntheme); * activeSheet.getCell(0, 0).backColor("accent 1"); * activeSheet.getCell(1, 0).backColor("accent 3"); * ``` */ accent3(value?: string): any; /** * Gets or sets the accent4 theme color of the color scheme. * @param {string} value The accent4 theme color string. * @returns {string|GC.Spread.Sheets.ColorScheme} If no value is set, returns the accent4 theme color; otherwise, returns the color scheme. * @example * ```javascript * //This example sets the accent4 color. * var ntheme = new GC.Spread.Sheets.Theme("customThemeColor"); * ntheme.colors().accent1("lightgreen"); * ntheme.colors().accent4("blue"); * activeSheet.currentTheme(ntheme); * activeSheet.getCell(0, 0).backColor("accent 1"); * activeSheet.getCell(1, 0).backColor("accent 4"); * ``` */ accent4(value?: string): any; /** * Gets or sets the accent5 theme color of the color scheme. * @param {string} value The accent5 theme color string. * @returns {string|GC.Spread.Sheets.ColorScheme} If no value is set, returns the accent5 theme color; otherwise, returns the color scheme. * @example * ```javascript * //This example sets the accent5 color. * var ntheme = new GC.Spread.Sheets.Theme("customThemeColor"); * ntheme.colors().accent1("lightgreen"); * ntheme.colors().accent5("blue"); * activeSheet.currentTheme(ntheme); * activeSheet.getCell(0, 0).backColor("accent 1"); * activeSheet.getCell(1, 0).backColor("accent 5"); * ``` */ accent5(value?: string): any; /** * Gets or sets the accent6 theme color of the color scheme. * @param {string} value The accent6 theme color string. * @returns {string|GC.Spread.Sheets.ColorScheme} If no value is set, returns the accent6 theme color; otherwise, returns the color scheme. * @example * ```javascript * //This example sets the accent6 color. * var ntheme = new GC.Spread.Sheets.Theme("customThemeColor"); * ntheme.colors().accent1("lightgreen"); * ntheme.colors().accent6("blue"); * activeSheet.currentTheme(ntheme); * activeSheet.getCell(0, 0).backColor("accent 1"); * activeSheet.getCell(1, 0).backColor("accent 6"); * ``` */ accent6(value?: string): any; /** * Gets or sets the background1 theme color of the color scheme. * @param {string} value The background1 theme color string. * @returns {string|GC.Spread.Sheets.ColorScheme} If no value is set, returns the background1 theme color; otherwise, returns the color scheme. * @example * ```javascript * //This example sets the background1 color. * var ntheme = new GC.Spread.Sheets.Theme("customThemeColor"); * ntheme.colors().accent1("lightgreen"); * ntheme.colors().background1("orange"); * activeSheet.currentTheme(ntheme); * activeSheet.getCell(0, 0).backColor("accent 1"); * activeSheet.getCell(1, 0).backColor("background 1"); * ``` */ background1(value?: string): any; /** * Gets or sets the background2 theme color of the color scheme. * @param {string} value The background2 theme color string. * @returns {string|GC.Spread.Sheets.ColorScheme} If no value is set, returns the background2 theme color; otherwise, returns the color scheme. * @example * ```javascript * //This example sets the background2 color. * var ntheme = new GC.Spread.Sheets.Theme("customThemeColor"); * ntheme.colors().accent1("lightgreen"); * ntheme.colors().background2("orange"); * activeSheet.currentTheme(ntheme); * activeSheet.getCell(0, 0).backColor("accent 1"); * activeSheet.getCell(1, 0).backColor("background 2"); * ``` */ background2(value?: string): any; /** * Gets or sets the followed hyperlink theme color of the color scheme. * @param {string} value The followed hyperlink theme color string. * @returns {string|GC.Spread.Sheets.ColorScheme} If no value is set, returns the followed hyperlink theme color; otherwise, returns the color scheme. * @example * ```javascript * //This example sets the followedHyperline color. * var ntheme = new GC.Spread.Sheets.Theme("customThemeColor"); * ntheme.colors().accent1("lightgreen"); * ntheme.colors().followedHyperlink("orange"); * ntheme.colors().hyperlink("red"); * activeSheet.currentTheme(ntheme); * activeSheet.getCell(0, 0).backColor("accent 1"); * activeSheet.getCell(1, 0).backColor("followedHyperlink"); * activeSheet.getCell(2, 0).backColor("hyperlink"); * ``` */ followedHyperlink(value?: string): any; /** * Gets the color based on the theme color. * @param {string} name The theme color name. * @returns {string} The theme color. * @example * ```javascript * //This example gets the theme color. * var ntheme = new GC.Spread.Sheets.Theme("customThemeColor"); * ntheme.colors().accent1("lightgreen"); * ntheme.colors().followedHyperlink("orange"); * ntheme.colors().hyperlink("red"); * ntheme.colors().name("test"); * activeSheet.currentTheme(ntheme); * activeSheet.getCell(0, 0).backColor("accent 1"); * activeSheet.getCell(1, 0).backColor("followedHyperlink"); * activeSheet.getCell(2, 0).backColor("hyperlink"); * var cname = ntheme.getColor("accent 1"); * alert(cname); * ``` */ getColor(name: string): string; /** * Gets or sets the hyperlink theme color of the color scheme. * @param {string} value The hyperlink theme color string. * @returns {string|GC.Spread.Sheets.ColorScheme} If no value is set, returns the hyperlink theme color; otherwise, returns the color scheme. * @example * ```javascript * //This example sets the hyperline color. * var ntheme = new GC.Spread.Sheets.Theme("customThemeColor"); * ntheme.colors().accent1("lightgreen"); * ntheme.colors().followedHyperlink("orange"); * ntheme.colors().hyperlink("red"); * activeSheet.currentTheme(ntheme); * activeSheet.getCell(0, 0).backColor("accent 1"); * activeSheet.getCell(1, 0).backColor("followedHyperlink"); * activeSheet.getCell(2, 0).backColor("hyperlink"); * ``` */ hyperlink(value?: string): any; /** * Gets or sets the name of the color scheme. * @param {string} value The name. * @returns {string|GC.Spread.Sheets.ColorScheme} If no value is set, returns the name; otherwise, returns the color scheme. * @example * ```javascript * //This example sets the theme name. * var ntheme = new GC.Spread.Sheets.Theme("customThemeColor"); * ntheme.colors().accent1("lightgreen"); * ntheme.colors().name("green theme"); * activeSheet.currentTheme(ntheme); * activeSheet.getCell(0, 0).backColor("accent 1"); * ``` */ name(value?: string): any; /** * Gets or sets the textcolor1 theme color of the color scheme. * @param {string} value The textcolor1 theme color string. * @returns {string|GC.Spread.Sheets.ColorScheme} If no value is set, returns the textcolor1 theme color; otherwise, returns the color scheme. * @example * ```javascript * //This example sets the textColor1 color. * var ntheme = new GC.Spread.Sheets.Theme("customThemeColor"); * ntheme.colors().accent1("lightgreen"); * ntheme.colors().textColor1("orange"); * activeSheet.currentTheme(ntheme); * activeSheet.getCell(0, 0).backColor("accent 1"); * activeSheet.getCell(1, 0).backColor("Text 1"); * ``` */ textColor1(value?: string): any; /** * Gets or sets the textcolor2 theme color of the color scheme. * @param {string} value The textcolor2 theme color string. * @returns {string|GC.Spread.Sheets.ColorScheme} If no value is set, returns the textcolor2 theme color; otherwise, returns the color scheme. * @example * ```javascript * //This example sets the textColor2 color. * var ntheme = new GC.Spread.Sheets.Theme("customThemeColor"); * ntheme.colors().accent1("lightgreen"); * ntheme.colors().textColor2("orange"); * activeSheet.currentTheme(ntheme); * activeSheet.getCell(0, 0).backColor("accent 1"); * activeSheet.getCell(1, 0).backColor("Text 2"); * ``` */ textColor2(value?: string): any; } export class CustomDocPropsManager{ /** * Represents a custom document property manager. It can manage custom properties on all documents. * @class * @param {GC.Spread.Sheets.Workbook} workbook The workbook. */ constructor(workbook: GC.Spread.Sheets.Workbook); /** * Set custom document property. * @param {string} propName Property name. * @param {GC.Spread.Sheets.CustomDocumentPropertyValueType} value Property value. * @param {boolean} isLinkTarget Is it a content link. * @example * ```javascript * spread.docProps.customDocPropsManager.add('prop1', '1'); * spread.docProps.customDocPropsManager.add('prop2', 'CellAlias', true); * ``` */ add(propName: string, value: GC.Spread.Sheets.CustomDocumentPropertyValueType, isLinkTarget?: boolean): void; /** * Get or set custom document properties. * @param {GC.Spread.Sheets.ICustomDocumentProperty[]} props Custom document properties. * @returns {GC.Spread.Sheets.ICustomDocumentProperty[] | undefined} Custom document properties. * @example * ```javascript * spread.docProps.customDocPropsManager.all([{ name: 'prop1', value: '1' }]); * spread.docProps.customDocPropsManager.all(); * ``` */ all(props?: GC.Spread.Sheets.ICustomDocumentProperty[]): GC.Spread.Sheets.ICustomDocumentProperty[] | undefined; /** * Clear custom document properties. * @example * ```javascript * spread.docProps.customDocPropsManager.clear(); * ``` */ clear(): void; /** * Get custom document property by property name. * @param {string} propName Property name. * @returns {GC.Spread.Sheets.ICustomDocumentProperty} Custom document property. * @example * ```javascript * spread.docProps.customDocPropsManager.all([{ name: 'prop1', value: '1' }]); * spread.docProps.customDocPropsManager.get('prop1'); * ``` */ get(propName: string): GC.Spread.Sheets.ICustomDocumentProperty | undefined; /** * Remove custom document property by property name. * @param {string} propName Property name. * @example * ```javascript * spread.docProps.customDocPropsManager.remove('prop1'); * ``` */ remove(propName: string): void; } export class CustomThemeManagerBase{ /** * Represents a custom theme manager that can manage all custom themes. * @class * @param {GC.Spread.Sheets.Workbook} workbook The workbook. */ constructor(workbook: GC.Spread.Sheets.Workbook); } export class Events{ /** * Defines the events supported in SpreadJS. * @class */ constructor(); /** * Occurs when the user has changed the active sheet. * @name GC.Spread.Sheets.Workbook#ActiveSheetChanged * @event * @param eventParam *{@link GC.Spread.Sheets.Worksheet}* `oldSheet` The old sheet. * @param eventParam *{@link GC.Spread.Sheets.Worksheet}* `newSheet` The new sheet. * @example * ```javascript * //This example creates log text for the ActiveSheetChanged event. * // Use web browser to see the console log text * spread.bind(GC.Spread.Sheets.Events.ActiveSheetChanged, function (sender, args) { * console.log("Active sheet has been switched."); * }); * ``` */ static ActiveSheetChanged: string; /** * Occurs when the user is changing the active sheet. * @name GC.Spread.Sheets.Workbook#ActiveSheetChanging * @event * @param eventParam *{@link GC.Spread.Sheets.Worksheet}* `oldSheet` The old sheet. * @param eventParam *{@link GC.Spread.Sheets.Worksheet}* `newSheet` The new sheet. * @param eventParam *boolean* `cancel` A value that indicates whether the operation should be canceled. * @example * ```javascript * //This example stops the active sheet from changing. * spread.bind(GC.Spread.Sheets.Events.ActiveSheetChanging, function (sender, args) { * //Cancel sheet switching. * args.cancel = true; * }); * ``` */ static ActiveSheetChanging: string; /** * Occurs before the print * @name GC.Spread.Sheets.WorkBook.BeforePrint * @event * @param eventParam *Object* `iframe` The print Dom * @param eventParam *boolean* `cancel` Whether cancel print * @example * ```javascript * //This example uses the BeforePrint. * window.onload = function(){ * var spread = new GC.Spread.Sheets.Workbook(document.getElementById("ss"),{sheetCount:3}); * spread.bind(GC.Spread.Sheets.Events.BeforePrint, function (e, data) { * alert(data.iframe + '\n' + 'cancel: ' + data.cancel); * }); * } * ``` */ static BeforePrint: string; /** * Occurs when the user clicks a button, check box, or hyperlink in a cell. * @name GC.Spread.Sheets.Workbook#ButtonClicked * @event * @param eventParam *{@link GC.Spread.Sheets.Worksheet}* `sheet` The sheet that triggered the event. * @param eventParam *string* `sheetName` The sheet's name. * @param eventParam *number* `row` The row index of the cell. * @param eventParam *number* `col` The column index of the cell. * @param eventParam *{@link GC.Spread.Sheets.SheetArea}* `sheetArea` The sheet area that contains the cell. * @example * ```javascript * //This example creates a button cell. * var cellType = new GC.Spread.Sheets.CellTypes.Button(); * cellType.buttonBackColor("#FFFF00"); * cellType.text("this is a button"); * activeSheet.setCellType(1,1,cellType); * //bind * spread.bind(GC.Spread.Sheets.Events.ButtonClicked, function (e, args) { * var sheet = args.sheet, row = args.row, col = args.col; * var cellType = activeSheet.getCellType(row, col); * if (cellType instanceof GC.Spread.Sheets.CellTypes.Button) { * alert("Button Clicked"); * } * }); * ``` */ static ButtonClicked: string; /** * Occurs when the calculate with incrementalCalculation. * @name GC.Spread.Sheets.Workbook#CalculationProgress * @event * @param eventParam *number* `totalCells` The count of total calculate cells. * @param eventParam *number* `pendingCells` The count of cells needed to be calculated. * @param eventParam *number* `iterate` The count of iterative calculation has done, only available when the iterative calculation. * @example * ```javascript * //This example uses the CalculationProgress event, to log the calculation progress. * spread.options.incrementalCalculation = true; * spread.bind(GC.Spread.Sheets.Events.CalculationProgress, function (e, info) { * var msg = "Calculate "; * if (info.pendingCells === 0) { * msg += "finished"; * } else if (info.iterate >= 0) { * msg += info.pendingCells + " cells in iterative calculation round " + info.iterate; * } else { * msg += (info.totalCells - info.pendingCells) + "/" + info.totalCells + "cells"; * } * console.log(msg) * }); * ``` */ static CalculationProgress: string; /** * Occurs when a change is made to a cell in this sheet that may require the cell to be repainted. * @name GC.Spread.Sheets.Worksheet#CellChanged * @event * @param eventParam *{@link GC.Spread.Sheets.Worksheet}* `sheet` The sheet that triggered the event. * @param eventParam *string* `sheetName` The sheet's name. * @param eventParam *number* `row` The row index of the cell. * @param eventParam *number* `col` The column index of the cell. * @param eventParam *{@link GC.Spread.Sheets.SheetArea}* `sheetArea` The sheetArea of the cell. * @param eventParam *string* `propertyName` The name of the cell's property that has changed. * @param eventParam *boolean* `isUndo` Whether this event is from a undo operation. * @example * ```javascript * //This example uses the CellChanged event. * activeSheet.bind(GC.Spread.Sheets.Events.CellChanged, function (e, info) { * if(info.sheetArea === GC.Spread.Sheets.SheetArea.viewport){ * alert("Cell index (" + info.row + "," + info.col + ")"); * } * }); * ``` */ static CellChanged: string; /** * Occurs when the user presses down the left mouse button in a cell. * @name GC.Spread.Sheets.Worksheet#CellClick * @event * @param eventParam *{@link GC.Spread.Sheets.Worksheet}* `sheet` The sheet that triggered the event. * @param eventParam *string* `sheetName` The sheet's name. * @param eventParam *{@link GC.Spread.Sheets.SheetArea}* `sheetArea` The sheet area the clicked cell is in. * @param eventParam *number* `row` The row index of the clicked cell. * @param eventParam *number* `col` The column index of the clicked cell. * @example * ```javascript * //This example uses the CellClick event. * // Use web browser to see the console log text * activeSheet.bind(GC.Spread.Sheets.Events.CellClick, function (sender, args) { * if(args.sheetArea === GC.Spread.Sheets.SheetArea.colHeader){ * console.log("The column header was clicked."); * } * if(args.sheetArea === GC.Spread.Sheets.SheetArea.rowHeader){ * console.log("The row header was clicked."); * } * if(args.sheetArea === GC.Spread.Sheets.SheetArea.corner){ * console.log("The corner header was clicked."); * } * console.log("Clicked column index: " + args.col); * console.log("Clicked row index: " + args.row); * }); * //bind * activeSheet.bind(GC.Spread.Sheets.Events.CellDoubleClick, function (sender, args) { * if(args.sheetArea === GC.Spread.Sheets.SheetArea.colHeader){ * console.log("The column header was double clicked."); * } * if(args.sheetArea === GC.Spread.Sheets.SheetArea.rowHeader){ * console.log("The row header was double clicked."); * } * if(args.sheetArea === GC.Spread.Sheets.SheetArea.corner){ * console.log("The corner header was double clicked."); * } * console.log("Double clicked column index: " + args.col); * console.log("Double clicked row index: " + args.row); * }) * ``` */ static CellClick: string; /** * Occurs when the user presses down the left mouse button twice (double-clicks) in a cell. * @name GC.Spread.Sheets.Worksheet#CellDoubleClick * @event * @param eventParam *{@link GC.Spread.Sheets.Worksheet}* `sheet` The sheet that triggered the event. * @param eventParam *string* `sheetName` The sheet's name. * @param eventParam *{@link GC.Spread.Sheets.SheetArea}* `sheetArea` The sheet area the clicked cell is in. * @param eventParam *number* `row` The row index of the clicked cell. * @param eventParam *number* `col` The column index of the clicked cell. * @example * ```javascript * //This example uses the CellDoubleClick event. * // Use web browser to see the console log text * activeSheet.bind(GC.Spread.Sheets.Events.CellClick, function (sender, args) { * if(args.sheetArea === GC.Spread.Sheets.SheetArea.colHeader){ * console.log("The column header was clicked."); * } * if(args.sheetArea === GC.Spread.Sheets.SheetArea.rowHeader){ * console.log("The row header was clicked."); * } * if(args.sheetArea === GC.Spread.Sheets.SheetArea.corner){ * console.log("The corner header was clicked."); * } * console.log("Clicked column index: " + args.col); * console.log("Clicked row index: " + args.row); * }); * //bind * activeSheet.bind(GC.Spread.Sheets.Events.CellDoubleClick, function (sender, args) { * if(args.sheetArea === GC.Spread.Sheets.SheetArea.colHeader){ * console.log("The column header was double clicked."); * } * if(args.sheetArea === GC.Spread.Sheets.SheetArea.rowHeader){ * console.log("The row header was double clicked."); * } * if(args.sheetArea === GC.Spread.Sheets.SheetArea.corner){ * console.log("The corner header was double clicked."); * } * console.log("Double clicked column index: " + args.col); * console.log("Double clicked row index: " + args.row); * }); * ``` */ static CellDoubleClick: string; /** * Occurs when a Clipboard change occurs that affects Spread.Sheets. * @name GC.Spread.Sheets.Worksheet#ClipboardChanged * @event * @param eventParam *{@link GC.Spread.Sheets.Worksheet}* `sheet` The sheet that triggered the event. * @param eventParam *string* `sheetName` The sheet's name. * @param eventParam *Object* `copyData` The data from Spread.Sheets that has been set into the clipboard. * @param eventParam *string* `copyData.text` The text string of the clipboard. * @param eventParam *string* `copyData.html` The html string of the clipboard. * @param eventParam *Array* `objects` The copied floating objects, it contains picture, custom floating object, slicer, chart and shape. * @example * ```javascript * //This example uses the ClipboardChanged event. * spread.bind(GC.Spread.Sheets.Events.ClipboardChanged, function (sender, args) { * console.log("ClipboardChanged.", args); * }); * ``` */ static ClipboardChanged: string; /** * Occurs when the Clipboard is changing due to a Spread.Sheets action. * @name GC.Spread.Sheets.Worksheet#ClipboardChanging * @event * @param eventParam *{@link GC.Spread.Sheets.Worksheet}* `sheet` The sheet that triggered the event. * @param eventParam *string* `sheetName` The sheet's name. * @param eventParam *Object* `copyData` The data from Spread.Sheets that is set into the clipboard. * @param eventParam *string* `copyData.text` The text string of the clipboard. * @param eventParam *string* `copyData.html` The html string of the clipboard. * @param eventParam *{@link GC.Spread.Sheets.Range[]}* `ranges` The source ranges of the source sheet for current cut or copy operation. * @param eventParam *{@link GC.Spread.Sheets.ClipboardActionType}* `action` Indicates the type of the current action. * @param eventParam *Array* `objects` The coping floating objects, it contains picture, custom floating object, slicer, chart and shape. * @param eventParam *boolean* `cancel` A value that indicates whether the operation should be canceled. * @example * ```javascript * //This example uses the ClipboardChanging event. * spread.bind(GC.Spread.Sheets.Events.ClipboardChanging, function (sender, args) { * console.log("ClipboardChanging", args); * }); * ``` */ static ClipboardChanging: string; /** * Occurs when the user pastes from the Clipboard. * @name GC.Spread.Sheets.Worksheet#ClipboardPasted * @event * @param eventParam *{@link GC.Spread.Sheets.Worksheet}* `sheet` The sheet that triggered the event. * @param eventParam *string* `sheetName` The sheet's name. * @param eventParam *{@link GC.Spread.Sheets.Range}* `cellRange` The range that was pasted. * @param eventParam *{@link GC.Spread.Sheets.ClipboardPasteOptions}* `pasteOption` The paste option that indicates what data is pasted from the clipboard: values, formatting, or formulas. * @param eventParam *Object* `pasteData` The data from the clipboard that will be pasted into Spread.Sheets. * @param eventParam *string* `pasteData.text` The text string of the clipboard. * @param eventParam *string* `pasteData.html` The html string of the clipboard. * @param eventParam *string* `pasteData.image` The image src string of the clipboard. * @param eventParam *{@link GC.Spread.Sheets.Worksheet}* `fromSheet` the source sheet of data range. * @param eventParam *{@link GC.Spread.Sheets.Range}* `[fromRange]` The source range of paste when copy or cut range. * @param eventParam *{@link GC.Spread.Sheets.ClipboardActionType}* `action` Indicates the type of the current action. * @param eventParam *Array* `objects` The pasted floating objects, it contains picture, custom floating object, slicer, chart and shape. * @param eventParam *{@link GC.Spread.Sheets.InsertShiftCell}* `[shiftCells]` The shift cells option, if not shift cell, will be undefined. * @example * ```javascript * //This example uses the ClipboardPasted event. * spread.bind(GC.Spread.Sheets.Events.ClipboardPasted, function (sender, args) { * console.log("ClipboardPasted", args); * }); * ``` */ static ClipboardPasted: string; /** * Occurs when the user is pasting from the Clipboard. * @name GC.Spread.Sheets.Worksheet#ClipboardPasting * @event * @param eventParam *{@link GC.Spread.Sheets.Worksheet}* `sheet` The sheet that triggered the event. * @param eventParam *string* `sheetName` The sheet's name. * @param eventParam *{@link GC.Spread.Sheets.Range}* `cellRange` The range to paste. * @param eventParam *{@link GC.Spread.Sheets.ClipboardPasteOptions}* `pasteOption` The paste option that indicates what data is pasted from the clipboard: values, formatting, or formulas. * @param eventParam *Object* `pasteData` The data from the clipboard that will be pasted into Spread.Sheets. * @param eventParam *string* `pasteData.text` The text string of the clipboard. * @param eventParam *string* `pasteData.html` The html string of the clipboard. * @param eventParam *string* `pasteData.image` The image src string of the clipboard. * @param eventParam *{@link GC.Spread.Sheets.Worksheet}* `fromSheet` the source sheet of data range. * @param eventParam *{@link GC.Spread.Sheets.Range}* `[fromRange]` The source range of paste when copy or cut range. * @param eventParam *{@link GC.Spread.Sheets.ClipboardActionType}* `action` Indicates the type of the current action. * @param eventParam *Array* `objects` The pasting floating objects, it contains picture, custom floating object, slicer, chart and shape. * @param eventParam *boolean* `cancel` A value that indicates whether the operation should be canceled. * @param eventParam *{@link GC.Spread.Sheets.InsertShiftCell}* `[shiftCells]` The shift cells option, if not shift cell, will be undefined. * @example * ```javascript * //This example uses the ClipboardPasting event. * spread.bind(GC.Spread.Sheets.Events.ClipboardPasting, function (sender, args) { * console.log("ClipboardPasting", args); * }); * ``` */ static ClipboardPasting: string; /** * After the redo in collaboration. * @name GC.Spread.Sheets.Worksheet#CollaborationEndRedo * @event * @param eventParam *object* `changeSet` The redo operation object. * @example * ```javascript * //This example. * workbook.bind(GC.Spread.Sheets.Events.CollaborationEndRedo, (sender, args) => { * const changeSet = args.changeSet; * console.log('redo changeSet is:' changeSet); * }); * ``` */ static CollaborationEndRedo: string; /** * After the undo in collaboration. * @name GC.Spread.Sheets.Worksheet#CollaborationEndUndo * @event * @param eventParam *object* `changeSet` The undo operation object. * @example * ```javascript * //This example. * workbook.bind(GC.Spread.Sheets.Events.CollaborationEndUndo, (sender, args) => { * const changeSet = args.changeSet; * console.log('undo changeSet is:' changeSet); * }); * ``` */ static CollaborationEndUndo: string; /** * Before the redo in collaboration. * @name GC.Spread.Sheets.Worksheet#CollaborationStartRedo * @event * @param eventParam *object* `changeSet` The redo operation object. * @example * ```javascript * //This example. * workbook.bind(GC.Spread.Sheets.Events.CollaborationStartRedo, (sender, args) => { * const changeSet = args.changeSet; * console.log('redo changeSet is:' changeSet); * }); * ``` */ static CollaborationStartRedo: string; /** * Before the undo in collaboration. * @name GC.Spread.Sheets.Worksheet#CollaborationStartUndo * @event * @param eventParam *object* `changeSet` The undo operation object. * @example * ```javascript * //This example. * workbook.bind(GC.Spread.Sheets.Events.CollaborationStartUndo, (sender, args) => { * const changeSet = args.changeSet; * console.log('undo changeSet is:' changeSet); * }); * ``` */ static CollaborationStartUndo: string; /** * Occurs when a change is made to a column or range of columns in this sheet that may require the column or range of columns to be repainted. * @name GC.Spread.Sheets.Worksheet#ColumnChanged * @event * @param eventParam *{@link GC.Spread.Sheets.Worksheet}* `sheet` The sheet that triggered the event. * @param eventParam *string* `sheetName` The sheet's name. * @param eventParam *number* `col` The column index. * @param eventParam *{@link GC.Spread.Sheets.SheetArea}* `sheetArea` The sheetArea of the column. * @param eventParam *string* `propertyName` The name of the column's property that has changed. * @param eventParam *Object* `oldValue` The old value of the property. * @param eventParam *Object* `newValue` The new value of the property. * @param eventParam *number* `[count]` The number of columns affected. * @param eventParam *boolean* `isUndo` Whether this event is from a undo operation. * @example * ```javascript * //This example uses the ColumnChanged event. * activeSheet.bind(GC.Spread.Sheets.Events.ColumnChanged, function (e, info) { * if(info.sheetArea === GC.Spread.Sheets.SheetArea.viewport){ * alert("Index (" + info.col + ")"); * } * }); * ``` */ static ColumnChanged: string; /** * Occurs when before a change is made to a column or range of columns in this sheet that may require the column or range of columns to be repainted. * @name GC.Spread.Sheets.Worksheet#ColumnChanging * @event * @param eventParam *{@link GC.Spread.Sheets.Worksheet}* `sheet` The sheet that triggered the event. * @param eventParam *string* `sheetName` The sheet's name. * @param eventParam *number* `col` The column index. * @param eventParam *{@link GC.Spread.Sheets.SheetArea}* `sheetArea` The sheetArea of the column. * @param eventParam *string* `propertyName` The name of the column's property that has changed. * @param eventParam *Object* `oldValue` The old value of the property. * @param eventParam *Object* `newValue` The new value of the property. * @param eventParam *number* `[count]` The number of columns affected. * @param eventParam *boolean* `cancel` Whether the operation should be canceled. * @example * ```javascript * //This example uses the ColumnChanging event. * activeSheet.bind(GC.Spread.Sheets.Events.ColumnChanging, function (e, info) { * if(info.sheetArea === GC.Spread.Sheets.SheetArea.viewport){ * alert("Index (" + info.col + ")"); * } * }); * ``` */ static ColumnChanging: string; /** * Occurs when the column width has changed. * @name GC.Spread.Sheets.Worksheet#ColumnWidthChanged * @event * @param eventParam *{@link GC.Spread.Sheets.Worksheet}* `sheet` The sheet that triggered the event. * @param eventParam *string* `sheetName` The sheet's name. * @param eventParam *Array* `colList` The list of columns whose widths have changed. * @param eventParam *boolean* `header` Whether the columns are row header columns. * @example * ```javascript * //This example uses the ColumnWidthChanged event. * activeSheet.bind(GC.Spread.Sheets.Events.ColumnWidthChanged, function (e, info) { * alert("Column (" + info.colList + ")"); * }); * ``` */ static ColumnWidthChanged: string; /** * Occurs when the column width is changing. * @name GC.Spread.Sheets.Worksheet#ColumnWidthChanging * @event * @param eventParam *{@link GC.Spread.Sheets.Worksheet}* `sheet` The sheet that triggered the event. * @param eventParam *string* `sheetName` The sheet's name. * @param eventParam *Array* `colList` The list of columns whose widths are changing. * @param eventParam *boolean* `header` Whether the columns are row header columns. * @param eventParam *boolean* `cancel` A value that indicates whether the operation should be canceled. * @example * ```javascript * //This example uses the ColumnWidthChanging event. * activeSheet.bind(GC.Spread.Sheets.Events.ColumnWidthChanging, function (e, info) { * alert("Column (" + info.colList + ")"); * }); * ``` */ static ColumnWidthChanging: string; /** * Occurs when any comment has changed. * @name GC.Spread.Sheets.Worksheet#CommentChanged * @event * @param eventParam *{@link GC.Spread.Sheets.Worksheet}* `sheet` The sheet that triggered the event. * @param eventParam *string* `sheetName` The sheet's name. * @param eventParam *{@link GC.Spread.Sheets.Comments.Comment}* `comment` The comment that triggered the event. * @param eventParam *string* `propertyName` The name of the comment's property that has changed. * @example * ```javascript * //This example uses the CommentChanged event. * activeSheet.bind(GC.Spread.Sheets.Events.CommentChanged, function (e, info) { * alert("changed"); * }); * ``` */ static CommentChanged: string; /** * Occurs when the user has removed the comment. * @name GC.Spread.Sheets.Worksheet#CommentRemoved * @event * @param eventParam *{@link GC.Spread.Sheets.Worksheet}* `sheet` The sheet that triggered the event. * @param eventParam *string* `sheetName` The sheet's name. * @param eventParam *{@link GC.Spread.Sheets.Comments.Comment}* `comment` The comment has been removed. * @example * ```javascript * //This example uses the CommentRemoved event. * var comment = new GC.Spread.Sheets.Comments.Comment(); * comment.text("new comment!"); * comment.backColor("orange"); * comment.displayMode(GC.Spread.Sheets.Comments.DisplayMode.alwaysShown); * activeSheet.getCell(5,5).comment(comment); * activeSheet.bind(GC.Spread.Sheets.Events.CommentRemoved, function (e, info) { * console.log("sheet name: " + info.sheetName); * }); * ``` */ static CommentRemoved: string; /** * Occurs when the user is removing any comment. * @name GC.Spread.Sheets.Worksheet#CommentRemoving * @event * @param eventParam *{@link GC.Spread.Sheets.Worksheet}* `sheet` The sheet that triggered the event. * @param eventParam *string* `sheetName` The sheet's name. * @param eventParam *{@link GC.Spread.Sheets.Comments.Comment}* `comment` The comment is being removed. * @param eventParam *boolean* `cancel` A value that indicates whether the operation should be canceled. * @example * ```javascript * //This example prevents the comment from being removed. * var comment = new GC.Spread.Sheets.Comments.Comment(); * comment.text("new comment!"); * comment.backColor("orange"); * comment.displayMode(GC.Spread.Sheets.Comments.DisplayMode.alwaysShown); * activeSheet.getCell(5,5).comment(comment); * activeSheet.bind(GC.Spread.Sheets.Events.CommentRemoving, function (e, info) { * info.cancel = true; * }); * ``` */ static CommentRemoving: string; /** * Occurs when all tables from data manager fetched completely through the workbook opening or importing the sjs/json format file. * @name GC.Spread.Sheets.Worksheet#DataFetchCompleted * @event * @param eventParam *{@link GC.Spread.Sheets.Workbook}* `spread` The workbook that triggered the event. * @example * ```javascript * //This example uses the DataFetchCompleted event. * //In general, the DataFetchCompleted event is triggered after the successCallback of the workbook open method invoked. * //If doesn\u2019t use any table of data manager, and the Workbook contains a lot of Worksheet, the DataFetchCompleted event could be triggered before the successCallback of the workbook open method invoked. * let isOpenFinished = false, isDataFetchCompleted = false; * spread.bind(GC.Spread.Sheets.Events.DataFetchCompleted, function () { * isDataFetchCompleted = true; * if (isOpenFinished) { * // do something with data fetched * } * }); * spread.open(file, function () { * isOpenFinished = true; * if (isDataFetchCompleted) { * // do something with file opened * } * }, function () { }, {}); * ``` */ static DataFetchCompleted: string; /** * Occurs when the user is dragging and dropping a range of cells. * @name GC.Spread.Sheets.Worksheet#DragDropBlock * @event * @param eventParam *{@link GC.Spread.Sheets.Worksheet}* `sheet` The sheet that triggered the event. * @param eventParam *string* `sheetName` The sheet's name. * @param eventParam *number* `fromRow` The row index of the top left cell of the source range (range being dragged). * @param eventParam *number* `fromCol` The column index of the top left cell of the source range (range being dragged). * @param eventParam *number* `toRow` The row index of the top left cell of the destination range (where selection is dropped). * @param eventParam *number* `toCol` The column index of the bottom right cell of the destination range (where selection is dropped). * @param eventParam *number* `rowCount` The row count of the cell range being dragged. * @param eventParam *number* `colCount` The column count of the cell range being dragged. * @param eventParam *boolean* `copy` Whether the source range is copied. * @param eventParam *boolean* `insert` Whether the source range is inserted. * @param eventParam *{@link GC.Spread.Sheets.CopyToOptions}* `copyOption` The CopyOption value for the drag and drop operation. * @param eventParam *boolean* `cancel` A value that indicates whether the operation should be canceled. * @example * ```javascript * //This example creates log text for the DragDropBlock event. * // Use web browser to see the console log text * var activeSheet = spread.getActiveSheet(); * activeSheet.bind(GC.Spread.Sheets.Events.DragDropBlock, function (e, args) { * console.log("From Column:" + args.fromCol); * console.log("From Row:" + args.fromRow); * console.log("To Column:" + args.toCol); * console.log("To Row:" + args.toRow); * }); * ``` */ static DragDropBlock: string; /** * Occurs when the user completes dragging and dropping a range of cells. * @name GC.Spread.Sheets.Worksheet#DragDropBlockCompleted * @event * @param eventParam *{@link GC.Spread.Sheets.Worksheet}* `sheet` The sheet that triggered the event. * @param eventParam *string* `sheetName` The sheet's name. * @param eventParam *number* `fromRow` The row index of the top left cell of the source range (range being dragged). * @param eventParam *number* `fromCol` The column index of the top left cell of the source range (range being dragged). * @param eventParam *number* `toRow` The row index of the top left cell of the destination range (where selection is dropped). * @param eventParam *number* `toCol` The column index of the bottom right cell of the destination range (where selection is dropped). * @param eventParam *number* `rowCount` The row count of the cell range being dragged. * @param eventParam *number* `colCount` The column count of the cell range being dragged. * @param eventParam *boolean* `copy` Whether the source range is copied. * @param eventParam *boolean* `insert` Whether the source range is inserted. * @param eventParam *{@link GC.Spread.Sheets.CopyToOptions}* `copyOption` The CopyOption value for the drag and drop operation. * @example * ```javascript * //This example uses the DragDropBlockCompleted event. * activeSheet.bind(GC.Spread.Sheets.Events.DragDropBlockCompleted, function (e, args) { * alert("From Column (" + args.fromCol + ")"); * }); * ``` */ static DragDropBlockCompleted: string; /** * Occurs when the user is dragging to fill a range of cells. * @name GC.Spread.Sheets.Worksheet#DragFillBlock * @event * @param eventParam *{@link GC.Spread.Sheets.Worksheet}* `sheet` The sheet that triggered the event. * @param eventParam *string* `sheetName` The sheet's name. * @param eventParam *{@link GC.Spread.Sheets.Range}* `fillRange` The range used for the fill operation. * @param eventParam *{@link GC.Spread.Sheets.Fill.AutoFillType}* `autoFillType` AutoFillType value used for the fill operation. * @param eventParam *{@link GC.Spread.Sheets.Fill.FillDirection}* `fillDirection` The direction of the fill. * @param eventParam *boolean* `cancel` A value that indicates whether the operation should be canceled. * @example * ```javascript * //This example uses the DragFillBlock event. * activeSheet.bind(GC.Spread.Sheets.Events.DragFillBlock, function (e, info) { * alert("Direction (" + info.fillDirection + ")"); * }); * ``` */ static DragFillBlock: string; /** * Occurs when the user completes dragging to fill a range of cells. * @name GC.Spread.Sheets.Worksheet#DragFillBlockCompleted * @event * @param eventParam *{@link GC.Spread.Sheets.Worksheet}* `sheet` The sheet that triggered the event. * @param eventParam *string* `sheetName` The sheet's name. * @param eventParam *{@link GC.Spread.Sheets.Range}* `fillRange` The range used for the fill operation. * @param eventParam *{@link GC.Spread.Sheets.Fill.AutoFillType}* `autoFillType` AutoFillType value used for the fill operation. * @param eventParam *{@link GC.Spread.Sheets.Fill.FillDirection}* `fillDirection` The direction of the fill. * @example * ```javascript * //This example uses the DragFillBlockCompleted event. * activeSheet.bind(GC.Spread.Sheets.Events.DragFillBlockCompleted, function (e, info) { * alert("Type (" + info.autoFillType + ")"); * }); * ``` */ static DragFillBlockCompleted: string; /** * Occurs after user drag merge cells. * @name GC.Spread.Sheets.Worksheet#DragMerged * @event * @param eventParam *{@link GC.Spread.Sheets.Worksheet}* `sheet` The sheet that triggered the event. * @param eventParam *string* `sheetName` The sheet's name. * @param eventParam *{@link GC.Spread.Sheets.Range}* `mergeRange` The range that will be merged. * @example * ```javascript * //This example returns the row index. * // Press Ctrl key to merge * $(document).keydown(function (e) { * if (e.keyCode === 17) { * spread.options.allowUserDragMerge = true; * } * }); * $(document).keyup(function (e) { * if (e.keyCode === 17) { * spread.options.allowUserDragMerge = false; * } * }); * activeSheet.bind(GC.Spread.Sheets.Events.DragMerging, function (e, data) { * var mergeRange = data.mergeRange; * alert(mergeRange.row); * }); * activeSheet.bind(GC.Spread.Sheets.Events.DragMerged, function (e, data) { * var mergeRange = data.mergeRange; * alert(mergeRange.row); * }); * ``` */ static DragMerged: string; /** * Occurs before user drag merge cells. * @name GC.Spread.Sheets.Worksheet#DragMerging * @event * @param eventParam *{@link GC.Spread.Sheets.Worksheet}* `sheet` The sheet that triggered the event. * @param eventParam *string* `sheetName` The sheet's name. * @param eventParam *{@link GC.Spread.Sheets.Range}* `mergeRange` The range that will be merged. * @param eventParam *boolean* `cancel` A value that indicates whether the operation should be canceled. * @example * ```javascript * //This example returns the row index. * // Press Ctrl key to merge * $(document).keydown(function (e) { * if (e.keyCode === 17) { * spread.options.allowUserDragMerge = true; * } * }); * $(document).keyup(function (e) { * if (e.keyCode === 17) { * spread.options.allowUserDragMerge = false; * } * }); * activeSheet.bind(GC.Spread.Sheets.Events.DragMerging, function (e, data) { * var mergeRange = data.mergeRange; * alert(mergeRange.row); * }); * activeSheet.bind(GC.Spread.Sheets.Events.DragMerged, function (e, data) { * var mergeRange = data.mergeRange; * alert(mergeRange.row); * }); * ``` */ static DragMerging: string; /** * Occurs when a cell is in edit mode and the text is changed. * @name GC.Spread.Sheets.Worksheet#EditChange * @event * @param eventParam *{@link GC.Spread.Sheets.Worksheet}* `sheet` The sheet that triggered the event. * @param eventParam *string* `sheetName` The sheet's name. * @param eventParam *number* `row` The row index of cell. * @param eventParam *number* `col` The column index of cell. * @param eventParam *Object* `editingText` The value from the current editor. * @example * ```javascript * //This example creates log text for the EditChange event. * // Use web browser to see the console log text * activeSheet.bind(GC.Spread.Sheets.Events.EditChange, function (sender, args) { * console.log("Cell (" + args.row + ", " + args.col + ") data has been changed.") * }); * ``` */ static EditChange: string; /** * Occurs when a cell leaves edit mode. * @name GC.Spread.Sheets.Worksheet#EditEnded * @event * @param eventParam *{@link GC.Spread.Sheets.Worksheet}* `sheet` The sheet that triggered the event. * @param eventParam *string* `sheetName` The sheet's name. * @param eventParam *number* `row` The row index of cell. * @param eventParam *number* `col` The column index of cell. * @param eventParam *Object* `editingText` The value from the current editor. * @param eventParam *boolean* `committed` Whether the value change was committed * @example * ```javascript * //This example creates log text for the EditStarting and EditEnded events. * // Use web browser to see the console log text * var activeSheet = spread.getActiveSheet(); * activeSheet.bind(GC.Spread.Sheets.Events.EditStarting, function (sender, args) { * console.log("Start cell editing."); * }); * activeSheet.bind(GC.Spread.Sheets.Events.EditEnded, function (sender, args) { * console.log("Finish cell editing."); * }); * ``` */ static EditEnded: string; /** * Occurs when a cell is leaving edit mode. * @name GC.Spread.Sheets.Worksheet#EditEnding * @event * @param eventParam *{@link GC.Spread.Sheets.Worksheet}* `sheet` The sheet that triggered the event. * @param eventParam *string* `sheetName` The sheet's name. * @param eventParam *number* `row` The row index of cell. * @param eventParam *number* `col` The column index of cell. * @param eventParam *Object* `editor` The current editor. * @param eventParam *Object* `editingText` The value from the current editor. * @param eventParam *boolean* `cancel` A value that indicates whether the operation should be canceled. * @param eventParam *boolean* `committed` Whether the value change was committed * @example * ```javascript * //This example uses the EditEnding event. * activeSheet.bind(GC.Spread.Sheets.Events.EditStarting, function (sender, args) { * console.log("Start cell editing."); * }); * activeSheet.bind(GC.Spread.Sheets.Events.EditEnding, function (sender, args) { * console.log("EditEnding event."); * }); * activeSheet.bind(GC.Spread.Sheets.Events.EditEnded, function (sender, args) { * console.log("EditEnded event."); * }); * ``` */ static EditEnding: string; /** * Occurs when the editor's status has changed. * @name GC.Spread.Sheets.Worksheet#EditorStatusChanged * @event * @param eventParam *{@link GC.Spread.Sheets.Worksheet}* `sheet` The sheet that triggered the event. * @param eventParam *string* `sheetName` The sheet's name. * @param eventParam *{@link GC.Spread.Sheets.EditorStatus}* `oldStatus` The old status of the editor. * @param eventParam *{@link GC.Spread.Sheets.EditorStatus}* `newStatus` The new status of the editor. * @example * ```javascript * //This example uses the EditorStatusChanged event. * activeSheet.bind(GC.Spread.Sheets.Events.EditorStatusChanged, function (e, info) { * alert("Column (" + info.newStatus + ")"); * }); * ``` */ static EditorStatusChanged: string; /** * Occurs when a cell is entering edit mode. * @name GC.Spread.Sheets.Worksheet#EditStarting * @event * @param eventParam *{@link GC.Spread.Sheets.Worksheet}* `sheet` The sheet that triggered the event. * @param eventParam *string* `sheetName` The sheet's name. * @param eventParam *number* `row` The row index of cell. * @param eventParam *number* `col` The column index of cell. * @param eventParam *boolean* `cancel` A value that indicates whether the operation should be canceled. * @example * ```javascript * //This example creates log text for the EditStarting and EditEnded events. * // Use web browser to see the console log text * var activeSheet = spread.getActiveSheet(); * activeSheet.bind(GC.Spread.Sheets.Events.EditStarting, function (sender, args) { * console.log("Start cell editing."); * }); * activeSheet.bind(GC.Spread.Sheets.Events.EditEnded, function (sender, args) { * console.log("Finish cell editing."); * }); * ``` */ static EditStarting: string; /** * Occurs when the focus enters a cell. * @name GC.Spread.Sheets.Worksheet#EnterCell * @event * @param eventParam *{@link GC.Spread.Sheets.Worksheet}* `sheet` The sheet that triggered the event. * @param eventParam *string* `sheetName` The sheet's name. * @param eventParam *number* `row` The row index of the cell being entered. * @param eventParam *number* `col` The column index of the cell being entered. * @example * ```javascript * //This example uses the EnterCell event. * activeSheet.bind(GC.Spread.Sheets.Events.EnterCell, function (e, info) { * alert("Cell (" + info.row + ", " + info.col +")"); * }); * ``` */ static EnterCell: string; /** * Occurs when any floating object has changed. * @name GC.Spread.Sheets.Worksheet#FloatingObjectsChanged * @event * @param eventParam *{@link GC.Spread.Sheets.Worksheet}* `sheet` The sheet that triggered the event. * @param eventParam *string* `sheetName` The sheet's name. * @param eventParam *{@link GC.Spread.Sheets.FloatingObjects.FloatingObject}* `floatingObject` The floating object that triggered the event. * @param eventParam *string* `propertyName` The name of the floating object's property that has changed. * @example * ```javascript * //This example uses the FloatingObjectChanged event. * var customFloatingObject = new GC.Spread.Sheets.FloatingObjects.FloatingObject("f1", 10, 10, 60, 64); * var btn = document.createElement('button'); * btn.style.width = "60px"; * btn.style.height = "30px"; * btn.innerText = "button"; * customFloatingObject.content(btn); * activeSheet.floatingObjects.add(customFloatingObject); * activeSheet.bind(GC.Spread.Sheets.Events.FloatingObjectChanged, function (e, info) { * alert("changed"); * }); * ``` */ static FloatingObjectChanged: string; /** * Occurs when the custom floating object content is loaded. * @name GC.Spread.Sheets.Worksheet#FloatingObjectLoaded * @event * @param eventParam *{@link GC.Spread.Sheets.Worksheet}* `sheet` The sheet that triggered the event. * @param eventParam *string* `sheetName` The sheet's name. * @param eventParam *{@link GC.Spread.Sheets.FloatingObjects.FloatingObject}* `floatingObject` The custom floating object that triggered the event. * @param eventParam *HTMLElement* `element` The HTMLElement of the custom floating object. */ static FloatingObjectLoaded: string; /** * Occurs when the user has removed the floating object. * @name GC.Spread.Sheets.Worksheet#FloatingObjectRemoved * @event * @param eventParam *{@link GC.Spread.Sheets.Worksheet}* `sheet` The sheet that triggered the event. * @param eventParam *string* `sheetName` The sheet's name. * @param eventParam *{@link GC.Spread.Sheets.FloatingObjects.FloatingObject}* `floatingObject` The floating object has been removed. * @example * ```javascript * //This example uses the FloatingObjectRemoved event. * var customFloatingObject = new GC.Spread.Sheets.FloatingObjects.FloatingObject("f1", 10, 10, 60, 64); * var btn = document.createElement('button'); * btn.style.width = "60px"; * btn.style.height = "30px"; * btn.innerText = "button"; * customFloatingObject.content(btn); * activeSheet.floatingObjects.add(customFloatingObject); * activeSheet.bind(GC.Spread.Sheets.Events.FloatingObjectRemoved, function (e, info) { * alert(info.sheetName); * }); * ``` */ static FloatingObjectRemoved: string; /** * Occurs when the user is removing any floating object. * @name GC.Spread.Sheets.Worksheet#FloatingObjectRemoving * @event * @param eventParam *{@link GC.Spread.Sheets.Worksheet}* `sheet` The sheet that triggered the event. * @param eventParam *string* `sheetName` The sheet's name. * @param eventParam *{@link GC.Spread.Sheets.FloatingObjects.FloatingObject}* `floatingObject` The floating object is being removed. * @param eventParam *boolean* `cancel` A value that indicates whether the operation should be canceled. * @example * ```javascript * //This example uses the FloatingObjectRemoving event. * var customFloatingObject = new GC.Spread.Sheets.FloatingObjects.FloatingObject("f1", 10, 10, 60, 64); * var btn = document.createElement('button'); * btn.style.width = "60px"; * btn.style.height = "30px"; * btn.innerText = "button"; * customFloatingObject.content(btn); * activeSheet.floatingObjects.add(customFloatingObject); * activeSheet.bind(GC.Spread.Sheets.Events.FloatingObjectRemoving, function (e, info) { * info.cancel = true; * }); * ``` */ static FloatingObjectRemoving: string; /** * Occurs when the selections of the floating object have changed. * @name GC.Spread.Sheets.Worksheet#FloatingObjectsSelectionChanged * @event * @param eventParam *{@link GC.Spread.Sheets.Worksheet}* `sheet` The sheet that triggered the event. * @param eventParam *string* `sheetName` The sheet's name. * @param eventParam *{@link GC.Spread.Sheets.FloatingObjects.FloatingObject}* `floatingObject` The floating object that triggered the event. * @example * ```javascript * //This example uses the FloatingObjectSelectionChanged event. * var customFloatingObject = new GC.Spread.Sheets.FloatingObjects.FloatingObject("f1", 10, 10, 60, 64); * var btn = document.createElement('button'); * btn.style.width = "60px"; * btn.style.height = "30px"; * btn.innerText = "button"; * customFloatingObject.content(btn); * activeSheet.floatingObjects.add(customFloatingObject); * // Use web browser to see the console log text * activeSheet.bind(GC.Spread.Sheets.Events.FloatingObjectSelectionChanged, function (e, info) { * console.log("sheet name: " + info.sheetName); * }); * ``` */ static FloatingObjectSelectionChanged: string; /** * Occurs when the button form control is clicked. * @name GC.Spread.Sheets.Worksheet#FormControlButtonClicked * @event * @param eventParam *{@link GC.Spread.Sheets.Worksheet}* `sheet` The sheet that triggered the event. * @param eventParam *string* `sheetName` The sheet's name. * @param eventParam *{@link GC.Spread.Sheets.Shapes.Shape}* `shape` The shape that triggered the event. * @example * ```javascript * //This example uses the FormControlButtonClicked event. * var shape = sheet.shapes.addFormControl("button", GC.Spread.Sheets.Shapes.FormControlType.button, 50, 50, 150, 100); * activeSheet.bind(GC.Spread.Sheets.Events.FormControlButtonClicked, function (e, info) { * console.log("event info: " + info); * }); * ``` */ static FormControlButtonClicked: string; /** * Occurs when the value of the form control have changed. * @name GC.Spread.Sheets.Worksheet#FormControlValueChanged * @event * @param eventParam *{@link GC.Spread.Sheets.Worksheet}* `sheet` The sheet that triggered the event. * @param eventParam *string* `sheetName` The sheet's name. * @param eventParam *{@link GC.Spread.Sheets.Shapes.Shape}* `shape` The shape that triggered the event. * @param eventParam *any* `newValue` the new value of the form control. * @param eventParam *any* `oldValue` the old value of the form control. * @example * ```javascript * //This example uses the FormControlValueChanged event. * var shape = sheet.shapes.addFormControl('spin', GC.Spread.Sheets.Shapes.FormControlType.spinButton, 50, 50, 150, 100); * activeSheet.bind(GC.Spread.Sheets.Events.FormControlValueChanged, function (e, info) { * console.log("event info: " + info); * }); * ``` */ static FormControlValueChanged: string; /** * Occurs when an invalid operation is performed. * @name GC.Spread.Sheets.Worksheet#InvalidOperation * @event * @param eventParam *{@link GC.Spread.Sheets.Worksheet}* `sheet` The sheet that triggered the event. * @param eventParam *string* `sheetName` The sheet's name. * @param eventParam *{@link GC.Spread.Sheets.InvalidOperationType}* `invalidType` Indicates which operation was invalid. * @param eventParam *string* `message` The description of the invalid operation. * @param eventParam *{@link GC.Spread.Sheets.Range}* `[fillRange]` When invalidType is dragFill, The range used for the fill operation. * @example * ```javascript * //This example uses the InvalidOperation event. * activeSheet.bind(GC.Spread.Sheets.Events.InvalidOperation, function (e, info) { * alert("Message (" + info.message + ")"); * }); * ``` */ static InvalidOperation: string; /** * Occurs when the focus leaves a cell. * @name GC.Spread.Sheets.Worksheet#LeaveCell * @event * @param eventParam *{@link GC.Spread.Sheets.Worksheet}* `sheet` The sheet that triggered the event. * @param eventParam *string* `sheetName` The sheet's name. * @param eventParam *number* `row` The row index of the cell being left. * @param eventParam *number* `col` The column index of the cell being left. * @param eventParam *boolean* `cancel` Whether the operation should be canceled. * @example * ```javascript * //This example creates log text for the LeaveCell event. * // Use web browser to see the console log text * activeSheet.bind(GC.Spread.Sheets.Events.LeaveCell, function (sender, args) { * console.log("The column index before moving: " + args.col); * console.log("The row index before moving: " + args.row); * }); * ``` */ static LeaveCell: string; /** * Occurs when the left column changes. * @name GC.Spread.Sheets.Worksheet#LeftColumnChanged * @event * @param eventParam *{@link GC.Spread.Sheets.Worksheet}* `sheet` The sheet that triggered the event. * @param eventParam *string* `sheetName` The sheet's name. * @param eventParam *number* `oldLeftCol` The old left column index. * @param eventParam *number* `newLeftCol` The new left column index. * @param eventParam *number* `oldOffset` The old left column offset. * @param eventParam *number* `newOffset` The new left column offset. * @example * ```javascript * //This example synchronizes vertical and horizontal scrolling for sheet 1 and sheet 2. * var sheet1 = spread.getSheet(0), * sheet2 = spread.getSheet(1); * sheet1.bind(GC.Spread.Sheets.Events.TopRowChanged, function (sender, args) { * //Set the displayed top row of sheet1 to sheet2 (vertical scroll synchronization). * sheet2.showRow(args.newTopRow, GC.Spread.Sheets.VerticalPosition.top); * }); * sheet1.bind(GC.Spread.Sheets.Events.LeftColumnChanged, function (sender, args) { * //Set the displayed left column of sheet1 to sheet2 (Horizontal scroll synchronization). * sheet2.showColumn(args.newLeftCol, GC.Spread.Sheets.HorizontalPosition.left); * }); * ``` */ static LeftColumnChanged: string; /** * Occurs when the outline column check status has changed. * @name GC.Spread.Sheets.Worksheet#OutlineColumnCheckStatusChanged * @event * @param eventParam *{@link GC.Spread.Sheets.Worksheet}* `sheet` The sheet that triggered the event. * @param eventParam *string* `sheetName` The sheet's name. * @param eventParam *number* `row` The outline column's change row index. * @param eventParam *number* `col` The outline column's change col index. * @param eventParam *boolean* `status` The outline column's change status * @example * ```javascript * //Removing the sparkline causes a change. * activeSheet.bind(GC.Spread.Sheets.Events.OutlineColumnCheckStatusChanged, function (e, info) { * console.log("status: " + info.status); * }); * ``` */ static OutlineColumnCheckStatusChanged: string; /** * Occurs when any picture has changed. * @name GC.Spread.Sheets.Worksheet#PictureChanged * @event * @param eventParam *{@link GC.Spread.Sheets.Worksheet}* `sheet` The sheet that triggered the event. * @param eventParam *string* `sheetName` The sheet's name. * @param eventParam *{@link GC.Spread.Sheets.FloatingObjects.Picture}* `picture` The picture that triggered the event. * @param eventParam *string* `propertyName` The name of the picture's property that has changed. * @example * ```javascript * var spread = new GC.Spread.Sheets.Workbook(document.getElementById("ss"),{sheetCount:3}); * var activeSheet = spread.getActiveSheet(); * activeSheet.pictures.add("f2","Event.png",2,2,6,6); * activeSheet.pictures.add("f1","tsoutline.png",3,0,6,6); * // Use web browser to see the console log text * activeSheet.bind(GC.Spread.Sheets.Events.PictureChanged, function (e, info) { * console.log("Sheet: " + info.sheetName); * console.log("Property: " + info.propertyName); * }); * ``` */ static PictureChanged: string; /** * Occurs when the selections of the picture have changed. * @name GC.Spread.Sheets.Worksheet#PictureSelectionChanged * @event * @param eventParam *{@link GC.Spread.Sheets.Worksheet}* `sheet` The sheet that triggered the event. * @param eventParam *string* `sheetName` The sheet's name. * @param eventParam *{@link GC.Spread.Sheets.FloatingObjects.Picture}* `picture` The picture that triggered the event. * @example * ```javascript * //This example uses the PictureSelectionChanged event. * var spread = new GC.Spread.Sheets.Workbook(document.getElementById("ss"),{sheetCount:3}); * var activeSheet = spread.getActiveSheet(); * activeSheet.pictures.add("f2","Event.png",2,2,6,6); * activeSheet.pictures.add("f1","tsoutline.png",3,0,6,6); * // Use web browser to see the console log text * activeSheet.bind(GC.Spread.Sheets.Events.PictureSelectionChanged, function (e, info) { * console.log("Sheet: " + info.sheetName); * }); * ``` */ static PictureSelectionChanged: string; /** * After PivotTable filter/sort/collapse/fieldChanged/grandTotal/showNoData/group. * @name GC.Spread.Sheets.Worksheet#PivotTableChanged * @event * @param eventParam *string* `pivotTableName` The PivotTable's name. * @param eventParam *string* `type` The specific operation name("filter" | "sort" | "collapse" | "fieldChanged" | "summarizedValueBy" | "showValueAs" | "dataPositionChanged" | "viewChanged" | "grandTotal" | "showNoData" | "group"). * @param eventParam *string* `[fieldName]` Changed fieldName. * @param eventParam *string* `[sourceName]` Changed field sourceName. * @param eventParam *boolean* `[oldValue]` PivotTable changes the value of the previous attribute(collapse, summarizedValueBy, showValueAs). * @param eventParam *boolean* `[newValue]` PivotTable changes the value of the previous attribute(collapse, summarizedValueBy, showValueAs). * @param eventParam *number* `[sortType]` PivotTable sort changes the value of the attribute(sort). * @param eventParam *Object* `[filterInfo]` PivotTable filter changes the value of the attribute(filter). * @param eventParam *number* `[clearType]` PivotTable clear filter changes the value of the attribute(filter). * @param eventParam *number* `[oldArea]` Old PivotTable Field Type(fieldChanged). * @param eventParam *number* `[oldIndex]` Old PivotTable Field index(fieldChanged). * @param eventParam *number* `[newArea]` New PivotTable Field Type(fieldChanged). * @param eventParam *number* `[newIndex]` New PivotTable Field index(fieldChanged). * @param eventParam *string* `[viewName]` Apply PivotTable Views Name(viewChanged). * @example * ```javascript * //This example. * sheet.bind(GC.Spread.Sheets.Events.PivotTableChanged, function (sender, args) { * alert("pivotTableName: " + args.pivotTableName + "changeType: " + args.type); * }); * ``` */ static PivotTableChanged: string; /** * Occurs when the cell range has changed. * @name GC.Spread.Sheets.Worksheet#RangeChanged * @event * @param eventParam *{@link GC.Spread.Sheets.Worksheet}* `sheet` The sheet that triggered the event. * @param eventParam *string* `sheetName` The sheet's name. * @param eventParam *number* `row` The range's row index. * @param eventParam *number* `col` The range's column index. * @param eventParam *number* `rowCount` The range's row count. * @param eventParam *number* `colCount` The range's column count. * @param eventParam *string[]* `tableNames` A collection of table names. * @param eventParam *Object[]* `changedCells` The positions of the cells whose data has changed, each position has row and col. * @param eventParam *{@link GC.Spread.Sheets.RangeChangedAction}* `action` The type of action that raises the RangeChanged event. * @param eventParam *boolean* `isUndo` Whether this event is from a undo operation. * @example * ```javascript * //This example returns the sheet name and action when changing the cell range in Microsoft Internet Explorer. * activeSheet.bind(GC.Spread.Sheets.Events.RangeChanged, function (sender, args) { * console.log(args.sheetName, args.action); * }); * ``` */ static RangeChanged: string; /** * Occurs when a range column has just been clear filtered. * @name GC.Spread.Sheets.Worksheet#RangeFilterCleared * @event * @param eventParam *{@link GC.Spread.Sheets.Worksheet}* `sheet` The sheet that triggered the event. * @param eventParam *string* `sheetName` The sheet's name. * @param eventParam *number* `col` The index of the sheet column has just been clear filtered. * @example * ```javascript * //This example uses the RangeFilterCleared event. * activeSheet.getCell(0,0).text("Name"); * activeSheet.getCell(0,1).text("Value"); * activeSheet.getCell(0,2).text("T/F"); * activeSheet.getCell(1,0).text("AW"); * activeSheet.getCell(1,1).text("5"); * activeSheet.getCell(1,2).text("T"); * var cellRange =new GC.Spread.Sheets.Range(0, 0, 5, 1); * var hideRowFilter =new GC.Spread.Sheets.Filter.HideRowFilter(cellRange); * activeSheet.rowFilter(hideRowFilter); * activeSheet.bind(GC.Spread.Sheets.Events.RangeFilterCleared, function (e, info) { * alert("Col (" + info.col + ")"); * }); * ``` */ static RangeFilterCleared: string; /** * Occurs when a range column is about to be automatically clear filter. * @name GC.Spread.Sheets.Worksheet#RangeFilterClearing * @event * @param eventParam *{@link GC.Spread.Sheets.Worksheet}* `sheet` The sheet that triggered the event. * @param eventParam *string* `sheetName` The sheet's name. * @param eventParam *number* `col` The index of the sheet column to be automatically clear filter. * @example * ```javascript * //This example uses the RangeFilterClearing event. * activeSheet.getCell(0,0).text("Name"); * activeSheet.getCell(0,1).text("Value"); * activeSheet.getCell(0,2).text("T/F"); * activeSheet.getCell(1,0).text("AW"); * activeSheet.getCell(1,1).text("5"); * activeSheet.getCell(1,2).text("T"); * var cellRange =new GC.Spread.Sheets.Range(0, 0, 5, 1); * var hideRowFilter =new GC.Spread.Sheets.Filter.HideRowFilter(cellRange); * activeSheet.rowFilter(hideRowFilter); * activeSheet.bind(GC.Spread.Sheets.Events.RangeFilterClearing, function (e, info) { * alert("Col (" + info.col + ")"); * }); * ``` */ static RangeFilterClearing: string; /** * Occurs when a column has just been automatically filtered. * @name GC.Spread.Sheets.Worksheet#RangeFiltered * @event * @param eventParam *{@link GC.Spread.Sheets.Worksheet}* `sheet` The sheet that triggered the event. * @param eventParam *string* `sheetName` The sheet's name. * @param eventParam *number* `col` The index of the column that was automatically filtered. * @param eventParam *Array* `filterValues` The values by which the column was filtered. * @param eventParam *Array* `conditionInfo` The condition rule info that which the column was filtered. * @example * ```javascript * //This example uses the RangeFiltered event. * var cellrange =new GC.Spread.Sheets.Range(0, 2, 5, 1); * var hideRowFilter =new GC.Spread.Sheets.Filter.HideRowFilter(cellrange); * activeSheet.rowFilter(hideRowFilter); * activeSheet.bind(GC.Spread.Sheets.Events.RangeFiltered, function (e, info) { * alert("Col (" + info.col + ")"); * }); * ``` */ static RangeFiltered: string; /** * Occurs when a column is about to be automatically filtered. * @name GC.Spread.Sheets.Worksheet#RangeFiltering * @event * @param eventParam *{@link GC.Spread.Sheets.Worksheet}* `sheet` The sheet that triggered the event. * @param eventParam *string* `sheetName` The sheet's name. * @param eventParam *number* `col` The index of the column to be automatically filtered. * @param eventParam *Array* `filterValues` The values by which to filter the column. * @param eventParam *Object* `conditionInfo` The condition rule info by which to filter the column. * @example * ```javascript * //This example uses the RangeFiltering event. * var cellrange =new GC.Spread.Sheets.Range(0, 2, 5, 1); * var hideRowFilter =new GC.Spread.Sheets.Filter.HideRowFilter(cellrange); * activeSheet.rowFilter(hideRowFilter); * activeSheet.bind(GC.Spread.Sheets.Events.RangeFiltering, function (e, info) { * alert("Col (" + info.col + ")"); * }); * ``` */ static RangeFiltering: string; /** * Occurs when the user has changed the outline state (range group) for rows or columns. * @name GC.Spread.Sheets.Worksheet#RangeGroupStateChanged * @event * @param eventParam *{@link GC.Spread.Sheets.Worksheet}* `sheet` The sheet that triggered the event. * @param eventParam *string* `sheetName` The sheet's name. * @param eventParam *boolean* `isRowGroup` Whether the outline (range group) is a group of rows. * @param eventParam *number* `index` The index of the RangeGroupInfo object whose state has changed. * @param eventParam *number* `level` The level of the RangeGroupInfo object whose state has changed. * @example * ```javascript * //This example uses the RangeGroupStateChanged event. * activeSheet.suspendPaint(); * activeSheet.setRowCount(34); * activeSheet.setValue(0,0,"Western"); * activeSheet.setValue(0,1,"Western"); * activeSheet.setValue(0,2,"Western"); * activeSheet.setValue(1,0,"A"); * activeSheet.setValue(1,1,"B"); * activeSheet.setValue(1,2,"C"); * activeSheet.setValue(2,0,"A"); * activeSheet.setValue(2,1,"B"); * activeSheet.setValue(2,2,"C"); * activeSheet.rowOutlines.group(0,2); * activeSheet.columnOutlines.group(0,1); * activeSheet.resumePaint(); * activeSheet.bind(GC.Spread.Sheets.Events.RangeGroupStateChanged, function (e, info) { * alert("Level (" + info.level + ")"); * }); * ``` */ static RangeGroupStateChanged: string; /** * Occurs before the user changes the outline state (range group) for rows or columns. * @name GC.Spread.Sheets.Worksheet#RangeGroupStateChanging * @event * @param eventParam *{@link GC.Spread.Sheets.Worksheet}* `sheet` The sheet that triggered the event. * @param eventParam *string* `sheetName` The sheet's name. * @param eventParam *boolean* `isRowGroup` Whether the outline (range group) is a group of rows. * @param eventParam *number* `index` The index of the RangeGroupInfo object whose state is changing. * @param eventParam *number* `level` The level of the RangeGroupInfo object whose state is changing. * @param eventParam *boolean* `cancel` A value that indicates whether the operation should be canceled. * @example * ```javascript * //This example uses the RangeGroupStateChanging event. * activeSheet.suspendPaint(); * activeSheet.setRowCount(34); * activeSheet.setValue(0,0,"Western"); * activeSheet.setValue(0,1,"Western"); * activeSheet.setValue(0,2,"Western"); * activeSheet.setValue(1,0,"A"); * activeSheet.setValue(1,1,"B"); * activeSheet.setValue(1,2,"C"); * activeSheet.setValue(2,0,"A"); * activeSheet.setValue(2,1,"B"); * activeSheet.setValue(2,2,"C"); * activeSheet.rowOutlines.group(0,2); * activeSheet.columnOutlines.group(0,1); * activeSheet.resumePaint(); * activeSheet.bind(GC.Spread.Sheets.Events.RangeGroupStateChanging, function (e, info) { * alert("Level (" + info.level + ")"); * }); * ``` */ static RangeGroupStateChanging: string; /** * Occurs when a column has just been automatically sorted. * @name GC.Spread.Sheets.Worksheet#RangeSorted * @event * @param eventParam *{@link GC.Spread.Sheets.Worksheet}* `sheet` The sheet that triggered the event. * @param eventParam *string* `sheetName` The sheet's name. * @param eventParam *number* `col` The index of the column that was automatically sorted. * @param eventParam *boolean* `ascending` Whether the automatic sort is ascending. * @example * ```javascript * //This example uses the RangeSorted event. * activeSheet.setValue(0, 0, 10); * activeSheet.setValue(1, 0, 100); * activeSheet.setValue(2, 0, 50); * activeSheet.setValue(3, 0, 40); * activeSheet.setValue(4, 0, 80); * activeSheet.setValue(5, 0, 1); * activeSheet.setValue(6, 0, 65); * activeSheet.setValue(7, 0, 20); * activeSheet.setValue(8, 0, 30); * activeSheet.setValue(9, 0, 35); * var cellrange =new GC.Spread.Sheets.Range(0, 0, 5, 1); * var hideRowFilter =new GC.Spread.Sheets.Filter.HideRowFilter(cellrange); * activeSheet.rowFilter(hideRowFilter); * activeSheet.bind(GC.Spread.Sheets.Events.RangeSorted, function (e, info) { * alert("Col (" + info.col + ", " + info.ascending +")"); * }); * ``` */ static RangeSorted: string; /** * Occurs when a column is about to be automatically sorted. * @name GC.Spread.Sheets.Worksheet#RangeSorting * @event * @param eventParam *{@link GC.Spread.Sheets.Worksheet}* `sheet` The sheet that triggered the event. * @param eventParam *string* `sheetName` The sheet's name. * @param eventParam *number* `col` The index of the column to be automatically sorted. * @param eventParam *boolean* `ascending` Whether the automatic sort is ascending. * @param eventParam *boolean* `cancel` Whether the operation should be canceled. * @param eventParam *{@link GC.Spread.Sheets.Range}* `range` The range of automatic sort. * @param eventParam *{@link GC.Spread.Sheets.GroupSort}* `groupSort` The groupSort level to use when sorting, default will use group level if contains group and use flat level if not contains group. * @param eventParam *boolean* `ignoreHidden` Whether to ignore the hidden values and only sort visible values. * @param eventParam *Function* `compareFunction` The customize function to use when sorting, used when value sort. function (value1, value2) {return 0;} * * @example * ```javascript * //This example uses the RangeSorting event. * activeSheet.setValue(0, 0, 10); * activeSheet.setValue(1, 0, 100); * activeSheet.setValue(2, 0, 50); * activeSheet.setValue(3, 0, 40); * activeSheet.setValue(4, 0, 80); * activeSheet.setValue(5, 0, 1); * activeSheet.setValue(6, 0, 65); * activeSheet.setValue(7, 0, 20); * activeSheet.setValue(8, 0, 30); * activeSheet.setValue(9, 0, 35); * var cellrange =new GC.Spread.Sheets.Range(0, 0, 10, 1); * var hideRowFilter =new GC.Spread.Sheets.Filter.HideRowFilter(cellrange); * activeSheet.rowFilter(hideRowFilter); * activeSheet.bind(GC.Spread.Sheets.Events.RangeSorting, function (e, info) { * alert("Col (" + info.col + ", " + info.ascending +")"); * info.groupSort = GC.Spread.Sheets.GroupSort.full; //use full level sort. * info.ignoreHidden = false; // sort with the hidden values. * info.compareFunction = (obj1, obj2)=>{return obj1.toString().localeCompare(obj2.toString())}; * }); * ``` */ static RangeSorting: string; /** * Occurs when the report sheet data has changed by update, insert or delete. Allows submitting data changes to the server. * @name GC.Spread.Report.ReportSheet#ReportSheetDataChanged * @event * @param eventParam *{@link GC.Spread.Report.ReportSheet}* `sheet` The report sheet that triggered the event. * @param eventParam *string* `sheetName` The report sheet's name. * @param eventParam *string* `type` The report sheet change type. insert, update or delete. * @param eventParam *number* `row` The changed row index. * @param eventParam *number* `col` The changed column index. * @example * ```javascript * //This example uses the ReportSheetDataChanged event. * const report = spread.addSheetTab(0, "Report", GC.Spread.Sheets.SheetType.reportSheet); * report.renderMode("Design"); * const templateSheet = report.getTemplate(); * templateSheet.setTemplateCell(0, 0, { * binding: "Orders[orderId]", * type: "Group", * }); * templateSheet.setTemplateCell(0, 1, { * binding: "Orders[customerId]", * type: "Group", * }); * templateSheet.setDataEntrySetting([ { * name: "Write Back Rule 1", * tableName: "Orders", * fields: [ * { dbColumnName: "orderId", formula: "A1", isPrimary: true }, * { dbColumnName: "customerId", formula: "B1" }, * ], * includeUnmodified: false, * skipRecordWithEmptyValue: false * } ]); * report.renderMode("Preview"); * report.bind(GC.Spread.Sheets.Events.ReportSheetDataChanged, (event, args) => { * let reportsheet = args.sheet, changes = reportsheet.getChanges(); * if (allowSubmit(changes)) { // users can submit or drop this changing. * reportsheet.submit(); // submit changes. * } else { * reportsheet.refresh(); // drop changes. * } * }); * // after reportsheet edit / update / delete records in UI will trigger ReportSheetDataChanged event. * // users can submit into server or drop this changing in this moment. * ``` */ static ReportSheetDataChanged: string; /** * Occurs when the report sheet is changing by update, insert or delete. Allows validating or cancellation of the data operation. * @name GC.Spread.Report.ReportSheet#ReportSheetDataChanging * @event * @param eventParam *{@link GC.Spread.Report.ReportSheet}* `sheet` The report sheet that triggered the event. * @param eventParam *string* `sheetName` The report sheet's name. * @param eventParam *string* `type` The report sheet change type. insert, update or delete. * @param eventParam *number* `row` The changing row index. * @param eventParam *number* `col` The changing column index. * @param eventParam *any* `oldValue` The update changing old value. * @param eventParam *any* `newValue` The update changing new value. * @param eventParam *boolean* `cancel` Whether the report sheet changing operation should be canceled. * @example * ```javascript * //This example uses the ReportSheetDataChanging event. * const report = spread.addSheetTab(0, "Report", GC.Spread.Sheets.SheetType.reportSheet); * report.renderMode("Design"); * const templateSheet = report.getTemplate(); * templateSheet.setTemplateCell(0, 0, { * binding: "Orders[orderId]", * type: "Group", * }); * templateSheet.setTemplateCell(0, 1, { * binding: "Orders[customerId]", * type: "Group", * }); * templateSheet.setDataEntrySetting([ { * name: "Write Back Rule 1", * tableName: "Orders", * fields: [ * { dbColumnName: "orderId", formula: "A1", isPrimary: true }, * { dbColumnName: "customerId", formula: "B1" }, * ], * includeUnmodified: false, * skipRecordWithEmptyValue: false * } ]); * report.renderMode("Preview"); * report.bind(GC.Spread.Sheets.Events.ReportSheetDataChanging, (event, args) => { * let { type, row, col, oldValue, newValue } = args; * if (allowChange(type, row, col, oldValue, newValue)) { // user validate this changing operation here. * console.log(`${type} row: ${row}, col: ${col} from ${oldValue} to ${newValue}`); * } else { * args.cancel = true; * } * }); * // reportsheet edit / update / delete records in UI will trigger ReportSheetDataChanging event. * // users can also cancel the operation here if the changing is invalid. * ``` */ static ReportSheetDataChanging: string; /** * Occurs after the report sheet submitted the changes to server. Allow user to provide UI feedback of the submit results from the server. * @name GC.Spread.Report.ReportSheet#ReportSheetRecordsSubmitted * @event * @param eventParam *{@link GC.Spread.Report.ReportSheet}* `sheet` The report sheet that triggered the event. * @param eventParam *string* `sheetName` The report sheet's name. * @param eventParam *{@link GC.Spread.Report.IRecord[]}* `updateSuccessRecords` Successful update or insert records. * @param eventParam *{@link GC.Spread.Report.IFailedRecord[]}* `updateFailedRecords` Failing update or insert records. * @param eventParam *{@link GC.Spread.Report.IRecord[]}* `deleteSuccessRecords` Successful delete records. * @param eventParam *{@link GC.Spread.Report.IFailedRecord[]}* `deleteFailedRecords` Failing delete records. * @example * ```javascript * //This example uses the ReportSheetDataChanged event. * const report = spread.addSheetTab(0, "Report", GC.Spread.Sheets.SheetType.reportSheet); * report.renderMode("Design"); * const templateSheet = report.getTemplate(); * templateSheet.setTemplateCell(0, 0, { * binding: "Orders[orderId]", * type: "Group", * }); * templateSheet.setTemplateCell(0, 1, { * binding: "Orders[customerId]", * type: "Group", * }); * templateSheet.setDataEntrySetting([ { * name: "Write Back Rule 1", * tableName: "Orders", * fields: [ * { dbColumnName: "orderId", formula: "A1", isPrimary: true }, * { dbColumnName: "customerId", formula: "B1" }, * ], * includeUnmodified: false, * skipRecordWithEmptyValue: false * } ]); * report.renderMode("Preview"); * report.bind(GC.Spread.Sheets.Events.ReportSheetRecordsSubmitted, (event, args) => { * let { updateSuccessRecords, deleteSuccessRecords, updateFailedRecords, deleteFailedRecords } = args; * for (let record of updateFailedRecords) { * for (let fieldKey in record.info) { * if (record.info.hasOwnproperty(fieldKey)) { * let recordDetail = record.info[fieldKey]; * if (recordDetail.state === "updated") { * // user console the failed detail info. * console.log(`Updated failed in row: ${recordDetail.row} col: ${recordDetail.col}, oldValue: ${recordDetail.oldValue}, reason is ${record.reason}`); * } * } * } * } * }); * // after submitting into the server, users can get the all success and failed records result. * ``` */ static ReportSheetRecordsSubmitted: string; /** * Occurs before the report sheet submitting changes to server. Allows final validation of all data changes or cancellign the operation. * @name GC.Spread.Report.ReportSheet#ReportSheetRecordsSubmitting * @event * @param eventParam *{@link GC.Spread.Report.ReportSheet}* `sheet` The report sheet that triggered the event. * @param eventParam *string* `sheetName` The report sheet's name. * @param eventParam *boolean* `cancel` Whether the report sheet submit operation should be canceled. * @example * ```javascript * //This example uses the ReportSheetDataChanged event. * const report = spread.addSheetTab(0, "Report", GC.Spread.Sheets.SheetType.reportSheet); * report.renderMode("Design"); * const templateSheet = report.getTemplate(); * templateSheet.setTemplateCell(0, 0, { * binding: "Orders[orderId]", * type: "Group", * }); * templateSheet.setTemplateCell(0, 1, { * binding: "Orders[customerId]", * type: "Group", * }); * templateSheet.setDataEntrySetting([ { * name: "Write Back Rule 1", * tableName: "Orders", * fields: [ * { dbColumnName: "orderId", formula: "A1", isPrimary: true }, * { dbColumnName: "customerId", formula: "B1" }, * ], * includeUnmodified: false, * skipRecordWithEmptyValue: false * } ]); * report.renderMode("Preview"); * report.bind(GC.Spread.Sheets.Events.ReportSheetRecordsSubmitting, (event, args) => { * let reportsheet = args.sheet, changes = reportsheet.getChanges(); * if (isInvalidate(changes)) { * args.cancel = true; * } * }); * // after submitting the report chages, users can validate the changes and cancel this submit. * ``` */ static ReportSheetRecordsSubmitting: string; /** * Occurs when a change is made to a row or range of rows in this sheet that may require the row or range of rows to be repainted. * @name GC.Spread.Sheets.Worksheet#RowChanged * @event * @param eventParam *{@link GC.Spread.Sheets.Worksheet}* `sheet` The sheet that triggered the event. * @param eventParam *string* `sheetName` The sheet's name. * @param eventParam *number* `row` The row index. * @param eventParam *{@link GC.Spread.Sheets.SheetArea}* `sheetArea` The sheetArea of the row. * @param eventParam *string* `propertyName` The name of the row's property that has changed. * @param eventParam *Object* `oldValue` The old value of the property. * @param eventParam *Object* `newValue` The new value of the property. * @param eventParam *number* `[count]` The number of rows affected. * @param eventParam *boolean* `isUndo` Whether this event is from a undo operation. * @example * ```javascript * //This example uses the RowChanged event. * activeSheet.bind(GC.Spread.Sheets.Events.RowChanged, function (e, info) { * alert("Row (" + info.row + ")"); * }); * ``` */ static RowChanged: string; /** * Occurs when before a change is made to a row or range of rows in this sheet that may require the row or range of rows to be repainted. * @name GC.Spread.Sheets.Worksheet#RowChanging * @event * @param eventParam *{@link GC.Spread.Sheets.Worksheet}* `sheet` The sheet that triggered the event. * @param eventParam *string* `sheetName` The sheet's name. * @param eventParam *number* `row` The row index. * @param eventParam *{@link GC.Spread.Sheets.SheetArea}* `sheetArea` The sheetArea of the row. * @param eventParam *string* `propertyName` The name of the row's property that has changed. * @param eventParam *Object* `oldValue` The old value of the property. * @param eventParam *Object* `newValue` The new value of the property. * @param eventParam *number* `[count]` The number of rows affected. * @param eventParam *boolean* `cancel` Whether the operation should be canceled. * @example * ```javascript * //This example uses the RowChanging event. * activeSheet.bind(GC.Spread.Sheets.Events.RowChanging, function (e, info) { * alert("Row (" + info.row + ")"); * }); * ``` */ static RowChanging: string; /** * Occurs when the row height has changed. * @name GC.Spread.Sheets.Worksheet#RowHeightChanged * @event * @param eventParam *{@link GC.Spread.Sheets.Worksheet}* `sheet` The sheet that triggered the event. * @param eventParam *string* `sheetName` The sheet's name. * @param eventParam *Array* `rowList` The list of rows whose heights have changed. * @param eventParam *boolean* `header` Whether the columns are column header columns. * @example * ```javascript * //This example uses the RowHeightChanged event. * activeSheet.bind(GC.Spread.Sheets.Events.RowHeightChanged, function (e, info) { * alert("Row List (" + info.rowList + ")"); * }); * ``` */ static RowHeightChanged: string; /** * Occurs when the row height is changing. * @name GC.Spread.Sheets.Worksheet#RowHeightChanging * @event * @param eventParam *{@link GC.Spread.Sheets.Worksheet}* `sheet` The sheet that triggered the event. * @param eventParam *string* `sheetName` The sheet's name. * @param eventParam *Array* `rowList` The list of rows whose heights are changing. * @param eventParam *boolean* `header` Whether the columns are column header columns. * @param eventParam *boolean* `cancel` A value that indicates whether the operation should be canceled. * @example * ```javascript * //This example uses the RowHeightChanging event. * activeSheet.bind(GC.Spread.Sheets.Events.RowHeightChanging, function (e, info) { * alert("Row List (" + info.rowList + ")"); * }); * ``` */ static RowHeightChanging: string; /** * Occurs when the applied row action is operated. * @name GC.Spread.Sheets.TableSheet.TableSheet#RowOperation * @event * @param eventParam *{@link GC.Spread.Sheets.TableSheet.TableSheet}* `sheet` The table sheet that triggered the event. * @param eventParam *string* `sheetName` The table sheet's name. * @param eventParam *{@link GC.Spread.Sheets.TableSheet.ActionType}* `actionType` The row action type. * @param eventParam *number* `row` The row index. * @example * ```javascript * //This example uses the RowOperation event. * workbook.bind(GC.Spread.Sheets.Events.RowOperation, function (e, info) { * console.log(info.sheetName, info.actionType, info.row); * }); * ``` */ static RowOperation: string; /** * Occurs when the selection of cells on the sheet has changed. * @name GC.Spread.Sheets.Worksheet#SelectionChanged * @event * @param eventParam *{@link GC.Spread.Sheets.Worksheet}* `sheet` The sheet that triggered the event. * @param eventParam *string* `sheetName` The sheet's name. * @param eventParam *{@link GC.Spread.Sheets.Range[]}* `oldSelections` The old selection ranges. * @param eventParam *{@link GC.Spread.Sheets.Range[]}* `newSelections` The new selection ranges. * @example * ```javascript * //This example uses the SelectionChanged event. * activeSheet.bind(GC.Spread.Sheets.Events.SelectionChanged, function (e, info) { * alert("Name (" + info.sheetName + ")"); * }); * ``` */ static SelectionChanged: string; /** * Occurs when the selection of cells on the sheet is changing. * @name GC.Spread.Sheets.Worksheet#SelectionChanging * @event * @param eventParam *{@link GC.Spread.Sheets.Worksheet}* `sheet` The sheet that triggered the event. * @param eventParam *string* `sheetName` The sheet's name. * @param eventParam *{@link GC.Spread.Sheets.Range[]}* `oldSelections` The old selection ranges. * @param eventParam *{@link GC.Spread.Sheets.Range[]}* `newSelections` The new selection ranges. * @example * ```javascript * //This example uses the SelectionChanging event. * activeSheet.bind(GC.Spread.Sheets.Events.SelectionChanging, function (e, info) { * //Use IE to see console * console.log("Name (" + info.sheetName + ")"); * }); * ``` */ static SelectionChanging: string; /** * Occurs when any shape has changed. * @name GC.Spread.Sheets.Worksheet#ShapeChanged * @event * @param eventParam *{@link GC.Spread.Sheets.Worksheet}* `sheet` The sheet that triggered the event. * @param eventParam *string* `sheetName` The sheet's name. * @param eventParam *{@link GC.Spread.Sheets.Shapes.Shape}* `shape` The shape that triggered the event. * @param eventParam *string* `propertyName` The name of the shape's property that has changed. * @example * ```javascript * //This example uses the ShapeChanged event. * var shape1 = activeSheet.shapes.add("shape1", GC.Spread.Sheets.Shapes.AutoShapeType.rectangle, 20, 20, 200, 200); * activeSheet.bind(GC.Spread.Sheets.Events.ShapeChanged, function (e, info) { * alert("changed"); * }); * ``` */ static ShapeChanged: string; /** * Occurs when the user has removed the shape. * @name GC.Spread.Sheets.Worksheet#ShapeRemoved * @event * @param eventParam *{@link GC.Spread.Sheets.Worksheet}* `sheet` The sheet that triggered the event. * @param eventParam *string* `sheetName` The sheet's name. * @param eventParam *{@link GC.Spread.Sheets.Shapes.Shape}* `shape` The shape has been removed. * @example * ```javascript * //This example uses the ShapeRemoved event. * var shape = activeSheet.shapes.add("myShape", GC.Spread.Sheets.Shapes.AutoShapeType.diamond, 0, 90, 200, 200); * activeSheet.bind(GC.Spread.Sheets.Events.ShapeRemoved, function (e, info) { * alert(info.shape.name()); * }); * ``` */ static ShapeRemoved: string; /** * Occurs when the user is removing any shape. * @name GC.Spread.Sheets.Worksheet#ShapeRemoving * @event * @param eventParam *{@link GC.Spread.Sheets.Worksheet}* `sheet` The sheet that triggered the event. * @param eventParam *string* `sheetName` The sheet's name. * @param eventParam *{@link GC.Spread.Sheets.Shapes.Shape}* `shape` The shape is being removed. * @param eventParam *boolean* `cancel` A value that indicates whether the operation should be canceled. * @example * ```javascript * //This example uses the ShapeRemoving event. * var shape = sheet.shapes.add("myShape", GC.Spread.Sheets.Shapes.AutoShapeType.diamond, 0, 90, 200, 200); * activeSheet.bind(GC.Spread.Sheets.Events.ShapeRemoving, function (e, info) { * info.cancel = true;// the shape will not remove * }); * ``` */ static ShapeRemoving: string; /** * Occurs when the selections of the shape have changed. * @name GC.Spread.Sheets.Worksheet#ShapeSelectionChanged * @event * @param eventParam *{@link GC.Spread.Sheets.Worksheet}* `sheet` The sheet that triggered the event. * @param eventParam *string* `sheetName` The sheet's name. * @param eventParam *{@link GC.Spread.Sheets.Shapes.Shape}* `shape` The shape that triggered the event. * @example * ```javascript * //This example uses the ShapeSelectionChanged event. * var shape = sheet.shapes.add("myShape", GC.Spread.Sheets.Shapes.AutoShapeType.diamond, 0, 90, 200, 200); * activeSheet.bind(GC.Spread.Sheets.Events.ShapeSelectionChanged, function (e, info) { * console.log("event info: " + info); * }); * ``` */ static ShapeSelectionChanged: string; /** * After sheet changed. * @name GC.Spread.Sheets.Worksheet#SheetChanged * @event * @param eventParam *string* `sheetName` The sheet's name. * @param eventParam *string* `propertyName` The specific operation name. * @param eventParam *number* `sheetIndex` The sheet index, related to the Worksheet collection or SheetTab collection. * @param eventParam *number* `sheetPosition` The sheet position, related to the combined collection which contains all Worksheet and SheetTab. * @param eventParam *boolean* `oldValue` Sheet changes the value of the previous attribute(isVisible, isSelected...). * @param eventParam *boolean* `newValue` Sheet changes the value of the attribute(isVisible, isSelected...). * @example * ```javascript * //This example. * spread.bind(GC.Spread.Sheets.Events.SheetChanged, function (sender, args) { * var sheet = args.sheet; * }); * ``` */ static SheetChanged: string; /** * Before sheet changed. * @name GC.Spread.Sheets.Worksheet#SheetChanging * @event * @param eventParam *string* `sheetName` The sheet's name. * @param eventParam *string* `propertyName` The specific operation name . * @param eventParam *number* `sheetIndex` The sheet index, related to the Worksheet collection or SheetTab collection. * @param eventParam *number* `sheetPosition` The sheet position, related to the combined collection which contains all Worksheet and SheetTab. * @param eventParam *boolean* `oldValue` Sheet changes the value of the previous attribute(isVisible, isSelected...). * @param eventParam *boolean* `newValue` Sheet changes the value of the attribute(isVisible, isSelected...). * @param eventParam *boolean* `cancel` Cancel the current operation. * @example * ```javascript * //This example. * spread.bind(GC.Spread.Sheets.Events.SheetChanging, function (sender, args) { * var sheetIndex = args.sheetIndex; * args.cancel = true; * }); * ``` */ static SheetChanging: string; /** * Occurs after the user drags and moves the sheet. * @name GC.Spread.Sheets.Worksheet#SheetMoved * @event * @param eventParam *{@link GC.Spread.Sheets.Worksheet}* `sheet` The sheet that triggered the event. * @param eventParam *string* `sheetName` The sheet's name. * @param eventParam *number* `oldIndex` The previous sheet index. * @param eventParam *number* `newIndex` The new sheet index. * @example * ```javascript * //This example uses the SheetMoved event. * window.onload = function(){ * var spread = new GC.Spread.Sheets.Workbook(document.getElementById("ss"),{sheetCount:3}); * var activeSheet = spread.getActiveSheet(); * spread.bind(GC.Spread.Sheets.Events.SheetMoving, function (e, data) { * alert(data.sheetName + '\n' + 'oldIndex: ' + data.oldIndex + '\n' + 'newIndex: ' + data.newIndex + '\n' + 'cancel: ' + data.cancel); * }); * spread.bind(GC.Spread.Sheets.Events.SheetMoved, function (e, data) { * alert(data.sheetName + '\n' + 'oldIndex: ' + data.oldIndex + '\n' + 'newIndex: ' + data.newIndex); * }); * } * ``` */ static SheetMoved: string; /** * Occurs before the user drags and moves the sheet. * @name GC.Spread.Sheets.Worksheet#SheetMoving * @event * @param eventParam *{@link GC.Spread.Sheets.Worksheet}* `sheet` The sheet that triggered the event. * @param eventParam *string* `sheetName` The sheet's name. * @param eventParam *number* `oldIndex` The old sheet index. * @param eventParam *number* `newIndex` A value that indicates the index will be moved to. * @param eventParam *boolean* `cancel` A value that indicates whether the operation should be canceled. * @example * ```javascript * //This example uses the SheetMoving event. * window.onload = function(){ * var spread = new GC.Spread.Sheets.Workbook(document.getElementById("ss"),{sheetCount:3}); * var activeSheet = spread.getActiveSheet(); * spread.bind(GC.Spread.Sheets.Events.SheetMoving, function (e, data) { * alert(data.sheetName + '\n' + 'oldIndex: ' + data.oldIndex + '\n' + 'newIndex: ' + data.newIndex + '\n' + 'cancel: ' + data.cancel); * }); * spread.bind(GC.Spread.Sheets.Events.SheetMoved, function (e, data) { * alert(data.sheetName + '\n' + 'oldIndex: ' + data.oldIndex + '\n' + 'newIndex: ' + data.newIndex); * }); * } * ``` */ static SheetMoving: string; /** * Occurs when the user has changed the sheet name. * @name GC.Spread.Sheets.Worksheet#SheetNameChanged * @event * @param eventParam *{@link GC.Spread.Sheets.Worksheet}* `sheet` The sheet that triggered the event. * @param eventParam *string* `oldValue` The sheet's old name. * @param eventParam *string* `newValue` The sheet's new name. * @example * ```javascript * //This example uses the SheetNameChanged event. * // Use web browser to see the console log text * spread.bind(GC.Spread.Sheets.Events.SheetNameChanging, function (sender, args) { * console.log(args.oldValue); * }); * spread.bind(GC.Spread.Sheets.Events.SheetNameChanged, function (sender, args) { * console.log(args.newValue); * }); * ``` */ static SheetNameChanged: string; /** * Occurs when the user is changing the sheet name. * @name GC.Spread.Sheets.Worksheet#SheetNameChanging * @event * @param eventParam *{@link GC.Spread.Sheets.Worksheet}* `sheet` The sheet that triggered the event. * @param eventParam *string* `oldValue` The sheet's old name. * @param eventParam *string* `newValue` The sheet's new name. * @param eventParam *boolean* `cancel` A value that indicates whether the operation should be canceled. * @example * ```javascript * //This example uses the SheetNameChanging event. * // Use web browser to see the console log text * spread.bind(GC.Spread.Sheets.Events.SheetNameChanging, function (sender, args) { * console.log(args.oldValue); * }); * spread.bind(GC.Spread.Sheets.Events.SheetNameChanged, function (sender, args) { * console.log(args.newValue); * }); * ``` */ static SheetNameChanging: string; /** * Occurs when the user clicks the sheet tab. * @name GC.Spread.Sheets.Worksheet#SheetTabClick * @event * @param eventParam *{@link GC.Spread.Sheets.Worksheet}* `sheet` The sheet that triggered the event. * @param eventParam *string* `sheetName` The sheet's name. * @param eventParam *number* `sheetTabIndex` The index of the sheet tab that the user clicked. * @example * ```javascript * //This example uses the SheetTabClick event. * spread.bind(GC.Spread.Sheets.Events.SheetTabClick, function (e, info) { * alert("Index (" + info.sheetTabIndex + ")"); * }); * ``` */ static SheetTabClick: string; /** * Occurs when the user double-clicks the sheet tab. * @name GC.Spread.Sheets.Worksheet#SheetTabDoubleClick * @event * @param eventParam *{@link GC.Spread.Sheets.Worksheet}* `sheet` The sheet that triggered the event. * @param eventParam *string* `sheetName` The sheet's name. * @param eventParam *number* `sheetTabIndex` The index of the sheet tab that the user double-clicked. * @example * ```javascript * //This example uses the SheetTabDoubleClick event. * spread.bind(GC.Spread.Sheets.Events.SheetTabDoubleClick, function (e, info) { * alert("Index (" + info.sheetTabIndex + ")"); * }); * ``` */ static SheetTabDoubleClick: string; /** * Occurs when any slicer has changed. * @name GC.Spread.Sheets.Worksheet#SlicerChanged * @event * @param eventParam *{@link GC.Spread.Sheets.Worksheet}* `sheet` The sheet that triggered the event. * @param eventParam *string* `sheetName` The sheet's name. * @param eventParam *{@link GC.Spread.Sheets.Slicers.ISlicer}* `slicer` The slicer that triggered the event. * @param eventParam *string* `propertyName` The name of the slicer's property that has changed. * @example * ```javascript * //This example uses the SlicerChanged event. * //create a table * datas = [ * ["1", "NewYork", "1968/6/8", "80", "180"], * ["4", "NewYork", "1972/7/3", "72", "168"], * ["4", "NewYork", "1964/3/2", "71", "179"], * ["5", "Washington", "1972/8/8","80", "171"], * ["6", "Washington", "1986/2/2", "89", "161"], * ["7", "Washington", "2012/2/15", "71", "240"]]; * var table = activeSheet.tables.addFromDataSource("table1", 2, 2, datas); * dataColumns = ["Name", "City", "Birthday", "Weight", "Height"]; * table.setColumnName(0, dataColumns[0]); * table.setColumnName(1, dataColumns[1]); * table.setColumnName(2, dataColumns[2]); * table.setColumnName(3, dataColumns[3]); * table.setColumnName(4, dataColumns[4]); * //add a slicer to the sheet and return the slicer instance. * var slicer = activeSheet.slicers.add("slicer1",table.name(),"Name"); * //change the slicer properties. * slicer.width(200); * slicer.height(200); * slicer.position(new GC.Spread.Sheets.Point(100, 200)); * slicer.style(GC.Spread.Sheets.Slicers.SlicerStyles.dark4()); * // Use web browser to see the console log text * activeSheet.bind(GC.Spread.Sheets.Events.SlicerChanged, function (e, info) { * console.log("name: " + info.propertyName); * }); * ``` */ static SlicerChanged: string; /** * Occurs when the sparkline has changed. * @name GC.Spread.Sheets.Worksheet#SparklineChanged * @event * @param eventParam *{@link GC.Spread.Sheets.Worksheet}* `sheet` The sheet that triggered the event. * @param eventParam *string* `sheetName` The sheet's name. * @param eventParam *{@link GC.Spread.Sheets.Sparklines.Sparkline}* `sparkline` The sparkline whose property has changed. * @example * ```javascript * //Removing the sparkline causes a change. * var data = new GC.Spread.Sheets.Range(1, 0, 8, 1); * var setting = new GC.Spread.Sheets.Sparklines.SparklineSetting(); * setting.options.showMarkers = true; * setting.options.lineWeight = 3; * setting.options.displayXAxis = true; * setting.options.showFirst = true; * setting.options.showLast = true; * setting.options.showLow = true; * setting.options.showHigh = true; * setting.options.showNegative = true; * setting.options.seriesColor = "Text 2 1"; * setting.options.firstMarkerColor = "Text 2 3"; * setting.options.negativeColor = "Accent 2 1"; * setting.options.markersColor = "Accent 3 1"; * setting.options.lowMarkerColor = "Accent 4 1"; * setting.options.highMarkerColor = "Accent 6 1"; * setting.options.lastMarkerColor = "Accent 6 6"; * setting.options.axisColor = "Text 1 1"; * activeSheet.addSpan(13, 0, 4, 3, null); * activeSheet.setSparkline(13, 0, data, GC.Spread.Sheets.Sparklines.DataOrientation.vertical, GC.Spread.Sheets.Sparklines.SparklineType.line, setting); * activeSheet.setValue(1, 0, 1); * activeSheet.setValue(2, 0, -2); * activeSheet.setValue(3, 0, -1); * activeSheet.setValue(4, 0, 6); * activeSheet.setValue(5, 0, 4); * activeSheet.setValue(6, 0, -4); * activeSheet.setValue(7, 0, 3); * activeSheet.setValue(8, 0, 8); * // Use web browser to see the console log text * activeSheet.bind(GC.Spread.Sheets.Events.SparklineChanged, function (e, info) { * console.log("name: " + info.sheetName); * }); * $("#button1").click(function () { * activeSheet.removeSparkline(13, 0); * }); * ``` */ static SparklineChanged: string; /** * Occurs when the user insert/delete columns in table. * @name GC.Spread.Sheets.Worksheet#TableColumnsChanged * @event * @param eventParam *{@link GC.Spread.Sheets.Worksheet}* `sheet` The sheet that triggered the event. * @param eventParam *{@link GC.Spread.Sheets.Tables.Table}* `table` The table which is insert/delete rows. * @param eventParam *string* `propertyName` The operation name which trigger event. * @param eventParam *number* `col` The index of the starting column to insert/delete based on table index. * @param eventParam *number* `count` The number of columns to insert/delete. * @param eventParam *boolean* `isAfter` Whether insert columns before the specified column index or after. By default is false, insert before. * @example * ```javascript * //This example uses the TableColumnsChanged event. * window.onload = function(){ * var spread = new GC.Spread.Sheets.Workbook(document.getElementById("ss")); * var activeSheet = spread.getActiveSheet(); * spread.bind(GC.Spread.Sheets.Events.TableColumnsChanged, function (e, data) {}); * } * ``` */ static TableColumnsChanged: string; /** * Occurs when a table column has just been clear filter. * @name GC.Spread.Sheets.Worksheet#TableFilterCleared * @event * @param eventParam *{@link GC.Spread.Sheets.Worksheet}* `sheet` The sheet that triggered the event. * @param eventParam *string* `sheetName` The sheet's name. * @param eventParam *{@link GC.Spread.Sheets.Tables.Table}* `table` The table column to be automatically filtered. * @param eventParam *number* `tableCol` The index of the table column has just been clear filter. * @example * ```javascript * //This example uses the TableFilterCleared event. * activeSheet.tables.add("Table1", 0, 0, 3, 3, GC.Spread.Sheets.Tables.TableThemes.dark1); * activeSheet.getCell(0,0).text("Name"); * activeSheet.getCell(0,1).text("Value"); * activeSheet.getCell(0,2).text("T/F"); * activeSheet.getCell(1,0).text("AW"); * activeSheet.getCell(1,1).text("5"); * activeSheet.getCell(1,2).text("T"); * activeSheet.bind(GC.Spread.Sheets.Events.TableFilterCleared, function (e, info) { * alert("Sheet (" + info.sheetName + ")"); * }); * ``` */ static TableFilterCleared: string; /** * Occurs when a table column is about to be automatically clear filter. * @name GC.Spread.Sheets.Worksheet#TableFilterCleared * @event * @param eventParam *{@link GC.Spread.Sheets.Worksheet}* `sheet` The sheet that triggered the event. * @param eventParam *string* `sheetName` The sheet's name. * @param eventParam *{@link GC.Spread.Sheets.Tables.Table}* `table` The table column to be automatically filtered. * @param eventParam *number* `tableCol` The index of the table column to be automatically clear filter. * @example * ```javascript * //This example uses the TableFilterClearing event. * activeSheet.tables.add("Table1", 0, 0, 3, 3, GC.Spread.Sheets.Tables.TableThemes.dark1); * activeSheet.getCell(0,0).text("Name"); * activeSheet.getCell(0,1).text("Value"); * activeSheet.getCell(0,2).text("T/F"); * activeSheet.getCell(1,0).text("AW"); * activeSheet.getCell(1,1).text("5"); * activeSheet.getCell(1,2).text("T"); * activeSheet.bind(GC.Spread.Sheets.Events.TableFilterClearing, function (e, info) { * alert("Sheet (" + info.sheetName + ")"); * }); * ``` */ static TableFilterClearing: string; /** * Occurs when a table column has just been automatically filtered. * @name GC.Spread.Sheets.Worksheet#TableFiltered * @event * @param eventParam *{@link GC.Spread.Sheets.Worksheet}* `sheet` The sheet that triggered the event. * @param eventParam *string* `sheetName` The sheet's name. * @param eventParam *{@link GC.Spread.Sheets.Tables.Table}* `table` The table column to be automatically filtered. * @param eventParam *number* `col` The index of the table column to be automatically filtered. * @param eventParam *Array* `filterValues` The values by which to filter the column. * @param eventParam *Object* `conditionInfo` The condition rule info by which to filter the column. * @example * ```javascript * //This example uses the TableFiltered event. * activeSheet.tables.add("Table1", 0, 0, 3, 3, GC.Spread.Sheets.Tables.TableThemes.dark1); * activeSheet.getCell(0,0).text("Name"); * activeSheet.getCell(0,1).text("Value"); * activeSheet.getCell(0,2).text("T/F"); * activeSheet.getCell(1,0).text("AW"); * activeSheet.getCell(1,1).text("5"); * activeSheet.getCell(1,2).text("T"); * activeSheet.bind(GC.Spread.Sheets.Events.TableFiltered, function (e, info) { * alert("Sheet (" + info.sheetName + ")"); * }); * ``` */ static TableFiltered: string; /** * Occurs when a table column is about to be automatically filtered. * @name GC.Spread.Sheets.Worksheet#TableFiltering * @event * @param eventParam *{@link GC.Spread.Sheets.Worksheet}* `sheet` The sheet that triggered the event. * @param eventParam *string* `sheetName` The sheet's name. * @param eventParam *{@link GC.Spread.Sheets.Tables.Table}* `table` The table column to be automatically filtered. * @param eventParam *number* `col` The index of the table column to be automatically filtered. * @param eventParam *Array* `filterValues` The values by which to filter the column. * @param eventParam *Object* `conditionInfo` The condition rule info by which to filter the column. * @example * ```javascript * //This example uses the TableFiltering event. * activeSheet.tables.add("Table1", 0, 0, 3, 3, GC.Spread.Sheets.Tables.TableThemes.dark1); * activeSheet.getCell(0,0).text("Name"); * activeSheet.getCell(0,1).text("Value"); * activeSheet.getCell(0,2).text("T/F"); * activeSheet.getCell(1,0).text("AW"); * activeSheet.getCell(1,1).text("5"); * activeSheet.getCell(1,2).text("T"); * activeSheet.bind(GC.Spread.Sheets.Events.TableFiltering, function (e, info) { * alert("Sheet (" + info.sheetName + ")"); * }); * ``` */ static TableFiltering: string; /** * Occurs after the user resized table. * @name GC.Spread.Sheets.Worksheet#TableResized * @event * @param eventParam *{@link GC.Spread.Sheets.Worksheet}* `sheet` The sheet that triggered the event. * @param eventParam *{@link GC.Spread.Sheets.Tables.Table}* `table` The table which is resized. * @param eventParam *{@link GC.Spread.Sheets.Range}* `oldRange` The table range before resize. * @param eventParam *{@link GC.Spread.Sheets.Range}* `newRange` The table range after resize. */ static TableResized: string; /** * Occurs when the user resizing table by resize handler. * @name GC.Spread.Sheets.Worksheet#TableResizing * @event * @param eventParam *{@link GC.Spread.Sheets.Worksheet}* `sheet` The sheet that triggered the event. * @param eventParam *{@link GC.Spread.Sheets.Tables.Table}* `table` The table which is resizing. * @param eventParam *{@link GC.Spread.Sheets.Range}* `oldRange` The table range before resize. * @param eventParam *{@link GC.Spread.Sheets.Range}* `newRange` The table range after resize. * @param eventParam *boolean* `cancel` Whether to cancel the current resize behavior. The default value is false. * @example * ```javascript * //This example uses the TableResizing and TableResized event. * window.onload = function(){ * var spread = new GC.Spread.Sheets.Workbook(document.getElementById("ss")); * var activeSheet = spread.getActiveSheet(); * spread.bind(GC.Spread.Sheets.Events.TableResizing, function (e, data) { * if (data.newRange.rowCount > 10) { * args.cancel = true; * } * }); * spread.bind(GC.Spread.Sheets.Events.TableResizing, function (e, data) {}); * spread.bind(GC.Spread.Sheets.Events.TableResized, function (e, data) {}); * } * ``` */ static TableResizing: string; /** * Occurs when the user insert/delete rows in table. * @name GC.Spread.Sheets.Worksheet#TableRowsChanged * @event * @param eventParam *{@link GC.Spread.Sheets.Worksheet}* `sheet` The sheet that triggered the event. * @param eventParam *{@link GC.Spread.Sheets.Tables.Table}* `table` The table which is insert/delete rows. * @param eventParam *string* `propertyName` The operation name which trigger event. * @param eventParam *number* `row` The index of the starting row to insert/delete based on table index. * @param eventParam *number* `count` The number of rows to insert/delete. * @param eventParam *boolean* `isAfter` Whether insert rows before the specified row index or after. By default is false, insert before. * @param eventParam *Object[]* `deletedItem` The deleted rows collection in binding. The every item in array specifies deleted data item. * @example * ```javascript * //This example uses the TableRowsChanged event. * window.onload = function(){ * var spread = new GC.Spread.Sheets.Workbook(document.getElementById("ss")); * var activeSheet = spread.getActiveSheet(); * spread.bind(GC.Spread.Sheets.Events.TableRowsChanged, function (e, data) {}); * } * ``` */ static TableRowsChanged: string; /** * Occurs when the top row changes. * @name GC.Spread.Sheets.Worksheet#TopRowChanged * @event * @param eventParam *{@link GC.Spread.Sheets.Worksheet}* `sheet` The sheet that triggered the event. * @param eventParam *string* `sheetName` The sheet's name. * @param eventParam *number* `oldTopRow` The old top row index. * @param eventParam *number* `newTopRow` The new top row index. * @param eventParam *number* `oldOffset` The old top row offset. * @param eventParam *number* `newOffset` The new top row offset. * @example * ```javascript * //This example synchronizes vertical and horizontal scrolling for sheet 1 and sheet 2. * var sheet1 = spread.getSheet(0), * sheet2 = spread.getSheet(1); * sheet1.bind(GC.Spread.Sheets.Events.TopRowChanged, function (sender, args) { * //Set the displayed top row of sheet1 to sheet2 (vertical scroll synchronization). * sheet2.showRow(args.newTopRow, GC.Spread.Sheets.VerticalPosition.top); * }); * sheet1.bind(GC.Spread.Sheets.Events.LeftColumnChanged, function (sender, args) { * //Set the displayed left column of sheet1 to sheet2 (Horizontal scroll synchronization). * sheet2.showColumn(args.newLeftCol, GC.Spread.Sheets.HorizontalPosition.left); * }); * ``` */ static TopRowChanged: string; /** * Occurs before the touch toolbar pops up. * @name GC.Spread.Sheets.Worksheet#TouchToolStripOpening * @event * @param eventParam *number* `x` The x-coordinate of the horizontal position. * @param eventParam *number* `y` The y-coordinate of the vertical position. * @param eventParam *boolean* `handled` If `true`, the touch toolbar is prevented from popping up; otherwise, the toolbar is displayed at the default position. * @example * ```javascript * //This example uses the TouchToolStripOpening event. * activeSheet.bind(GC.Spread.Sheets.Events.TouchToolStripOpening, function (e, info) { * alert(info.x); * }); * ``` */ static TouchToolStripOpening: string; /** * Occurs when the user types a formula. * @name GC.Spread.Sheets.Worksheet#UserFormulaEntered * @event * @param eventParam *{@link GC.Spread.Sheets.Worksheet}* `sheet` The sheet that triggered the event. * @param eventParam *string* `sheetName` The sheet's name. * @param eventParam *number* `row` The row index of the cell in which the user entered a formula. * @param eventParam *number* `col` The column index of the cell in which the user entered a formula. * @param eventParam *string* `formula` The formula that the user entered. * @param eventParam *boolean* `isCircularReference` The entered formula is circular reference. * @example * ```javascript * //This example uses the UserFormulaEntered event. * activeSheet.bind(GC.Spread.Sheets.Events.UserFormulaEntered, function (e, info) { * alert("Formula (" + info.formula + ")"); * }); * ``` */ static UserFormulaEntered: string; /** * Occurs when the applied cell value is invalid. * @name GC.Spread.Sheets.Worksheet#ValidationError * @event * @param eventParam *{@link GC.Spread.Sheets.Worksheet}* `sheet` The sheet that triggered the event. * @param eventParam *string* `sheetName` The sheet's name. * @param eventParam *number* `row` The cell's row index. * @param eventParam *number* `col` The cell's column index. * @param eventParam *Object* `editingValue` The cell's editing value. * @param eventParam *{@link GC.Spread.Sheets.DataValidation.DefaultDataValidator}* `validator` The data validator that caused the error. * @param eventParam *{@link GC.Spread.Sheets.DataValidation.DataValidationResult}* `validationResult` The policy that the user can set to determine how to process the error. * @example * ```javascript * //This example uses the ValidationError event. * var nCondition = new GC.Spread.Sheets.ConditionalFormatting.Condition(GC.Spread.Sheets.ConditionalFormatting.ConditionType.cellValueCondition); * nCondition.compareType(GC.Spread.Sheets.ConditionalFormatting.ComparisonOperators.equalsTo); * nCondition.expected(0); * //When the option is false, the validation fails and the red alert is displayed. * //When the option is true, the blank cell is treated as zero and the validation is successful. * nCondition.treatNullValueAsZero(false); * var validator = new GC.Spread.Sheets.DataValidation.DefaultDataValidator(nCondition) * validator.ignoreBlank(false); * validator.type(GC.Spread.Sheets.DataValidation.CriteriaType.wholeNumber) * activeSheet.getCell(0, 0, GC.Spread.Sheets.SheetArea.viewport).validator(validator); * spread.options.highlightInvalidData = true; * activeSheet.setValue(0, 0, null); * //Type different values in cell (0,0). This event fires if the user types an invalid value. * activeSheet.bind("ValidationError", vError); * function vError(sender, args) { * alert("error"); * } * ``` */ static ValidationError: string; /** * Occurs when the value in the subeditor changes. * @name GC.Spread.Sheets.Worksheet#ValueChanged * @event * @param eventParam *{@link GC.Spread.Sheets.Worksheet}* `sheet` The sheet that triggered the event. * @param eventParam *string* `sheetName` The sheet's name. * @param eventParam *number* `row` The row index of the cell. * @param eventParam *number* `col` The column index of the cell. * @param eventParam *Object* `oldValue` The old value of the cell. * @param eventParam *Object* `newValue` The new value of the cell. * @example * ```javascript * //This example uses the ValueChanged event. * activeSheet.bind(GC.Spread.Sheets.Events.ValueChanged, function (e, info) { * alert("Value (" + info.newValue + ")"); * }); * ``` */ static ValueChanged: string; /** * Occurs after the user zooms. * @name GC.Spread.Sheets.Worksheet#ViewZoomed * @event * @param eventParam *{@link GC.Spread.Sheets.Worksheet}* `sheet` The sheet that triggered the event. * @param eventParam *string* `sheetName` The sheet's name. * @param eventParam *number* `newZoomFactor` The new zoom factor. * @param eventParam *number* `oldZoomFactor` The old zoom factor. * @example * ```javascript * //This example uses the ViewZoomed event. * spread.options.allowUserZoom = true; * activeSheet.bind(GC.Spread.Sheets.Events.ViewZoomed, function (e, info) { * alert("Zoom (" + info.newZoomFactor + ")"); * }); * ``` */ static ViewZoomed: string; /** * Occurs when the user zooms. * @name GC.Spread.Sheets.Worksheet#ViewZooming * @event * @param eventParam *{@link GC.Spread.Sheets.Worksheet}* `sheet` The sheet that triggered the event. * @param eventParam *string* `sheetName` The sheet's name. * @param eventParam *number* `newZoomFactor` The new zoom factor, user could make some change to intervene the real zoom action. * @param eventParam *number* `oldZoomFactor` The old zoom factor. * @param eventParam *boolean* `cancel` A value that indicates whether the operation should be canceled. * @example * ```javascript * //This example uses the ViewZooming event, to limit zooming max factor. * spread.options.allowUserZoom = true; * activeSheet.bind(GC.Spread.Sheets.Events.ViewZooming, function (e, info) { * if (info.newZoomFactor >= 2) { * info.newZoomFactor = 2; * } * }); * ``` */ static ViewZooming: string; } export class LineBorder{ /** * Represents the line border for a border side. * @class * @param {string} [color] Indicates the border color and uses a format such as color name (for example, "red") or "#RGB", "#RRGGBB", "rgb(R,B,B)", "rgba(R,G,B,A)". * @param {GC.Spread.Sheets.LineStyle} [style] Indicates the border line style. * @example * ```javascript * //This example creates a border. * var border = new GC.Spread.Sheets.LineBorder * border.color = "#7FFFD4"; * border.style = GC.Spread.Sheets.LineStyle.double; * var cell = activeSheet.getCell(1, 1, GC.Spread.Sheets.SheetArea.viewport); * cell.borderLeft(border); * ``` */ constructor(color?: string, style?: GC.Spread.Sheets.LineStyle); /** * Indicates the color of the border line. Use a known color name or HEX style color value. The default value is black. * @example * ```javascript * //This example sets the color property. * var border = new GC.Spread.Sheets.LineBorder * border.color = "#7FFFD4"; * border.style = GC.Spread.Sheets.LineStyle.double; * var cell = activeSheet.getCell(1, 1, GC.Spread.Sheets.SheetArea.viewport); * cell.borderLeft(border); * ``` */ color: string; /** * Indicates the line style of the border line. The default value is empty. * @example * ```javascript * //This example sets the style property. * var border = new GC.Spread.Sheets.LineBorder * border.color = "#7FFFD4"; * border.style = GC.Spread.Sheets.LineStyle.double; * var cell = activeSheet.getCell(1, 1, GC.Spread.Sheets.SheetArea.viewport); * cell.borderLeft(border); * ``` */ style: GC.Spread.Sheets.LineStyle; } export class NameInfo{ /** * Represents a custom named expression that can be used by formulas. * @class * @param {string} name The custom expression name. * @param {GC.Spread.CalcEngine.Expression} expr The custom named expression. * @param {number} row The base row of the expression. * @param {number} column The base column of the expression. * @param {string} [comment] The custom expression comment. * @param {boolean} [isReadOnly] The custom expression could be editable. */ constructor(name: string, expr: GC.Spread.CalcEngine.Expression, row: number, column: number, comment?: string, isReadOnly?: boolean); /** * Gets the base column of the custom named expression. * @returns {number} The base column. */ getColumn(): number; /** * Gets the comment of the current NameInfo object. * @returns {string} The name of the current NameInfo object. */ getComment(): string; /** * Gets the expression. * @returns {GC.Spread.CalcEngine.Expression} The expression. */ getExpression(): GC.Spread.CalcEngine.Expression; /** * Gets the name of the current NameInfo object. * @returns {string} The name of the current NameInfo object. */ getName(): string; /** * Gets the base row of the custom named expression. * @returns {number} The base row. */ getRow(): number; /** * Gets/Sets the readonly status of the custom named expression. * @returns {boolean} The readonly status. */ isReadOnly(value?: boolean): boolean; /** * Rename the name, the formula, and the comment of the custom name. * @param {string} [name] The new name of the custom name, all referenced formulas will be updated. * @param {string} [formula] The new formula of the custom name, all referenced cells will be recalculated. * @param {number} [baseRow] The row index of the new formula. * @param {number} [baseCol] The column index of the new formula. * @param {string} [comment] The new custom comment. */ set(name?: string, formula?: string, baseRow?: number, baseCol?: number, comment?: string): void; } export class PivotTableManager{ /** * Represents a pivot table manager which can manage all pivot tables in a sheet. * @class * @param {GC.Spread.Sheets.Worksheet} sheet The worksheet. */ constructor(sheet: GC.Spread.Sheets.Worksheet); /** * @description Add a pivot table to current worksheet. * @param {string} name Indicates the pivot table name, it should be unique in the whole workbook. * @param {string} sourceData Indicates the sourceData is using for pivot table. It supports three types: a table name or a table sheet name or the formula which references a range absolutely. * @param {number} row Indicates the pivot table start row position. * @param {number} col Indicates the pivot table start col position. * @param {GC.Spread.Pivot.PivotTableLayoutType} layout Indicates the pivot table layout. * @param {string | GC.Spread.Pivot.PivotTableTheme} theme Indicates the pivot table theme style name. * @param {Object} options Indicates the options of pivot table. * @param {boolean} [options.allowMultipleFiltersPerField] Indicates whether use multiple filter in one field. * @param {boolean} [options.insertBlankLineAfterEachItem] Indicates whether insert a blank row at end of each item. * @param {GC.Spread.Pivot.GrandTotalPosition} [options.grandTotalPosition] Indicates whether show grandtotal in row, column or both. * @param {GC.Spread.Pivot.SubtotalsPosition} [options.subTotalsPosition] Indicates show subtotal top or bottom or not show. * @param {GC.Spread.Pivot.DisplayFields} [options.displayFieldsInPageFilterArea] Indicates the field display in page area show first over then down or first down then over. * @param {number} [options.reportFilterFieldsPerColumn] Indicates the number of report filer field per column. * @param {boolean} [options.bandRows] Indicates show band row or not. * @param {boolean} [options.bandColumns] Indicates show band column or not. * @param {boolean} [options.showRowHeader] Indicates show row header style or not. * @param {boolean} [options.showColumnHeader] Indicates show column header style or not. * @param {boolean} [options.showDrill] Indicates show expand/collapse button or not. * @param {boolean} [options.showMissing] Indicates whether the missingCaption option is effected. * @param {boolean} [options.missingCaption] Indicates what value should be shown when the actual value is empty * @param {boolean} [options.fillDownLabels] Indicates show repeat label items or not. * @param {boolean} [options.rowLabelIndent] Indicates the indent of the title of each level. * @param {boolean} [options.printDrill] Print expand/collapse buttons when displayed on PivotTable. * @param {boolean} [options.itemPrintTitles] Repeat row labels on each PivotTable. * @param {boolean} [options.fieldPrintTitles] Set Print titles. * @param {boolean} [options.showFilter] Indicates show filter button or not. * @param {boolean} [options.showToolTip] Indicates show tooltip or not. * @param {boolean} [options.mergeItem] Indicates wether merge and center the cells with labels. * @returns {GC.Spread.Pivot.PivotTable} The new pivot table instance. * @example * ```javascript * var spread = new GC.Spread.Sheets.Workbook(document.getElementById("ss"),{sheetCount:3}); * var sourceSheet = spread.getSheet(0); * var sheet = spread.getSheet(1); * var sourceData = [["Date","Buyer","Type","Amount"], * ["01-Jan","Mom","Fuel",74], * ["15-Jan","Mom","Food",235], * ["17-Jan","Dad","Sports",20], * ["21-Jan","Kelly","Books",125]]; * sourceSheet.setArray(0, 0, sourceData ); * sourceSheet.tables.add('sourceData', 0, 0, 5, 4); * var layout = GC.Spread.Pivot.PivotTableLayoutType.compact; * var theme = GC.Spread.Pivot.PivotTableThemes.medium2; * sheet.pivotTables.add("pivotTable_1", 'sourceData', 1, 1, layout, theme); * ``` */ add(name: string, sourceData: string, row: number, col: number, layout?: GC.Spread.Pivot.PivotTableLayoutType, theme?: string | GC.Spread.Pivot.PivotTableTheme, options?: GC.Spread.Pivot.IPivotTableOption): GC.Spread.Pivot.PivotTable; /** * @description Get all pivot table in current worksheet. * @return {GC.Spread.Pivot.PivotTable[]} return all pivot table in current worksheet. * @example * ```javascript * var spread = new GC.Spread.Sheets.Workbook(document.getElementById("ss"),{sheetCount:3}); * var sourceSheet = spread.getSheet(0); * var sheet = spread.getSheet(1); * var sourceData = [["Date","Buyer","Type","Amount"], * ["01-Jan","Mom","Fuel",74], * ["15-Jan","Mom","Food",235], * ["17-Jan","Dad","Sports",20], * ["21-Jan","Kelly","Books",125]]; * sourceSheet.setArray(0, 0, sourceData ); * sourceSheet.tables.add('sourceData', 0, 0, 5, 4); * var layout = GC.Spread.Pivot.PivotTableLayoutType.compact; * var theme = GC.Spread.Pivot.PivotTableThemes.medium2; * var options = {showRowHeader: true, showColumnHeader: true}; * var pivotTable = sheet.pivotTables.add("pivotTable_1", 'sourceData', 1, 1, layout, theme, options); * var pivotTables = pivotTableManager.all(); * console.log(pivotTables); * ``` */ all(): GC.Spread.Pivot.PivotTable[]; /** * @description Get pivot table by cell position. * @param {number} r Indicates cell row index. * @param {number} c Indicates cell column index. * @returns {GC.Spread.Pivot.PivotTable} return the pivot table instance. */ findPivotTable(r: number, c: number): GC.Spread.Pivot.PivotTable; /** * @description Get pivot table by name. * @param {string} name Indicates pivot table name. * @returns {GC.Spread.Pivot.PivotTable} return the pivot table instance. */ get(name: string): GC.Spread.Pivot.PivotTable; /** * @description get pivot areas by specified sheet range. * @param {GC.Spread.Sheets.Range} range Indicates the sheet range. * @returns {GC.Spread.Pivot.IPivotAreasCollection} all pivot areas contains in range. * @example * ```javascript * var spread = new GC.Spread.Sheets.Workbook(document.getElementById("ss"),{sheetCount:3}); * var sourceSheet = spread.getSheet(0); * var sheet = spread.getSheet(1); * var sourceData = [["Date","Buyer","Type","Amount"], * ["01-Jan","Mom","Fuel",74], * ["15-Jan","Mom","Food",235], * ["17-Jan","Dad","Sports",20], * ["21-Jan","Kelly","Books",125]]; * sourceSheet.setArray(0, 0, sourceData ); * sourceSheet.tables.add('sourceData', 0, 0, 5, 4); * var layout = GC.Spread.Pivot.PivotTableLayoutType.compact; * var theme = GC.Spread.Pivot.PivotTableThemes.medium2; * var myPivotTable = sheet.pivotTables.add("pivotTable_1", 'sourceData', 1, 1, layout, theme); * myPivotTable.add("Buyer", "Buyer", GC.Spread.Pivot.PivotTableFieldType.rowField); * myPivotTable.add("Type", "Type", GC.Spread.Pivot.PivotTableFieldType.columnField) * myPivotTable.add("Amount", "Sum of Amount", GC.Spread.Pivot.PivotTableFieldType.valueField, GC.Pivot.SubtotalType.sum); * var pivotAreas = sheet.pivotTables.getRangePivotAreas(new GC.Spread.Sheets.Range(3, 2, 2, 2))[myPivotTable.name()]; * var style = new GC.Spread.Sheets.Style(); * style.backColor = 'red'; * myPivotTable.setStyle(pivotAreas[0], style); * ``` */ getRangePivotAreas(range: GC.Spread.Sheets.Range): GC.Spread.Pivot.IPivotAreasCollection; /** * @description Remove a pivot table from worksheet. * @param {string} name Indicates the pivot table name. * @returns {void} * @example * ```javascript * var spread = new GC.Spread.Sheets.Workbook(document.getElementById("ss"),{sheetCount:3}); * var sourceSheet = spread.getSheet(0); * var sheet = spread.getSheet(1); * var sourceData = [["Date","Buyer","Type","Amount"], * ["01-Jan","Mom","Fuel",74], * ["15-Jan","Mom","Food",235], * ["17-Jan","Dad","Sports",20], * ["21-Jan","Kelly","Books",125]]; * sourceSheet.setArray(0, 0, sourceData ); * sourceSheet.tables.add('sourceData', 0, 0, 5, 4); * var layout = GC.Spread.Pivot.PivotTableLayoutType.compact; * var theme = GC.Spread.Pivot.PivotTableThemes.medium2; * sheet.pivotTables.add("pivotTable_1", 'sourceData', 1, 1, layout, theme); * sheet.pivotTables.remove("pivotTable_1"); * ``` */ remove(name: string): any; } export class Point{ /** * Represents an x- and y-coordinate pair in two-dimensional space. * @class * @param {number} x The x-coordinate. * @param {number} y The y-coordinate. * @example * ```javascript * //This example creates a floating object. * var customFloatingObject = new GC.Spread.Sheets.FloatingObjects.FloatingObject("f1"); * var point = new GC.Spread.Sheets.Point(10, 10); * customFloatingObject.position(point); * customFloatingObject.width(60); * customFloatingObject.height(64); * var btn = document.createElement('button'); * btn.style.width = "60px"; * btn.style.height = "30px"; * btn.innerText = "button"; * customFloatingObject.content(btn); * activeSheet.floatingObjects.add(customFloatingObject); * ``` */ constructor(x: number, y: number); /** * Clones a new point from the current point. * @returns {GC.Spread.Sheets.Point} The cloned object. */ clone(): GC.Spread.Sheets.Point; } export class Range{ /** * Represents a range, which is described by the row index, column index, row count, and column count. * @class * @param {number} r The row index. * @param {number} c The column index. * @param {number} rc The row count. * @param {number} cc The column count. * @example * ```javascript * var style = new GC.Spread.Sheets.Style(); * style.backColor = "red"; * var rule = new GC.Spread.Sheets.ConditionalFormatting.NormalConditionRule(); * rule.ruleType(GC.Spread.Sheets.ConditionalFormatting.RuleType.cellValueRule); * rule.ranges([new GC.Spread.Sheets.Range(0,0,5,1)]); * rule.operator(GC.Spread.Sheets.ConditionalFormatting.ComparisonOperators.between); * rule.style(style); * rule.value1(2); * rule.value2(100); * activeSheet.conditionalFormats.addRule(rule); * activeSheet.setValue(0,0,1,3); * activeSheet.setValue(1,0,45,3); * ``` */ constructor(r: number, c: number, rc:number, cc:number); /** * The column index. * @example * ```javascript * var cellrange = new GC.Spread.Sheets.Range(); * cellrange.col = 0; * cellrange.row = 1; * cellrange.colCount = 1; * cellrange.rowCount = 8; * activeSheet.setValue(1, 0, 1); * activeSheet.setValue(2, 0, -2); * activeSheet.setValue(3, 0, -1); * activeSheet.setValue(4, 0, 6); * activeSheet.setValue(5, 0, 4); * activeSheet.setValue(6, 0, -4); * activeSheet.setValue(7, 0, 3); * activeSheet.setValue(8, 0, 8); * var setting = new GC.Spread.Sheets.Sparklines.SparklineSetting(); * setting.options.showMarkers = true; * activeSheet.setSparkline(13, 0, cellrange, GC.Spread.Sheets.Sparklines.DataOrientation.vertical, GC.Spread.Sheets.Sparklines.SparklineType.line, setting); * ``` */ col: number; /** * The column count. * @example * ```javascript * var cellrange = new GC.Spread.Sheets.Range(); * cellrange.col = 0; * cellrange.row = 1; * cellrange.colCount = 1; * cellrange.rowCount = 8; * activeSheet.setValue(1, 0, 1); * activeSheet.setValue(2, 0, -2); * activeSheet.setValue(3, 0, -1); * activeSheet.setValue(4, 0, 6); * activeSheet.setValue(5, 0, 4); * activeSheet.setValue(6, 0, -4); * activeSheet.setValue(7, 0, 3); * activeSheet.setValue(8, 0, 8); * var setting = new GC.Spread.Sheets.Sparklines.SparklineSetting(); * setting.options.showMarkers = true; * activeSheet.setSparkline(13, 0, cellrange, GC.Spread.Sheets.Sparklines.DataOrientation.vertical, GC.Spread.Sheets.Sparklines.SparklineType.line, setting); * ``` */ colCount: number; /** * The row index. * @example * ```javascript * var cellrange = new GC.Spread.Sheets.Range(); * cellrange.col = 0; * cellrange.row = 1; * cellrange.colCount = 1; * cellrange.rowCount = 8; * activeSheet.setValue(1, 0, 1); * activeSheet.setValue(2, 0, -2); * activeSheet.setValue(3, 0, -1); * activeSheet.setValue(4, 0, 6); * activeSheet.setValue(5, 0, 4); * activeSheet.setValue(6, 0, -4); * activeSheet.setValue(7, 0, 3); * activeSheet.setValue(8, 0, 8); * var setting = new GC.Spread.Sheets.Sparklines.SparklineSetting(); * setting.options.showMarkers = true; * activeSheet.setSparkline(13, 0, cellrange, GC.Spread.Sheets.Sparklines.DataOrientation.vertical, GC.Spread.Sheets.Sparklines.SparklineType.line, setting); * ``` */ row: number; /** * The row count. * @example * ```javascript * var cellrange = new GC.Spread.Sheets.Range(); * cellrange.col = 0; * cellrange.row = 1; * cellrange.colCount = 1; * cellrange.rowCount = 8; * activeSheet.setValue(1, 0, 1); * activeSheet.setValue(2, 0, -2); * activeSheet.setValue(3, 0, -1); * activeSheet.setValue(4, 0, 6); * activeSheet.setValue(5, 0, 4); * activeSheet.setValue(6, 0, -4); * activeSheet.setValue(7, 0, 3); * activeSheet.setValue(8, 0, 8); * var setting = new GC.Spread.Sheets.Sparklines.SparklineSetting(); * setting.options.showMarkers = true; * activeSheet.setSparkline(13, 0, cellrange, GC.Spread.Sheets.Sparklines.DataOrientation.vertical, GC.Spread.Sheets.Sparklines.SparklineType.line, setting); * ``` */ rowCount: number; /** * Gets whether the current range contains the specified cell. * @param {number} row The row index. * @param {number} col The column index. * @param {number} rowCount The row count. * @param {number} colCount The column count. * @returns {boolean} `true` if the range contains the cell; otherwise, `false`. */ contains(row: number, col: number, rowCount?: number, colCount?: number): boolean; /** * Gets whether the current range contains the specified range. * @param {GC.Spread.Sheets.Range} range The cell range. * @returns {boolean} `true` if the current range contains the specified cell range; otherwise, `false`. */ containsRange(range: GC.Spread.Sheets.Range): boolean; /** * Gets whether the current range is equal to the specified range. * @param {GC.Spread.Sheets.Range} range The range to compare. * @returns {boolean} `true` if the current range is equal to the specified range; otherwise, `false`. */ equals(range: GC.Spread.Sheets.Range): boolean; /** * Gets the intersection of two cell ranges. * @param {GC.Spread.Sheets.Range} range The cell range. * @param {number} maxRowCount The maximum row count. * @param {number} maxColumnCount The maximum column count. * @returns {GC.Spread.Sheets.Range} Returns null if there is no intersection, or the cell range of the intersection. */ getIntersect(range: GC.Spread.Sheets.Range, maxRowCount: number, maxColumnCount: number): GC.Spread.Sheets.Range; /** * Gets whether the current range intersects with the one specified by the row and column index and the row and column count. * @param {number} row The row index. * @param {number} col The column index. * @param {number} rowCount The row count. * @param {number} colCount The column count. * @returns {boolean} `true` if the specified range intersects with the current range; otherwise `false`. */ intersect(row: number, col: number, rowCount: number, colCount: number): boolean; /** * Offsets the location of the range by the specified coordinates. * @param {number} x The offset along the x-axis. * @param {number} y The offset along the y-axis. * @returns {GC.Spread.Sheets.Range} The new location. */ offset(x: number, y: number): GC.Spread.Sheets.Range; /** * Joins this range with the specified range as a union. * @param {GC.Spread.Sheets.Range} range The target range. * @returns {GC.Spread.Sheets.Range} Returns the union of the ranges. */ union(range: GC.Spread.Sheets.Range): GC.Spread.Sheets.Range; } export class Rect{ /** * Represents a rectangle with a special location, and its width and height in two-dimensional space. * @class * @param {number} x The x-coordinate of the top-left corner of the rectangle. * @param {number} y The y-coordinate of the top-left corner of the rectangle. * @param {number} w The width of the rectangle. * @param {number} h The height of the rectangle. */ constructor(x: number, y: number, w: number, h: number); /** * The width of the rectangle. */ height: number; /** * The height of the rectangle. */ width: number; /** * The x-coordinate of the top-left corner of the rectangle. */ x: number; /** * The y-coordinate of the top-left corner of the rectangle. */ y: number; /** * Indicates whether the rectangle contains the specified x-coordinate and y-coordinate. * @param {number} x The x-coordinate of the point to check. * @param {number} y The y-coordinate of the point to check. * @returns {boolean} `true` if (x, y) is contained by the rectangle; otherwise, `false`. */ contains(x: number, y: number): boolean; /** * Gets the rectangle that intersects with the current rectangle. * @param {GC.Spread.Sheets.Rect} rect The rectangle. * @returns {GC.Spread.Sheets.Rect} The intersecting rectangle. If the two rectangles do not intersect, returns null. */ getIntersectRect(x: number, y: number, width: number, height: number): GC.Spread.Sheets.Rect; /** * Indicates whether the specified rectangle intersects with the current rectangle. * @param {number} x The x-coordinate of the top-left corner of the rectangle. * @param {number} y The y-coordinate of the top-left corner of the rectangle. * @param {number} w The width of the rectangle. * @param {number} h The height of the rectangle. * @returns {boolean} `true` if the specified rectangle intersects with the current rectangle; otherwise, `false`. */ intersect(x: number, y: number, width: number, height: number): boolean; /** * Indicates whether the specified rectangle intersects with the current rectangle. * @param {GC.Spread.Sheets.Rect} rect The specified rectangle. * @returns {boolean} `true` if the specified rectangle intersects with the current rectangle; otherwise, `false`. */ intersectRect(rect: GC.Spread.Sheets.Rect): boolean; } export class SheetTabStyleManager{ /** * Represents the sheet tab style manager, which can manage the related styles of all sheet tabs. * @class * @param {GC.Spread.Sheets.Workbook} workbook The workbook. */ constructor(workbook: GC.Spread.Sheets.Workbook); /** * Add the status style of some or all sheet tabs in the spreadsheet. * @param {GC.Spread.Sheets.SheetTabState} state Sheet tab state. * @param {GC.Spread.Sheets.ISheetTabStyle} style Sheet tab style. * @param {string[]} sheetNames The array of sheet tab names to style. * @example * ```javascript * spread.sheetTabStyles.add(GC.Spread.Sheets.SheetTabState.active, {foreColor: "red"}, ["Sheet1", "Sheet2"]); * spread.sheetTabStyles.add(GC.Spread.Sheets.SheetTabState.hover, {foreColor: "red"}); * ``` */ add(state: GC.Spread.Sheets.SheetTabState, style: GC.Spread.Sheets.ISheetTabStyle, sheetNames?: string[]): void; /** * Get the status style of some or all sheet tabs in the spreadsheet. * @param {string[]} sheetNames Array of names of sheet tabs to be queried. * @returns {GC.Spread.Sheets.ISheetNameTabStyleMap} The status style of some or all sheet tabs. * @example * ```javascript * spread.sheetTabStyles.all(["Sheet1", "Sheet2"]); * spread.sheetTabStyles.all(); * ``` */ all(sheetNames?: string[]): GC.Spread.Sheets.ISheetNameTabStyleMap; /** * Clear the status styles of some or all sheet tabs in the spreadsheet. * @param {string[]} sheetNames The array of worksheet tab names whose status styles need to be cleared. * @example * ```javascript * spread.sheetTabStyles.clear(["Sheet1", "Sheet2"]); * spread.sheetTabStyles.clear(); * ``` */ clear(sheetNames?: string[]): void; /** * Remove the status style of some or all sheet tabs in the spreadsheet. * @param {GC.Spread.Sheets.SheetTabState} state Sheet tab state. * @param {string[]} sheetNames The worksheet tab name array corresponding to the state style needs to be deleted. * @example * ```javascript * spread.sheetTabStyles.remove(GC.Spread.Sheets.SheetTabState.active, ["Sheet1", "Sheet2"]); * spread.sheetTabStyles.remove(GC.Spread.Sheets.SheetTabState.hover); * ``` */ remove(state: GC.Spread.Sheets.SheetTabState, sheetNames?: string[]): void; } export class Style{ /** * Represents the style for a cell, row, and column. * @class * @param {string | GC.Spread.Sheets.IPatternFill | GC.Spread.Sheets.IGradientFill | GC.Spread.Sheets.IGradientPathFill} [backColor] The background color. * @param {string} [foreColor] The foreground color. * @param {GC.Spread.Sheets.HorizontalAlign} [hAlign] The horizontal alignment. * @param {GC.Spread.Sheets.VerticalAlign} [vAlign] The vertical alignment. * @param {string} [font] The font. * @param {string} [themeFont] The font theme. * @param {string|GC.Spread.Formatter.GeneralFormatter} [formatter] The formatting object. * @param {GC.Spread.Sheets.IMaskType} [mask] The mask object for input mask. * @param {GC.Spread.Sheets.LineBorder} [borderLeft] The left border. * @param {GC.Spread.Sheets.LineBorder} [borderTop] The top border. * @param {GC.Spread.Sheets.LineBorder} [borderRight] The right border. * @param {GC.Spread.Sheets.LineBorder} [borderBottom] The bottom border. * @param {GC.Spread.Sheets.LineBorder} [diagonalDown] The diagonal with LeftTop to bottomRight. * @param {GC.Spread.Sheets.LineBorder} [diagonalUp] The diagonal with topRight to bottomLeft. * @param {boolean} [locked] Whether the cell, row, or column is locked. * @param {number} [textIndent] The text indent amount. * @param {boolean} [wordWrap] Whether words wrap within the cell or cells. * @param {boolean} [shrinkToFit] Whether content shrinks to fit the cell or cells. * @param {string} [backgroundImage] The background image to display. * @param {GC.Spread.Sheets.CellTypes.Base} [cellType] The cell type. * @param {GC.Spread.Sheets.ImageLayout} [backgroundImageLayout] The layout for the background image. * @param {boolean} [tabStop] Whether the user can set focus to the cell using the Tab key. * @param {GC.Spread.Sheets.TextDecorationType} [textDecoration] Specifies the decoration added to text. * @param {GC.Spread.Sheets.ImeMode} [imeMode] Specifies the input method editor mode. * @param {string} [name] Specifies the name. * @param {string} [parentName] Specifies the name of the parent style. * @param {string} [watermark] Specifies the watermark content. * @param {string} [cellPadding] Specifies the cell padding. * @param {GC.Spread.Sheets.ILabelOptions} [labelOptions] Specifies the cell label options. * @param {boolean} [isVerticalText] Whether to set the cell's text vertical. * @param {number} [textOrientation] the cell text rotation angle. * @param {string} [fontStyle] Specifies the font style. * @param {string} [fontWeight] Specifies the font weight. * @param {string} [fontSize] Specifies the font size. * @param {string} [fontFamily] Specifies the font family. * @param {GC.Spread.Sheets.TextDirectionType} [textDirection] Specifies the direction of the text. * @example * ```javascript * //This example uses a style with rules. * activeSheet.setArray(0,0,[1,2,3,4,5,6,7,8,9,10]); * var style = new GC.Spread.Sheets.Style(); * style.backColor = "red"; * style.foreColor = "black"; * var cell = new GC.Spread.Sheets.ConditionalFormatting.NormalConditionRule(); * cell.ruleType(GC.Spread.Sheets.ConditionalFormatting.RuleType.cellValueRule); * cell.operator(GC.Spread.Sheets.ConditionalFormatting.ComparisonOperators.greaterThan); * cell.value1(5); * cell.ranges([new GC.Spread.Sheets.Range(0, 0, 10, 1)]); * cell.style(style); * activeSheet.conditionalFormats.addRule(cell); * var style1 = new GC.Spread.Sheets.Style(); * style1.foreColor = "red"; * var top = new GC.Spread.Sheets.ConditionalFormatting.NormalConditionRule(); * top.ruleType(GC.Spread.Sheets.ConditionalFormatting.RuleType.top10Rule); * top.type(GC.Spread.Sheets.ConditionalFormatting.Top10ConditionType.top); * top.rank(3); * top.style(style1); * top.ranges([new GC.Spread.Sheets.Range(0, 0, 10, 1)]); * top.stopIfTrue(true); * activeSheet.conditionalFormats.addRule(top); * ``` * @example * ```javascript * //This example creates and sets parameters for the style. * sheet.setValue(0,0, 1,3); * sheet.setValue(1,0, 50,3); * sheet.setValue(2,0, 100,3); * sheet.setValue(3,0, 2,3); * sheet.setValue(4,0, 60,3); * sheet.setValue(5,0, 90,3); * sheet.setValue(6,0, 3,3); * sheet.setValue(7,0, 40,3); * sheet.setValue(8,0, 70,3); * sheet.setValue(9,0, 5,3); * sheet.setValue(10,0, 35,3); * var style = new GC.Spread.Sheets.Style(); * style.backColor = "red"; * style.borderLeft =new GC.Spread.Sheets.LineBorder("blue",GC.Spread.Sheets.LineStyle.medium); * style.borderTop = new GC.Spread.Sheets.LineBorder("blue",GC.Spread.Sheets.LineStyle.medium); * style.borderRight = new GC.Spread.Sheets.LineBorder("blue",GC.Spread.Sheets.LineStyle.medium); * style.borderBottom = new GC.Spread.Sheets.LineBorder("blue",GC.Spread.Sheets.LineStyle.medium); * sheet.conditionalFormats.addAverageRule(GC.Spread.Sheets.ConditionalFormatting.AverageConditionType.above, style, [new GC.Spread.Sheets.Range(0, 0, 10, 3)]); * ``` */ constructor(backColor?: string | GC.Spread.Sheets.IPatternFill | GC.Spread.Sheets.IGradientFill | GC.Spread.Sheets.IGradientPathFill, foreColor?: string, hAlign?: GC.Spread.Sheets.HorizontalAlign, vAlign?: GC.Spread.Sheets.VerticalAlign, font?: string, themeFont?: string, formatter?: string | GC.Spread.Formatter.GeneralFormatter, borderLeft?: GC.Spread.Sheets.LineBorder, borderTop?: GC.Spread.Sheets.LineBorder, borderRight?: GC.Spread.Sheets.LineBorder, borderBottom?: GC.Spread.Sheets.LineBorder, locked?: boolean, textIndent?: number, wordWrap?: boolean, showEllipsis?: boolean, shrinkToFit?: boolean, backgroundImage?: string, cellType?: GC.Spread.Sheets.CellTypes.Base, backgroundImageLayout?: GC.Spread.Sheets.ImageLayout, tabStop?: boolean, textDecoration?: GC.Spread.Sheets.TextDecorationType, imeMode?: GC.Spread.Sheets.ImeMode, name?: string, parentName?: string, watermark?: string, cellPadding?: string, labelOptions?: GC.Spread.Sheets.ILabelOptions, quotePrefix?: boolean, diagonalDown?: GC.Spread.Sheets.LineBorder, diagonalUp?: GC.Spread.Sheets.LineBorder, isVerticalText?: boolean, cellButtons?: GC.Spread.Sheets.ICellButton[], dropdown?: GC.Spread.Sheets.IDropdown[], textOrientation?: number, decoration?: GC.Spread.Sheets.TextDecorationType, mask?: GC.Spread.Sheets.IMaskType, fontStyle?: string, fontWeight?: string, fontSize?: string, fontFamily?: string, hidden?: boolean, textDirection?: GC.Spread.Sheets.TextDirectionType); /** * Indicates whether the cell can enter edit mode for editing. * @type {boolean} * @example * ```javascript * //This example sets the allowEditInCell property. * var style = activeSheet.getStyle(1,1,GC.Spread.Sheets.SheetArea.viewport); * style.allowEditInCell = false; * ``` */ allowEditInCell: boolean | undefined; /** * Only work for namedStyle, the boolean value indicates whether the alignment formatting applied. * @type {boolean} * @example * ```javascript * //This example sets the applyAlignment property for namedStyle. * var style = new GC.Spread.Sheets.Style(); * style.name = 'test'; * style.applyAlignment = false; * spread.addNamedStyle(style); * ``` */ applyAlignment: boolean; /** * Only work for namedStyle, the boolean value indicates whether the border formatting applied. * @type {boolean} * @example * ```javascript * //This example sets the applyBorder property for namedStyle. * var style = new GC.Spread.Sheets.Style(); * style.name = 'test'; * style.applyBorder = false; * spread.addNamedStyle(style); * ``` */ applyBorder: boolean; /** * Only work for namedStyle, the boolean value indicates whether the fill formatting applied. * @type {boolean} * @example * ```javascript * //This example sets the applyFill property for namedStyle. * var style = new GC.Spread.Sheets.Style(); * style.name = 'test'; * style.applyFill = false; * spread.addNamedStyle(style); * ``` */ applyFill: boolean; /** * Only work for namedStyle, the boolean value indicates whether the font formatting applied. * @type {boolean} * @example * ```javascript * //This example sets the applyFont property for namedStyle. * var style = new GC.Spread.Sheets.Style(); * style.name = 'test'; * style.applyFont = false; * spread.addNamedStyle(style); * ``` */ applyFont: boolean; /** * Only work for namedStyle, the boolean value indicates whether the number formatting applied. * @type {boolean} * @example * ```javascript * //This example sets the applyNumberFormat property for namedStyle. * var style = new GC.Spread.Sheets.Style(); * style.name = 'test'; * style.applyNumberFormat = false; * spread.addNamedStyle(style); * ``` */ applyNumberFormat: boolean; /** * Only work for namedStyle, the boolean value indicates whether the protection formatting applied. * @type {boolean} * @example * ```javascript * //This example sets the applyProtection property for namedStyle. * var style = new GC.Spread.Sheets.Style(); * style.name = 'test'; * style.applyProtection = false; * spread.addNamedStyle(style); * ``` */ applyProtection: boolean; /** * Indicates the background color. * @type {string} * @example * ```javascript * //This example sets the style backColor property. * activeSheet.setArray(0,0,[1,2,3,4,5,6,7,8,9,10]); * var style = new GC.Spread.Sheets.Style(); * style.backColor = "red"; * style.foreColor = "black"; * var cell = new GC.Spread.Sheets.ConditionalFormatting.NormalConditionRule(); * cell.ruleType(GC.Spread.Sheets.ConditionalFormatting.RuleType.cellValueRule); * cell.operator(GC.Spread.Sheets.ConditionalFormatting.ComparisonOperators.greaterThan); * cell.value1(5); * cell.ranges([new GC.Spread.Sheets.Range(0, 0, 10, 1)]); * cell.style(style); * activeSheet.conditionalFormats.addRule(cell); * var style1 = new GC.Spread.Sheets.Style(); * style1.foreColor = "red"; * var top = new GC.Spread.Sheets.ConditionalFormatting.NormalConditionRule(); * top.ruleType(GC.Spread.Sheets.ConditionalFormatting.RuleType.top10Rule); * top.type(GC.Spread.Sheets.ConditionalFormatting.Top10ConditionType.top); * top.rank(3); * top.style(style1); * top.ranges([new GC.Spread.Sheets.Range(0, 0, 10, 1)]); * top.stopIfTrue(true); * activeSheet.conditionalFormats.addRule(top); * ``` */ backColor: string | undefined | GC.Spread.Sheets.IPatternFill | GC.Spread.Sheets.IGradientFill | GC.Spread.Sheets.IGradientPathFill; /** * Indicates the background image. * @type {string} * @example * ```javascript * //This example sets the backgroundImage property. * var style = new GC.Spread.Sheets.Style(); * style.backColor = "lightgreen"; * style.backgroundImage = "./css/images/quarter1.png"; * activeSheet.setStyle(1,1,style,GC.Spread.Sheets.SheetArea.viewport); * ``` */ backgroundImage: string | undefined; /** * Indicates the background image layout. * @type {GC.Spread.Sheets.ImageLayout} * @example * ```javascript * //This example sets the backgroundImageLayout property. * var style = new GC.Spread.Sheets.Style(); * style.backColor = "lightgreen"; * style.backgroundImage = "./css/images/quarter1.png"; * style.backgroundImageLayout = GC.Spread.Sheets.ImageLayout.center; * activeSheet.setStyle(1,1,style,GC.Spread.Sheets.SheetArea.viewport); * ``` */ backgroundImageLayout: GC.Spread.Sheets.ImageLayout | undefined; /** * Indicates the bottom border line. * @type {GC.Spread.Sheets.LineBorder} * @example * ```javascript * //This example creates a border. * var cellType = new GC.Spread.Sheets.CellTypes.Button(); * cellType.buttonBackColor("#FFFF00"); * cellType.text("this is a button"); * var style = new GC.Spread.Sheets.Style(); * style.backColor = "red"; * style.borderLeft =new GC.Spread.Sheets.LineBorder("blue",GC.Spread.Sheets.LineStyle.medium); * style.borderTop = new GC.Spread.Sheets.LineBorder("blue",GC.Spread.Sheets.LineStyle.medium); * style.borderRight = new GC.Spread.Sheets.LineBorder("blue",GC.Spread.Sheets.LineStyle.medium); * style.borderBottom = new GC.Spread.Sheets.LineBorder("blue",GC.Spread.Sheets.LineStyle.medium); * style.cellType = cellType * activeSheet.setStyle(1,1,style,GC.Spread.Sheets.SheetArea.viewport); * ``` */ borderBottom: GC.Spread.Sheets.LineBorder | undefined; /** * Indicates the left border line. * @type {GC.Spread.Sheets.LineBorder} * @example * ```javascript * //This example creates a border. * var cellType = new GC.Spread.Sheets.CellTypes.Button(); * cellType.buttonBackColor("#FFFF00"); * cellType.text("this is a button"); * var style = new GC.Spread.Sheets.Style(); * style.backColor = "red"; * style.borderLeft =new GC.Spread.Sheets.LineBorder("blue",GC.Spread.Sheets.LineStyle.medium); * style.borderTop = new GC.Spread.Sheets.LineBorder("blue",GC.Spread.Sheets.LineStyle.medium); * style.borderRight = new GC.Spread.Sheets.LineBorder("blue",GC.Spread.Sheets.LineStyle.medium); * style.borderBottom = new GC.Spread.Sheets.LineBorder("blue",GC.Spread.Sheets.LineStyle.medium); * style.cellType = cellType * activeSheet.setStyle(1,1,style,GC.Spread.Sheets.SheetArea.viewport); * ``` */ borderLeft: GC.Spread.Sheets.LineBorder | undefined; /** * Indicates the right border line. * @type {GC.Spread.Sheets.LineBorder} * @example * ```javascript * //This example creates a border. * var cellType = new GC.Spread.Sheets.CellTypes.Button(); * cellType.buttonBackColor("#FFFF00"); * cellType.text("this is a button"); * var style = new GC.Spread.Sheets.Style(); * style.backColor = "red"; * style.borderLeft =new GC.Spread.Sheets.LineBorder("blue",GC.Spread.Sheets.LineStyle.medium); * style.borderTop = new GC.Spread.Sheets.LineBorder("blue",GC.Spread.Sheets.LineStyle.medium); * style.borderRight = new GC.Spread.Sheets.LineBorder("blue",GC.Spread.Sheets.LineStyle.medium); * style.borderBottom = new GC.Spread.Sheets.LineBorder("blue",GC.Spread.Sheets.LineStyle.medium); * style.cellType = cellType * activeSheet.setStyle(1,1,style,GC.Spread.Sheets.SheetArea.viewport); * ``` */ borderRight: GC.Spread.Sheets.LineBorder | undefined; /** * Indicates the top border line. * @type {GC.Spread.Sheets.LineBorder} * @example * ```javascript * //This example creates a border. * var cellType = new GC.Spread.Sheets.CellTypes.Button(); * cellType.buttonBackColor("#FFFF00"); * cellType.text("this is a button"); * var style = new GC.Spread.Sheets.Style(); * style.backColor = "red"; * style.borderLeft =new GC.Spread.Sheets.LineBorder("blue",GC.Spread.Sheets.LineStyle.medium); * style.borderTop = new GC.Spread.Sheets.LineBorder("blue",GC.Spread.Sheets.LineStyle.medium); * style.borderRight = new GC.Spread.Sheets.LineBorder("blue",GC.Spread.Sheets.LineStyle.medium); * style.borderBottom = new GC.Spread.Sheets.LineBorder("blue",GC.Spread.Sheets.LineStyle.medium); * style.cellType = cellType * activeSheet.setStyle(1,1,style,GC.Spread.Sheets.SheetArea.viewport); * ``` */ borderTop: GC.Spread.Sheets.LineBorder | undefined; /** * Indicates the cellButtons of cell. * @type {Object[]} * @property {string} [caption] - Specific the text of the button to display * @property {GC.Spread.Sheets.CaptionAlignment} [captionAlign] - Specific the position of image and caption. * @property {GC.Spread.Sheets.ButtonPosition} [position] - Specific the button's position in cell * @property {boolean} [enabled] - Specific whether the cell button responds to user actions, default value is true. * @property {boolean} [useButtonStyle] - Specific whether the cellButton is a button style, default value is false. * @property {number} [width] - Specific 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 {GC.Spread.Sheets.ButtonVisibility} [visibility] - Specific the button can be visible always, onSelected, onEditing, default value is always. * @property {string | function} [command] - When click button, allow user to execute a spread command or user can execute a callback. * @property {GC.Spread.Sheets.ButtonImageType} [imageType] - Specific the button's type (the type of image to display in the button). Provide some predefined type for cellButton, custom allow to specific icon. * @property {string} [imageSrc] - When imageType is custom, can specific a image (base64) by imageSrc. * @property {GC.Spread.Sheets.IImageSize} [imageSize] - Specific the image's size, default value is 16px. * @property {string} [hoverBackColor] - Specific the hover backColor of cell button when the button is visible and enable. * @property {string} [buttonBackColor] - Specific the backColor of cell button when the button is enable. * @example * ```javascript * buttonConfig1 = { * caption: "left", * enabled: true, * buttonBackColor: "#174EA6", * visibility:GC.Spread.Sheets.ButtonVisibility.always, * }; * buttonConfig2 = { * caption: "left", * enabled: true, * hoverBackColor: "#3390FF", * visibility:GC.Spread.Sheets.ButtonVisibility.onSelected, * }; * buttonConfig3 = { * caption: "Cut", * imageType: GC.Spread.Sheets.ButtonImageType.custom, * useButtonStyle: true, * imageSrc:"data:image/svg+xml;base64,PD94bWwgdmVyc2lvb...", //This is not a complete base64 string * }; * //create style * var style = new GC.Spread.Sheets.Style(); * style.cellButtons=[ * buttonConfig1, * buttonConfig2, * buttonConfig3 * ]; * sheet.setStyle(0, 0, style); * ``` */ cellButtons: GC.Spread.Sheets.ICellButton[] | undefined; /** * Indicates the cell padding. * @type {string} * @example * ```javascript * //This example sets the cell padding for the watermark. * var type = new GC.Spread.Sheets.Style(); * type.watermark = "User name"; * type.cellPadding = "20"; * type.labelOptions = {alignment:GC.Spread.Sheets.LabelAlignment.topLeft, visibility: GC.Spread.Sheets.LabelVisibility.visible}; * activeSheet.setStyle(0, 1, type); * activeSheet.getRange(0, -1, 1, -1, GC.Spread.Sheets.SheetArea.viewport).height(60); * activeSheet.getRange(-1, 1, -1, 1).width(150); * var combo = new GC.Spread.Sheets.CellTypes.ComboBox(); * combo.items([{ text: "Oranges", value: "11k" }, { text: "Apples", value: "15k" }, { text: "Grape", value: "100k" }]); * combo.editorValueType(GC.Spread.Sheets.CellTypes.EditorValueType.text); * activeSheet.setCellType(2, 1, combo, GC.Spread.Sheets.SheetArea.viewport); * activeSheet.getCell(2, 1, GC.Spread.Sheets.SheetArea.viewport).watermark("ComboBox Cell Type").cellPadding('10 10 20 10'); * activeSheet.getCell(2, 1, GC.Spread.Sheets.SheetArea.viewport).labelOptions({alignment: GC.Spread.Sheets.LabelAlignment.bottomCenter, foreColor: 'yellowgreen', font: 'bold 15px Arial'}); * activeSheet.getRange(2, -1, 1, -1, GC.Spread.Sheets.SheetArea.viewport).height(60); * ``` */ cellPadding: string | undefined; /** * Indicates the cell type. * @type {GC.Spread.Sheets.CellTypes.Base} * @example * ```javascript * //This example creates a style and applies it to a cell. * var cellType = new GC.Spread.Sheets.CellTypes.Button(); * cellType.buttonBackColor("#FFFF00"); * cellType.text("this is a button"); * var style = new GC.Spread.Sheets.Style(); * style.backColor = "red"; * style.borderLeft =new GC.Spread.Sheets.LineBorder("blue",GC.Spread.Sheets.LineStyle.medium); * style.borderTop = new GC.Spread.Sheets.LineBorder("blue",GC.Spread.Sheets.LineStyle.medium); * style.borderRight = new GC.Spread.Sheets.LineBorder("blue",GC.Spread.Sheets.LineStyle.medium); * style.borderBottom = new GC.Spread.Sheets.LineBorder("blue",GC.Spread.Sheets.LineStyle.medium); * style.cellType = cellType * activeSheet.setStyle(1,1,style,GC.Spread.Sheets.SheetArea.viewport); * ``` */ cellType: GC.Spread.Sheets.CellTypes.Base | undefined; /** * Define a decorator for cell to better represent cell. * @type {Object} * @example * ```javascript * //This example sets the decoration property for Style. * var style = new GC.Spread.Sheets.Style(); * style.decoration = { * cornerFold: { * size: 6, * position: GC.Spread.Sheets.CornerPosition.leftTop, * color: "red" * }, * icons: [ * { * src: './icon.png', * width: 12, * height: 12, * position: GC.Spread.Sheets.IconPosition.left, * } * ] * } * ``` */ decoration: GC.Spread.Sheets.IDecoration; /** * Indicates the diagonalDown border line. * @type {GC.Spread.Sheets.LineBorder} * @example * ```javascript * activeSheet.getRange(-1, 3, -1, 1, GC.Spread.Sheets.SheetArea.viewport).diagonalDown(new GC.Spread.Sheets.LineBorder("blue", GC.Spread.Sheets.LineStyle.mediumDashed)); * ``` */ diagonalDown: GC.Spread.Sheets.LineBorder | undefined; /** * Indicates the diagonalUp border line. * @type {GC.Spread.Sheets.LineBorder} * @example * ```javascript * activeSheet.getRange(-1, 3, -1, 1, GC.Spread.Sheets.SheetArea.viewport).diagonalUp(new GC.Spread.Sheets.LineBorder("blue", GC.Spread.Sheets.LineStyle.mediumDashed)); * ``` */ diagonalUp: GC.Spread.Sheets.LineBorder | undefined; /** * Indicates the dropdown type of cell. * @type {Object[]} * @example * ```javascript * leftButtonConfig1 = { * caption: "left", * enabled: true, * isLeft: true, * visibility:GC.Spread.Sheets.ButtonVisibility.always, * command: "opendropdown" * } * //create style * var style = new GC.Spread.Sheets.Style(); * style.cellButtons=[ * leftButtonConfig1 * ]; * style.dropDowns= [{ type: "colorPicker" }]; * sheet.setStyle(0, 0, style); * ``` */ dropDowns: GC.Spread.Sheets.IDropdown[] | undefined; /** * Indicates the font. * @type {string} * @example * ```javascript * //This example sets the font property. * var style = new GC.Spread.Sheets.Style(); * style.font = "8pt Arial"; * style.hAlign = GC.Spread.Sheets.HorizontalAlign.center; * style.vAlign = GC.Spread.Sheets.VerticalAlign.center; * activeSheet.setStyle(1,1,style,GC.Spread.Sheets.SheetArea.viewport); * activeSheet.getCell(1,1).value("B2"); * ``` */ font: string | undefined; /** * Indicates the fontFamily. * @type {string} * @example * ```javascript * //This example sets the fontFamily property. * var style = new GC.Spread.Sheets.Style(); * style.fontFamily = "Arial"; * activeSheet.setStyle(1,1,style,GC.Spread.Sheets.SheetArea.viewport); * activeSheet.getCell(1,1).value("B2"); * ``` */ fontFamily: string | undefined; /** * Indicates the fontSize. * @type {string} * @example * ```javascript * //This example sets the fontSize property. * var style = new GC.Spread.Sheets.Style(); * style.fontSize = "22px"; * activeSheet.setStyle(1,1,style,GC.Spread.Sheets.SheetArea.viewport); * activeSheet.getCell(1,1).value("B2"); * ``` */ fontSize: string | undefined; /** * Indicates the fontStyle. * @type {string} * @example * ```javascript * //This example sets the fontStyle property. * var style = new GC.Spread.Sheets.Style(); * style.fontStyle = "italic"; * activeSheet.setStyle(1,1,style,GC.Spread.Sheets.SheetArea.viewport); * activeSheet.getCell(1,1).value("B2"); * ``` */ fontStyle: string | undefined; /** * Indicates the fontWeight. * @type {string} * @example * ```javascript * //This example sets the fontWeight property. * var style = new GC.Spread.Sheets.Style(); * style.fontWeight = "bold"; * activeSheet.setStyle(1,1,style,GC.Spread.Sheets.SheetArea.viewport); * activeSheet.getCell(1,1).value("B2"); * ``` */ fontWeight: string | undefined; /** * Indicates the foreground color. * @type {string} * @example * ```javascript * //This example sets the foreColor property. * activeSheet.setArray(0,0,[1,2,3,4,5,6,7,8,9,10]); * var style = new GC.Spread.Sheets.Style(); * style.backColor = "red"; * style.foreColor = "black"; * var cell = new GC.Spread.Sheets.ConditionalFormatting.NormalConditionRule(); * cell.ruleType(GC.Spread.Sheets.ConditionalFormatting.RuleType.cellValueRule); * cell.operator(GC.Spread.Sheets.ConditionalFormatting.ComparisonOperators.greaterThan); * cell.value1(5); * cell.ranges([new GC.Spread.Sheets.Range(0, 0, 10, 1)]); * cell.style(style); * activeSheet.conditionalFormats.addRule(cell); * var style1 = new GC.Spread.Sheets.Style(); * style1.foreColor = "red"; * var top = new GC.Spread.Sheets.ConditionalFormatting.NormalConditionRule(); * top.ruleType(GC.Spread.Sheets.ConditionalFormatting.RuleType.top10Rule); * top.type(GC.Spread.Sheets.ConditionalFormatting.Top10ConditionType.top); * top.rank(3); * top.style(style1); * top.ranges([new GC.Spread.Sheets.Range(0, 0, 10, 1)]); * top.stopIfTrue(true); * activeSheet.conditionalFormats.addRule(top); * ``` */ foreColor: string | undefined; /** * Indicates the formatter. * @type {string|GC.Spread.Formatter.GeneralFormatter} * @example * ```javascript * //This example uses the formatter property. * var style = new GC.Spread.Sheets.Style(); * style.formatter = "0.000%"; * style.themeFont = "Body"; * activeSheet.setStyle(1,1,style,GC.Spread.Sheets.SheetArea.viewport); * activeSheet.getCell(1,1).value("11"); * ``` */ formatter: string | GC.Spread.Formatter.GeneralFormatter | undefined; /** * Indicates the horizontal alignment. * @type {GC.Spread.Sheets.HorizontalAlign} * @example * ```javascript * //This example sets the hAlign property. * var style = new GC.Spread.Sheets.Style(); * style.font = "8pt Arial"; * style.hAlign = GC.Spread.Sheets.HorizontalAlign.center; * style.vAlign = GC.Spread.Sheets.VerticalAlign.center; * activeSheet.setStyle(1,1,style,GC.Spread.Sheets.SheetArea.viewport); * activeSheet.getCell(1,1).value("B2"); * ``` */ hAlign: GC.Spread.Sheets.HorizontalAlign | undefined; /** * Indicates whether a cell formula is visible or not when sheet is protected. * @type {boolean} * @example * ```javascript * //This example hidden a single cell. * activeSheet.options.isProtected = true; * activeSheet.setValue(1, 1, "=SUM(1,2)"); * var style = new GC.Spread.Sheets.Style(); * style.backColor = "red"; * style.borderLeft =new GC.Spread.Sheets.LineBorder("blue",GC.Spread.Sheets.LineStyle.medium); * style.borderTop = new GC.Spread.Sheets.LineBorder("blue",GC.Spread.Sheets.LineStyle.medium); * style.borderRight = new GC.Spread.Sheets.LineBorder("blue",GC.Spread.Sheets.LineStyle.medium); * style.borderBottom = new GC.Spread.Sheets.LineBorder("blue",GC.Spread.Sheets.LineStyle.medium); * style.hidden = true; * activeSheet.setStyle(1,1,style,GC.Spread.Sheets.SheetArea.viewport); * ``` */ hidden: boolean | undefined; /** * Indicates the Input Method Editor (IME) mode. * @type {GC.Spread.Sheets.ImeMode} * @deprecated This property currently only works in Internet Explorer. * @example * ```javascript * //This example sets the IME mode. * var style = new GC.Spread.Sheets.Style(); * style.imeMode = GC.Spread.Sheets.ImeMode.auto; * activeSheet.setStyle(0, 0, style); * ``` */ imeMode: GC.Spread.Sheets.ImeMode | undefined; /** * Indicates whether to set the text vertical. * @type {boolean} * @example * ```javascript * //This example uses the rotate property. * var style = new GC.Spread.Sheets.Style(); * style.isVerticalText = true; * activeSheet.setStyle(1,1,style,GC.Spread.Sheets.SheetArea.viewport); * ``` */ isVerticalText: boolean | undefined; /** * Indicates the cell label options. * @property {GC.Spread.Sheets.LabelAlignment} [alignment] - The cell label position. * @property {GC.Spread.Sheets.LabelVisibility} [visibility] - The cell label visibility. * @property {string} [font] - The cell label font. * @property {string} [foreColor] - The cell label foreColor. * @property {string} [margin] - The cell label margin. * @type {Object} * @example * ```javascript * //This example sets label options for the watermark. * var type = new GC.Spread.Sheets.Style(); * type.watermark = "User name"; * type.cellPadding = "20"; * type.labelOptions = {alignment:GC.Spread.Sheets.LabelAlignment.topLeft, visibility: GC.Spread.Sheets.LabelVisibility.visible}; * activeSheet.setStyle(0, 1, type); * activeSheet.getRange(0, -1, 1, -1, GC.Spread.Sheets.SheetArea.viewport).height(60); * activeSheet.getRange(-1, 1, -1, 1).width(150); * var combo = new GC.Spread.Sheets.CellTypes.ComboBox(); * combo.items([{ text: "Oranges", value: "11k" }, { text: "Apples", value: "15k" }, { text: "Grape", value: "100k" }]); * combo.editorValueType(GC.Spread.Sheets.CellTypes.EditorValueType.text); * activeSheet.setCellType(2, 1, combo, GC.Spread.Sheets.SheetArea.viewport); * activeSheet.getCell(2, 1, GC.Spread.Sheets.SheetArea.viewport).watermark("ComboBox Cell Type").cellPadding('10 10 20 10'); * activeSheet.getCell(2, 1, GC.Spread.Sheets.SheetArea.viewport).labelOptions({alignment: GC.Spread.Sheets.LabelAlignment.bottomCenter, foreColor: 'yellowgreen', font: 'bold 15px Arial'}); * activeSheet.getRange(2, -1, 1, -1, GC.Spread.Sheets.SheetArea.viewport).height(60); * ``` */ labelOptions: GC.Spread.Sheets.ILabelOptions | undefined; /** * Indicates whether a cell is marked as locked from editing. * @type {boolean} * @example * ```javascript * //This example unlocks a single cell. * activeSheet.options.isProtected = true; * var style = new GC.Spread.Sheets.Style(); * style.backColor = "red"; * style.borderLeft =new GC.Spread.Sheets.LineBorder("blue",GC.Spread.Sheets.LineStyle.medium); * style.borderTop = new GC.Spread.Sheets.LineBorder("blue",GC.Spread.Sheets.LineStyle.medium); * style.borderRight = new GC.Spread.Sheets.LineBorder("blue",GC.Spread.Sheets.LineStyle.medium); * style.borderBottom = new GC.Spread.Sheets.LineBorder("blue",GC.Spread.Sheets.LineStyle.medium); * style.locked = false; * activeSheet.setStyle(1,1,style,GC.Spread.Sheets.SheetArea.viewport); * ``` */ locked: boolean | undefined; /** * Indicates input mask. * @type {GC.Spread.Sheets.IMaskType} * @example * ```javascript * // This example uses the mask property. * var style = new GC.Spread.Sheets.Style(); * style.mask = { * pattern: '000-00000', * excludeLiteral: true, * placeholder: '#' * }; * activeSheet.setStyle(1, 1, style, GC.Spread.Sheets.SheetArea.viewport); * ``` */ mask: GC.Spread.Sheets.IMaskType | undefined; /** * Indicates the name. * @type {string} * @example * ```javascript * //This example sets the style name. * var namedStyle = new GC.Spread.Sheets.Style(); * namedStyle.name = "style1"; * namedStyle.backColor = "green"; * activeSheet.addNamedStyle(namedStyle); * activeSheet.setStyleName(1, 1, "style1"); // cell(1,1)'s backColor is green. * var namedStyle1 = new GC.Spread.Sheets.Style(); * namedStyle1.name = "style2"; * namedStyle1.parentName = "style1"; * namedStyle1.foreColor = "red"; // the namedStyle's foreColor is red. * activeSheet.addNamedStyle(namedStyle1); * activeSheet.setStyleName(2, 1, "style2"); * ``` */ name: string | undefined; /** * Indicates the name of the parent style. * @type {string} * @example * ```javascript * //This example sets the parent name. * var namedStyle = new GC.Spread.Sheets.Style(); * namedStyle.name = "style1"; * namedStyle.backColor = "green"; * activeSheet.addNamedStyle(namedStyle); * activeSheet.setStyleName(1, 1, "style1"); // cell(1,1)'s backColor is green. * var namedStyle1 = new GC.Spread.Sheets.Style(); * namedStyle1.name = "style2"; * namedStyle1.parentName = "style1"; * namedStyle1.foreColor = "red"; // the namedStyle's foreColor is red. * activeSheet.addNamedStyle(namedStyle1); * activeSheet.setStyleName(2, 1, "style2"); * ``` */ parentName: string | undefined; /** * Controls whether the Text out of bounds shows ellipsis. * @type {boolean} * @example * ```javascript * //This example sets the showEllipsis property. * var style = new GC.Spread.Sheets.Style(); * style.showEllipsis = true; * activeSheet.setStyle(1,1,style,GC.Spread.Sheets.SheetArea.viewport); * activeSheet.getCell(1,1).text("TestTestTestTest"); * ``` */ showEllipsis: boolean | undefined; /** * Indicates whether to shrink to fit. * @type {boolean} * @example * ```javascript * //This example sets the shrinkToFit property. * var style = new GC.Spread.Sheets.Style(); * style.shrinkToFit = true; * activeSheet.setStyle(1,1,style,GC.Spread.Sheets.SheetArea.viewport); * activeSheet.getCell(1,1).text("Shrink To Fit"); * ``` */ shrinkToFit: boolean | undefined; /** * Indicates whether the user can set focus to the cell using the Tab key. * @type {boolean} * @example * ```javascript * //This example sets the tabStop property. * var style = new GC.Spread.Sheets.Style(); * style.tabStop = false; * style.backColor = "lightgreen"; * activeSheet.setStyle(1,1,style,GC.Spread.Sheets.SheetArea.viewport); * ``` */ tabStop: boolean | undefined; /** * Indicates the decoration added to text. * @type {GC.Spread.Sheets.TextDecorationType} * @example * ```javascript * //This example uses the textDecoration property. * activeSheet.getCell(0, 0).textDecoration(GC.Spread.Sheets.TextDecorationType.underline); * activeSheet.getRange(1, -1, 1, -1).textDecoration(GC.Spread.Sheets.TextDecorationType.overline | GC.Spread.Sheets.TextDecorationType.underline); * activeSheet.getRange(-1, 1, -1, 1).textDecoration(GC.Spread.Sheets.TextDecorationType.overline | GC.Spread.Sheets.TextDecorationType.lineThrough | GC.Spread.Sheets.TextDecorationType.underline); * var style = new GC.Spread.Sheets.Style(); * style.textDecoration = GC.Spread.Sheets.TextDecorationType.overline | GC.Spread.Sheets.TextDecorationType.underline; * activeSheet.setStyle(1, 1, style, GC.Spread.Sheets.SheetArea.viewport); * activeSheet.getCell(0, 0).value("Test"); * activeSheet.getCell(1, 0).value("Test"); * activeSheet.getCell(0, 1).value("Test"); * ``` */ textDecoration: GC.Spread.Sheets.TextDecorationType | undefined; /** * Define a text direction for cell to better represent cell. * @type {GC.Spread.Sheets.TextDirectionType} * @example * ```javascript * //This example sets the text direction property for Style. * var style = new GC.Spread.Sheets.Style(); * style.textDirection = GC.Spread.Sheets.TextDirectionType.rightToLeft; * ``` */ textDirection: GC.Spread.Sheets.TextDirectionType | undefined; /** * Indicates the number of units of indentation for text in a cell, an integer value, where an increment of 1 represents 8 pixels. * @type {number} * @example * ```javascript * //This example sets the textIndent property. * var style = new GC.Spread.Sheets.Style(); * style.textIndent = 3; * // Enter multiple lines with Alt+Enter * style.wordWrap = true; * activeSheet.setStyle(1,1,style,GC.Spread.Sheets.SheetArea.viewport); * activeSheet.getCell(1,1).text("Test"); * ``` */ textIndent: number | undefined; /** * Indicates the text rotation angle of cell. * @type {number} * @example * ```javascript * //This example sets the textOrientation property. * var style = new GC.Spread.Sheets.Style(); * style.textOrientation = 66; * activeSheet.setStyle(1,1,style,GC.Spread.Sheets.SheetArea.viewport); * activeSheet.getCell(1,1).text("TestTestTestTest"); * ``` */ textOrientation: number | undefined; /** * Indicates the font theme. * @type {string} * @example * ```javascript * //This example uses the themeFont property. * var style = new GC.Spread.Sheets.Style(); * style.formatter = "0.000%"; * style.themeFont = "Body"; * activeSheet.setStyle(1,1,style,GC.Spread.Sheets.SheetArea.viewport); * activeSheet.getCell(1,1).value("11"); * ``` */ themeFont: string | undefined; /** * Indicates the vertical alignment. * @type {GC.Spread.Sheets.VerticalAlign} * @example * ```javascript * //This example sets the vAlign property. * var style = new GC.Spread.Sheets.Style(); * style.font = "8pt Arial"; * style.hAlign = GC.Spread.Sheets.HorizontalAlign.center; * style.vAlign = GC.Spread.Sheets.VerticalAlign.center; * activeSheet.setStyle(1,1,style,GC.Spread.Sheets.SheetArea.viewport); * activeSheet.getCell(1,1).value("B2"); * ``` */ vAlign: GC.Spread.Sheets.VerticalAlign | undefined; /** * Indicates the watermark content. * @type {string} * @example * ```javascript * //The following examples add watermarks to cells, columns, and rows. * var type = new GC.Spread.Sheets.Style(); * type.watermark = "User name"; * sheet.setStyle(0, 1, type); * var type = new GC.Spread.Sheets.Style(); * type.watermark = "Password"; * sheet.setStyle(1, 1, type); * ``` * @example * ```javascript * var type = new GC.Spread.Sheets.Style(); * type.watermark = "The watermark."; * activeSheet.setStyle(-1, 1, type); * activeSheet.setStyle(1, -1, type); * activeSheet.setStyle(2, 2, type); * ``` */ watermark: string | undefined; /** * Indicates whether to wrap text. * @type {boolean} * @example * ```javascript * //This example sets the wordWrap property. * var style = new GC.Spread.Sheets.Style(); * style.textIndent = 3; * // Enter multiple lines with Alt+Enter * style.wordWrap = true; * activeSheet.setStyle(1,1,style,GC.Spread.Sheets.SheetArea.viewport); * activeSheet.getCell(1,1).text("Test"); * ``` */ wordWrap: boolean | undefined; /** * Clones the current style. * @returns {GC.Spread.Sheets.Style} The cloned style. */ clone(): GC.Spread.Sheets.Style; } export class Theme{ /** * Represents a color scheme. * @class * @param {string} name The name of the theme. * @param {GC.Spread.Sheets.ColorScheme} colorScheme The base colors of the theme color. * @param {string} headingFont The name of the heading font. * @param {string} bodyFont The name of the body font. * @example * ```javascript * //This example creates a new SpreadTheme object. * sheet.getCell(0, 0).backColor("accent 1"); * sheet.getCell(1, 0).backColor("accent 6"); * $("#btn").click(function () { * var custom = new GC.Spread.Sheets.Theme("Custom"); * custom.colors().accent1("red"); * custom.colors().accent6("green"); * sheet.currentTheme(custom); * }) * ``` */ constructor(name: string, colorScheme: ColorScheme, headingFont: string, bodyFont: string); /** * Gets or sets the body font of the theme depending on the culture. * @param {string} [value] The body font. * @returns {string|GC.Spread.Sheets.Theme} If no value is set, returns the body font; otherwise, returns the theme. * @example * ```javascript * var custom = new GC.Spread.Sheets.Theme("Custom"); * custom.bodyFont('cursive'); * sheet.currentTheme(custom); * sheet.setValue(0, 0, 'hello world!'); // The font of the cell will be 'cursive'. * ``` */ bodyFont(value?: string): any; /** * Gets or sets the base colors of the theme. * @param {GC.Spread.Sheets.ColorScheme} [value] The base colors of the theme. * @returns {GC.Spread.Sheets.ColorScheme|GC.Spread.Sheets.Theme} If no value is set, returns the base colors of the theme; otherwise, returns the theme. * @example * ```javascript * var custom = new GC.Spread.Sheets.Theme("Custom"); * custom.colors().accent1("red"); * custom.colors().accent6("green"); * sheet.currentTheme(custom); * sheet.getCell(0, 0).backColor("accent 1"); // The background color of the cell will be red. * sheet.getCell(0, 1).backColor("accent 6"); // The background color of the cell will be green. * ``` */ colors(value?: GC.Spread.Sheets.ColorScheme): any; /** * Gets or sets the font of the theme. * @param {GC.Spread.Sheets.ThemeFont} [value] The font of the theme. * @returns {GC.Spread.Sheets.ThemeFont|GC.Spread.Sheets.Theme} If no value is set, returns the font of the theme; otherwise, returns the theme. * @example * ```javascript * var custom = new GC.Spread.Sheets.Theme("Custom"); * custom.font().bodyFont("cursive"); * sheet.currentTheme(custom); * ``` */ font(value?: GC.Spread.Sheets.ThemeFont): any; /** * Gets or sets the heading font of the theme depending on the culture. * @param {string} [value] The heading font. * @returns {string|GC.Spread.Sheets.Theme} If no value is set, returns the heading font; otherwise, returns the theme. * @example * ```javascript * var custom = new GC.Spread.Sheets.Theme("Custom"); * custom.headingFont('cursive'); * sheet.currentTheme(custom); * sheet.getCell(0, 0).themeFont('Headings'); * sheet.setValue(0, 0, 'hello world!'); // The font of the cell will be 'cursive'. * ``` */ headingFont(value?: string): any; /** * Gets or sets the name of the theme. * @param {string} [value] The theme name. * @returns {string|GC.Spread.Sheets.Theme} If no value is set, returns the theme name; otherwise, returns the theme. */ name(value?: string): any; } export class ThemeColors{ /** * Represents the theme color of built-in themes. * @class * @example * ```javascript * //This example creates a custom theme. * var custom = new GC.Spread.Sheets.Theme("CustomTheme"); * custom.colors().accent1("red"); * custom.colors().accent6("green"); * custom.colors().textColor1("orange"); * activeSheet.currentTheme(custom); * activeSheet.getCell(0, 0).backColor("accent 1"); * activeSheet.getCell(1, 0).backColor("accent 1 30"); * ``` */ constructor(); /** * The theme color of the Apex theme. * @example * ```javascript * //This example uses the Apex theme. * activeSheet.currentTheme("Apex"); * activeSheet.resumePaint(); * activeSheet.repaint(); * ``` */ Apex: ColorScheme; /** * The theme color of the Aspect theme. * @example * ```javascript * //This example uses the Aspect theme. * activeSheet.currentTheme("Aspect"); * activeSheet.resumePaint(); * activeSheet.repaint(); * ``` */ Aspect: ColorScheme; /** * The theme color of the Civic theme. * @example * ```javascript * //This example uses the Civic theme. * activeSheet.currentTheme("Civic"); * activeSheet.resumePaint(); * activeSheet.repaint(); * ``` */ Civic: ColorScheme; /** * The theme color of the Concourse theme. * @example * ```javascript * //This example uses the Concourse theme. * activeSheet.currentTheme("Concourse"); * activeSheet.resumePaint(); * activeSheet.repaint(); * ``` */ Concourse: ColorScheme; /** * The theme color of the Default theme. * @example * ```javascript * //This example sets the Default theme. * activeSheet.currentTheme("Default"); * activeSheet.resumePaint(); * activeSheet.repaint(); * ``` */ Default: ColorScheme; /** * The theme color of the Equity theme. * @example * ```javascript * //This example sets the Equity theme. * activeSheet.currentTheme("Equity"); * activeSheet.resumePaint(); * activeSheet.repaint(); * ``` */ Equity: ColorScheme; /** * The theme color of the Flow theme. * @example * ```javascript * //This example sets the Flow theme. * activeSheet.currentTheme("Flow"); * activeSheet.resumePaint(); * activeSheet.repaint(); * ``` */ Flow: ColorScheme; /** * The theme color of the Foundry theme. * @example * ```javascript * //This example sets the Foundry theme. * activeSheet.currentTheme("Foundry"); * activeSheet.resumePaint(); * activeSheet.repaint(); * ``` */ Foundry: ColorScheme; /** * The theme color of the Median theme. * @example * ```javascript * //This example sets the Median theme. * activeSheet.currentTheme("Median"); * activeSheet.resumePaint(); * activeSheet.repaint(); * ``` */ Median: ColorScheme; /** * The theme color of the Metro theme. * @example * ```javascript * //This example sets the Metro theme. * activeSheet.currentTheme("Metro"); * activeSheet.resumePaint(); * activeSheet.repaint(); * ``` */ Metro: ColorScheme; /** * The theme color of the Module theme. * @example * ```javascript * //This example sets the Module theme. * activeSheet.currentTheme("Module"); * activeSheet.resumePaint(); * activeSheet.repaint(); * ``` */ Module: ColorScheme; /** * The theme color of the Office theme. * @example * ```javascript * //This example sets the Office theme. * activeSheet.currentTheme("Office"); * activeSheet.resumePaint(); * activeSheet.repaint(); * ``` */ Office: ColorScheme; /** * The theme color of the Office 2007 theme. * @example * ```javascript * //This example uses the Office2007 theme. * activeSheet.currentTheme("Office2007"); * activeSheet.resumePaint(); * activeSheet.repaint(); * ``` */ Office2007: ColorScheme; /** * The theme color of the Opulent theme. * @example * ```javascript * //This example sets the Opulent theme. * activeSheet.currentTheme("Opulent"); * activeSheet.resumePaint(); * activeSheet.repaint(); * ``` */ Opulent: ColorScheme; /** * The theme color of the Oriel theme. * @example * ```javascript * //This example sets the Oriel theme. * activeSheet.currentTheme("Oriel"); * activeSheet.resumePaint(); * activeSheet.repaint(); * ``` */ Oriel: ColorScheme; /** * The theme color of the Origin theme. * @example * ```javascript * //This example sets the Origin theme. * activeSheet.currentTheme("Origin"); * activeSheet.resumePaint(); * activeSheet.repaint(); * ``` */ Origin: ColorScheme; /** * The theme color of the Paper theme. * @example * ```javascript * //This example sets the Paper theme. * activeSheet.currentTheme("Paper"); * activeSheet.resumePaint(); * activeSheet.repaint(); * ``` */ Paper: ColorScheme; /** * The theme color of the Solstice theme. * @example * ```javascript * //This example sets the Solstice theme. * activeSheet.currentTheme("Solstice"); * activeSheet.resumePaint(); * activeSheet.repaint(); * ``` */ Solstice: ColorScheme; /** * The theme color of the Technic theme. * @example * ```javascript * //This example sets the Technic theme. * activeSheet.currentTheme("Technic"); * activeSheet.resumePaint(); * activeSheet.repaint(); * ``` */ Technic: ColorScheme; /** * The theme color of the Trek theme. * @example * ```javascript * //This example sets the Trek theme. * activeSheet.currentTheme("Trek"); * activeSheet.resumePaint(); * activeSheet.repaint(); * ``` */ Trek: ColorScheme; /** * The theme color of the Urban theme. * @example * ```javascript * //This example sets the Urban theme. * activeSheet.currentTheme("Urban"); * activeSheet.resumePaint(); * activeSheet.repaint(); * ``` */ Urban: ColorScheme; /** * The theme color of the Verve theme. * @example * ```javascript * //This example sets the Verve theme. * activeSheet.currentTheme("Verve"); * activeSheet.resumePaint(); * activeSheet.repaint(); * ``` */ Verve: ColorScheme; } export class ThemeFont{ /** * Represents a theme font. * @class * @param {string} name The name of the theme font. * @param {string} headingFont The name of the heading font of the Latin text. * @param {string} bodyFont The name of the body font of the Latin text. * @param {string} headingEastAsianFont The name of the heading font of the East Asian. * @param {string} bodyEastAsianFont The name of the body font of the East Asian. * @example * ```javascript * //This example creates a new SpreadTheme object. * var custom = new GC.Spread.Sheets.Theme("Custom"); * custom.font().bodyEastAsianFont("SimSum"); * sheet.currentTheme(custom); * ``` */ constructor(name: string, headingFont: string, bodyFont: string, headingEastAsianFont?: string, bodyEastAsianFont?: string); /** * Gets or sets the body font of the theme font of the East Asian. * @param {string} [value] The body font of the theme font of the East Asian. * @returns {string|GC.Spread.Sheets.ThemeFont} If no value is set, returns the name of the theme font; otherwise, returns the theme font. * @example * ```javascript * var custom = new GC.Spread.Sheets.Theme("Custom", "Cambria", "Calibri"); * custom.font().bodyEastAsianFont("SimSum"); * sheet.currentTheme(custom); * ``` */ bodyEastAsianFont(value?: string): any; /** * Gets or sets the body font of the theme font of the Latin text. * @param {string} [value] The body font of the theme font of the Latin text. * @returns {string|GC.Spread.Sheets.ThemeFont} If no value is set, returns the name of the theme font; otherwise, returns the theme font. * @example * ```javascript * var custom = new GC.Spread.Sheets.Theme("Custom", "Cambria", "Calibri"); * custom.font().bodyFont("Calibri"); * sheet.currentTheme(custom); * ``` */ bodyFont(value?: string): any; /** * Gets or sets the typeface depending on the font script. * @param {string} script The font script code. * @param {string} [typeface] The font typeface. * @returns {string|GC.Spread.Sheets.ThemeFont} If only the script is set, returns the typeface; otherwise, the typeface be set. * @example * ```javascript * var custom = new GC.Spread.Sheets.Theme("Custom"); * // get the typeface depending on the font script * var typeface = custom.bodyFontScriptTypeface('Hans'); * // set the typeface depending on the font script * custom.bodyFontScriptTypeface('Hans', 'SimSum'); * ``` */ bodyFontScriptTypeface(script: string, typeface?: string): any; /** * Gets or sets the heading font of the theme font of the East Asian. * @param {string} [value] The heading font of the theme font of the East Asian. * @returns {string|GC.Spread.Sheets.ThemeFont} If no value is set, returns the name of the theme font; otherwise, returns the theme font. * @example * ```javascript * var custom = new GC.Spread.Sheets.Theme("Custom", "Cambria", "Calibri"); * custom.font().headingEastAsianFont("SimSum"); * sheet.currentTheme(custom); * ``` */ headingEastAsianFont(value?: string): any; /** * Gets or sets the heading font of the theme font of the Latin text. * @param {string} [value] The heading font of the theme font of the Latin text. * @returns {string|GC.Spread.Sheets.ThemeFont} If no value is set, returns the name of the theme font; otherwise, returns the theme font. * @example * ```javascript * var custom = new GC.Spread.Sheets.Theme("Custom", "Cambria", "Calibri"); * custom.font().headingFont("Calibri"); * sheet.currentTheme(custom); * ``` */ headingFont(value?: string): any; /** * Gets or sets the typeface depending on the font script. * @param {string} script The font script code. * @param {string} [typeface] The font typeface. * @returns {string|GC.Spread.Sheets.ThemeFont} If only the script is set, returns the typeface; otherwise, the typeface be set. * @example * ```javascript * var custom = new GC.Spread.Sheets.Theme("Custom"); * // get the typeface depending on the font script * var typeface = custom.headingFontScriptTypeface('Hans'); * // set the typeface depending on the font script * custom.headingFontScriptTypeface('Hans', 'SimSum'); * ``` */ headingFontScriptTypeface(script: string, typeface?: string): any; /** * Gets or sets the name of the theme font. * @param {string} [value] The name of the theme font. * @returns {string|GC.Spread.Sheets.ThemeFont} If no value is set, returns the name of the theme font; otherwise, returns the theme font. */ name(value?: string): any; } export class ThemeFonts{ /** * Represents the theme font of built-in themes. * @class * @example * ```javascript * //This example creates a custom theme. * var custom = new GC.Spread.Sheets.Theme("CustomTheme"); * custom.font(GC.Spread.Sheets.ThemeFonts.Office); * activeSheet.currentTheme(custom); * ``` */ constructor(); /** * The theme font named BookmanGillSansMT. */ BookmanGillSansMT: GC.Spread.Sheets.ThemeFont; /** * The theme font named CalibriConstantia. */ CalibriConstantia: GC.Spread.Sheets.ThemeFont; /** * The theme font named CenturyGothic. */ CenturyGothic: GC.Spread.Sheets.ThemeFont; /** * The theme font named CenturySchoolbook. */ CenturySchoolbook: GC.Spread.Sheets.ThemeFont; /** * The theme font named ConsolasCorbel. */ ConsolasCorbel: GC.Spread.Sheets.ThemeFont; /** * The theme font named Constantia. */ Constantia: GC.Spread.Sheets.ThemeFont; /** * The theme font named Corbel. */ Corbel: GC.Spread.Sheets.ThemeFont; /** * The theme font named FranklinGothic. */ FranklinGothic: GC.Spread.Sheets.ThemeFont; /** * The theme font named FranklinGothicArial. */ FranklinGothicArial: GC.Spread.Sheets.ThemeFont; /** * The theme font named FranklinGothicPerpetua. */ FranklinGothicPerpetua: GC.Spread.Sheets.ThemeFont; /** * The theme font named Georgia. */ Georgia: GC.Spread.Sheets.ThemeFont; /** * The theme font named GillSansMT. */ GillSansMT: GC.Spread.Sheets.ThemeFont; /** * The theme font named LucidaBook. */ LucidaBook: GC.Spread.Sheets.ThemeFont; /** * The theme font named LucidaSansUnicode. */ LucidaSansUnicode: GC.Spread.Sheets.ThemeFont; /** * The theme font named Office. */ Office: GC.Spread.Sheets.ThemeFont; /** * The theme font named Office2007. */ Office2007: GC.Spread.Sheets.ThemeFont; /** * The theme font named Rockwell. */ Rockwell: GC.Spread.Sheets.ThemeFont; /** * The theme font named TrebuchetGeorgia. */ TrebuchetGeorgia: GC.Spread.Sheets.ThemeFont; /** * The theme font named TrebuchetMS. */ TrebuchetMS: GC.Spread.Sheets.ThemeFont; /** * The theme font named TwCenMT. */ TwCenMT: GC.Spread.Sheets.ThemeFont; /** * The theme font named Verdana. */ Verdana: GC.Spread.Sheets.ThemeFont; } export class Themes{ /** * Represents all built-in themes. * @class */ constructor(); /** * Indicates the Apex theme. */ Apex: Theme; /** * Indicates the Aspect theme. */ Aspect: Theme; /** * Indicates the Civic theme. */ Civic: Theme; /** * Indicates the Concourse theme. */ Concourse: Theme; /** * Indicates the Default theme. */ Default: Theme; /** * Indicates the Equity theme. */ Equity: Theme; /** * Indicates the Flow theme. */ Flow: Theme; /** * Indicates the Foundry theme. */ Foundry: Theme; /** * Indicates the Median theme. */ Median: Theme; /** * Indicates the Metro theme. */ Metro: Theme; /** * Indicates the Module theme. */ Module: Theme; /** * Indicates the Office theme. */ Office: Theme; /** * Indicates the Office 2007 theme. */ Office2007: Theme; /** * Indicates the Opulent theme. */ Opulent: Theme; /** * Indicates the Oriel theme. */ Oriel: Theme; /** * Indicates the Origin theme. */ Origin: Theme; /** * Indicates the Paper theme. */ Paper: Theme; /** * Indicates the Solstice theme. */ Solstice: Theme; /** * Indicates the Technic theme. */ Technic: Theme; /** * Indicates the Trek theme. */ Trek: Theme; /** * Indicates the Urban theme. */ Urban: Theme; /** * Indicates the Verve theme. */ Verve: Theme; } export class Workbook{ /** * Represents a spreadsheet with the specified hosted DOM element or DOM id and options setting. * @class * @param {HTMLElement | string} host - The host DOM element or id. * @param {Object} [options] - The initialization options. * @param {number} [options.sheetCount] - The number of sheets. * @param {string} [options.font] - The tab strip font. * @param {boolean} [options.allowUserDragMerge] - Whether to allow the user to drag merge cells. * @param {GC.Spread.Sheets.AllowDragHeaderToMove} [options.allowDragHeaderToMove] - Specifies how to allow drag header to move. * @param {boolean} [options.allowUserDragDrop] - Whether to allow the user to drag and drop range data. * @param {boolean} [options.allowUserDragFill] - Whether to allow the user to drag fill a range. * @param {boolean} [options.allowUserZoom] - Whether to zoom the display by scrolling the mouse wheel while pressing the Ctrl key. * @param {boolean} [options.allowUserResize] - Whether to allow the user to resize columns and rows. * @param {boolean} [options.allowUndo] - Whether to allow the user to undo edits. * @param {boolean} [options.allowSheetReorder] - Whether the user can reorder the sheets in the Spread component. * @param {boolean} [options.allowContextMenu] - Whether to allow the user to open the built-in context menu. * @param {boolean} [options.allowUserDeselect] - Whether to allow the user to can use deselect in selection. * @param {GC.Spread.Sheets.Fill.AutoFillType} [options.defaultDragFillType] - The default fill type. * @param {boolean} [options.showDragFillSmartTag] - Whether to display the drag fill dialog. * @param {boolean} [options.showHorizontalScrollbar] - Whether to display the horizontal scroll bar. * @param {boolean} [options.showVerticalScrollbar] - Whether to display the vertical scroll bar. * @param {boolean} [options.scrollbarShowMax] - Whether the displayed scroll bars are based on the entire number of columns and rows in the sheet. * @param {boolean} [options.scrollbarMaxAlign] - Whether the scroll bar aligns with the last row and column of the active sheet. * @param {boolean} [options.tabStripVisible] - Whether to display the sheet tab strip. * @param {number} [options.tabStripRatio] - The width of the tab strip expressed as a percentage of the overall horizontal scroll bar width. * @param {boolean} [options.tabEditable] - Whether to allow the user to edit the sheet tab strip. * @param {boolean} [options.newTabVisible] - Whether the spreadsheet displays the special tab to let users insert new sheets. * @param {GC.Spread.Sheets.AllSheetsListVisibility} [options.allSheetsListVisible] - Whether the spreadsheet shows a special tab to allow the user to open the dialog to display all sheets. * @param {boolean} [options.tabNavigationVisible] - Whether to display the sheet tab navigation. * @param {boolean} [options.cutCopyIndicatorVisible] - Whether to display an indicator when copying or cutting the selected item. * @param {string} [options.cutCopyIndicatorBorderColor] - The border color for the indicator displayed when the user cuts or copies the selection. * @param {string} [options.backColor] - A color string used to represent the background color of the Spread component, such as "red", "#FFFF00", "rgb(255,0,0)", "Accent 5", and so on. * @param {string} [options.backgroundImage] - The background image of the Spread component. * @param {GC.Spread.Sheets.ImageLayout} [options.backgroundImageLayout] - The background image layout for the Spread component. * @param {string} [options.grayAreaBackColor] - A color string used to represent the background color of the gray area , such as "red", "#FFFF00", "rgb(255,0,0)", "Accent 5", and so on. * @param {GC.Spread.Sheets.ShowResizeTip} [options.showResizeTip] - How to display the resize tip. * @param {boolean} [options.showDragDropTip] -Whether to display the drag-drop tip. * @param {boolean} [options.showDragFillTip] - Whether to display the drag-fill tip. * @param {GC.Spread.Sheets.ShowScrollTip} [options.showScrollTip] - How to display the scroll tip. * @param {boolean} [options.scrollIgnoreHidden] - Whether the scroll bar ignores hidden rows or columns. * @param {boolean} [options.highlightInvalidData] - Whether to highlight invalid data. * @param {boolean} [options.useTouchLayout] - Whether to use touch layout to present the Spread component. * @param {boolean} [options.hideSelection] - Whether to display the selection highlighting when the Spread component does not have focus. * @param {GC.Spread.Sheets.ResizeZeroIndicator} [options.resizeZeroIndicator] - The drawing policy when the row or column is resized to zero. * @param {boolean} [options.allowUserEditFormula] - Whether the user can edit formulas in a cell in the spreadsheet. * @param {boolean} [options.enableFormulaTextbox] - Whether to enable the formula text box in the spreadsheet. * @param {GC.Spread.Sheets.AutoFitType} [options.autoFitType] - Whether content will be formatted to fit in cells or in cells and headers. * @param {GC.Spread.Sheets.ReferenceStyle} [options.referenceStyle] - the style for cell and range references in cell formulas on the workbook. * @param {boolean} [options.calcOnDemand] - Whether to calculate formulas only when they are demanded. * @param {boolean} [options.incrementalCalculation] - Whether to incremental calculate formulas without blocking UI. * @param {boolean} [options.allowCopyPasteExcelStyle] - Whether the user can copy style from Spread Sheets then paste to Excel, or copy style from Excel then paste to Spread Sheets. * @param {boolean} [options.allowExtendPasteRange] - Whether extend paste range if the paste range is not enough for pasting. * @param {GC.Spread.Sheets.CopyPasteHeaderOptions} [options.copyPasteHeaderOptions] - Which headers are included when data is copied to or pasted. * @param {GC.Spread.Sheets.CalculationMode} [options.calculationMode] - The recalculation behavior of the workbook. The default is auto. * @param {boolean} [options.scrollByPixel] - Whether to enable the precision scrolling by pixel. * @param {number} [options.scrollPixel] - Decides scrolling by that number of pixels at a time when scrollByPixel is true. The final scrolling pixels are the result of scrolling delta multiply scrollPixel. For example, the scrolling delta is 3, and the scrollPixel is 5, the final scrolling pixels are 15. * @param {boolean} [options.enableAccessibility] - Whether to enable the accessibility support in the spreadsheet. * @param {boolean} [options.allowAutoCreateHyperlink] - Whether to enable auto creating hyperlink in the spreadsheet. * @param {GC.Spread.Sheets.ResizeMode} [options.columnResizeMode] - Specifies the way to resize column. * @param {GC.Spread.Sheets.ResizeMode} [options.rowResizeMode] - Specifies the way to resize row. * @param {Array} [options.customList] - The list for user to customize drag fill, prioritize matching this list in each fill. Each array item is type of string array. * @param {GC.Spread.Sheets.ScrollbarAppearance} [options.scrollbarAppearance] - The scrollbar appearance, contains skin and mobile two enums. Default is skin. * @param {boolean} [options.pasteSkipInvisibleRange] - Whether paste skip invisible range. Default is false. * @param {boolean} [options.allowAutoExtendFilterRange] - Whether allow auto extend filter range like excel. Default is false. * @param {boolean} [options.allowInvalidFormula] - Whether allow input invalid formula string. Default is false. * @param {boolean} [options.formulaFormatHint] - Whether automatically generate the format when formula inputs. Default is true. * @param {GC.Spread.Pivot.PivotAreaReference} [options.pivotAreaReference ] - Whether automatically generate the getPivotData formula or cell reference when choose pivot table data area. Default is getPivotData. * @param {GC.Spread.Sheets.SheetTabStyles} [options.defaultSheetTabStyles] - All default state styles for sheet tabs. * @param {GC.Spread.Sheets.IBuiltInFileIcons} [options.builtInFileIcons] - All built-in file icons. * @example * ```javascript * var workbook = new GC.Spread.Sheets.Workbook(document.getElementById("ss"), {sheetCount:3, font:"12pt Arial"}); * var workbook = new GC.Spread.Sheets.Workbook(document.getElementById("ss"), {sheetCount:3, newTabVisible:false}); * var workbook = new GC.Spread.Sheets.Workbook(document.getElementById("ss"), { sheetCount: 3, tabEditable: false }); * var workbook = new GC.Spread.Sheets.Workbook(document.getElementById("ss"), {sheetCount:3, tabStripVisible:false}); * var workbook = new GC.Spread.Sheets.Workbook(document.getElementById("ss"), {sheetCount:3, allowUserResize:false}); * var workbook = new GC.Spread.Sheets.Workbook(document.getElementById("ss"), { sheetCount: 3, allowUserZoom: false}); * ``` */ constructor(host?: HTMLElement | string, options?: GC.Spread.Sheets.IWorkBookDefaultOptions); /** * Collaboration manager for the workbook. * @type {GC.Spread.Sheets.Collaboration.Collaboration} * //This example shows how to get snapshot. * @example * ```javascript * var snapshot = workbook.collaboration.toSnapshot(); * ``` */ collaboration: GC.Spread.Sheets.Collaboration.Collaboration; /** * ContextMenu for the spread. * @type {GC.Spread.Sheets.ContextMenu.ContextMenu} * @example * ```javascript * //This example shows how to get contextMenu's menuData. * var menuData = spread.contextMenu.menuData; * ``` */ contextMenu: GC.Spread.Sheets.ContextMenu.ContextMenu; /** * Represents the custom pivot table theme manager. * @type {GC.Spread.Pivot.CustomPivotTableThemeManager} */ customPivotTableThemes: GC.Spread.Pivot.CustomPivotTableThemeManager; /** * Represents the custom item slicer theme manager. * @type {GC.Spread.Sheets.Slicers.CustomSlicerThemeManager} */ customSlicerThemes: GC.Spread.Sheets.Slicers.CustomSlicerThemeManager; /** * Represents the custom table theme manager. * @type {GC.Spread.Sheets.Tables.CustomTableThemeManager} */ customTableThemes: GC.Spread.Sheets.Tables.CustomTableThemeManager; /** * Represents the custom timeline slicer theme manager. * @type {GC.Spread.Sheets.Slicers.CustomTimelineThemeManager} */ customTimelineThemes: GC.Spread.Sheets.Slicers.CustomTimelineThemeManager; /** * Document properties. * @type {GC.Spread.Sheets.IDocProps} */ docProps: GC.Spread.Sheets.IDocProps; /** * Represents the name of the Spread control. * @type {string} * @example * ```javascript * spread.name = "Spread1"; * ``` */ name: string; /** * Represents the options of the Spread control. * @type {Object} * @property {boolean} allowUserDragMerge - Whether to allow the user to drag merge cells. * @property {GC.Spread.Sheets.AllowDragHeaderToMove} [options.allowDragHeaderToMove] - Specifies how to allow drag header to move. * @property {boolean} allowUserDragDrop - Whether to allow the user to drag and drop range data. * @property {boolean} allowUserDragFill - Whether to allow the user to drag fill a range. * @property {boolean} allowUserZoom - Whether to zoom the display by scrolling the mouse wheel while pressing the Ctrl key. * @property {boolean} allowUserResize - Whether to allow the user to resize columns and rows. * @property {boolean} allowUndo - Whether to allow the user to undo edits. * @property {boolean} allowSheetReorder - Whether the user can reorder the sheets in the Spread component. * @property {boolean} allowContextMenu - Whether to allow the user to open the built-in context menu. * @property {boolean} allowUserDeselect - Whether to allow the user to can use deselect in selection. * @property {GC.Spread.Sheets.Fill.AutoFillType} defaultDragFillType - The default fill type. * @property {boolean} showDragFillSmartTag - Whether to display the drag fill dialog. * @property {boolean} showHorizontalScrollbar - Whether to display the horizontal scroll bar. * @property {boolean} showVerticalScrollbar - Whether to display the vertical scroll bar. * @property {boolean} scrollbarShowMax - Whether the displayed scroll bars are based on the entire number of columns and rows in the sheet. * @property {boolean} scrollbarMaxAlign - Whether the scroll bar aligns with the last row and column of the active sheet. * @property {boolean} tabStripVisible - Whether to display the sheet tab strip. * @property {number} tabStripRatio - The width of the tab strip expressed as a percentage of the overall horizontal scroll bar width. * @property {number} tabStripWidth - The width of the tab strip when it is at the left or right position. The default and minimum is 80. * @property {boolean} tabEditable - Whether to allow the user to edit the sheet tab strip. * @property {GC.Spread.Sheets.TabStripPosition} tabStripPosition - The position of tab strip. The default is bottom. * @property {boolean} newTabVisible - Whether the spreadsheet displays the special tab to let users insert new sheets. * @property {GC.Spread.Sheets.AllSheetsListVisibility} allSheetsListVisible - Whether the spreadsheet shows a special tab to allow the user to open the dialog to display all sheets. * @property {boolean} tabNavigationVisible - Whether to display the sheet tab navigation. * @property {boolean} cutCopyIndicatorVisible - Whether to display an indicator when copying or cutting the selected item. * @property {string} cutCopyIndicatorBorderColor - The border color for the indicator displayed when the user cuts or copies the selection. * @property {string} backColor - A color string used to represent the background color of the Spread component, such as "red", "#FFFF00", "rgb(255,0,0)", "Accent 5", and so on. * @property {string} backgroundImage - The background image of the Spread component. * @property {GC.Spread.Sheets.ImageLayout} backgroundImageLayout - The background image layout for the Spread component. * @property {string} grayAreaBackColor - A color string used to represent the background color of the gray area , such as "red", "#FFFF00", "rgb(255,0,0)", "Accent 5", and so on. * @property {GC.Spread.Sheets.ShowResizeTip} showResizeTip - How to display the resize tip. * @property {boolean} showDragDropTip -Whether to display the drag-drop tip. * @property {boolean} showDragFillTip - Whether to display the drag-fill tip. * @property {GC.Spread.Sheets.ShowScrollTip} showScrollTip - How to display the scroll tip. * @property {boolean} scrollIgnoreHidden - Whether the scroll bar ignores hidden rows or columns. * @property {boolean} highlightInvalidData - Whether to highlight invalid data. * @property {boolean} useTouchLayout - Whether to use touch layout to present the Spread component. * @property {boolean} hideSelection - Whether to display the selection highlighting when the Spread component does not have focus. * @property {GC.Spread.Sheets.ResizeZeroIndicator} resizeZeroIndicator - The drawing policy when the row or column is resized to zero. * @property {boolean} allowUserEditFormula - Whether the user can edit formulas in a cell in the spreadsheet. * @property {boolean} enableFormulaTextbox - Whether to enable the formula text box in the spreadsheet. * @property {GC.Spread.Sheets.AutoFitType} autoFitType - Whether content will be formatted to fit in cells or in cells and headers. * @property {GC.Spread.Sheets.ReferenceStyle} referenceStyle - the style for cell and range references in cell formulas on the workbook. * @property {boolean} allowDynamicArray - Whether to enable dynamic array. * @property {boolean} iterativeCalculation - Whether to enable the iterative calculation. * @property {number} iterativeCalculationMaximumIterations - The Maximum Iterations when iterative calculation. * @property {number} iterativeCalculationMaximumChange - The Maximum Change when iterative calculation. * @property {boolean} calcOnDemand - Whether to calculate formulas only when they are demanded. * @property {boolean} incrementalCalculation - Whether to incremental calculate formulas without blocking UI. * @property {boolean} dynamicReferences - Whether to calculate functions with dynamic reference. * @property {boolean} allowCopyPasteExcelStyle - Whether the user can copy style from Spread Sheets then paste to Excel, or copy style from Excel then paste to Spread Sheets. * @property {boolean} allowExtendPasteRange - Whether extend paste range if the paste range is not enough for pasting. * @property {GC.Spread.Sheets.CopyPasteHeaderOptions} copyPasteHeaderOptions - Which headers are included when data is copied to or pasted. * @property {GC.Spread.Sheets.CalculationMode} calculationMode - The recalculation behavior of the workbook. The default is auto. * @property {boolean} scrollByPixel - Whether to enable the precision scrolling by pixel. * @property {number} scrollPixel - Decides scrolling by that number of pixels at a time when scrollByPixel is true. The final scrolling pixels are the result of scrolling delta multiply scrollPixel. For example, the scrolling delta is 3, and the scrollPixel is 5, the final scrolling pixels are 15. * @property {boolean} enableAccessibility - Whether to enable the accessibility support in the spreadsheet. * @property {boolean} allowAutoCreateHyperlink - Whether to enable auto creating hyperlink in the spreadsheet. * @property {GC.Spread.Sheets.ResizeMode} columnResizeMode - Specifies the way to resize column. * @property {GC.Spread.Sheets.ResizeMode} rowResizeMode - Specifies the way to resize row. * @property {Array} customList - The list for user to customize drag fill, prioritize matching this list in each fill. Each array item is type of string array. * @property {GC.Spread.Sheets.ScrollbarAppearance} scrollbarAppearance - The scrollbar appearance, contains skin and mobile two enums. Default is skin. * @property {boolean} pasteSkipInvisibleRange - Whether paste skip invisible range. Default is false. * @property {boolean} allowAutoExtendFilterRange - Whether allow auto extend filter range like excel. Default is false. * @property {boolean} allowInvalidFormula - Whether allow input invalid formula string. Default is false. * @property {boolean} formulaFormatHint - Whether automatically generate the format when formula inputs. Default is true. * @property {GC.Spread.Pivot.PivotAreaReference} pivotAreaReference - Whether automatically generate the getPivotData formula or cell reference when choose pivot table data area. Default is getPivotData. * @property {GC.Spread.Sheets.SheetTabStyles} defaultSheetTabStyles - All default state styles for sheet tabs. * @property {GC.Spread.Sheets.IBuiltInFileIcons} [options.builtInFileIcons] - All built-in file icons. * @example * ```javascript * // var workbook = new GC.Spread.Sheets.Workbook(document.getElementById("ss"),{sheetCount:5,showHorizontalScrollbar:false}); * var workbook = new GC.Spread.Sheets.Workbook("ss",{sheetCount:5,showHorizontalScrollbar:false}); * workbook.options.allowUserDragDrop = false; * workbook.options.allowUserZoom = false; * ``` */ options: IWorkbookOptions; /** * Represents the sheet collection. * @type {GC.Spread.Sheets.Worksheet[]} */ sheets: GC.Spread.Sheets.Worksheet[]; /** * A state style manager representing worksheet tabs. * @type {GC.Spread.Sheets.SheetTabStyleManager} */ sheetTabStyles: GC.Spread.Sheets.SheetTabStyleManager; /** * Represents the touch toolstrip. * @type {GC.Spread.Sheets.Touch.TouchToolStrip} */ touchToolStrip: GC.Spread.Sheets.Touch.TouchToolStrip; /** * Adds a custom function. * @param {GC.Spread.CalcEngine.Functions.Function} fn The function to add. */ addCustomFunction(fn: GC.Spread.CalcEngine.Functions.Function): void; /** * Adds a custom name. * @param {string} name The custom name. * @param {string} formula The formula. * @param {number} baseRow The row index. * @param {number} baseCol The column index. * @param {string} [comment] The custom comment. * @param {boolean} [isReadOnly] The custom name could be editable. */ addCustomName(name: string, formula: string, baseRow: number, baseCol: number, comment?: string, isReadOnly?: boolean): void; /** * Adds a style to the Workbook named styles collection. * @param {GC.Spread.Sheets.Style} style The style to be added. */ addNamedStyle(style: GC.Spread.Sheets.Style): void; /** * Inserts a sheet at the specific index. * @param {number} index The index at which to add a sheet. * @param {GC.Spread.Sheets.Worksheet} sheet The sheet to be added. * @example * ```javascript * //This example adds a sheet to the spreadsheet. * spread.addSheet(0,new GC.Spread.Sheets.Worksheet("custom")); * ``` */ addSheet(index: number, sheet?: GC.Spread.Sheets.Worksheet): void; /** * Inserts a sheet tab at the specific index. * @param {number} index The index at which to add a sheet tab. * @param {string} name The name of sheet tab to be added. * @param {GC.Spread.Sheets.SheetType} type The type of sheet tab to be added. * @returns {Object} The added sheet tab. */ addSheetTab(index: number, name: string, type: GC.Spread.Sheets.SheetType): any; /** * Adds a SparklineEx to the SparklineEx collection. * @param {GC.Spread.Sheets.Sparklines.SparklineEx} sparklineEx The SparklineEx to be added. * @example * ```javascript * window.MySparklineEx = function(color) { * GC.Spread.Sheets.Sparklines.SparklineEx.apply(this, arguments); * this.typeName = 'MySparklineEx'; * this.color = color; * } * MySparklineEx.prototype = new GC.Spread.Sheets.Sparklines.SparklineEx(); * MySparklineEx.prototype.createFunction = function () { * var func = new GC.Spread.CalcEngine.Functions.Function('CIRCLE', 0, 0); * func.evaluate = function (args) { * return {}; * }; * return func; * }; * MySparklineEx.prototype.paint = function (context, value, x, y, width, height) { * context.beginPath(); * context.arc(x + width / 2, y + height / 2, (Math.min(width, height) - 6) / 2, 0, Math.PI * 2); * context.strokeStyle = this.color; * context.stroke(); * }; * spread.addSparklineEx(new MySparklineEx('green')); * ``` */ addSparklineEx(sparklineEx: GC.Spread.Sheets.Sparklines.SparklineEx): void; /** * Binds an event to the Workbook. * @param {string} type The event type. * @param {Object} data Specifies additional data to pass along to the function. * @param {Function} fn Specifies the function to run when the event occurs. * @example * ```javascript * //This example binds events to functions. * sheet.setActiveCell(5,5); * alert(sheet.getActiveColumnIndex()); * alert(sheet.getActiveRowIndex()); * spread.bind(GC.Spread.Sheets.Events.EnterCell, function (event, data) { * alert(data.col); * alert(data.row); * }); * spread.bind(GC.Spread.Sheets.Events.LeaveCell, function (event, data) { * alert(data.col); * alert(data.row); * }); * ``` */ bind(type: string, data?: any, fn?: Function): void; /** * Rebuild, mark dirty, broadcast dirty and recalculate the formulas. * First rebuild and mark dirty in the address by the calculation type. * Then broadcast dirty will recursively set the dependents of dirty cells to dirty in the workbook. * In automatic mode, all the dirty cells will be calculated. * In the manual mode, only the cells in the address are calculated, other cells keep the dirty state. * If the CalcService is suspended, the recalculate will be skipped. * @param {GC.Spread.Sheets.CalculationType} type Specifies the rebuild and mark dirty types of calculation. * @param {string} address Specifies the sheet or range to mark dirty and calculate. It will be the workbook if it's omitted. * Notice that dirty dependencies out of the range will be calculated in automatic mode. * @example * ```javascript * spread.sheets[0].setFormula(0,0,"RAND()"); * spread.sheets[0].setFormula(1,0,"=Sheet2!A1"); * spread.sheets[0].setFormula(2,0,"=1+2"); * spread.sheets[1].setFormula(0,0,"RAND()"); * spread.sheets[1].setFormula(1,0,"=Sheet1!A1"); * * // All the cell is recalculated. * spread.calculate(); * spread.calculate(GC.Spread.Sheets.CalculationType.regular); * * // Sheet1!A1 Sheet2!A2 are evaluated to new number, and Sheet1!A2 Sheet1!A3 are evaluated. * spread.calculate(GC.Spread.Sheets.CalculationType.all, "Sheet1"); * * // Sheet1!A1 Sheet2!A2 are evaluated to new number. * spread.calculate(GC.Spread.Sheets.CalculationType.regular, "Sheet1!A1"); * * // No cells are evaluated. * spread.calculate(GC.Spread.Sheets.CalculationType.regular, "Sheet1!A2"); * * spread.options.calculationMode = GC.Spread.Sheets.CalculationMode.manual; // Switch to manual mode * * // Sheet1!A1 is evaluated to new number, Sheet1!A2 Sheet1!A3 are evaluated but don't changed, Sheet2!A2 keeps dirty in manual mode. * spread.calculate(GC.Spread.Sheets.CalculationType.all, "Sheet1"); * * // Sheet1!A1 is evaluated to new number, Sheet2!A2 keeps dirty in manual mode. * spread.calculate(GC.Spread.Sheets.CalculationType.regular, "Sheet1"); * * // Sheet2!A2 is evaluated because it is dirty. * spread.calculate(GC.Spread.Sheets.CalculationType.minimal); * ``` */ calculate(type?: GC.Spread.Sheets.CalculationType, address?: string): void; /** * Change sheet index and reorder sheets. * @param {string} sheetName The sheet name. * @param {number} targetIndex The target index. * @example * ```javascript * //This example show how to change sheet index. * var spread = GC.Spread.Sheets.findControl(ss); * spread.setSheetCount(5); // The sheets sequence should be "Sheet1", "Sheet2", "Sheet3", "Sheet4", "Sheet5". * spread.changeSheetIndex("Sheet1", 3); // The sheets sequence should be "Sheet2", "Sheet3", "Sheet4", "Sheet1", "Sheet5". * ``` */ changeSheetIndex(sheetName: string, targetIndex: number): boolean; /** * Change sheet position and reorder sheets. * @param {string} sheetName The sheet name. * @param {number} targetPosition The target position. * @example * ```javascript * //This example show how to change sheet position. * var spread = GC.Spread.Sheets.findControl(ss); * spread.setSheetCount(5); * spread.addSheetTab(0, "tableSheet1", GC.Spread.Sheets.SheetType.tableSheet); // The sheets sequence should be "Sheet1", "Sheet2", "Sheet3", "Sheet4", "Sheet5", "tableSheet1". * spread.changeSheetPosition("tableSheet1", 3); // The sheets sequence should be "Sheet1", "Sheet2", "Sheet3", "tableSheet1", "Sheet4", "Sheet5". * ``` */ changeSheetPosition(sheetName: string, targetPosition: number): boolean; /** * Clears all custom functions. */ clearCustomFunctions(): void; /** * Clears custom names. */ clearCustomNames(): void; /** * Clears all sheets in the control. * @example * ```javascript * //This example uses the clearSheets method. * spread.clearSheets(); * ``` */ clearSheets(): void; /** * Clears all sheet tabs in the control. */ clearSheetTabs(): void; /** * Gets the command manager. * @returns {GC.Spread.Commands.CommandManager} The command manager. * @example * ```javascript * //This example executes a command that performs a specified action. * spread.options.allowUndo = true; * spread.commandManager().execute({cmd: "outlineRow", sheetName: "Sheet1", index: 3, count: 5}); * ``` */ commandManager(): GC.Spread.Commands.CommandManager; /** * Gets the data manager. * @returns {GC.Data.DataManager} Returns the data manager. */ dataManager(): GC.Data.DataManager; /** * set or get the default pivot table theme. * @param {string} name the default name of the pivot table theme * @returns {GC.Spread.Pivot.PivotTableTheme | undefined} * @example * ```javascript * // set Default pivot table theme name as "custom0" * spread.defaultPivotTableTheme("custom0"); * let newPivotTable = activeSheet.pivotTables.add("pivotTable1", 1, 1, 10, 5); * // The pivot table above will use "custom0" as the theme since no specific theme has been specified. * * // get default pivot table theme * spread.defaultPivotTableTheme(); * ``` */ defaultPivotTableTheme(themeName?: string): GC.Spread.Pivot.PivotTableTheme | undefined; /** * set or get the default slicer theme. * @param {string} name the default name of the slicer theme * @returns {GC.Spread.Sheets.Slicers.SlicerStyle | undefined} * @example * ```javascript * // set default slicer theme name as "custom0" * spread.defaultSlicerTheme("custom0"); * let newSlicer = activeSheet.slicers.add("slicer1", 1, 1, 10, 5); * // The slicer above will use "custom0" as the theme since no specific theme has been specified. * * // get default slicer theme * spread.defaultSlicerTheme(); * ``` */ defaultSlicerTheme(themeName?: string): GC.Spread.Sheets.Slicers.SlicerStyle | undefined; /** * set or get the default table theme. * @param {string} name the default name of the table theme * @returns {GC.Spread.Sheets.Tables.TableTheme | undefined} * @example * ```javascript * // set default table theme name as "custom0" * spread.defaultTableTheme("custom0"); * let newable = activeSheet.tables.add("table1", 1, 1, 10, 5); * // The table above will use "custom0" as the theme since no specific theme has been specified. * * // get the default table theme * spread.defaultTableTheme(); * ``` */ defaultTableTheme(themeName?: string): GC.Spread.Sheets.Tables.TableTheme | undefined; /** * set or get the default timeLine theme. * @param {string} name the default name of the timeLine theme * @returns {GC.Spread.Sheets.Slicers.TimelineStyle | undefined} * @example * ```javascript * // set default timeLine theme name as "custom0" * spread.defaultTimelineTheme("custom0"); * let newTimeline = activeSheet.timeLines.add("timeLine1", 1, 1, 10, 5); * // The timeLine above will use "custom0" as the theme since no specific theme has been specified. * * // get default timeLine theme * spread.defaultTimelineTheme(); * ``` */ defaultTimelineTheme(themeName?: string): GC.Spread.Sheets.Slicers.TimelineStyle | undefined; /** * Destroys the workbook and all sheets it contains. * @example * ```javascript * //This example destroys the workbook instance. * spread.destroy(); * ``` */ destroy(): void; /** * Exports the object state to excel or ssjson file or csv file. * @param {function} [successCallBack] The success callback when export object state complete, accept Blob as argument. * @param {function} [errorCallBack] The error callback when export object state got error. * @param {GC.Spread.Sheets.ExportOptions} [exportOptions] - The export options. * @example * ```javascript * spread.export(function (blob) { * // save blob to a file * saveAs(blob, fileName); * }, function (e) { * console.log(e); * }, { * fileType: GC.Spread.Sheets.FileType.excel, * includeBindingSource: true * }); * ``` */ export(successCallBack?: Function, errorCallBack?: Function, exportOptions?: GC.Spread.Sheets.ExportOptions): void; /** * Makes the Workbook component get focus or lose focus. * @param {boolean} focusIn `false` makes the Workbook component lose the focus; otherwise, get focus. * @example * ```javascript * //This example sets focus to the Spread control. * $("#button1").click(function () { * spread.focus(true); * }); * ``` */ focus(focusIn?: boolean): void; /** * Loads the object state from the specified JSON string. * @param {Object} workbookData The spreadsheet data from deserialization. * @param {GC.Spread.Sheets.IDeserializationOptions} [deserializationOptions] - The deserialization options. * @returns {Promise} - The fromJSON promise. * @example * ```javascript * //This example uses the fromJSON method. * activeSheet.getCell(0,0).value(123); * var jsonStr = null; * //export * jsonStr = JSON.stringify(spread.toJSON()); * //import * var fromJSONPromise = spread.fromJSON(JSON.parse(jsonStr)); * fromJSONPromise.then(() => { * alert(jsonStr); * }); * ``` */ fromJSON(workbookData: Object, deserializationOptions?: GC.Spread.Sheets.IDeserializationOptions): Promise; /** * Gets the active sheet. * @returns {GC.Spread.Sheets.Worksheet} The active sheet instance. */ getActiveSheet(): GC.Spread.Sheets.Worksheet; /** * Gets the active sheet index of the control. * @returns {number} The active sheet index. * @example * ```javascript * //This example uses the getActiveSheetIndex method. * var index = spread.getActiveSheetIndex(); * alert(index); * ``` */ getActiveSheetIndex(): number; /** * Gets the active sheet tab. * @returns {Object} The active sheet tab instance. */ getActiveSheetTab(): any; /** * Gets the active sheet tab index of the control. * @returns {number} The active sheet tab index. */ getActiveSheetTabIndex(): number; /** * Gets the all the Circular Reference cell information in the workbook. * @returns {Object[]} Returns circular reference cell information object array * cellsInfo.row {number} Indicates the cellRange row index. * cellsInfo.col {number} Indicates the cellRange col index. * cellsInfo.rowCount {number} Indicates the cellRange row count. * cellsInfo.colCount {number} Indicates the cellRange col count. * cellsInfo.sheetName {string} Indicates the workSheet name. * @example * ```javascript * spread.getCircularReference(); * ``` */ getCircularReference(): GC.Spread.Sheets.ICellsInfo[]; /** * Gets a custom function. * @param {string} name The custom function name. * @returns {GC.Spread.CalcEngine.Functions.Function} The custom function. */ getCustomFunction(name: string): void; /** * Gets the specified custom name information. * @param {string} name The custom name. * @returns {GC.Spread.Sheets.NameInfo} The information for the specified custom name. */ getCustomName(name: string): GC.Spread.Sheets.NameInfo; /** * Gets all custom name information. * @returns {GC.Spread.Sheets.NameInfo[]} The type GC.Spread.Sheets.NameInfo stored in an array. */ getCustomNames(): GC.Spread.Sheets.NameInfo[]; /** * Get the cross workbook reference list of current workbook. * @param {boolean} includeItemDetail - Specifies whether to include the target cell and the source ranges. Default value is false. * @returns {Object[]} The externalReference array.
* externalReference.name {string} The file name of cross workbook reference.
* externalReference.filePath {string} The file path of cross workbook reference. * @example * ```javascript * //This example gets and update the used data source. * spread.getActiveSheet().setFormula(0, 0, "='[Jackson.xlsx]Sheet1'!B6+SUM('[Petrosky.xlsx]Sheet2'!B7:B8)"); * spread.getExternalReferences().forEach(item=>{ * spread.updateExternalReference(item.name, spreadList[item.name], item.filePath); * }) * ``` */ getExternalReferences(includeItemDetail?: boolean): GC.Spread.Sheets.IExternalReference[]; /** * Gets the host element of the current Workbook instance. * @returns {HTMLElement} host The host element of the current Workbook instance. */ getHost(): HTMLElement; /** * Gets a style from the Workbook named styles collection which has the specified name. * @param {string} name The name of the style to return. * @returns {GC.Spread.Sheets.Style} Returns the specified named style. */ getNamedStyle(name: string): GC.Spread.Sheets.Style; /** * Gets named styles from the Workbook. * @returns {GC.Spread.Sheets.Style[]} The GC.Spread.Sheets.Style array of named styles. */ getNamedStyles(): GC.Spread.Sheets.Style[]; /** * Gets the specified sheet. * @param {number} index The index of the sheet to return. * @returns {GC.Spread.Sheets.Worksheet} The specified sheet. * @example * ```javascript * //This example gets the sheet and sets the cell forecolor. * var sheet1 = spread.getSheet(1); * sheet1.getCell(0,0).value("A1").foreColor("red"); * ``` */ getSheet(index: number): GC.Spread.Sheets.Worksheet; /** * Gets the number of sheets. * @returns {number} The number of sheets. * @example * ```javascript * //This example uses the getSheetCount method. * var index = spread.getSheetCount(); * alert(index); * ``` */ getSheetCount(): number; /** * Gets the sheet with the specified name. * @param {string} name The sheet name. * @returns {GC.Spread.Sheets.Worksheet} The sheet with the specified name. * @example * ```javascript * //This example gets the sheet and sets the cell forecolor. * var sheet1 = spread.getSheetFromName("Sheet2"); * sheet1.getCell(0,0).value("A1").foreColor("red"); * ``` */ getSheetFromName(name: string): GC.Spread.Sheets.Worksheet; /** * Gets the sheet index with the specified name. * @param {string} name The sheet name. * @returns {number} The sheet index, based on the Worksheet collection. * @example * ```javascript * //This example uses the getSheetIndex method. * spread.setSheetCount(5); * var index = spread.getSheetIndex("Sheet2"); * alert(index); // 1 * ``` */ getSheetIndex(name: string): number; /** * Gets the sheet tab position with the specified name. * @param {string} name The sheet tab name. * @returns {number} The sheet tab position, based on the Worksheet and TableSheet collection. * @example * ```javascript * //This example uses the getSheetPosition method. * spread.setSheetCount(5); * spread.addSheetTab(0, "tableSheet1", GC.Spread.Sheets.SheetType.tableSheet); * var position = spread.getSheetPosition("tableSheet1"); * alert(position); // 5 * ``` */ getSheetPosition(name: string): number; /** * Gets the specified sheet tab by index or name. * @param {number | string} indexOrName The index or name of the sheet tab to return. * @returns {Object} The specified sheet tab. */ getSheetTab(indexOrName: number | string): any; /** * Gets the number of sheet tabs. * @returns {number} The number of sheet tabs. */ getSheetTabCount(): number; /** * Gets the sheet tab index with the specified name. * @param {string} name The sheet tab name. * @returns {number} The sheet tab index, based on the TabSheet collection. * @example * ```javascript * //This example uses the getSheetTabIndex method. * spread.setSheetCount(5); * spread.addSheetTab(0, "tableSheet1", GC.Spread.Sheets.SheetType.tableSheet); * var index = spread.getSheetTabIndex("tableSheet1"); * alert(index); // 0 * ``` */ getSheetTabIndex(name: string): number; /** * Performs a hit test. * @param {number} x The x-coordinate, x relative to spread horizontal axis. * @param {number} y The y-coordinate, y relative to spread vertical axis. * @returns {Object} The hit test information. If selecting the worksheet, the worksheet information is returned. The information contains x, y, and worksheetHitInfo; * If selecting the sheetsTabStrip, the sheetsTabStrip information is returned. This information contains x, y, and tabStripHitInfo; * If selecting the horizontalScrollbar, the horizontalScrollbar information is returned. This information contains x, y, and horizontalScrollBarHitInfo; * If selecting the verticalScrollbar, the verticalScrollbar information is returned. This information contains x, y, and verticalScrollBarHitInfo; * If selecting the footerCorner, the footerCorner information is returned. This information contains x, y, and footerCornerHitInfo. * @example * ```javascript * //This example uses the hitTest method. * window.onload = function(){ * var spread = new GC.Spread.Sheets.Workbook(document.getElementById("ss"),{sheetCount:3}); * var activeSheet = spread.getActiveSheet(); * $("#ss").click(function (e) { * //Acquire cell index from mouse-clicked point of regular cells which are neither fixed rows/columns nor row/column headers. * var offset = $("#ss").offset(); * var x = e.pageX - offset.left; * var y = e.pageY - offset.top; * var target = spread.hitTest(x, y); * if(target.worksheetHitInfo) { * if(target.worksheetHitInfo.hitTestType === 0) { * str = 'corner'; * } else if (target.worksheetHitInfo.hitTestType === 1) { * str = 'colHeader'; * } else if (target.worksheetHitInfo.hitTestType === 2) { * str = 'rowHeader'; * } else { * str = 'viewport'; * } * } else if(target.tabStripHitInfo) { * if(target.tabStripHitInfo.navButton){ * str = target.tabStripHitInfo.navButton; * } else if(target.tabStripHitInfo.sheetTab) { * str = target.tabStripHitInfo.sheetTab.sheetName; * } else if(target.tabStripHitInfo.resize === true) { * str = "resize"; * } else { * str = "blank"; * } * } else if(target.horizontalScrollBarHitInfo) { * str = target.horizontalScrollBarHitInfo.element; * } else if(target.verticalScrollBarHitInfo) { * str = target.verticalScrollBarHitInfo.element; * } else if(target.footerCornerHitInfo) { * str = target.footerCornerHitInfo.element; * } * alert(str); * }); * } * ``` */ hitTest(x: number, y: number): IWorkbookHitTestInformation; /** * Imports the object state from the excel or ssJson or csv file or javascript file. * @param {File} file - The ssJson or csv or Excel file or javascript file for import. * @param {function} [successCallBack] - The success callback when import file complete, accept json as argument. * @param {function} [errorCallBack] - The error callback when import file got error. * @param {GC.Spread.Sheets.ImportOptions} [importOptions] - The import options. * @example * ```javascript * //This example uses the import method. * //Get file blob. * var file = document.getElementById("importFileName").files[0]; * // import * spread.import(file, function () { * // success callback to do something * }, function (e) { * console.log(e); // error callback * }, { * fileType: GC.Spread.Sheets.FileType.excel * }); * ``` */ import(file: File, successCallback?: Function, errorCallback?: Function, importOptions?: GC.Spread.Sheets.ImportOptions): void; /** * Inject the AI callback function or environments to the workbook. * @param {GC.Spread.Sheets.AI.AIRequestCallback | GC.Spread.Sheets.AI.IAIEnvironment} callbackOrEnv The callback function for AI request, which will send the body of the AI request ot the environments of AI request, SpreadJS will send the request to the AI service. * @example * ```javascript * // 1. inject the environment if you are not afraid of exposing your API key * workbook.injectAI({ * model: 'your model', * key: 'your-api-key', * basePath: 'your base path' * }); * * // 2. inject the request callback if you want control the request body and send to AI service by yourself. * const httpCallback = async (requestBody) => { * const AI_BATH_PATH = 'your base path'; * const AI_KEY = 'your api key'; * * requestBody.model = 'your model name'; * * const response = await fetch(AI_BASE_PATH, { * method: 'POST', * headers: { * 'Authorization': `Bearer ${AI_KEY}`, * 'Content-Type': 'application/json' * }, * body: JSON.stringify(requestBody) * }); * * if (!response.ok) { * throw new Error(`HTTP error! status: ${response.status}`); * } * return response; * }; * workbook.injectAI(httpCallback); * * // 3. inject the request callback if you want to send the request to your server and then send to AI service. * const serverCallback = async (requestBody) => { * requestBody.model = 'your model name'; * let response = await fetch('/api/queryAI', { * method: 'POST', * headers: { 'Content-Type': 'application/json' }, * body: JSON.stringify(requestBody) * }); * if (!response.ok) { * throw new Error(`HTTP error! status: ${response.status}`); * } * return response; * } * workbook.injectAI(serverCallback); * ``` */ injectAI(callbackOrEnv: GC.Spread.Sheets.AI.AIRequestCallback | GC.Spread.Sheets.AI.IAIEnvironment): void; /** * Updates the control layout information. * @example * ```javascript * //This example updates the layout. * spread.invalidateLayout(); * spread.repaint(); * ``` */ invalidateLayout(): void; /** * Get if spread paint is suspended. */ isPaintSuspended(): boolean; /** * Gets or sets the next control used by GC.Spread.Sheets.Actions.selectNextControl and GC.Spread.Sheets.Actions.moveToNextCellThenControl. * @param {HTMLElement} value The next control. The control must have a focus method. * @returns {HTMLElement|GC.Spread.Sheets.Workbook} If no value is set, returns the next control; otherwise, returns the spreadsheet. */ nextControl(value?: HTMLElement): any; /** * Loads the object state from the sjs zipped file. * @param {Blob} file - The zipped spreadsheet data file. * @param {function} successCallBack - The success callback when import file complete, accept json as argument. * @param {function} errorCallBack - The error callback when import file got error. * @param {GC.Spread.Sheets.OpenOptions} [openOptions] - The deserialization options. * @example * ```javascript * //This example uses the open method. * //Get file blob. * var file = document.getElementById("importFileName").files[0]; * // import * spread.open(file, function () { * // success callback to do something * }, function (e) { * console.log(e); // error callback * }, { openMode: GC.Spread.Sheets.OpenMode.lazy }); * ``` */ open(file: File, successCallback?: Function, errorCallback?: Function, openOptions?: GC.Spread.Sheets.OpenOptions): void; /** *Get a page info for a sheet * @param {number} sheetIndex The sheet index. * @returns {Object | Array} return a page info for a sheet, If the sheet index is ignored return all sheet's page info in an array * @example * ```javascript * var spread = new GC.Spread.Sheets.Workbook(document.getElementById("ss")); * spread.suspendPaint(); * var sheet = spread.getActiveSheet(); * for(var i=0;i<20;i++){ * for(var j=0;j<20;j++){ * sheet.setValue(i,j,"Row"+i+"_Column"+j); * } * } * var pageInfos = spread.pageInfo(0); * console.table(pageInfos.pages); * ``` */ pageInfo(sheetIndex?: number): any; /** * Gets or sets the previous control used by GC.Spread.Sheets.Actions.selectPreviousControl and GC.Spread.Sheets.Actions.moveToPreviousCellThenControl. * @param {HTMLElement} value The previous control. The control must have a focus method. * @returns {HTMLElement|GC.Spread.Sheets.Workbook} If no value is set, returns the previous control; otherwise, returns the spreadsheet. */ previousControl(value?: HTMLElement): any; /** * Prints the specified sheet. * @param {number} sheetIndex The sheet index. If the sheet index is ignored, prints all visible sheets. */ print(sheetIndex?: number): void; /** * Manually refreshes the layout and rendering of the Workbook object. * @example * ```javascript * //This example uses the refresh method. * spread.refresh(); * ``` */ refresh(): void; /** * Removes a custom function. * @param {string} name The custom function name. */ removeCustomFunction(name: string): void; /** * Removes the specified custom name. * @param {string} name The custom name. * @example * ```javascript * //This example uses the removeCustomName method. * activeSheet.setValue(0, 0, 1); * activeSheet.setValue(0, 1, 2); * activeSheet.setValue(0, 2, 3); * spread.addCustomName("customName1","=12", 0, 0); * activeSheet.setFormula(1, 0, "customName1"); * //spread.removeCustomName("customName1"); * ``` */ removeCustomName(name: string): void; /** * Removes a style from the Workbook named styles collection which has the specified name. * @param {string} name The name of the style to remove. * @example * ```javascript * var namedStyle = new GC.Spread.Sheets.Style(); * namedStyle.name = "style1"; * namedStyle.backColor = "green"; * spread.addNamedStyle(namedStyle); * activeSheet.setStyleName(1, 1, "style1"); // cell(1,1)'s backColor is green. * activeSheet.setStyleName(2, 1, "style1"); * var style = spread.getNamedStyle("style1"); * style.foreColor = "red"; // the namedStyle's foreColor is red. * activeSheet.repaint(); // the foreColor of the cell(1,1) and cell(2,1) is red. * activeSheet.getCell(1,1).value("test"); * $("#button1").click(function () { * spread.removeNamedStyle("style1"); * }); * ``` */ removeNamedStyle(name: string): void; /** * Removes the specified sheet. * @param {number} index The index of the sheet to remove. * @example * ```javascript * //This example removes a sheet from the spreadsheet. * spread.setSheetCount(5); * spread.removeSheet(0); * ``` */ removeSheet(index: number): void; /** * Removes the specified sheet tab by index or name. * @param {number | string} indexOrName The index or name of the sheet tab to remove. */ removeSheetTab(indexOrName: number | string): void; /** * Removes a SparklineEx from the SparklineEx collection. * @param {string} name The name of the SparklineEx to remove. */ removeSparklineEx(name: string): void; /** * Repaints the Workbook control. * @example * ```javascript * //This example updates the layout. * spread.invalidateLayout(); * spread.repaint(); * ``` */ repaint(): void; /** * Resumes the calculation service. * @param {boolean} recalcAll Specifies whether to recalculate all formulas. * @example * ```javascript * //This example uses the resumeCalcService method. * spread.suspendCalcService(false); * activeSheet.setValue(0,0,1); * activeSheet.setValue(0,1,2); * activeSheet.setValue(0,2,10); * activeSheet.getCell(1,1).formula("=SUM(A1:C1)"); * spread.resumeCalcService(true); * ``` */ resumeCalcService(recalcAll?: boolean): void; /** * Resumes the event. * @example * ```javascript * //This example suspends and resumes the event. * activeSheet.bind(GC.Spread.Sheets.Events.CellChanged, function (sender, args) { * if (args.propertyName === "value") { * alert(activeSheet.getValue(args.row, args.col)); * } * }); * spread.suspendEvent(); * activeSheet.setValue(0, 0, "111"); * spread.resumeEvent(); * activeSheet.setValue(1, 1, "222"); * ``` */ resumeEvent(): void; /** * Resumes the paint of active sheet and tab strip. */ resumePaint(): void; /** * Saves the spreadJS state to a sjs file. * @param {function} successCallBack - The success callback when save spreadJS state complete, accept Blob as argument. * @param {function} errorCallBack - The error callback when save spreadJS state got error. * @param {GC.Spread.Sheets.SaveOptions} saveOptions - The save options. * @example * ```javascript * spread.save(function (blob) { * // save blob to a file * saveAs(blob, fileName); * }, function (e) { * console.log(e); * }, { includeUnusedNames: false }); * ``` */ save(successCallBack?: Function, errorCallBack?: Function, saveOptions?: GC.Spread.Sheets.SaveOptions): void; /** * Exports the specified sheet to PDF. * @param {function} successCallback Call this function after successfully export. function (blob) {}. * @param {function} errorCallback Call this function if an error occurs. The exception parameter object structure { errorCode: GC.Spread.Sheets.PDF.ErrorCode, errorMessage: string}. * @param {Object} [options] The options for export PDF. * @param {string} [options.creator] The name of the application (for example, Adobe FrameMaker\xae) that created the original document from which it was converted. * @param {string} [options.title] The document\u2019s title. * @param {string} [options.author] The name of the person who created the document. * @param {string} [options.keywords] Keywords associated with the document. * @param {string} [options.subject] The subject of the document. * @param {number} sheetIndex The sheet index. If the sheet index is ignored, exports all visible sheets. */ savePDF(successCallback: Function, errorCallback: Function, options?: Object, sheetIndex?: number): void; /** * Searches the text in the cells in the specified sheet for the specified string with the specified criteria. * @param {GC.Spread.Sheets.Search.SearchCondition} searchCondition The search conditions. * @returns {GC.Spread.Sheets.Search.SearchResult} The search result. * @example * ```javascript * //This example searches the active sheet using the specified search condition. * activeSheet.getCell(2,3).value("testSearch"); * var searchCondition = new GC.Spread.Sheets.Search.SearchCondition(); * searchCondition.searchString = "testSearch"; * searchCondition.startSheetIndex = spread.getActiveSheetIndex(); * searchCondition.endSheetIndex = spread.getActiveSheetIndex(); * searchCondition.searchOrder = GC.Spread.Sheets.Search.SearchOrder.nOrder; * searchCondition.searchTarget = GC.Spread.Sheets.Search.SearchFoundFlags.cellText; * searchCondition.searchFlags = GC.Spread.Sheets.Search.SearchFlags.ignoreCase| GC.Spread.Sheets.Search.SearchFlags.useWildCards; * var searchresult= spread.search(searchCondition); * var str ="[searchFoundFlag:"+ searchresult.searchFoundFlag+",\r\n foundSheetIndex:"+searchresult.foundSheetIndex+",foundRowIndex:" + * searchresult.foundRowIndex+", foundColumnIndex:"+searchresult.foundColumnIndex+", foundString:"+searchresult.foundSheetIndex+"]"; * alert(str); * ``` */ search(searchCondition: GC.Spread.Sheets.Search.SearchCondition): GC.Spread.Sheets.Search.SearchResult; /** * Sets the active sheet by name. * @param {string} name The name of the sheet to make the active sheet. * @example * ```javascript * //This example sets the active sheet. * spread.setSheetCount(3); * spread.setActiveSheet("Sheet2"); * ``` */ setActiveSheet(name: string): void; /** * Sets the active sheet index for the control. * @param {number} value The active sheet index. * @example * ```javascript * //This example uses the setActiveSheetIndex method. * spread.setActiveSheetIndex(1); * ``` */ setActiveSheetIndex(value: number): void; /** * Sets the active sheet tab by index or name. * @param {number | string} indexOrName The index or name of the sheet tab to make the active sheet tab. */ setActiveSheetTab(indexOrName: number | string): void; /** * Sets the number of sheets. * @param {number} count The number of sheets. * @example * ```javascript * spread.setSheetCount(5); * ``` */ setSheetCount(count: number): void; /** * Gets or sets the index of the first sheet to display in the spreadsheet. * @param {number} value The index of the first sheet to display in the spreadsheet. * @returns {number|GC.Spread.Sheets.Workbook} If no value is set, returns the index of the first sheet displayed in the spreadsheet; otherwise, returns the spreadsheet. */ startSheetIndex(value?: number): any; /** * Suspends the calculation service. * @param {boolean} ignoreDirty Specifies whether to invalidate the dependency cells. * @example * ```javascript * //This example uses the suspendCalcService method. * spread.suspendCalcService(false); * activeSheet.setValue(0,0,1); * activeSheet.setValue(0,1,2); * activeSheet.setValue(0,2,10); * activeSheet.getCell(1,1).formula("=SUM(A1:C1)"); * spread.resumeCalcService(true); * ``` */ suspendCalcService(ignoreDirty?: boolean): void; /** * Suspends the event. * @example * ```javascript * //This example suspends and resumes the event. * activeSheet.bind(GC.Spread.Sheets.Events.CellChanged, function (sender, args) { * if (args.propertyName === "value") { * alert(activeSheet.getValue(args.row, args.col)); * } * }); * spread.suspendEvent(); * activeSheet.setValue(0, 0, "111"); * spread.resumeEvent(); * activeSheet.setValue(1, 1, "222"); * ``` */ suspendEvent(): void; /** * Suspends the paint of active sheet and tab strip. */ suspendPaint(): void; /** * Saves the object state to a JSON string. * @param {GC.Spread.Sheets.ISerializationOption} serializationOption - The serialization options. * @returns {Object} The spreadsheet data. * @example * ```javascript * activeSheet.getCell(0,0).value(123); * var jsonStr = null; * //export * jsonStr = JSON.stringify(spread.toJSON()); * //import * spread.fromJSON(JSON.parse(jsonStr)); * alert(jsonStr); * ``` */ toJSON(serializationOption?: GC.Spread.Sheets.ISerializationOption): Object; /** * Removes the binding of an event to Workbook. * @param {string} type The event type. * @param {Function} fn Specifies the function to run when the event occurs. * @example * ```javascript * //This example removes the event binding. * activeSheet.bind(GC.Spread.Sheets.Events.CellChanged, function (sender, args) { * if (args.propertyName === "value") { * alert(activeSheet.getValue(args.row, args.col)); * } * }); * activeSheet.setValue(0, 0, "111"); * spread.unbind(GC.Spread.Sheets.Events.CellChanged); * //spread.unbindAll(); //cancel monitoring of all events. * activeSheet.setValue(1, 0, "222"); * activeSheet.setValue(2, 0, "333"); * activeSheet.setValue(3, 0, "444"); * ``` */ unbind(type: string, fn?: Function): void; /** * Removes the binding of all events to Workbook. * @example * ```javascript * //This example removes the event binding. Uncomment the unbindAll method to remove all event binding. * activeSheet.bind(GC.Spread.Sheets.Events.CellChanged, function (sender, args) { * if (args.propertyName === "value") { * alert(activeSheet.getValue(args.row, args.col)); * } * }); * activeSheet.setValue(0, 0, "111"); * spread.unbind(GC.Spread.Sheets.Events.CellChanged); * //spread.unbindAll(); //cancel monitoring of all events. * activeSheet.setValue(1, 0, "222"); * activeSheet.setValue(2, 0, "333"); * activeSheet.setValue(3, 0, "444"); * ``` */ unbindAll(): void; /** * Gets the undo manager. * @returns {GC.Spread.Commands.UndoManager} The undo manager. */ undoManager(): GC.Spread.Commands.UndoManager; /** * Sets or update the data of external source with the workbook json or the external values from the successCallback result of GC.Spread.Sheets.IO.getPartialValues. * @param {string | GC.Spread.Sheets.ExternalPartialValues} linkInfo - The string type is the file name of the external source, mostly ends with ".xlsx". Another type should be an array of external partial values get from the callback of GC.Spread.Sheets.IO.getPartialValues. * @param {object} [data] - The json data of the external source. Can be spread.toJSON() or the value can be fetched by data[sheetName][rowIndex][colIndex]. Only required when linkInfo is string type. * @param {string} [filePath] - The file path or the link of the file, can be empty if don't have duplicated linkNames. * @param {boolean} isMergeUpdate - Indicates whether to update by merging. If it's not true, the whole external sheet data will be overwritten. * @example * ```javascript * // This example sets the external source with workbook JSON. * spread.getActiveSheet().setFormula(0, 0, "[calc.xlsx]Sheet1!A1"); // spread cell A1 value is #REF! * spread2.getActiveSheet().setFormula(0, 0, "=123+1"); \xa0// spread2 cell A1 value is 124 * spread.updateExternalReference("calc.xlsx", spread2.toJSON()); // spread cell A1 value is 124 * // Set the data with simple JSON data: * spread.getActiveSheet().setFormula(0, 0, "=SUM([calc.xlsx]Sheet1!A1:B2"); \xa0// spread cell A1 value is #REF! * spread.updateExternalReference("calc.xlsx", {"Sheet1":[[1, 2],[1, 3]]}); \xa0// spread cell A1 value is 7 * spread.updateExternalReference("calc.xlsx", {"Sheet1":{0:{0:10, 1:10}, 1:{0:10, 1:10}}}); \xa0// spread cell A1 value is 40 * spread.updateExternalReference("calc.xlsx", {"Sheet1":{1:{0:2, 1:2}}}, null, true); \xa0// spread cell A1 value is 24 after the merge update. * // This example sets the external values with the successCallback result of GC.Spread.Sheets.IO.getPartialValues * let refList = spread.getExternalReferences(true); * GC.Spread.Sheets.IO.getPartialValues(refList, getFile, (externalValues) => { * // successCallback * spread.updateExternalReference(externalValues); * }, (errorMsg) => { * // errorCallback * console.log(errorMsg); * }); * ``` */ updateExternalReference(linkInfo: string | GC.Spread.Sheets.ExternalPartialValues, data?: object, filePath?: string, isMergeUpdate?: boolean): void; } export class Worksheet{ /** * Represents a worksheet. * @class * @param {string} name The name of the Worksheet. */ constructor(name: string); /** * Indicates whether to generate columns automatically while binding data context. * @type {boolean} * @example * ```javascript * //This example sets a data source for the sheet. * var test = [ * { "Series0": 2, "Series1": 1 }, * { "Series0": 4, "Series1": 2 }, * { "Series0": 3, "Series1": 4 } * ]; * activeSheet.autoGenerateColumns = true; * activeSheet.setDataSource(test, true); * ``` */ autoGenerateColumns: boolean; /** The cellState manager. * @type {GC.Spread.Sheets.CellState.CellStateManager} */ cellStates: GC.Spread.Sheets.CellState.CellStateManager; /** * Chart manager for the sheet. * @type {GC.Spread.Sheets.Charts.ChartCollection} * @example * ```javascript * //This example shows how to add a chart. * var dataRange = "A1:D4"; * var chart = activeSheet.charts.add('Chart1', GC.Spread.Sheets.Charts.ChartType.columnClustered, 250, 20, 600, 400, dataRange); * ``` */ charts: GC.Spread.Sheets.Charts.ChartCollection; /** * Indicates the column range group. * @type {GC.Spread.Sheets.Outlines.Outline} */ columnOutlines: GC.Spread.Sheets.Outlines.Outline; /** * Comment manager for the sheet. * @type {GC.Spread.Sheets.Comments.CommentManager} */ comments: GC.Spread.Sheets.Comments.CommentManager; /** * Conditional format manager for the sheet. * @type {GC.Spread.Sheets.ConditionalFormatting.ConditionalFormats} * @example * ```javascript * //This example creates a rule. * var style = new GC.Spread.Sheets.Style(); * style.backColor = "red"; * var rule = new GC.Spread.Sheets.ConditionalFormatting.NormalConditionRule(); * rule.ruleType(GC.Spread.Sheets.ConditionalFormatting.RuleType.cellValueRule); * rule.ranges([new GC.Spread.Sheets.Range(0,0,5,1)]); * rule.operator(GC.Spread.Sheets.ConditionalFormatting.ComparisonOperators.between); * rule.style(style); * rule.value1(2); * rule.value2(100); * activeSheet.conditionalFormats.addRule(rule); * activeSheet.setValue(0,0,1,3); * activeSheet.setValue(1,0,45,3); * var ruletest = activeSheet.conditionalFormats.getRules(); * alert(ruletest[0].style().backColor); * ``` */ conditionalFormats: ConditionalFormatting.ConditionalFormats; /** The datachart manager. * @type {GC.Spread.Sheets.DataCharts.DataChartManager} * @example * ```javascript * //This example creates a datachart. * var datacharts = sheet.dataCharts; * var datachart = datacharts.add('datachart1', 250, 20, 600, 400, GC.Spread.Sheets.DataCharts.DataChartType.column); * ``` */ dataCharts: GC.Spread.Sheets.DataCharts.DataChartManager; /** * Data range manager for the sheet. * @type {GC.Spread.Sheets.DataRange.DataRangeManager} */ dataRanges: GC.Spread.Sheets.DataRange.DataRangeManager; /** * Indicates the default row height and column width of the sheet. * @type {Object} * @example * ```javascript * //This example sets the default row height and column width. * activeSheet.suspendPaint(); * activeSheet.defaults.rowHeight = 40; * activeSheet.defaults.colWidth = 30; * activeSheet.resumePaint(); * ``` */ defaults: GC.Spread.Sheets.ISheetDefaultOption; /** * FloatingObject manager for the sheet. * @type {GC.Spread.Sheets.FloatingObjects.FloatingObjectCollection} * @example * ```javascript * //This example creates a floating object. * var customFloatingObject = new GC.Spread.Sheets.FloatingObjects.FloatingObject("f1", 10, 10, 60, 64); * var btn = document.createElement('button'); * btn.style.width = "60px"; * btn.style.height = "30px"; * btn.innerText = "button"; * customFloatingObject.content(btn); * activeSheet.floatingObjects.add(customFloatingObject); * ``` */ floatingObjects: GC.Spread.Sheets.FloatingObjects.FloatingObjectCollection; /** * Indicates the options of the sheet. * @type {Object} * @property {boolean} allowCellOverflow - Indicates whether data can overflow into adjacent empty cells. * @property {boolean} showFormulas - Indicates whether display the formulas string not the formula result. * @property {boolean} showZeros - Indicates whether display the 0 in cells containing zero value. Default is true. * @property {string} sheetTabColor - A color string used to represent the sheet tab color, such as "red", "#FFFF00", "rgb(255,0,0)", "Accent 5", and so on. * @property {string} frozenlineColor - A color string used to represent the frozen line color, such as "red", "#FFFF00", "rgb(255,0,0)", "Accent 5", and so on. * @property {GC.Spread.Sheets.ClipboardPasteOptions} clipBoardOptions - The clipboard option. * @property {Object} gridline - The grid line's options. * @property {string} gridline.color - The grid line color * @property {boolean} gridline.showVerticalGridline - Whether to show the vertical grid line. * @property {boolean} gridline.showHorizontalGridline - Whether to show the horizontal grid line. * @property {boolean} rowHeaderVisible - Indicates whether the row header is visible. * @property {boolean} colHeaderVisible - Indicates whether the column header is visible. * @property {GC.Spread.Sheets.HeaderAutoText} rowHeaderAutoText - Indicates whether the row header displays letters or numbers or is blank. * @property {GC.Spread.Sheets.HeaderAutoText} colHeaderAutoText - Indicates whether the column header displays letters or numbers or is blank. * @property {number} rowHeaderAutoTextIndex - Specifies which row header column displays the automatic text when there are multiple row header columns. * @property {number} colHeaderAutoTextIndex - Specifies which column header row displays the automatic text when there are multiple column header rows. * @property {boolean} isProtected - Indicates whether cells on this sheet that are marked as protected cannot be edited. * @property {Object} protectionOptions - A value that indicates the elements that you want users to be able to change. * @property {boolean} [protectionOptions.allowSelectLockedCells] - True or undefined if the user can select locked cells. * @property {boolean} [protectionOptions.allowSelectUnlockedCells] - True or undefined if the user can select unlocked cells. * @property {boolean} [protectionOptions.allowSort] - True if the user can sort ranges. * @property {boolean} [protectionOptions.allowFilter] - True if the user can filter ranges. * @property {boolean} [protectionOptions.allowEditObjects] - True if the user can edit floating objects. * @property {boolean} [protectionOptions.allowResizeRows] - True if the user can resize rows. * @property {boolean} [protectionOptions.allowResizeColumns] - True if the user can resize columns. * @property {boolean} [protectionOptions.allowDragInsertRows] - True if the user can drag to insert rows. * @property {boolean} [protectionOptions.allowDragInsertColumns] - True if the user can drag to insert columns. * @property {boolean} [protectionOptions.allowInsertRows] - True if the user can insert rows. * @property {boolean} [protectionOptions.allowInsertColumns] - True if the user can insert columns. * @property {boolean} [protectionOptions.allowDeleteRows] - True if the user can delete rows. * @property {boolean} [protectionOptions.allowDeleteColumns] - True if the user can delete columns. * @property {boolean} [protectionOptions.allowOutlineColumns] - True if the user can expand or collapse the column groups. * @property {boolean} [protectionOptions.allowOutlineRows] - True if the user can expand or collapse the row groups. * @property {string} selectionBackColor - The selection's background color for the sheet. * @property {string} selectionBorderColor - The selection's border color for the sheet. * @property {Object} sheetAreaOffset - The sheetAreaOffset's options. * @property {number} [sheetAreaOffset.left] - The offset left of sheet from host. * @property {number} [sheetAreaOffset.top] - The offset top of sheet from host. * @property {boolean} keepUnknownFormulas - Indicates whether the unknown formulas could be included in sheet json data. * @property {GC.Spread.Sheets.IAddRowButtonOption} [addRowButtonOption] - The add row button's options. * @property {GC.Spread.Sheets.IAddColumnButtonOption} [addColumnButtonOption] - The add column button's options. * @property {boolean} rightToLeft - Indicates whether the sheet is rendered from right to left. * @property {string} backgroundImage - Indicates the URL of the background image. * @example * ```javascript * sheet.setRowCount(2,GC.Spread.Sheets.SheetArea.colHeader); * sheet.setColumnCount(2,GC.Spread.Sheets.SheetArea.rowHeader); * sheet.setValue(0, 2,"Column",GC.Spread.Sheets.SheetArea.colHeader); * sheet.options.colHeaderAutoTextIndex = 1; * sheet.options.colHeaderAutoText = GC.Spread.Sheets.HeaderAutoText.numbers; * ``` */ options: GC.Spread.Sheets.IWorksheetOptions; /** * Gets the outline column for the sheet. * @returns {GC.Spread.Sheets.OutlineColumn.OutlineColumn} */ outlineColumn: GC.Spread.Sheets.OutlineColumn.OutlineColumn; /** * Picture manager for the sheet. * @type {GC.Spread.Sheets.FloatingObjects.FloatingObjectCollection} * @deprecated since version 15.2.0, please use 'sheet.shapes' instead * @example * ```javascript * //This example adds a picture. * activeSheet.pictures.add("f2","Event.png",2,2,10,10); * var picture = activeSheet.pictures.get("f2"); * picture.pictureStretch(GC.Spread.Sheets.ImageLayout.center); * picture.backColor("Blue"); * picture.borderWidth(2); * picture.borderColor("Red"); * picture.borderStyle("dotted"); * picture.borderRadius(5); * ``` */ pictures: GC.Spread.Sheets.FloatingObjects.FloatingObjectCollection; /** The pivot table manager. * @type {GC.Spread.Sheets.PivotTableManager} * @example * ```javascript * //This example creates a pivot table. * var pivotTableManager = sheet.pivotTables; * var sourceData = [["Date","Buyer","Type","Amount"],["01-Jan","Mom","Fuel",74],["15-Jan","Mom","Food",235],["17-Jan","Dad","Sports",20],["21-Jan","Kelly","Books",125],["02-Feb","Mom","Food",235],["20-Feb","Kelly","Music",20],["25-Feb","Kelly","Tickets",125]]; * var options = {showRowHeader: true, showColumnHeader: true}; * var myPivotTable = pivotTableManager.add("pivotTable_1", sourceData , 1, 1, GC.Spread.Pivot.PivotTableLayoutType.tabular, GC.Spread.Pivot.PivotTableThemes.medium2, option); * ``` */ pivotTables: GC.Spread.Sheets.PivotTableManager; /** * Indicates the row range group. * @type {GC.Spread.Sheets.Outlines.Outline} */ rowOutlines: GC.Spread.Sheets.Outlines.Outline; /** * Shape manager for the sheet. * @type {GC.Spread.Sheets.Shapes.ShapeCollection} * @example * ```javascript * //This example shows how to add a shape. * var shape = activeSheet.shapes.add("shape1", GC.Spread.Sheets.Shapes.AutoShapeType.heart, 100, 50, 100, 150); * ``` */ shapes: GC.Spread.Sheets.Shapes.ShapeCollection; /** The slicer manager. * @type {GC.Spread.Sheets.Slicers.SlicerCollection} * @example * ```javascript * //This example adds a slicer. * //create a table * datas = [ * ["1", "NewYork", "1968/6/8", "80", "180"], * ["4", "NewYork", "1972/7/3", "72", "168"], * ["4", "NewYork", "1964/3/2", "71", "179"], * ["5", "Washington", "1972/8/8","80", "171"], * ["6", "Washington", "1986/2/2", "89", "161"], * ["7", "Washington", "2012/2/15", "71", "240"]]; * var table = activeSheet.tables.addFromDataSource("table1", 2, 2, datas); * dataColumns = ["Name", "City", "Birthday", "Weight", "Height"]; * table.setColumnName(0, dataColumns[0]); * table.setColumnName(1, dataColumns[1]); * table.setColumnName(2, dataColumns[2]); * table.setColumnName(3, dataColumns[3]); * table.setColumnName(4, dataColumns[4]); * var style1 = new GC.Spread.Sheets.Slicers.SlicerStyles.light4(); * //add a slicer to the sheet and return the slicer instance. * var slicer = activeSheet.slicers.add("slicer1",table.name(),"Height"); * //change the slicer properties. * slicer.position(new GC.Spread.Sheets.Point(100, 200)); * slicer.disableResizingAndMoving(true); * slicer.style(style1); * ``` */ slicers: GC.Spread.Sheets.Slicers.SlicerCollection; /** The table manager. * @type {GC.Spread.Sheets.Tables.TableManager} * @example * ```javascript * //This example creates a table. * activeSheet.tables.add("Table1", 0, 0, 3, 3, GC.Spread.Sheets.Tables.TableThemes.dark1); * activeSheet.getCell(0,0).text("Name"); * activeSheet.getCell(0,1).text("Value"); * activeSheet.getCell(0,2).text("T/F"); * activeSheet.getCell(1,0).text("AW"); * activeSheet.getCell(1,1).text("5"); * activeSheet.getCell(1,2).text("T"); * ``` */ tables: GC.Spread.Sheets.Tables.TableManager; /** * Adds the column or columns to the data model at the specified index. * @param {number} col Column index at which to add the new columns. * @param {number} count The number of columns to add. * @param {GC.Spread.Sheets.SheetArea} [sheetArea] The sheet area. If this parameter is not given, it defaults to `viewport`. * @example * ```javascript * //This example adds columns. * sheet.setValue(0, 0, "value"); * sheet.addRows(0, 2); * sheet.addColumns(0, 2); * sheet.setRowHeight(0, 50.0,GC.Spread.Sheets.SheetArea.viewport); * sheet.setColumnWidth(0, 150.0,GC.Spread.Sheets.SheetArea.viewport); * sheet.getRange(0, -1, 1, -1,GC.Spread.Sheets.SheetArea.viewport).backColor("Gray"); * sheet.getRange(-1, 0, -1, 1,GC.Spread.Sheets.SheetArea.viewport).backColor ("Brown"); * ``` */ addColumns(col: number, count: number, sheetArea?: GC.Spread.Sheets.SheetArea): void; /** * Adds a custom function. * @param {GC.Spread.CalcEngine.Functions.Function} fn The function to add. */ addCustomFunction(fn: GC.Spread.CalcEngine.Functions.Function): void; /** * Adds a custom name. * @param {string} name The custom name. * @param {string} formula The formula. * @param {number} baseRow The row index. * @param {number} baseCol The column index. * @param {string} [comment] The comment. * @param {boolean} [isReadOnly] The custom name could be editable. * @example * ```javascript * //This example creates custom names. * sheet.setValue(0, 0, 1); * sheet.setValue(0, 1, 2); * sheet.setValue(0, 2, 3); * sheet.addCustomName("customName1","=12", 0, 0); * sheet.addCustomName("customName2","Average(20,45)", 0, 0); * sheet.addCustomName("customName3", "=$A$1:$C$1", 0, 0); * sheet.setFormula(1, 0, "customName1"); * sheet.setFormula(1, 1, "customName2"); * sheet.setFormula(1, 2, "sum(customName3)"); * ``` */ addCustomName(name: string, formula: string, baseRow: number, baseCol: number, comment?: string, isReadOnly?: boolean): void; /** * Adds a style to the Worksheet named styles collection. * @param {GC.Spread.Sheets.Style} style The style to be added. * @example * ```javascript * var namedStyle = new GC.Spread.Sheets.Style(); * namedStyle.name = "style1"; * namedStyle.backColor = "green"; * activeSheet.addNamedStyle(namedStyle); * activeSheet.setStyleName(1, 1, "style1"); // cell(1,1)'s backColor is green. * activeSheet.setStyleName(2, 1, "style1"); * var style = activeSheet.getNamedStyle("style1"); * style.foreColor = "red"; // the namedStyle's foreColor is red. * activeSheet.repaint(); // the foreColor of the cell(1,1) and cell(2,1) is red. * activeSheet.getCell(1,1).value("test"); * $("#button1").click(function () { * activeSheet.removeNamedStyle("style1"); * }); * ``` */ addNamedStyle(style: GC.Spread.Sheets.Style): void; /** * Adds rows in this worksheet. * @param {number} row The index of the starting row. * @param {number} count The number of rows to add. * @param {GC.Spread.Sheets.SheetArea} [sheetArea] The sheet area. If this parameter is not given, it defaults to `viewport`. * @example * ```javascript * //This example adds rows. * sheet.setValue(0, 0, "value"); * sheet.addRows(0, 2); * sheet.addColumns(0, 2); * sheet.setRowHeight(0, 50.0,GC.Spread.Sheets.SheetArea.viewport); * sheet.setColumnWidth(0, 150.0,GC.Spread.Sheets.SheetArea.viewport); * sheet.getRange(0, -1, 1, -1,GC.Spread.Sheets.SheetArea.viewport).backColor("Gray"); * sheet.getRange(-1, 0, -1, 1,GC.Spread.Sheets.SheetArea.viewport).backColor ("Brown"); * ``` */ addRows(row: number, count: number, sheetArea?: GC.Spread.Sheets.SheetArea): void; /** * Adds a cell or cells to the selection. * @param {number} row The row index of the first cell to add. * @param {number} column The column index of the first cell to add. * @param {number} rowCount The number of rows to add. * @param {number} columnCount The number of columns to add. * @example * ```javascript * //This example adds a selection and uses the selection in a rule. * sheet.setValue(0,0, 1,3); * sheet.setValue(1,0, 50,3); * sheet.setValue(2,0, 100,3); * sheet.setValue(3,0, 2,3); * sheet.setValue(4,0, 60,3); * sheet.setValue(5,0, 90,3); * sheet.setValue(6,0, 3,3); * sheet.setValue(7,0, 40,3); * sheet.setValue(8,0, 70,3); * sheet.setValue(9,0, 5,3); * sheet.setValue(10,0, 35,3); * sheet.addSelection(0,0,11,1); * sheet.conditionalFormats.add3ScaleRule(1, 10, "red", 0, 50, "blue",2, 100, "yellow", sheet.getSelections()); * ``` */ addSelection(row: number, column: number, rowCount: number, columnCount: number): void; /** * Adds a span of cells to this sheet in the specified sheet area. * @param {number} row The row index of the cell at which to start the span. * @param {number} column The column index of the cell at which to start the span. * @param {number} rowCount The number of rows to span. * @param {number} colCount The number of columns to span. * @param {GC.Spread.Sheets.SheetArea} [sheetArea] The sheet area. If this parameter is not given, it defaults to `viewport`. * @example * ```javascript * //This example creates cell spans. * sheet.setRowCount(4,1); * sheet.setColumnCount(4,2); * sheet.addSpan(0,0,3,3,GC.Spread.Sheets.SheetArea.colHeader); * sheet.addSpan(0,0,3,3,GC.Spread.Sheets.SheetArea.rowHeader); * sheet.addSpan(0,0,3,3,GC.Spread.Sheets.SheetArea.viewport); * ``` */ addSpan(row: number, col: number, rowCount: number, colCount: number, sheetArea?: GC.Spread.Sheets.SheetArea): void; /** * Adds a lot of spans to this sheet in the specified sheet area. * @param {Array} spans The span ranges, each range contains row, col, rowCount, colCount. * @param {GC.Spread.Sheets.SheetArea} [sheetArea] The sheet area. If this parameter is not given, it defaults to `viewport`. * @example * ```javascript * //This example creates cell spans. * sheet.addSpans([{row: 0, col: 0, rowCount: 2, colCount: 2}, {row: 3, col: 0, rowCount: 3, colCount: 3}, {row: 7, col: 0, rowCount: 4, colCount: 4}], GC.Spread.Sheets.SheetArea.viewport); * ``` */ addSpans(spans: GC.Spread.Sheets.IRange[], sheetArea?: GC.Spread.Sheets.SheetArea): void; /** * Automatically fits the viewport column. * @property {number} column The column index. * @example * ```javascript * //This example sets the column width based on the text. * activeSheet.setValue(0, 1, "testing"); * activeSheet.autoFitColumn(1); * ``` */ autoFitColumn(column: number): void; /** * Automatically fits the viewport row. * @property {number} row The row index. * @example * ```javascript * //This example sets the row height based on the text. * activeSheet.setValue(0, 1, "testing\r\nmultiple\r\nlines"); * activeSheet.getCell(0,1).wordWrap(true); * activeSheet.autoFitRow(0); * ``` */ autoFitRow(row: number): void; /** * Applies auto merge for a range. * @param {GC.Spread.Sheets.Range} range The auto merge range. * @param {GC.Spread.Sheets.AutoMerge.AutoMergeDirection} direction The auto merge direction. If this parameter is not provided, it defaults to `column`. Specially, if the direction is `none`, the auto merge for the range will be canceled. * @param {GC.Spread.Sheets.AutoMerge.AutoMergeMode} mode The auto merge mode. If this parameter is not provided, it defaults to `free`. * @param {GC.Spread.Sheets.SheetArea} sheetArea The sheet area of the auto merge range. If this parameter is not provided, it defaults to `viewport`. * @param {GC.Spread.Sheets.AutoMerge.SelectionMode} selectionMode The auto merge selection mode. If this parameter is not provided, it defaults to `source`. * @returns {Array} If no parameter is provided, returns all auto merge range infos of current worksheet. Each range info contains range, direction, mode, sheetArea, selection mode. * @example * ```javascript * var range = new GC.Spread.Sheets.Range(-1, 0, -1, 1); * sheet.autoMerge(range); * ``` */ autoMerge(range: GC.Spread.Sheets.Range, direction?: GC.Spread.Sheets.AutoMerge.AutoMergeDirection, mode?: GC.Spread.Sheets.AutoMerge.AutoMergeMode, sheetArea?: GC.Spread.Sheets.SheetArea, selectionMode?: GC.Spread.Sheets.AutoMerge.SelectionMode): GC.Spread.Sheets.AutoMerge.IRangeInfo[]; /** * Get or set the background image of the worksheet, if there is no parameters, indicates return the background image of the worksheet. * @param {src} src the url of the background image. * @returns {string | null} Returns url of the background image of the worksheet. * @example * ```javascript * activeSheet.backgroundImage('./image/background.jpg'); * let imageUrl = activeSheet.backgroundImage(); * alert(imageUrl); * ``` */ backgroundImage(src?: string): string | null; /** * Binds an event to the sheet. * @param {string} type The event type. * @param {Object} data Optional. Specifies additional data to pass along to the function. * @param {Function} fn Specifies the function to run when the event occurs. * @example * ```javascript * //This example binds events. * sheet.bind(GC.Spread.Sheets.Events.LeftColumnChanged,function(event,data) * { * var str = "----------------------------------------\n"; * var title = "Event [LeftColumnChanged ] Fired"; * str = str.substr(0, 4) + title + str.substr(4 + title.length); * if (typeof data == "object") { * for (var key in data) { * str += key + " : " + data[key] + "\n"; * } * } else { * str += data + "\n"; * } * alert(str); * }); * sheet.bind(GC.Spread.Sheets.Events.TopRowChanged,function(event,data) * { * var str = "----------------------------------------\n"; * var title = "Event [TopRowChanged] Fired"; * str = str.substr(0, 4) + title + str.substr(4 + title.length); * if (typeof data == "object") { * for (var key in data) { * str += key + " : " + data[key] + "\n"; * } * } else { * str += data + "\n"; * } * alert(str); * }); * ``` */ bind(type: string, data?: any, fn?: Function): void; /** * Binds the column using the specified data field. * @param {number} index The column index. * @param {string|Object} column Column information with data field. If its type is string, it is regarded as name. * @example * ```javascript * var test = [ * {"Series0":2,"Series1":1}, * {"Series0":4,"Series1":2}, * {"Series0":3,"Series1":4} * ]; * sheet.setDataSource(test); * sheet.bindColumn(1,"Series0"); * sheet.bindColumn(0,"Series1"); * ``` */ bindColumn(index: number, column: string | GC.Spread.Sheets.IColumn): void; /** * Binds the columns using the specified data fields. * @param {Array} columns The array of column information with data fields. If an item's type is string, the item is regarded as name. * @example * ```javascript * var datasource = [ * { name: "Alice", age: 27, birthday: "1985/08/31", position: "Beijing", isMarried: false}, * { name: "Aimee", age: 28, birthday: "1984/07/31", position: "Xi'An", isMarried: true}, * { name: "Charles", age: 29, birthday: "1983/03/31", position: "ShangHai", isMarried: true}, * ]; * var colInfos = [ * { name: "name", displayName: "Name", size: 70, pageBread: false}, * { name: "age", displayName: "Age", size: 40, resizable: false }, * { name: "birthday", displayName: "Birthday", formatter: "d/M/yy", size: 120 }, * { name: "position", displayName: "Position", size: 50, visible: true, value: function (item){ * return 'China ' + item['position']; * }}, * { name: "isMarried", displayName: "IsMarried", size: 50, visible: true, cellType: new GC.Spread.Sheets.CellTypes.CheckBox()} * ]; * activeSheet.autoGenerateColumns = true; * activeSheet.setDataSource(datasource); * activeSheet.bindColumns(colInfos); * ``` */ bindColumns(columns: GC.Spread.Sheets.IColumn[]): void; /** * Clears the specified area. * @param {number} row The start row index. * @param {number} column The start column index. * @param {number} rowCount The number of rows to clear. * @param {number} columnCount The number of columns to clear. * @param {GC.Spread.Sheets.SheetArea} area The area to clear. * @param {GC.Spread.Sheets.StorageType} storageType The clear type. * @example * ```javascript * //This example clears the data from the specified range. * activeSheet.getCell(0,0).value("A1"); * activeSheet.clear(0,0,3,3,GC.Spread.Sheets.SheetArea.viewport,GC.Spread.Sheets.StorageType.data); * ``` */ clear(row: number, column: number, rowCount: number, colCount: number, area: GC.Spread.Sheets.SheetArea, storageType: GC.Spread.Sheets.StorageType): void; /** * Clears all custom functions. * @example * ```javascript * //This example clears the custom functions from the active sheet. * activeSheet.clearCustomFunctions(); * ``` */ clearCustomFunctions(): void; /** * Clears custom names. * @example * ```javascript * //This example creates custom names and then clears them. * activeSheet.setValue(0, 0, 1); * activeSheet.setValue(0, 1, 2); * activeSheet.setValue(0, 2, 3); * activeSheet.addCustomName("customName1","=12", 0, 0); * activeSheet.addCustomName("customName2","Average(20,45)", 0, 0); * activeSheet.addCustomName("customName3", "=$A$1:$C$1", 0, 0); * activeSheet.setFormula(1, 0, "customName1"); * activeSheet.setFormula(1, 1, "customName2"); * activeSheet.setFormula(1, 2, "sum(customName3)"); * activeSheet.clearCustomNames(); * ``` */ clearCustomNames(): void; /** * Clears the dirty, insert, and delete status from the current worksheet. * @param {Object} [clearChangeInfo] - The clear change info. * @param {number} [clearChangeInfo.row] - The row index of clearing range. * @param {number} [clearChangeInfo.col] - The col index of clearing range. * @param {number} [clearChangeInfo.rowCount] - The row count of clearing range. * @param {number} [clearChangeInfo.colCount] - The col count of clearing range. * @param {GC.Spread.Sheets.ClearPendingChangeType} [clearChangeInfo.clearType] - The type of clearing pending change, contains dirty/insert/delete, default is dirty. * @example * ```javascript * sheet.clearPendingChanges({clearType: 1, row: 0, rowCount: 3, col: 0, colCount: 4}); * sheet.clearPendingChanges({clearType: 2, row: 0, rowCount: 3, col: -1}); * sheet.clearPendingChanges({clearType: 4, row: 0, rowCount: 10, col: -1}); * ``` */ clearPendingChanges(clearChangeInfo?: GC.Spread.Sheets.IClearChangeInfo): void; /** * Clears the selection. * @example * ```javascript * //This example clears the selection. * sheet.addSelection(4, 0, 2, 2); * sheet.clearSelection(); * ``` */ clearSelection(): void; /** * Copies data from one range to another. * @param {number} fromRow The source row. * @param {number} fromColumn The source column. * @param {number} toRow The target row. * @param {number} toColumn The target column. * @param {number} rowCount The row count. * @param {number} columnCount The column count. * @param {GC.Spread.Sheets.CopyToOptions} option The copy option. * @example * ```javascript * //This example copies data to the specified location. * activeSheet.getCell(0,0).value("1"); * activeSheet.copyTo(0,0,1,1,2,2,GC.Spread.Sheets.CopyToOptions.value); * ``` */ copyTo(fromRow: number, fromColumn: number, toRow: number, toColumn: number, rowCount: number, columnCount: number, option: GC.Spread.Sheets.CopyToOptions): void; /** * Gets or sets the current theme for the sheet. * @param {string|GC.Spread.Common.Theme} [value] The theme name or the theme. * @returns {GC.Spread.Sheets.Theme|GC.Spread.Sheets.Worksheet} If no value is set, returns the current theme; otherwise, returns the worksheet. * @example * ```javascript * //This example sets a theme. * sheet.currentTheme("Civic"); * ``` */ currentTheme(value?: string | GC.Spread.Sheets.Theme): any; /** * Deletes the columns in this sheet at the specified index. * @param {number} col The index of the first column to delete. * @param {number} count The number of columns to delete. * @param {GC.Spread.Sheets.SheetArea} [sheetArea] The sheet area. If this parameter is not given, it defaults to `viewport`. * @example * ```javascript * activeSheet.getCell(0,0).value("A1"); * activeSheet.getCell(0,4).value("Test") * activeSheet.deleteColumns(0,2); * activeSheet.deleteRows(3,1); * ``` */ deleteColumns(col: number, count: number, sheetArea?: GC.Spread.Sheets.SheetArea): void; /** * Deletes the rows in this worksheet at the specified index. * @param {number} row The index of the first row to delete. * @param {number} count The number of rows to delete. * @param {GC.Spread.Sheets.SheetArea} [sheetArea] The sheet area. If this parameter is not given, it defaults to `viewport`. * @example * ```javascript * activeSheet.getCell(0,0).value("A1"); * activeSheet.getCell(0,4).value("Test") * activeSheet.deleteColumns(0,2); * activeSheet.deleteRows(3,1); * ``` */ deleteRows(row: number, count: number, sheetArea?: GC.Spread.Sheets.SheetArea): void; /** * Returns the editor's status. * @returns {GC.Spread.Sheets.EditorStatus} The editor status. */ editorStatus(): GC.Spread.Sheets.EditorStatus; /** * Stops editing the active cell. * @param {boolean} ignoreValueChange If set to `true`, does not apply the edited text to the cell. * @returns {boolean} `true` when able to stop cell editing successfully; otherwise, `false`. * @example * ```javascript * //This example removes the text "123" when typing in a cell. * activeSheet.bind(GC.Spread.Sheets.Events.EditChange, function (sender,args) { * if (args.editingText === "123") { * activeSheet.endEdit(true); * } * }); * ``` */ endEdit(ignoreValueChange?: boolean): boolean; /** * Fills the specified range automatically. * @param {GC.Spread.Sheets.Range} startRange The fill start range. * @param {GC.Spread.Sheets.Range} wholeRange The entire range to fill. * @param {Object} options The range fill information. * @param {GC.Spread.Sheets.Fill.FillType} [options.fillType] - Specifies how to fill the specified range. * GC.Spread.Sheets.Fill.FillType.direction: * Fills the specified range in the specified direction. * GC.Spread.Sheets.Fill.FillType.linear: * Fills the specified range using a linear trend when the source value type is number. * The next value is generated by the step and stop values. * The next value is computed by adding the step value to the current cell value. * GC.Spread.Sheets.Fill.FillType.growth: * Fills the specified range using a growth trend when the source value type is number. * The next value is generated by the step and stop values. * The next value is computed by multiplying the step value with the current cell. * GC.Spread.Sheets.Fill.FillType.date: * Fills the specified range when the source value type is date. * The next value is generated by adding the step value to the current value. * The step value is affected by the fill date unit. * GC.Spread.Sheets.Fill.FillType.auto: * Fills the specified range automatically. * When the value is a string, the value is copied to other cells. * When the value is a number, the new value is generated by the TREND formula. * @param {GC.Spread.Sheets.Fill.FillSeries} [options.series] - The fill series. * @param {GC.Spread.Sheets.Fill.FillDirection} [options.direction] - direction The fill direction. * @param {number} [options.step] step - The fill step value. * @param {number|Date} [options.stop] stop - The fill stop value. * @param {GC.Spread.Sheets.Fill.FillDateUnit} [options.unit] - unit The fill date unit. * @example * ```javascript * activeSheet.setValue(0, 0, 5); * var start = new GC.Spread.Sheets.Range(0, 0, 1, 1); * var r3 = new GC.Spread.Sheets.Range(0, 0, 4, 1); * activeSheet.fillAuto(start,r3, {fillType:GC.Spread.Sheets.Fill.FillType.auto, series:GC.Spread.Sheets.Fill.FillSeries.column, direction:GC.Spread.Sheets.Fill.FillDirection.down}); * ``` */ fillAuto(startRange: GC.Spread.Sheets.Range, wholeRange: GC.Spread.Sheets.Range, options: GC.Spread.Sheets.Fill.IFillOptions): void; /** * Loads the object state from the specified JSON string. * @param {Object} sheetSettings The sheet data from deserialization. * @example * ```javascript * //This example uses the fromJSON method. * activeSheet.getCell(0,0).value(123); * var jsonStr = null; * //export * jsonStr = JSON.stringify(activeSheet.toJSON()); * //import * activeSheet.fromJSON(JSON.parse(jsonStr)); * alert(jsonStr); * ``` */ fromJSON(sheetSettings: Object): void; /** * Gets or sets the number of frozen columns of the sheet. * @param {number} [colCount] The number of columns to freeze. * @param {number} [leftCol] The left column index to freeze, default is 0. * @returns {number|GC.Spread.Sheets.Worksheet} If no value is set, returns the number of frozen columns; otherwise, returns the worksheet. * @example * ```javascript * sheet.frozenColumnCount(30, 20); * ``` */ frozenColumnCount(colCount?: number, leftCol?: number): any; /** * Gets or sets the number of frozen rows of the sheet. * @param {number} [rowCount] The number of rows to freeze. * @param {number} [topRow] The top row index to freeze, default is 0. * @returns {number|GC.Spread.Sheets.Worksheet} If no value is set, returns the number of frozen rows; otherwise, returns the worksheet. * @example * ```javascript * sheet.frozenRowCount(60, 50); * ``` */ frozenRowCount(rowCount?: number, topRow?: number): any; /** * Gets or sets the number of trailing frozen columns of the sheet. * @param {number} [colCount] The number of columns to freeze at the right side of the sheet. * @param {boolean} [stickToEdge] Whether the frozenTrailingColumn stick to the right edge of viewport area. By default is true. * @returns {number|GC.Spread.Sheets.Worksheet} If no value is set, returns the number of trailing frozen columns; otherwise, returns the worksheet. * @example * ```javascript * sheet.frozenTrailingColumnCount(1, false); * ``` */ frozenTrailingColumnCount(colCount?: number, stickToEdge?: boolean): any; /** * Gets or sets the number of trailing frozen rows of the sheet. * @param {number} [rowCount] The number of rows to freeze at the bottom of the sheet. * @param {boolean} [stickToEdge] Whether the frozenTrailingRow stick to the bottom edge of viewport area. By default is true. * @returns {number|GC.Spread.Sheets.Worksheet} If no value is set, returns the number of trailing frozen rows; otherwise, returns the worksheet. * @example * ```javascript * sheet.frozenTrailingRowCount(1, false); * ``` */ frozenTrailingRowCount(rowCount?: number, stickToEdge?: boolean): any; /** * Gets the active column index for this sheet. * @returns {number} The column index of the active cell. * @example * ```javascript * //This example gets the active column. * sheet.setActiveCell(5,5); * alert(sheet.getActiveColumnIndex()); * alert(sheet.getActiveRowIndex()); * spread.bind(GC.Spread.Sheets.Events.EnterCell, function (event, data) { * alert(data.col); * alert(data.row); * }); * spread.bind(GC.Spread.Sheets.Events.LeaveCell, function (event, data) { * alert(data.col); * alert(data.row); * }); * ``` */ getActiveColumnIndex(): number; /** * Gets the active row index for this sheet. * @returns {number} The row index of the active cell. * @example * ```javascript * //This example gets the active row. * sheet.setActiveCell(5,5); * alert(sheet.getActiveColumnIndex()); * alert(sheet.getActiveRowIndex()); * spread.bind(GC.Spread.Sheets.Events.EnterCell, function (event, data) { * alert(data.col); * alert(data.row); * }); * spread.bind(GC.Spread.Sheets.Events.LeaveCell, function (event, data) { * alert(data.col); * alert(data.row); * }); * ``` */ getActiveRowIndex(): number; /** * Gets the actual style information for a specified cell in the specified sheet area. * @param {number} row The row index. * @param {number} column The column index. * @param {GC.Spread.Sheets.SheetArea} [sheetArea] The sheet area. If this parameter is not provided, it defaults to `viewport`. * @param {boolean} [sheetStyleOnly] If `true`, the row filter and the conditional format style are not applied to the return style; * otherwise, the return style only contains the cell's inherited style. * @returns {GC.Spread.Sheets.Style} Returns the cell style of the specified cell. * @example * ```javascript * //This example uses the getActualStyle method. * var style = new GC.Spread.Sheets.Style(); * style.backColor = "red"; * style.borderLeft =new GC.Spread.Sheets.LineBorder("blue",GC.Spread.Sheets.LineStyle.medium); * style.borderTop = new GC.Spread.Sheets.LineBorder("blue",GC.Spread.Sheets.LineStyle.medium); * style.borderRight = new GC.Spread.Sheets.LineBorder("blue",GC.Spread.Sheets.LineStyle.medium); * style.borderBottom = new GC.Spread.Sheets.LineBorder("blue",GC.Spread.Sheets.LineStyle.medium); * activeSheet.setStyle(1,1,style,GC.Spread.Sheets.SheetArea.viewport); * var cstyle = activeSheet.getActualStyle(1,1,GC.Spread.Sheets.SheetArea.viewport, true); * alert(cstyle.backColor); * ``` */ getActualStyle(row: number, column: number, sheetArea?: GC.Spread.Sheets.SheetArea, sheetStyleOnly?: boolean): GC.Spread.Sheets.Style; /** * Gets the alternative text from the specified cell in the specified sheet area. * @param {number} row The row index. * @param {number} col The column index. * @param {GC.Spread.Sheets.SheetArea} sheetArea The sheet area. If this parameter is not provided, it defaults to `viewport`. * @returns {Object} Returns the alternative text of the cell. * @example * ```javascript * var SpreadIcon = { * FolderOpen: '\ue685', * InfoFilled: '\ue718', * Library: '\ue69d', * NotebookFilled: '\uD800\uDC0F', * Browse: '\ue626' * }; * activeSheet.setValue(1, 1, SpreadIcon.FolderOpen); * activeSheet.setAltText(1, 1, "Folder Open Icon"); * alert(activeSheet.getAltText(1, 1)); * ``` */ getAltText(row: number, col: number, sheetArea?: GC.Spread.Sheets.SheetArea): any; /** * Gets an object array from a specified range of cells. * @param {number} row The row index. * @param {number} column The column index. * @param {number} rowCount The row count. * @param {number} colCount The column count. * @param {boolean} getFormula If `true`, return formulas; otherwise, return values. * @returns {Object[][]} The object array from the specified range of cells. * @example * ```javascript * //This example uses the getArray method. * //set value * var array = [[1,2,3],[4,5],[6,7,8,9]]; * activeSheet.setArray(1, 2, array); * //set formula * var array = [["=1+1","=2+2","=3+3"],["=4+4","=5+5"],["=6+6","=7+7","=8+8","=9+9"]]; * activeSheet.setArray(1, 2, array, true); * //get value * var newArray = activeSheet.getArray(1, 2, 3, 4); * //getformula * var newArray = activeSheet.getArray(1, 2, 3, 4, true); * //alert(newArray[0]); * ``` */ getArray(row: number, column: number, rowCount: number, columnCount: number, getFormula?: boolean): any[]; /** * Gets the binding path of cell-level binding from the specified cell in the specified sheet area. * @param {number} row The row index. * @param {number} col The column index. * @returns {string} Returns the binding path of the cell for cell-level binding. * @example * ```javascript * //This example uses the getBindingPath method. * var person = {name: "Wang feng", age: 25, address: {postcode: "710075"}}; * var source = new GC.Spread.Sheets.Bindings.CellBindingSource(person); * activeSheet.setBindingPath(0, 0, "name"); * activeSheet.setBindingPath(1, 1, "age"); * activeSheet.setBindingPath(3, 3, "address.postcode"); * activeSheet.setDataSource(source); * alert(activeSheet.getBindingPath(0, 0, GC.Spread.Sheets.SheetArea.viewport)); * ``` */ getBindingPath(row: number, col: number): string; /** * Gets the specified cell in the specified sheet area. * @param {number} row The row index. * @param {number} col The column index. * @param {GC.Spread.Sheets.SheetArea} sheetArea The sheet area. If this parameter is not given, it defaults to`viewport`. * @returns {GC.Spread.Sheets.CellRange} The cell. * @example * ```javascript * //This example gets the cell. * activeSheet.getCell(1,1).text("cell object"); * ``` */ getCell(row: number, col: number, sheetArea?: GC.Spread.Sheets.SheetArea): GC.Spread.Sheets.CellRange; /** * Gets the rectangle of the cell. * @param {number} row The row index. * @param {number} col The column index. * @param {number} [rowViewportIndex] Index of the row of the viewport: -1 represents column header area, 0 represents frozen row area, 1 represents viewport area, 2 represents trailing frozen row area. * @param {number} [colViewportIndex] Index of the column of the viewport: -1 represents row header area, 0 represents frozen column area, 1 represents viewport area, 2 represents trailing frozen column area. * @returns {GC.Spread.Sheets.Rect} Object that contains the size and location of the cell rectangle. * @example * ```javascript * //This example uses the getCellRect method. * activeSheet.bind(GC.Spread.Sheets.Events.CellClick, function (e, info) { * if (info.sheetArea === GC.Spread.Sheets.SheetArea.viewport) { * alert("Clicked cell index (" + info.row + "," + info.col + ")"); * //Acquire the coordinate information of regular cells which exist at the specified index position * var cellRect = activeSheet.getCellRect(info.row, info.col); * alert("X coordinate:" + cellRect.x); * alert("Y coordinate:" + cellRect.y); * alert("Cell width:" + cellRect.width); * alert("Cell height:" + cellRect.height); * } * }); * ``` */ getCellRect(row: number, col: number, rowViewportIndex?: number, colViewportIndex?: number): GC.Spread.Sheets.Rect; /** * Gets the cell type. * @param {number} row The row index. * @param {number} col The column index. * @param {GC.Spread.Sheets.SheetArea} [sheetArea] The sheet area. If this parameter is not provided, it defaults to `viewport`. * @returns {GC.Spread.Sheets.CellTypes.Base} Returns the cell type for the specified cell. * @example * ```javascript * //This example gets the cell type. * var cellType = new GC.Spread.Sheets.CellTypes.Button(); * cellType.buttonBackColor("#FFFF00"); * cellType.text("this is a button"); * activeSheet.getCell(0, 2).cellType(cellType); * var cellType = activeSheet.getCellType(0,2,GC.Spread.Sheets.SheetArea.viewport) * if (cellType instanceof GC.Spread.Sheets.CellTypes.Button) { * alert("This is a ButtonCellType"); * } * ``` */ getCellType(row: number, col: number, sheetArea?: GC.Spread.Sheets.SheetArea): GC.Spread.Sheets.CellTypes.Base; /** * Gets the column count in the specified sheet area. * @param {GC.Spread.Sheets.SheetArea} [sheetArea] The sheet area. If this parameter is not given, it defaults to `viewport`. * @returns {number} The number of columns. * @example * ```javascript * //This example gets the number of columns. * var count = activeSheet.getColumnCount(GC.Spread.Sheets.SheetArea.viewport); * alert(count); * ``` */ getColumnCount(sheetArea?: GC.Spread.Sheets.SheetArea): number; /** * Gets whether a forced page break is inserted before the specified column on this sheet when printing. * @param {number} column The column index. * @returns {boolean} `true` if a forced page break is inserted before the specified column; otherwise, `false`. */ getColumnPageBreak(column: number): boolean; /** * Gets a value that indicates whether the user can resize a specified column in the specified sheet area. * @param {number} col The column index. * @param {GC.Spread.Sheets.SheetArea} [sheetArea] The sheet area. If this parameter is not given, it defaults to `viewport`. * @returns {boolean} `true` if the user can resize the specified column; otherwise, `false`. * @example * ```javascript * //This example gets whether the column is resizable. * sheet.setRowCount(10); * sheet.setColumnCount(7); * sheet.setValue(0, 0,"Western"); * sheet.setValue(0, 1,"Western"); * sheet.setValue(0, 2,"Western"); * sheet.setValue(1, 0,"A"); * sheet.setValue(1, 1,"B"); * sheet.setValue(1, 2,"C"); * sheet.setColumnResizable(0,true, GC.Spread.Sheets.SheetArea.colHeader); * sheet.setRowResizable(0,true, GC.Spread.Sheets.SheetArea.rowHeader); * alert( sheet.getColumnResizable(0)); * alert( sheet.getRowResizable(0, GC.Spread.Sheets.SheetArea.rowHeader)); * ``` */ getColumnResizable(col: number, sheetArea?: GC.Spread.Sheets.SheetArea): boolean; /** * Gets whether a column in the specified sheet area is displayed. * @param {number} col The column index. * @param {GC.Spread.Sheets.SheetArea} [sheetArea] The sheet area. If this parameter is not given, it defaults to `viewport`. * @returns {boolean} `true` if the column is visible in the sheet area; otherwise, `false`. * @example * ```javascript * //This example returns the visible and width settings for a column. * var visible = activeSheet.getColumnVisible(1, GC.Spread.Sheets.SheetArea.viewport); * var width = activeSheet.getColumnWidth(1, GC.Spread.Sheets.SheetArea.viewport); * alert(visible); * alert(width); * ``` */ getColumnVisible(col: number, sheetArea?: GC.Spread.Sheets.SheetArea): boolean; /** * Gets the width in pixels or the dynamic size for the specified column in the specified sheet area. * @param {number} col The column index. * @param {GC.Spread.Sheets.SheetArea} [sheetArea] The sheet area. If this parameter is not given, it defaults to viewport. * @param {boolean} [getDynamicSize] Whether get the dynamic size. If not given, it defaults to false. If this parameter is true, and dynamic size is not set, will return undefined. * @returns {number | string} The column width in pixels or the dynamic size. * @example * ```javascript * //This example returns the visible and width settings for a column. * var visible = activeSheet.getColumnVisible(1, GC.Spread.Sheets.SheetArea.viewport); * var width = activeSheet.getColumnWidth(1, GC.Spread.Sheets.SheetArea.viewport); * alert(visible); * alert(width); * ``` */ getColumnWidth(col: number, sheetArea?: GC.Spread.Sheets.SheetArea, getDynamicSize?: boolean): any; /** * Gets delimited text from a range. * @property {number} row The start row. * @property {number} column The start column. * @property {number} rowCount The row count. * @property {number} columnCount The column count. * @property {string} rowDelimiter The row delimiter that is appended to the end of the row. * @property {string} columnDelimiter The column delimiter that is appended to the end of the column. * @returns {string} The text from the range with the specified delimiters. */ getCsv(row: number, column: number, rowCount: number, columnCount: number, rowDelimiter: string, columnDelimiter: string): string; /** * Gets a custom function. * @param {string} fnName The custom function name. * @returns {GC.Spread.CalcEngine.Functions.Function} The custom function. */ getCustomFunction(name: string): void; /** * Gets the specified custom name information. * @param {string} fnName The custom name. * @returns {GC.Spread.Sheets.NameInfo} The information for the specified custom name. * @example * ```javascript * //This example gets the custom name and formula. * activeSheet.setValue(0, 0, 1); * activeSheet.setValue(0, 1, 2); * activeSheet.setValue(0, 2, 3); * activeSheet.addCustomName("customName1", "=12", 0, 0); * activeSheet.addCustomName("customName2", "Average(20,45)", 0, 0); * activeSheet.addCustomName("customName3", "=$A$1:$C$1"); * activeSheet.setFormula(1, 0, "customName1"); * activeSheet.setFormula(1, 1, "customName2"); * activeSheet.setFormula(1, 2, "sum(customName3)"); * $("#button1").click(function () { * let cname = activeSheet.getCustomName("customName2"); * if (cname instanceof GC.Spread.Sheets.NameInfo) { * //get CustomName * let name = cname.getName(); * //get Expression * let expression = cname.getExpression(); * //get Expression String * let expStr = GC.Spread.Sheets.CalcEngine.expressionToFormula(activeSheet, expression, 0, 0); * alert("Name:" + name + ";Expression: =" + expStr); * } * }); * ``` */ getCustomName(name: string): GC.Spread.Sheets.NameInfo; /** * Gets all custom name information. * @returns {GC.Spread.Sheets.NameInfo[]} The type GC.Spread.Sheets.NameInfo stored in an array. */ getCustomNames(): GC.Spread.Sheets.NameInfo[]; /** * Gets the column name at the specified position. * @param {number} column The column index for which the name is requested. * @returns {string} The column name for data binding. * @example * ```javascript * //This example returns the name for the specified bound column. * var test = [ * {"Series0":2,"Series1":1}, * {"Series0":4,"Series1":2}, * {"Series0":3,"Series1":4} * ]; * activeSheet.setDataSource(test); * activeSheet.bindColumn(1,"Series0"); * activeSheet.bindColumn(0,"Series1"); * var colname = activeSheet.getDataColumnName(0); * alert(colname); * ``` */ getDataColumnName(column: number): string; /** * Gets the data item. * @param {number} row The row index. * @returns {Object} The row data. * @example * ```javascript * //This example uses the getDataItem method. * var test = [ * { "Series0": 2, "Series1": 1 }, * { "Series0": 4, "Series1": 2 }, * { "Series0": 3, "Series1": 4 } * ]; * activeSheet.autoGenerateColumns = true; * activeSheet.setDataSource(test, false); * alert(JSON.stringify(activeSheet.getDataItem(0))); * ``` */ getDataItem(row: number): any; /** * Gets the data source that populates the sheet. * @function * @returns {Object} Returns the data source. * @example * ```javascript * var test = [ * {"Series0":2,"Series1":1}, * {"Series0":4,"Series1":2}, * {"Series0":3,"Series1":4} * ]; * activeSheet.setDataSource(test); * alert(activeSheet.getDataSource); * ``` */ getDataSource(): any; /** * Gets the cell data validator. * @param {number} row The row index. * @param {number} col The column index. * @param {GC.Spread.Sheets.SheetArea} sheetArea The sheet area. If this parameter is not provided, it defaults to `viewport`. * @returns {GC.Spread.Sheets.DataValidation.DefaultDataValidator} Returns the cell data validator for the specified cell. * @example * ```javascript * spread.options.highlightInvalidData = true; * var dv = GC.Spread.Sheets.DataValidation.createListValidator("1,2,3"); * dv.showInputMessage(true); * dv.inputMessage("Value must be 1,2 or 3"); * dv.inputTitle("tip"); * activeSheet.setDataValidator(1,1,1,1,dv,GC.Spread.Sheets.SheetArea.viewport); * alert(activeSheet.getDataValidator(1,1).getValidList(activeSheet,1,1)); * ``` */ getDataValidator(row: number, col: number, sheetArea: GC.Spread.Sheets.SheetArea): GC.Spread.Sheets.DataValidation.DefaultDataValidator; /** * Gets the default style information for the sheet. * @param {GC.Spread.Sheets.SheetArea} [sheetArea] The sheet area. If this parameter is not provided, it defaults to `viewport`. * @returns {GC.Spread.Sheets.Style} Returns the sheet's default style. * @example * ```javascript * //This example uses the getDefaultStyle method. * var defaultStyle = new GC.Spread.Sheets.Style(); * defaultStyle.backColor = "LemonChiffon"; * defaultStyle.foreColor = "Red"; * defaultStyle.borderLeft = new GC.Spread.Sheets.LineBorder("Green"); * defaultStyle.borderTop = new GC.Spread.Sheets.LineBorder("Green"); * defaultStyle.borderRight = new GC.Spread.Sheets.LineBorder("Green"); * defaultStyle.borderBottom = new GC.Spread.Sheets.LineBorder("Green"); * activeSheet.setDefaultStyle(defaultStyle, GC.Spread.Sheets.SheetArea.viewport); * var cstyle = activeSheet.getDefaultStyle(GC.Spread.Sheets.SheetArea.viewport); * alert(cstyle.backColor); * ``` */ getDefaultStyle(sheetArea?: GC.Spread.Sheets.SheetArea): GC.Spread.Sheets.Style; /** * Gets the default value from the specified cell. * @param {number} row The row index. * @param {number} col The column index. * @returns {Object | string} Returns the default value of cell. * @example * ```javascript * sheet.setDefaultValue(0, 0, 20); * let defaultValue = sheet.getDefaultValue(0, 0); * let value = sheet.getValue(0, 0); // the value equals to defaultValue * ``` */ getDefaultValue(row: number, col: number): any; /** * Gets the deleted row collection. * @return {Object[]} The deleted rows collection. the item in array contains two properties, row.row: specifies deleted row index, row.originalItem: specifies deleted data item. */ getDeletedRows(): any[]; /** * Gets the dependent CellRange information object array of the cell. * @param {number} row The row index. * @param {number} col The column index. * @returns {Object[]} Returns dependent cell information object array * dependentsInfo.row {number} Indicates the cellRange row index. * dependentsInfo.col {number} Indicates the cellRange col index. * dependentsInfo.rowCount {number} Indicates the cellRange row count. * dependentsInfo.colCount {number} Indicates the cellRange colcount. * dependentsInfo.sheetName {string} Indicates the workSheet name. * @example * ```javascript * sheet.getDependents(1, 1); * ``` */ getDependents(row: number, col: number): GC.Spread.Sheets.ICellsInfo[]; /** * Gets the dirty cell collection. * @param {number} row The row index. * @param {number} col The column index. * @param {number} rowCount The number of rows in the range of dirty cells. * @param {number} colCount The number of columns in the range of dirty cells. * @return {Array} The dirty cells. */ getDirtyCells(row: number, col: number, rowCount: number, colCount: number): GC.Spread.Sheets.IDirtyCellInfo[]; /** * Gets the dirty row collection. * @returns {Object[]} The dirty rows collection, the item in array contains three properties, row.row: specifies row index, row.item: specifies data item of current row, row.originalItem: specifies original data item of the row. */ getDirtyRows(): any[]; /** * Gets the cell formatter. * @param {number} row The row index. * @param {number} col The column index. * @param {GC.Spread.Sheets.SheetArea} sheetArea The sheet area. If this parameter is not provided, it defaults to `viewport`. * @returns {string|GC.Spread.Formatter.FormatterBase} Returns the cell formatter string or object for the specified cell. * @example * ```javascript * //This example returns the format object for the active sheet. * activeSheet.getCell(0, 1).formatter("M"); * activeSheet.setValue(0, 1, new Date(2011, 2, 9)); * var style = activeSheet.getFormatter(0,1,GC.Spread.Sheets.SheetArea.viewport); * alert(style); * ``` */ getFormatter(row: number, col: number, sheetArea: GC.Spread.Sheets.SheetArea): any; /** * Gets the formula in the specified cell in this sheet. * @param {number} row The row index. * @param {number} col The column index. * @param {GC.Spread.Sheets.SheetArea} [sheetArea] The sheet area. If you do not provide this parameter, it defaults to `viewport`. * @returns {string} Returns the formula string. * @example * ```javascript * //This example returns the formula in the specified cell. * activeSheet.setValue(0,0,1); * activeSheet.setValue(0,1,2); * activeSheet.setValue(0,2,10); * activeSheet.getCell(1,1).formula("=SUM(A1:C1)"); * let formula = activeSheet.getFormula(1, 1, GC.Spread.Sheets.SheetArea.viewport); * alert(formula); * ``` */ getFormula(row: number, col: number, sheetArea?: GC.Spread.Sheets.SheetArea): string; /** * Gets the formula detail information in the specified cell in this sheet. * @param {number} row The row index. * @param {number} col The column index. * @returns {Object} formulaInfo - Returns the formula information about the cell. * formulaInfo.hasFormula {boolean} Indicates whether there is a formula in the cell. * formulaInfo.isArrayFormula {boolean} Indicates whether the formula is an array formula. * formulaInfo.formula {string} The formula string. * formulaInfo.formulaWithCulture {string} The formula string with culture. * @example * ```javascript * activeSheet.setValue(0,0,1); * activeSheet.setValue(0,1,2); * activeSheet.setValue(0,2,10); * activeSheet.getCell(1,1).formula("=SUM(A1:C1)"); * let test = activeSheet.getFormulaInformation(1,1, GC.Spread.Sheets.SheetArea.viewport); * alert(test.formula); * ``` */ getFormulaInformation(row: number, col: number): GC.Spread.Sheets.IFormulaInfo; /** * Sets the hyperlink data for the specified cell in the specified sheet area. * @param {number} row The row index. * @param {number} col The column index. * @param {GC.Spread.Sheets.SheetArea} sheetArea The sheet area. If this parameter is not provided, it defaults to `viewport`. * @example * ```javascript * //This example uses the getHyperlink method. * let firstHyperlinkData = sheet.getHyperlink(0, 2, GC.Spread.Sheets.SheetArea.viewport); * let secondHyperlinkData = sheet.setHyperlink(1, 1, GC.Spread.Sheets.SheetArea.viewport); * ``` */ getHyperlink(row: number, col: number, sheetArea?: GC.Spread.Sheets.SheetArea): GC.Spread.Sheets.IHyperlink; /** * Get the id of the worksheet * @returns {string} The id of the worksheet */ getId(): string; /** * Gets the inserted row collection. * @returns {Object[]} The inserted rows collection, the item in array contains two properties, row.row: specifies insert row index, row.item: specifies insert data item. */ getInsertRows(): any[]; /** * Gets a style from the Worksheet named styles collection which has the specified name. * @param {string} name The name of the style to return. * @returns {GC.Spread.Sheets.Style} Returns the specified named style. */ getNamedStyle(name: string): GC.Spread.Sheets.Style; /** * Gets named styles from the Worksheet. * @returns {GC.Spread.Sheets.Style[]} The GC.Spread.Sheets.Style array of named styles. */ getNamedStyles(): GC.Spread.Sheets.Style[]; /** * Gets the parent Spread object of the current sheet. * @returns {GC.Spread.Sheets.Workbook} Returns the parent Spread object of the current sheet. */ getParent(): GC.Spread.Sheets.Workbook; /** * Gets the precedent CellRange information object array of the cell. * @param {number} row The row index. * @param {number} col The column index. * @returns {Object[]} Returns precedent cellRange information object array * precedentsInfo.row {number} Indicates the cellRange row index. * precedentsInfo.col {number} Indicates the cellRange col index. * precedentsInfo.rowCount {number} Indicates the cellRange row count. * precedentsInfo.colCount {number} Indicates the cellRange colcount. * precedentsInfo.sheetName {string} Indicates the workSheet name. * @example * ```javascript * sheet.getPrecedents(1, 1); * ``` */ getPrecedents(row: number, col: number): GC.Spread.Sheets.ICellsInfo[]; /** * Gets a range of cells by row info and column info in the specified sheet area. * @param {number} row The row index. * @param {number} col The column index. * @param {number} rowCount The row count of the range. If you do not provide this parameter, it defaults to `1`. * @param {number} colCount The column count of the range. If you do not provide this parameter, it defaults to `1`. * @param {GC.Spread.Sheets.SheetArea} sheetArea The sheet area. If this parameter is not given, it defaults to`viewport`. * @returns {GC.Spread.Sheets.CellRange} The cellRange. * If row is -1 and rowCount is -1, the range represents columns. For example, sheet.getRange(-1,4,-1,6) returns the columns "E:J". * If col is -1 and colCount is -1, the range represents rows. For example, sheet.getRange(4,-1,6,-1) returns the rows "5:10". */ getRange(row: number, col: number, rowCount?: number, colCount?: number, sheetArea?: GC.Spread.Sheets.SheetArea): GC.Spread.Sheets.CellRange; /** * Gets a range of cells by A1 style address(not support R1C1 style) in the specified sheet area. * @param {string} address The range address string. For example "C1", "A:C", "A1:C3", "1:3". * @param {GC.Spread.Sheets.SheetArea} sheetArea The sheet area. If this parameter is not given, it defaults to`viewport`. * @returns {GC.Spread.Sheets.CellRange} The cellRange. * @example * ```javascript * // Get a single cell, it equals to sheet.getRange(0, 0, 1, 1) * sheet.getRange("A1") * // Get whole columns, it equals to sheet.getRange(-1, 0, -1, 3) * sheet.getRange("A:C") * // Get whole rows, it equals to sheet.getRange(0, -1, 3, -1) * sheet.getRange("1:3") * // Get a range, it equals to sheet.getRange(0, 0, 3, 3) * sheet.getRange("A1:C3") * ``` */ getRange(address: string, sheetArea?: GC.Spread.Sheets.SheetArea): GC.Spread.Sheets.CellRange; /** * Gets the row count in the specified sheet area. * @param {GC.Spread.Sheets.SheetArea} [sheetArea] The sheet area. If this parameter is not given, it defaults to `viewport`. * @returns {number} The number of rows. * @example * ```javascript * //This example gets the row count. * var count = activeSheet.getRowCount(GC.Spread.Sheets.SheetArea.viewport); * alert(count); * ``` */ getRowCount(sheetArea?: GC.Spread.Sheets.SheetArea): number; /** * Gets the height in pixels or the dynamic size for the specified row in the specified sheet area. * @param {number} row The row index. * @param {GC.Spread.Sheets.SheetArea} [sheetArea] The sheet area. If this parameter is not given, it defaults to `viewport`. * @param {boolean} [getDynamicSize] Whether get the dynamic size. If not given, it defaults to false. If this parameter is true, and dynamic size is not set, will return undefined. * @returns {number | string} The row height in pixels or the dynamic size. * @example * ```javascript * //This example returns the height for the specified row. * var rheight = activeSheet.getRowHeight(1,GC.Spread.Sheets.SheetArea.viewport); * alert(rheight); * ``` */ getRowHeight(row: number, sheetArea?: GC.Spread.Sheets.SheetArea, getDynamicSize?: boolean): any; /** * Gets whether a forced page break is inserted before the specified row on this sheet when printing. * @param {number} row The row index. * @returns {boolean} `true` if a forced page break is inserted before the specified row; otherwise, `false`. */ getRowPageBreak(row: number): boolean; /** * Gets a value that indicates whether users can resize the specified row in the specified sheet area. * @param {number} row The row index. * @param {GC.Spread.Sheets.SheetArea} [sheetArea] The sheet area. If this parameter is not given, it defaults to `viewport`. * @returns {boolean} `true` if the users can resize the specified row; otherwise, `false`. * @example * ```javascript * //This example gets whether the row is resizable. * sheet.setRowCount(10); * sheet.setColumnCount(7); * sheet.setValue(0, 0,"Western"); * sheet.setValue(0, 1,"Western"); * sheet.setValue(0, 2,"Western"); * sheet.setValue(1, 0,"A"); * sheet.setValue(1, 1,"B"); * sheet.setValue(1, 2,"C"); * sheet.setColumnResizable(0,true, GC.Spread.Sheets.SheetArea.colHeader); * sheet.setRowResizable(0,true, GC.Spread.Sheets.SheetArea.rowHeader); * alert( sheet.getColumnResizable(0)); * alert( sheet.getRowResizable(0, GC.Spread.Sheets.SheetArea.rowHeader)); * ``` */ getRowResizable(row: number, sheetArea?: GC.Spread.Sheets.SheetArea): boolean; /** * Gets whether the control displays the specified row. * @param {number} row The row index. * @param {GC.Spread.Sheets.SheetArea} [sheetArea] The sheet area. If this parameter is not given, it defaults to `viewport`. * @returns {boolean} `true` if the row is visible in the sheet area; otherwise, `false`. * @example * ```javascript * //This example returns the visible setting for the specified row. * rvisible = activeSheet.getRowVisible(1,GC.Spread.Sheets.SheetArea.viewport); * alert(rvisible); * ``` */ getRowVisible(row: number, sheetArea?: GC.Spread.Sheets.SheetArea): boolean; /** * Gets the selections in the current sheet. * @returns {GC.Spread.Sheets.Range[]} The type GC.Spread.Sheets.Range is stored in an Array. */ getSelections(): GC.Spread.Sheets.Range[]; /** * Get last sort state in this sheet. * @returns {ISortState} the last sort state info . * @example * ```javascript * //This example get sort state. * sheet.setValue(0,0,"112"); * sheet.setValue(1,0,"10"); * sheet.setValue(2,0,"223"); * sheet.setValue(3,0,"20"); * sheet.setValue(4,0,"334"); * sheet.setValue(5,0,"30"); * sheet.sortRange(0, 0, 6, 1, true, [{index:0, ascending:true}]); * let sortState = sheet.getSortState(); * ``` */ getSortState(): ISortState; /** * Gets the spans in the specified range in the specified sheet area. * @param {GC.Spread.Sheets.Range} range The cell range. * @param {GC.Spread.Sheets.SheetArea} [sheetArea] The sheet area. If this parameter is not given, it defaults to `viewport`. * @returns {GC.Spread.Sheets.Range[]} An array that contains span information whose item type is GC.Spread.Sheets.Range. */ getSpans(range?: GC.Spread.Sheets.Range, sheetArea?: GC.Spread.Sheets.SheetArea): GC.Spread.Sheets.Range[]; /** * Gets the sparkline for the specified cell. * @param {number} row The row index. * @param {number} col The column index. * @returns {GC.Spread.Sheets.Sparkline} The sparkline for the cell. * @example * ```javascript * //This example creates and gets a sparkline. * var cellr = new GC.Spread.Sheets.Range(0, 0, 1, 5); * var ex = new GC.Spread.Sheets.Sparklines.SparklineSetting(); * ex.options.SeriesColor = "Aquamarine"; * sheet.setValue(0, 0, 2); * sheet.setValue(0, 1, 5); * sheet.setValue(0, 2, 4); * sheet.setValue(0, 3, -1); * sheet.setValue(0, 4, 3); * sheet.setSparkline(0, 5, cellr, GC.Spread.Sheets.Sparklines.DataOrientation.horizontal, GC.Spread.Sheets.Sparklines.SparklineType.column, ex); * alert(sheet.getSparkline(0, 5).toString()); * //sheet.removeSparkline(0, 5); * ``` */ getSparkline(row: number, column: number): GC.Spread.Sheets.Sparklines.Sparkline; /** * Gets the style information for a cell, row, column, or the sheet default based on the provided indices. * Special Index Behavior: * - When rowIndex is -1 and columnIndex is a valid column index (>= 0), returns the style at the **column level** for the specified column. * - When columnIndex is -1 and rowIndex is a valid row index (>= 0), returns the style at the **row level** for the specified row. * - When both rowIndex and columnIndex are -1, returns the **sheet's default style** (not associated with any specific cell, row, or column). * - When both rowIndex and columnIndex are >= 0 (default case), returns the **cell's style** at the specified (row, column), which is resolved based on the priority: Cell > Row > Column > Default. * @param {number} row The row index. Use -1 to query column-level or default style. * @param {number} column The column index. Use -1 to query row-level or default style. * @param {GC.Spread.Sheets.SheetArea} [sheetArea] The sheet area. If this parameter is not provided, it defaults to `viewport`. * @returns {GC.Spread.Sheets.Style} The resolved Style object based on the index combination. * * @example * ```javascript * // 1. Get the style of a specific cell (original usage) * var cellStyle = activeSheet.getStyle(1, 1, GC.Spread.Sheets.SheetArea.viewport); * * // 2. Get the column-level style for column index 1 (column B) * var columnStyle = activeSheet.getStyle(-1, 1, GC.Spread.Sheets.SheetArea.viewport); * * // 3. Get the row-level style for row index 2 (row 3) * var rowStyle = activeSheet.getStyle(2, -1, GC.Spread.Sheets.SheetArea.viewport); * * // 4. Get the sheet's default style * var defaultStyle = activeSheet.getStyle(-1, -1, GC.Spread.Sheets.SheetArea.viewport); * ``` */ getStyle(row: number, column: number, sheetArea?: GC.Spread.Sheets.SheetArea): GC.Spread.Sheets.Style; /** * Gets the name of the style for a specified cell in the specified sheet area. * @param {number} row The row index. * @param {number} column The column index. * @param {GC.Spread.Sheets.SheetArea} [sheetArea] The sheet area. If this parameter is not provided, it defaults to `viewport`. * @returns {string} Returns the name string for the style. * @example * ```javascript * //This example uses the getStyleName method. * var namedStyle = new GC.Spread.Sheets.Style(); * namedStyle.name = "style1"; * namedStyle.backColor = "green"; * activeSheet.addNamedStyle(namedStyle); * activeSheet.setStyleName(1, 1, "style1"); // cell(1,1)'s backColor is green. * activeSheet.setStyleName(2, 1, "style1"); * alert(activeSheet.getStyleName(1,1,GC.Spread.Sheets.SheetArea.viewport)); * ``` */ getStyleName(row: number, column: number, sheetArea?: GC.Spread.Sheets.SheetArea): string; /** * Gets the tag value from the specified cell in the specified sheet area. * @param {number} row The row index. * @param {number} col The column index. * @param {GC.Spread.Sheets.SheetArea} sheetArea The sheet area. If this parameter is not provided, it defaults to `viewport`. * @returns {Object} Returns the tag value of the cell. * @example * ```javascript * //This example adds and gets a cell tag. * activeSheet.getRange(1, -1, 1, -1).tag("row tag"); * alert(activeSheet.getTag(1,-1,GC.Spread.Sheets.SheetArea.viewport)); * ``` */ getTag(row: number, col: number, sheetArea?: GC.Spread.Sheets.SheetArea): any; /** * Gets the formatted text in the cell in the specified sheet area. * @param {number} row The row index. * @param {number} col The column index. * @param {GC.Spread.Sheets.SheetArea} [sheetArea] The sheet area. If this parameter is not provided, it defaults to `viewport`. * @returns {string} Returns the formatted text of the cell. * @example * ```javascript * activeSheet.getText(1, 0); * ``` */ getText(row: number, col: number, sheetArea?: GC.Spread.Sheets.SheetArea): string; /** * Get the range used in the sheet * @param {GC.Spread.Sheets.UsedRangeType} [type] The type of the used range type. * @returns {GC.Spread.Sheets.Range} If no value is set, returns null; otherwise, returns a used range. * @example * ```javascript * var spread = new GC.Spread.Sheets.Workbook(document.getElementById("ss"),{sheetCount:1}); * var sheet = spread.getSheet(0); * sheet.setValue(2, 2, "value"); * sheet.setValue(4, 2, "value"); * sheet.setValue(6, 8, "value"); * sheet.setValue(10, 15, "value"); * sheet.setFormula(5, 5, "=C3"); * sheet.setFormula(8, 8, "=I6"); * sheet.setStyle(30,4, new GC.Spread.Sheets.Style()) * sheet.setStyle(3, 24, new GC.Spread.Sheets.Style()) * sheet.setRowHeight(8, 40); * sheet.getUsedRange(GC.Spread.Sheets.UsedRangeType.all); * ``` */ getUsedRange(type?: GC.Spread.Sheets.UsedRangeType): GC.Spread.Sheets.Range; /** * Gets the unformatted data from the specified cell in the specified sheet area. * @param {number} row The row index. * @param {number} col The column index. * @param {GC.Spread.Sheets.SheetArea} [sheetArea] The sheet area. If this parameter is not provided, it defaults to `viewport`. * @param {GC.Spread.Sheets.ValueType} [valueType] - Indicate the return value type is normal text or rich text, default is normal text. * @returns {Object} Returns the value of the cell. * @example * ```javascript * activeSheet.getValue(1, 1, GC.Spread.Sheets.SheetArea.viewport, GC.Spread.Sheets.ValueType.richText); * ``` */ getValue(row: number, col: number, sheetArea?: GC.Spread.Sheets.SheetArea, valueType?: GC.Spread.Sheets.ValueType): any; /** * Gets the index of the bottom row in the viewport. * @param {number} rowViewportIndex The index of the viewport. * @returns {number} The index of the bottom row in the viewport. * @example * ```javascript * //This example returns the indices for the bottom and top rows and left and right columns in the current sheet view. * var brow = activeSheet.getViewportBottomRow(1); * var lcol = activeSheet.getViewportLeftColumn(1); * var rcol = activeSheet.getViewportRightColumn(1); * var trow = activeSheet.getViewportTopRow(1); * alert(brow); * alert(lcol); * alert(rcol); * alert(trow); * ``` */ getViewportBottomRow(rowViewportIndex: number): number; /** * Gets the height of the specified viewport row for the active sheet. * @param {number} rowViewportIndex The index of the row viewport. * @returns {number} The height of the viewport. * @example * ```javascript * //This example uses the getViewportHeight method. * alert(activeSheet.getViewportHeight(1)); * ``` */ getViewportHeight(rowViewportIndex: number): number; /** * Gets the index of the left column in the viewport. * @param {number} columnViewportIndex The index of the viewport. * @returns {number} The index of the left column in the viewport. * @example * ```javascript * //This example returns the indices for the bottom and top rows and left and right columns in the current sheet view. * var brow = activeSheet.getViewportBottomRow(1); * var lcol = activeSheet.getViewportLeftColumn(1); * var rcol = activeSheet.getViewportRightColumn(1); * var trow = activeSheet.getViewportTopRow(1); * alert(brow); * alert(lcol); * alert(rcol); * alert(trow); * ``` */ getViewportLeftColumn(columnViewportIndex: number): number; /** * Gets the index of the right column in the viewport. * @param {number} columnViewportIndex The index of the viewport. * @returns {number} The index of the right column in the viewport. * @example * ```javascript * //This example returns the indices for the bottom and top rows and left and right columns in the current sheet view. * var brow = activeSheet.getViewportBottomRow(1); * var lcol = activeSheet.getViewportLeftColumn(1); * var rcol = activeSheet.getViewportRightColumn(1); * var trow = activeSheet.getViewportTopRow(1); * alert(brow); * alert(lcol); * alert(rcol); * alert(trow); * ``` */ getViewportRightColumn(columnViewportIndex: number): number; /** * Gets the index of the top row in the viewport. * @param {number} rowViewportIndex The index of the viewport. * @returns {number} The index of the top row in the viewport. * @example * ```javascript * //This example returns the indices for the bottom and top rows and left and right columns in the current sheet view. * var brow = activeSheet.getViewportBottomRow(1); * var lcol = activeSheet.getViewportLeftColumn(1); * var rcol = activeSheet.getViewportRightColumn(1); * var trow = activeSheet.getViewportTopRow(1); * alert(brow); * alert(lcol); * alert(rcol); * alert(trow); * ``` */ getViewportTopRow(rowViewportIndex: number): number; /** * Gets the width of the specified viewport column for the active sheet. * @param {number} columnViewportIndex The index of the column viewport. * @returns {number} The width of the viewport * @example * ```javascript * //This example uses the getViewportWidth method. * alert(activeSheet.getViewportWidth(1)); * ``` */ getViewportWidth(columnViewportIndex: number): number; /** * Groups the sparklines. * @param {GC.Spread.Sheets.Sparklines.Sparkline[]} sparklines The sparklines to group. * @returns {GC.Spread.Sheets.Sparklines.SparklineGroup} The sparkline group. * @example * ```javascript * //This example groups a sparkline. * sheet.setValue(0, 0, "Data Range is A2-A9"); * sheet.setValue(1, 0, 1); * sheet.setValue(2, 0, -2); * sheet.setValue(3, 0, -1); * sheet.setValue(4, 0, 6); * sheet.setValue(5, 0, 4); * sheet.setValue(6, 0, -4); * sheet.setValue(7, 0, 3); * sheet.setValue(8, 0, 8); * var data = new GC.Spread.Sheets.Range(1, 0, 8, 1); * var setting = new GC.Spread.Sheets.Sparklines.SparklineSetting(); * var s1= sheet.setSparkline(13, 0, data * , GC.Spread.Sheets.Sparklines.DataOrientation.vertical * , GC.Spread.Sheets.Sparklines.SparklineType.line * , setting * ); * var s2 =sheet.setSparkline(13, 3, data * , GC.Spread.Sheets.Sparklines.DataOrientation.vertical * , GC.Spread.Sheets.Sparklines.SparklineType.column * , setting * ); * var s3= sheet.setSparkline(13, 6, data * , GC.Spread.Sheets.Sparklines.DataOrientation.vertical * , GC.Spread.Sheets.Sparklines.SparklineType.winloss * , setting * ); * var group = sheet.groupSparkline([s1,s2,s3]); * ``` */ groupSparkline(sparklines: Sparklines.Sparkline[]): GC.Spread.Sheets.Sparklines.SparklineGroup; /** * Get whether worksheet has set a password for protection. * @property {string} password Sheet protection password. * @returns {boolean} Returns true if the password is set, otherwise false * @example * ```javascript * let password = "fe4c4be8" * sheet.protect(password); * if(sheet.hasPassword()) { * sheet.unprotect(password); * } else { * sheet.unprotect(); * } * ``` */ hasPassword(): boolean; /** * Gets whether there is a dirty, insert, or delete status for the specified range. * @returns {boolean} `true` if any of the rows or cells in the range are dirty, or have been inserted or deleted; otherwise, `false`. */ hasPendingChanges(): boolean; /** * Performs a hit test. * @param {number} x The x-coordinate. * @param {number} y The y-coordinate. * @returns {Object} The hit test information. */ hitTest(x: number, y: number): GC.Spread.Sheets.IHitTestInformation; /** * Invalidates the sheet layout. * @example * ```javascript * //This example updates the layout. * activeSheet.columnOutlines.group(0, 1); * activeSheet.invalidateLayout(); * activeSheet.repaint(); * ``` */ invalidateLayout(): void; /** * Gets whether recording the dirty data is suspended. * @returns {boolean} Whether the dirty data is suspended. * @example * ```javascript * //This example uses the isDirtySuspended method. * var customers = [ * { ID: 0, Name: 'A', Info1: 'Info0' }, * { ID: 1, Name: 'B', Info1: 'Info1' }, * { ID: 2, Name: 'C', Info1: 'Info2' }, * ]; * activeSheet.setDataSource(customers); * activeSheet.suspendDirty(); * alert(activeSheet.isDirtySuspended()); * activeSheet.resumeDirty(); * alert(activeSheet.isDirtySuspended()); * ``` */ isDirtySuspended(): boolean; /** * Gets whether the sheet is in edit mode. * @returns {boolean} `true` if the sheet is in edit mode; otherwise, `false`. * @example * ```javascript * //This example uses the isEditing method. * alert(activeSheet.isEditing()); * ``` */ isEditing(): boolean; /** * Get if sheet paint is suspended. */ isPaintSuspended(): boolean; /** * Gets or sets whether display a print line for the sheet. * @param {boolean} [value] Whether display a print line for the sheet * @returns {boolean} If no value is set, returns a value indicating whether the print line is displayed */ isPrintLineVisible(value?: boolean): boolean; /** * Gets or sets the selected state of the worksheet. * @param {boolean} [selectedState] The selected state of the worksheet. * @returns {boolean|GC.Spread.Sheets.Worksheet} If no selectedState is set, returns the worksheet selected state; otherwise, returns the worksheet. * @example * ```javascript * spread.sheets[0].isSelected(); * spread.sheets[1].isSelected(true); * ``` */ isSelected(selectedState?: boolean): any; /** * Determines whether the cell value is valid. * @param {number} row The row index. * @param {number} column The column index. * @param {Object} value The cell value. * @returns {boolean} `true` if the value is valid; otherwise, `false`. * @example * ```javascript * //This example uses the isValid method. * alert(activeSheet.isValid(0, 0, 10)); * ``` */ isValid(row: number, column: number, value: Object): boolean; /** * Moves data from one range to another. * @param {number} fromRow The source row. * @param {number} fromColumn The source column. * @param {number} toRow The target row. * @param {number} toColumn The target column. * @param {number} rowCount The row count. * @param {number} columnCount The column count. * @param {GC.Spread.Sheets.CopyToOptions} option The copy option. * @example * ```javascript * //This example moves the data to the specified location. * activeSheet.getCell(0,0).value("A1"); * activeSheet.getCell(1,1).value("Test") * activeSheet.moveTo(0,0,3,3,2,2,GC.Spread.Sheets.CopyToOptions.value); * ``` */ moveTo(fromRow: number, fromColumn: number, toRow: number, toColumn: number, rowCount: number, columnCount: number, option: GC.Spread.Sheets.CopyToOptions): void; /** * Gets or sets the name of the worksheet. * @param {string} [value] The name of the worksheet. * @returns {string|GC.Spread.Sheets.Worksheet} If no value is set, returns the worksheet name; otherwise, returns the worksheet. * @example * ```javascript * spread.sheets[0].name("The first sheet"); * spread.sheets[1].name( "The second sheet"); * ``` */ name(value?: string): any; /** * Gets or sets the print information for the sheet. * @param {GC.Spread.Sheets.Print.PrintInfo} [value] The print information for the sheet. * @returns {GC.Spread.Sheets.Print.PrintInfo | GC.Spread.Sheets.Worksheet} If no value is set, returns the print information for the sheet; otherwise, returns the sheet. */ printInfo(value?: GC.Spread.Sheets.Print.PrintInfo): any; /** * Protects a worksheet. Do nothing if the worksheet has already been protected. * @property {string} password Sheet protection password. * @example * ```javascript * let password = "fe4c4be8" * sheet.protect(password); * ``` */ protect(password?: string): void; /** * Recalculates all the formulas in the sheet. * @param {boolean} refreshAll Specifies whether to rebuild all fromula reference, custom name and custom functions. * @deprecated since version 16.2.0, please use 'spread.calculate' instead * @example * ```javascript * //This example uses the recalcAll method. * activeSheet.setValue(0,0,1); * activeSheet.setValue(0,1,2); * activeSheet.setValue(0,2,10); * activeSheet.getCell(1,1).formula("=SUM(A1:C1)"); * activeSheet.recalcAll(); * ``` */ recalcAll(refreshAll?: boolean): void; /** * Removes a custom function. * @param {string} fnName The custom function name. * @example * ```javascript * //This example uses the removeCustomFunction method. * // Add Custom function * // Type =myfunc(1) * // in a cell to see the result * function myfunc() {} * myfunc.prototype = new GC.Spread.CalcEngine.Functions.Function("myfunc", 0, 0, {name: "myfunc",description: "This is my first function"}); * myfunc.prototype.evaluate = function (args) { * return 100; * } * activeSheet.addCustomFunction(new myfunc()); * activeSheet.removeCustomFunction("myfunc"); * ``` */ removeCustomFunction(name: string): void; /** * Removes the specified custom name. * @param {string} fnName The custom name. * @example * ```javascript * //This example uses the removeCustomName method. * activeSheet.setValue(0, 0, 1); * activeSheet.setValue(0, 1, 2); * activeSheet.setValue(0, 2, 3); * activeSheet.addCustomName("customName1","=12", 0, 0); * activeSheet.addCustomName("customName2","Average(20,45)", 0, 0); * activeSheet.addCustomName("customName3", "=$A$1:$C$1", 0, 0); * activeSheet.setFormula(1, 0, "customName1"); * activeSheet.setFormula(1, 1, "customName2"); * activeSheet.setFormula(1, 2, "sum(customName3)"); * //activeSheet.removeCustomName("customName3"); * ``` */ removeCustomName(name: string): void; /** * Removes a style from the Worksheet named styles collection which has the specified name. * @param {string} name The name of the style to remove. */ removeNamedStyle(name: string): void; /** * Removes the span that contains a specified anchor cell in the specified sheet area. * @param {number} row The row index of the anchor cell for the span (at which spanned cells start). * @param {number} col The column index of the anchor cell for the span (at which spanned cells start). * @param {GC.Spread.Sheets.SheetArea} [sheetArea] The sheet area. If this parameter is not given, it defaults to `viewport`. * @example * ```javascript * activeSheet.addSpan(0,0,3,3,GC.Spread.Sheets.SheetArea.viewport); * //activeSheet.removeSpan(0, 0, GC.Spread.Sheets.SheetArea.viewport); * ``` */ removeSpan(row: number, col: number, sheetArea?: GC.Spread.Sheets.SheetArea): void; /** * Removes the sparkline for the specified cell. * @param {number} row The row index. * @param {number} col The column index. * @example * ```javascript * //This example removes a sparkline. * var cellr = new GC.Spread.Sheets.Range(0, 0, 1, 5); * var ex = new GC.Spread.Sheets.Sparklines.SparklineSetting(); * ex.options.SeriesColor = "Aquamarine"; * sheet.setValue(0, 0, 2); * sheet.setValue(0, 1, 5); * sheet.setValue(0, 2, 4); * sheet.setValue(0, 3, -1); * sheet.setValue(0, 4, 3); * sheet.setSparkline(0, 5, cellr, GC.Spread.Sheets.Sparklines.DataOrientation.horizontal, GC.Spread.Sheets.Sparklines.SparklineType.column, ex); * alert(sheet.getSparkline(0, 5).toString()); * //sheet.removeSparkline(0, 5); * ``` */ removeSparkline(row: number, col: number): void; /** * Repaints the specified rectangle. * @param {GC.Spread.Sheets.Rect} clipRect The rectangle to repaint. * @example * ```javascript * //This example causes a repaint. * var cellrange =new GC.Spread.Sheets.Range(0, 0, 5, 1); * var hideRowFilter =new GC.Spread.Sheets.Filter.HideRowFilter(cellrange); * sheet.rowFilter(hideRowFilter); * sheet.resumePaint(); * sheet.repaint(); * ``` */ repaint(clipRect?: GC.Spread.Sheets.Rect): void; /** * Resets the sheet. * @example * ```javascript * //This example uses the reset method. * activeSheet.reset(); * ``` */ reset(): void; /** * Resumes the calculation service. * @param {boolean} recalcAll Specifies whether to recalculate all formulas. * @example * ```javascript * //This example uses the resumeCalcService method. * activeSheet.suspendCalcService(false); * activeSheet.setValue(0,0,1); * activeSheet.setValue(0,1,2); * activeSheet.setValue(0,2,10); * activeSheet.getCell(1,1).formula("=SUM(A1:C1)"); * activeSheet.resumeCalcService(true); * ``` */ resumeCalcService(recalcAll?: boolean): void; /** * Resumes recording the dirty data. * @example * ```javascript * //This example uses the resumeDirty method. * var customers = [ * { ID: 0, Name: 'A', Info1: 'Info0' }, * { ID: 1, Name: 'B', Info1: 'Info1' }, * { ID: 2, Name: 'C', Info1: 'Info2' }, * ]; * activeSheet.setDataSource(customers); * activeSheet.suspendDirty(); * alert(activeSheet.isDirtySuspended()); * activeSheet.resumeDirty(); * alert(activeSheet.isDirtySuspended()); * ``` */ resumeDirty(): void; /** * Resumes the event. * @example * ```javascript * //This example suspends and resumes the event. * activeSheet.bind(GC.Spread.Sheets.Events.CellChanged, function (sender, args) { * if (args.propertyName === "value") { * alert(activeSheet.getValue(args.row, args.col)); * } * }); * activeSheet.suspendEvent(); * activeSheet.setValue(0, 0, "111"); * activeSheet.resumeEvent(); * activeSheet.setValue(1, 1, "222"); * ``` */ resumeEvent(): void; /** * Resumes the paint. */ resumePaint(): void; /** * Gets or sets the row filter for the sheet. * @param {GC.Spread.Sheets.Filter.RowFilterBase} [value] The row filter for the sheet. * @returns {GC.Spread.Sheets.Filter.RowFilterBase|GC.Spread.Sheets.Worksheet} invoking the method without parameter, will return the filter instance, otherwise, return the worksheet instance. * @example * ```javascript * //This example creates a row filter. * sheet.rowFilter(new GC.Spread.Sheets.Filter.HideRowFilter(new GC.Spread.Sheets.Range(1,1,10,3))); * ``` */ rowFilter(value?: GC.Spread.Sheets.Filter.RowFilterBase): any; /** * Scrolls the sheet by specified pixels. * When vPixels is positive, worksheet will scroll down; when vPixels is negative, worksheet will scroll up; when vPixels is 0, worksheet won't scroll in vertical direction. * When hPixels is positive, worksheet will scroll right; when hPixels is negative, worksheet will scroll left; when hPixels is 0, worksheet won't scroll in horizontal direction. * When Workbook's option scrollByPixel is true, worksheet will scroll to new top row/left column index and new top row/left column offset; * When Workbook's option scrollByPixel is false, worksheet will scroll to new top row/left column index, and new top row/left column offset will be always 0. * @param {number} vPixels The pixels to scroll in vertical direction. * @param {number} hPixels The pixels to scroll in horizontal direction. * @example * ```javascript * //This example scrolls down the sheet 10 pixels and scrolls right the sheet 5 pixels. * activeSheet.scroll(10, 5); * ``` */ scroll(vPixels: number, hPixels: number): void; /** * Searches the specified content. * @param {GC.Spread.Sheets.Search.SearchCondition} searchCondition The search condition. * @returns {GC.Spread.Sheets.Search.SearchResult} The search result. * @example * ```javascript * //This example uses the search method. * activeSheet.getCell(2,3).value("testSearch"); * var searchCondition = new GC.Spread.Sheets.Search.SearchCondition(); * searchCondition.searchString = "testSearch"; * searchCondition.startSheetIndex = spread.getActiveSheetIndex(); * searchCondition.endSheetIndex = spread.getActiveSheetIndex(); * searchCondition.searchOrder = GC.Spread.Sheets.Search.SearchOrder.nOrder; * searchCondition.searchTarget = GC.Spread.Sheets.Search.SearchFoundFlags.cellText; * searchCondition.searchFlags = GC.Spread.Sheets.Search.SearchFlags.ignoreCase| GC.Spread.Sheets.Search.SearchFlags.useWildCards; * var searchresult= activeSheet.search(searchCondition); * var str ="[searchFoundFlag:"+ searchresult.searchFoundFlag+",\r\n foundSheetIndex:"+searchresult.foundSheetIndex+",foundRowIndex:" + * searchresult.foundRowIndex+", foundColumnIndex:"+searchresult.foundColumnIndex+", foundString:"+searchresult.foundSheetIndex+"]"; * alert(str); * ``` */ search(searchCondition: GC.Spread.Sheets.Search.SearchCondition): GC.Spread.Sheets.Search.SearchResult; /** * Gets or sets whether users can select ranges of items on a sheet. * @param {GC.Spread.Sheets.SelectionPolicy} [value] Whether users can select single items, ranges, or a combination of both. * @returns {GC.Spread.Sheets.SelectionPolicy|GC.Spread.Sheets.Worksheet} If no value is set, returns the selection policy setting; otherwise, returns the sheet. * @example * ```javascript * //This example uses the selectionPolicy method. * activeSheet.selectionUnit(GC.Spread.Sheets.SelectionUnit.row); * activeSheet.selectionPolicy(GC.Spread.Sheets.SelectionPolicy.range); * ``` */ selectionPolicy(value?: GC.Spread.Sheets.SelectionPolicy): any; /** * Gets or sets whether users can select cells, rows, or columns on a sheet. * @param {GC.Spread.Sheets.SelectionUnit} [value] Whether users can select cells, rows, or columns. * @returns {GC.Spread.Sheets.SelectionUnit|GC.Spread.Sheets.Worksheet} If no value is set, returns the selection unit setting; otherwise, returns the sheet. * @example * ```javascript * //This example uses the selectionUnit method. * activeSheet.selectionUnit(GC.Spread.Sheets.SelectionUnit.row); * activeSheet.selectionPolicy(GC.Spread.Sheets.SelectionPolicy.range); * ``` */ selectionUnit(value?: GC.Spread.Sheets.SelectionUnit): any; /** * Sets the active cell for this sheet. * @param {number} row The row index of the cell. * @param {number} col The column index of the cell. * @example * ```javascript * //This example sets the active cell. * sheet.setActiveCell(5,5); * alert(sheet.getActiveColumnIndex()); * alert(sheet.getActiveRowIndex()); * spread.bind(GC.Spread.Sheets.Events.EnterCell, function (event, data) { * alert(data.col); * alert(data.row); * }); * spread.bind(GC.Spread.Sheets.Events.LeaveCell, function (event, data) { * alert(data.col); * alert(data.row); * }); * ``` */ setActiveCell(row: number, col: number): void; /** * Sets the alternative text for the specified cell in the specified sheet area. * @param {number} row The row index. * @param {number} col The column index. * @param {Object} value The alternative text to set for the specified cell. * @param {GC.Spread.Sheets.SheetArea} sheetArea The sheet area. If this parameter is not provided, it defaults to `viewport`. * @example * ```javascript * var SpreadIcon = { * FolderOpen: '\ue685', * InfoFilled: '\ue718', * Library: '\ue69d', * NotebookFilled: '\uD800\uDC0F', * Browse: '\ue626' * }; * activeSheet.setValue(1, 1, SpreadIcon.FolderOpen); * activeSheet.setAltText(1, 1, "Folder Open Icon"); * * // Besides plain text, the alternative text could also contain placeholder {value} or {formatted}, which represents cell value or cell formatted value. * // For example, if the cell value is 1000, and the alt text is "Sales amount is {value}", the final accessible content should be "Sales amount is 1000". * activeSheet.setValue(1, 1, 1000); * activeSheet.setAltText(1, 1, "Sales amount is {value}"); * ``` */ setAltText(row: number, col: number, value: string, sheetArea?: GC.Spread.Sheets.SheetArea): void; /** * Sets the values in the specified two-dimensional array of objects into the specified range of cells on this sheet. * @param {number} row The row index. * @param {number} column The column index. * @param {Array} array The array from which to set values. * @param {boolean} [setFormula] If `true`, set formulas; otherwise, set values. * @example * ```javascript * //This example uses the setArray method. * //set value * var array = [[1,2,3],[4,5],[6,7,8,9]]; * activeSheet.setArray(1, 2, array); * //set formula * var array = [["=1+1","=2+2","=3+3"],["=4+4","=5+5"],["=6+6","=7+7","=8+8","=9+9"]]; * activeSheet.setArray(1, 2, array, true); * //get value * var newArray = activeSheet.getArray(1, 2, 3, 4); * //getformula * var newArray = activeSheet.getArray(1, 2, 3, 4, true); * //alert(newArray[0]); * ``` */ setArray(row: number, column: number, array: any[], setFormula?: boolean): void; /** * Sets a formula in a specified cell in the specified sheet area. * @param {number} row The start row index. * @param {number} col The start column index. * @param {number} rowCount The number of rows in range. * @param {number} colCount The number of columns in range. * @param {string} value The array formula to place in the specified range. * @param {GC.Spread.Sheets.SheetArea} [sheetArea] The sheet area. If you do not provide this parameter, it defaults to `viewport`. * @example * ```javascript * //This example uses the setArrayFormula method. * activeSheet.getCell(1,1).value(3); * activeSheet.getCell(2,1).value(1); * activeSheet.getCell(3,1).value(3); * activeSheet.getCell(4,1).value(7); * activeSheet.getCell(1,2).value(7); * activeSheet.getCell(2,2).value(7); * activeSheet.getCell(3,2).value(7); * activeSheet.getCell(4,2).value(7); * spread.allowUserEditFormula(true); * activeSheet.setArrayFormula(0, 3, 4, 1, "B2:B5*C2:C5", GC.Spread.Sheets.SheetArea.viewport); * ``` */ setArrayFormula(row: number, col: number, rowCount: number, colCount: number, value: string, sheetArea?: GC.Spread.Sheets.SheetArea): void; /** * Sets the binding path for cell-level binding in a specified cell in the specified sheet area. * @param {number} row The row index. * @param {number} col The column index. * @param {string} path The binding path for the cell binding source. * @returns {GC.Spread.Sheets.Worksheet} * @example * ```javascript * //This example binds a cell. * var test = {name: "John", gender: "male"}; * sheet.setBindingPath(0, 0, "name"); * sheet.setBindingPath(0, 1, "gender"); * sheet.setDataSource(new GC.Spread.Sheets.Bindings.CellBindingSource(test)); * ``` */ setBindingPath(row: number, col: number, path: string): GC.Spread.Sheets.Worksheet; /** * Sets the cell type. * @param {number} row The row index. * @param {number} col The column index. * @param {GC.Spread.Sheets.CellTypes.Base} value The cell type. * @param {GC.Spread.Sheets.SheetArea} [sheetArea] The sheet area. If this parameter is not provided, it defaults to `viewport`. * @example * ```javascript * //This example uses the setCellType method. * var cellType = new GC.Spread.Sheets.CellTypes.Button(); * cellType.buttonBackColor("#FFFF00"); * cellType.text("this is a button"); * activeSheet.setCellType(1,1,cellType); * spread.bind(GC.Spread.Sheets.Events.ButtonClicked, function (e, args) { * var sheet = args.sheet, row = args.row, col = args.col; * var cellType = activeSheet.getCellType(row, col); * if (cellType instanceof GC.Spread.Sheets.CellTypes.Button) { * alert("Button Clicked"); * } * }); * ``` */ setCellType(row: number, col: number, value: GC.Spread.Sheets.CellTypes.Base, sheetArea?: GC.Spread.Sheets.SheetArea): void; /** * Sets the column count in the specified sheet area. * @param {number} colCount The column count. * @param {GC.Spread.Sheets.SheetArea} [sheetArea] The sheet area. If this parameter is not given, it defaults to `viewport`. * @param {GC.Spread.Sheets.UsedRangeType} [guardContent] which type of content needs to be guarded. * @example * ```javascript * //This example sets the number of columns. * sheet.setRowCount(4,1); * sheet.setColumnCount(4,2); * sheet.addSpan(0,0,3,3,GC.Spread.Sheets.SheetArea.colHeader); * sheet.addSpan(0,0,3,3,GC.Spread.Sheets.SheetArea.rowHeader); * sheet.addSpan(0,0,3,3,GC.Spread.Sheets.SheetArea.viewport); * ``` */ setColumnCount(colCount: number, sheetArea?: GC.Spread.Sheets.SheetArea, guardContent?: GC.Spread.Sheets.UsedRangeType): void; /** * Sets whether a forced page break is inserted before the specified column on this sheet when printing. * @param {number} column The column index. * @param {boolean} value Set to `true` to force a page break before the specified column on this sheet when printing. * @example * ```javascript * //This example sets the page break. * activeSheet.setColumnPageBreak(5, true); * ``` */ setColumnPageBreak(column: number, value: boolean): void; /** * Sets whether users can resize the specified column in the specified sheet area. * @param {number} col The column index. * @param {boolean} value Set to `true` to allow users to resize the column. * @param {GC.Spread.Sheets.SheetArea} [sheetArea] The sheet area. If this parameter is not given, it defaults to `viewport`. * @example * ```javascript * //This example sets the setColumnResizable method. * sheet.setRowResizable(3,false,GC.Spread.Sheets.SheetArea.viewport); * sheet.setColumnResizable(3,false,GC.Spread.Sheets.SheetArea.viewport); * sheet.getRange(1,-1, 1, -1, GC.Spread.Sheets.SheetArea.viewport).resizable(false); * sheet.getRange(-1, 1, -1, 1, GC.Spread.Sheets.SheetArea.viewport).resizable(false); * ``` */ setColumnResizable(col: number, value: boolean, sheetArea?: GC.Spread.Sheets.SheetArea): void; /** * Sets whether a column in the specified sheet area is displayed. * @param {number} col The column index. * @param {boolean} value Whether to display the column. * @param {GC.Spread.Sheets.SheetArea} [sheetArea] The sheet area. If this parameter is not given, it defaults to `viewport`. * @example * ```javascript * //This example sets the specified column to be hidden. * activeSheet.setColumnVisible(2,false,GC.Spread.Sheets.SheetArea.viewport); * ``` */ setColumnVisible(col: number, value: boolean, sheetArea?: GC.Spread.Sheets.SheetArea): void; /** * Sets the width in pixels or dynamic size for the specified column in the specified sheet area. * @param {number} col The column index. * @param {number | string} value The width in pixels, or use the string with "*" to represent the dynamic size. * @param {GC.Spread.Sheets.SheetArea} [sheetArea] The sheet area. If this parameter is not given, it defaults to viewport. * @example * ```javascript * //This example sets the column width. * sheet.setValue(0, 0, "value"); * sheet.addRows(0, 2); * sheet.addColumns(0, 2); * sheet.setRowHeight(0, 50.0, GC.Spread.Sheets.SheetArea.viewport); * sheet.setColumnWidth(0, 150.0, GC.Spread.Sheets.SheetArea.viewport); * sheet.setColumnWidth(1, "2*", GC.Spread.Sheets.SheetArea.viewport); * sheet.getRange(0, -1, 1, -1, GC.Spread.Sheets.SheetArea.viewport).backColor("Gray"); * sheet.getRange(-1, 0, -1, 1, GC.Spread.Sheets.SheetArea.viewport).backColor ("Brown"); * ``` */ setColumnWidth(col: number, value: number | string, sheetArea?: GC.Spread.Sheets.SheetArea): void; /** * Sets delimited text (CSV) in the sheet. * @property {number} row The start row. * @property {number} column The start column. * @property {string} text The delimited text. * @property {string} rowDelimiter The row delimiter. * @property {string} columnDelimiter The column delimiter. */ setCsv(row: number, column: number, text: string, rowDelimiter: string, columnDelimiter: string): void; /** * Sets the data source that populates the sheet. * @param {Object} data The data source. * @param {boolean} reset `true` if the sheet is reset; otherwise, `false`. * @example * ```javascript * var test = [ * { "Series0": 2, "Series1": 1 }, * { "Series0": 4, "Series1": 2 }, * { "Series0": 3, "Series1": 4 } * ]; * activeSheet.autoGenerateColumns = true; * activeSheet.setDataSource(test, true); * ``` */ setDataSource(data: any, reset?: boolean): void; /** * Sets the cell data validator. * @param {number} row The row index. * @param {number} col The column index. * @param {GC.Spread.Sheets.DataValidation.DefaultDataValidator} value The data validator. * @param {GC.Spread.Sheets.SheetArea} [sheetArea] The sheet area. If this parameter is not provided, it defaults to `viewport`. * @example * ```javascript * spread.options.highlightInvalidData = true; * var dv = GC.Spread.Sheets.DataValidation.createListValidator("1,2,3"); * dv.showInputMessage(true); * dv.inputMessage("Value must be 1,2 or 3"); * dv.inputTitle("tip"); * activeSheet.setDataValidator(1,1,dv,GC.Spread.Sheets.SheetArea.viewport); * alert(activeSheet.getDataValidator(1,1).getValidList(activeSheet,1,1)); * ``` */ setDataValidator(row: number, col: number, value: GC.Spread.Sheets.DataValidation.DefaultDataValidator, sheetArea?: GC.Spread.Sheets.SheetArea): void; /** * Sets the cell data validator. * @param {number} row The row index. * @param {number} col The column index. * @param {number} rowCount The row count. * @param {number} colCount The column count. * @param {GC.Spread.Sheets.DataValidation.DefaultDataValidator} value The data validator. * @param {GC.Spread.Sheets.SheetArea} [sheetArea] The sheet area. If this parameter is not provided, it defaults to `viewport`. * @example * ```javascript * spread.options.highlightInvalidData = true; * var dv = GC.Spread.Sheets.DataValidation.createListValidator("1,2,3"); * dv.showInputMessage(true); * dv.inputMessage("Value must be 1,2 or 3"); * dv.inputTitle("tip"); * activeSheet.setDataValidator(1,1,1,1,dv,GC.Spread.Sheets.SheetArea.viewport); * alert(activeSheet.getDataValidator(1,1).getValidList(activeSheet,1,1)); * ``` */ setDataValidator(row: number, col: number, rowCount: number, colCount: number, value: GC.Spread.Sheets.DataValidation.DefaultDataValidator, sheetArea?: GC.Spread.Sheets.SheetArea): void; /** * Sets the default style information for the sheet. * @param {GC.Spread.Sheets.Style} style The style to set. * @param {GC.Spread.Sheets.SheetArea} [sheetArea] The sheet area. If this parameter is not provided, it defaults to `viewport`. */ setDefaultStyle(style: GC.Spread.Sheets.Style, sheetArea?: GC.Spread.Sheets.SheetArea): void; /** * Sets the default value to the cell, it can be the value data or the formula string. It works when the cell has no data. * @param {number} row The row index. * @param {number} col The column index. * @param {Object | string} value The default value of the cell. * @example * ```javascript * sheet.setDefaultValue(0, 0, "name"); * sheet.setDefaultValue(0, 1, "=A1"); * ``` */ setDefaultValue(row: number, col: number, value: any): void; /** * Sets the cell formatter. * @param {number} row The row index. * @param {number} col The column index. * @param {string | GC.Spread.Formatter.FormatterBase} value The formatter string or object. * @param {GC.Spread.Sheets.SheetArea} sheetArea The sheet area. If this parameter is not provided, it defaults to `viewport`. * @example * ```javascript * //This example sets the format object for the active sheet. * activeSheet.setValue(2, 3, new Date(2011, 2, 9)); * activeSheet.setFormatter(2,3,"M",GC.Spread.Sheets.SheetArea.viewport); * ``` */ setFormatter(row: number, col: number, value: string | GC.Spread.Formatter.FormatterBase, sheetArea: GC.Spread.Sheets.SheetArea): void; /** * Sets a formula in a specified cell in the specified sheet area. * @param {number} row The row index. * @param {number} col The column index. * @param {string|null} value The formula to place in the specified cell. If `null`, the formula in the cell will be cleared. * @param {GC.Spread.Sheets.SheetArea} [sheetArea] The sheet area. If not provided, defaults to `viewport`. * @example * ```javascript * // This example sets the formula for the specified cell. * activeSheet.setValue(0, 2, 3); * activeSheet.setFormula(1, 1, "C1+D1"); * * // This example clears the formula in the specified cell. * activeSheet.setFormula(1, 1, null); * ``` */ setFormula(row: number, col: number, value: string | null, sheetArea?: GC.Spread.Sheets.SheetArea): void; /** * Sets the hyperlink data for the specified cell in the specified sheet area. * @param {number} row The row index. * @param {number} col The column index. * @param {Object} value The hyperlink data to set for the specified cell. * @param {GC.Spread.Sheets.SheetArea} sheetArea The sheet area. If this parameter is not provided, it defaults to `viewport`. * @example * ```javascript * //This example uses the setHyperlink method. * sheet.setHyperlink(0, 2, { * url: 'https://www.spreadjs.com', * tooltip: 'spreadjs', * linkColor: 'blue', * visitedLinkColor: 'red', * target: GC.Spread.Sheets.Hyperlink.HyperlinkTargetType.blank, * command: 'navigationLeft' * }); * sheet.setValue(0,2, 'spreadjs'); * sheet.setHyperlink(1, 1, { * url: 'https://www.spreadjs.com', * tooltip: 'spreadjs', * target: GC.Spread.Sheets.Hyperlink.HyperlinkTargetType.top, * command: function () { console.log('Only show this message when click the hyperlink.') } * }); * sheet.setValue(1,1, 'spreadjs'); * ``` */ setHyperlink(row: number, col: number, value: GC.Spread.Sheets.IHyperlink, sheetArea?: GC.Spread.Sheets.SheetArea): void; /** * Sets the row count in the specified sheet area. * @param {number} rowCount The row count. * @param {GC.Spread.Sheets.SheetArea} [sheetArea] The sheet area. If this parameter is not given, it defaults to `viewport`. * @param {GC.Spread.Sheets.UsedRangeType} [guardContent] which type of content needs to be guarded. * @example * ```javascript * //This example sets the row count. * sheet.setRowCount(4,1); * sheet.setColumnCount(4,2); * sheet.addSpan(0,0,3,3,GC.Spread.Sheets.SheetArea.colHeader); * sheet.addSpan(0,0,3,3,GC.Spread.Sheets.SheetArea.rowHeader); * sheet.addSpan(0,0,3,3,GC.Spread.Sheets.SheetArea.viewport); * ``` */ setRowCount(rowCount: number, sheetArea?: GC.Spread.Sheets.SheetArea, guardContent?: GC.Spread.Sheets.UsedRangeType): void; /** * Sets the height in pixels or dynamic size for the specified row in the specified sheet area. * @param {number} row The row index. * @param {number | string} value The height in pixels, or use the string with "*" to represent the dynamic size. * @param {GC.Spread.Sheets.SheetArea} [sheetArea] The sheet area. If this parameter is not given, it defaults to `viewport`. * @example * ```javascript * //This example sets the row height. * sheet.setValue(0, 0, "value"); * sheet.addRows(0, 2); * sheet.addColumns(0, 2); * sheet.setRowHeight(0, 50.0, GC.Spread.Sheets.SheetArea.viewport); * sheet.setRowHeight(1, "3*", GC.Spread.Sheets.SheetArea.viewport); * sheet.setColumnWidth(0, 150.0, GC.Spread.Sheets.SheetArea.viewport); * sheet.getRange(0, -1, 1, -1, GC.Spread.Sheets.SheetArea.viewport).backColor("Gray"); * sheet.getRange(-1, 0, -1, 1, GC.Spread.Sheets.SheetArea.viewport).backColor ("Brown"); * ``` */ setRowHeight(row: number, value: number | string, sheetArea?: GC.Spread.Sheets.SheetArea): void; /** * Sets whether a forced page break is inserted before the specified row on this sheet when printing. * @param {number} row The row index. * @param {boolean} value Set to `true` to force a page break before the specified row on this sheet when printing. * @example * ```javascript * activeSheet.setRowPageBreak(3, true); * ``` */ setRowPageBreak(row: number, value: boolean): void; /** * Sets whether users can resize the specified row in the specified sheet area. * @param {number} row The row index. * @param {boolean} value Set to `true` to let the users resize the specified row. * @param {GC.Spread.Sheets.SheetArea} [sheetArea] The sheet area. If this parameter is not given, it defaults to `viewport`. * @example * ```javascript * //This example prevents certain rows and columns from being resized. * sheet.setRowResizable(3,false,GC.Spread.Sheets.SheetArea.viewport); * sheet.setColumnResizable(3,false,GC.Spread.Sheets.SheetArea.viewport); * sheet.getRange(1,-1, 1, -1, GC.Spread.Sheets.SheetArea.viewport).resizable(false); * sheet.getRange(-1, 1, -1, 1, GC.Spread.Sheets.SheetArea.viewport).resizable(false); * ``` */ setRowResizable(row: number, value: boolean, sheetArea?: GC.Spread.Sheets.SheetArea): void; /** * Sets whether the control displays the specified row in the specified sheet area. * @param {number} row The row index. * @param {boolean} value Set to `true` to display the specified row. * @param {GC.Spread.Sheets.SheetArea} [sheetArea] The sheet area. If this parameter is not given, it defaults to `viewport`. * @example * ```javascript * //This example sets the specified row to be hidden. * activeSheet.setRowVisible(1,false,GC.Spread.Sheets.SheetArea.viewport); * ``` */ setRowVisible(row: number, value: boolean, sheetArea?: GC.Spread.Sheets.SheetArea): void; /** * Sets the selection to a cell or a range and sets the active cell to the first cell. * @param {number} row The row index of the first cell to add. * @param {number} column The column index of the first cell to add. * @param {number} rowCount The number of rows to add. * @param {number} columnCount The number of columns to add. * @example * ```javascript * //This example selects a range of cells. * sheet.setValue(0,0, 1,3); * sheet.setValue(1,0, 50,3); * sheet.setValue(2,0, 100,3); * sheet.setValue(3,0, 2,3); * sheet.setValue(4,0, 60,3); * sheet.setValue(5,0, 90,3); * sheet.setValue(6,0, 3,3); * sheet.setValue(7,0, 40,3); * sheet.setValue(8,0, 70,3); * sheet.setValue(9,0, 5,3); * sheet.setValue(10,0, 35,3); * sheet.setSelection(0,0,11,1); * sheet.conditionalFormats.add3ScaleRule(1, 10, "red", 0, 50, "blue",2, 100, "yellow", sheet.getSelections()); * ``` */ setSelection(row: number, column: number, rowCount: number, columnCount: number): void; /** * Sets the sparkline for a cell. * @param {number} row The row index. * @param {number} col The column index. * @param {GC.Spread.Sheets.Range | string} dataRange The data range. * @param {GC.Spread.Sheets.Sparklines.DataOrientation} dataOrientation The data orientation. * @param {GC.Spread.Sheets.Sparklines.SparklineType} sparklineType The sparkline type. * @param {GC.Spread.Sheets.Sparklines.SparklineSetting} sparklineSetting The sparkline setting. * @param {GC.Spread.Sheets.Range | string} dateAxisRange The date axis range. * @param {GC.Spread.Sheets.Sparklines.DataOrientation} dateAxisOrientation The date axis range orientation. * @returns {GC.Spread.Sheets.Sparklines.Sparkline} The sparkline. * @example * ```javascript * //This example creates a sparkline for the specified range. * var data = new GC.Spread.Sheets.Range(1, 0, 8, 1); * var setting = new GC.Spread.Sheets.Sparklines.SparklineSetting(); * setting.options.showMarkers = true; * setting.options.lineWeight = 3; * setting.options.displayXAxis = true; * setting.options.showFirst = true; * setting.options.showLast = true; * setting.options.showLow = true; * setting.options.showHigh = true; * setting.options.showNegative = true; * setting.options.seriesColor = "Text 2 1"; * setting.options.firstMarkerColor = "Text 2 3"; * setting.options.negativeColor = "Accent 2 1"; * setting.options.markersColor = "Accent 3 1"; * setting.options.lowMarkerColor = "Accent 4 1"; * setting.options.highMarkerColor = "Accent 6 1"; * setting.options.lastMarkerColor = "Accent 6 6"; * setting.options.axisColor ="Text 1 1"; * sheet.addSpan(13, 0, 4, 3, null); * sheet.setSparkline(13, 0, data, GC.Spread.Sheets.Sparklines.DataOrientation.Vertical, GC.Spread.Sheets.Sparklines.SparklineType.line, setting); * sheet.setValue(1, 0, 1); * sheet.setValue(2, 0, -2); * sheet.setValue(3, 0, -1); * sheet.setValue(4, 0, 6); * sheet.setValue(5, 0, 4); * sheet.setValue(6, 0, -4); * sheet.setValue(7, 0, 3); * sheet.setValue(8, 0, 8); * ``` */ setSparkline(row: number, col: number, dataRange: GC.Spread.Sheets.Range | string, dataOrientation: GC.Spread.Sheets.Sparklines.DataOrientation, sparklineType: GC.Spread.Sheets.Sparklines.SparklineType, sparklineSetting: GC.Spread.Sheets.Sparklines.SparklineSetting, dateAxisRange?: GC.Spread.Sheets.Range | string, dateAxisOrientation?: GC.Spread.Sheets.Sparklines.DataOrientation): GC.Spread.Sheets.Sparklines.Sparkline; /** * Sets the style information for a cell, row, column, or the worksheet default based on the provided indices. * * Special Index Behavior: * - When rowIndex is -1 and columnIndex is a valid column index (>= 0), sets the **column-level style** for the specified column. * - When columnIndex is -1 and rowIndex is a valid row index (>= 0), sets the **row-level style** for the specified row. * - When both rowIndex and columnIndex are -1, sets the **worksheet's default style** (applies to all cells unless overridden). * - When both rowIndex and columnIndex are >= 0 (default case), sets the **cell style** for the specified (row, column) in the given sheet area. * * @param {number} row The zero-based row index. Use -1 to target column-level or default style. * @param {number} col The zero-based column index. Use -1 to target row-level or default style. * @param {GC.Spread.Sheets.Style} value The Style object containing the style properties to apply. * @param {GC.Spread.Sheets.SheetArea} [sheetArea] The sheet area. If this parameter is not provided, it defaults to `viewport`. * * @example * ```javascript * var style = new GC.Spread.Sheets.Style(); * style.backColor = "lightgreen"; * sheet.setStyle(1, 1, style, GC.Spread.Sheets.SheetArea.viewport); * // 2. Set the column-level style for column index 2 (column C) * var columnStyle = new GC.Spread.Sheets.Style(); * columnStyle.backColor = "yellow"; * sheet.setStyle(-1, 2, columnStyle, GC.Spread.Sheets.SheetArea.viewport); * // 3. Set the row-level style for row index 3 (row 4) * var rowStyle = new GC.Spread.Sheets.Style(); * rowStyle.backColor = "lightcoral"; * sheet.setStyle(3, -1, rowStyle, GC.Spread.Sheets.SheetArea.viewport); * // 4. Set the worksheet's default style * var defaultStyle = new GC.Spread.Sheets.Style(); * defaultStyle.backColor = "lightblue"; * sheet.setStyle(-1, -1, defaultStyle, GC.Spread.Sheets.SheetArea.viewport); * ``` */ setStyle(row: number, col: number, value: GC.Spread.Sheets.Style, sheetArea?: GC.Spread.Sheets.SheetArea): void; /** * Sets the specified style name for a specified cell in the specified sheet area. * @param {number} row The row index. * @param {number} column The column index. * @param {string} value The name of the style to set. * @param {GC.Spread.Sheets.SheetArea} [sheetArea] The sheet area. If this parameter is not provided, it defaults to `viewport`. * @example * ```javascript * var namedStyle = new GC.Spread.Sheets.Style(); * namedStyle.name = "style1"; * namedStyle.backColor = "green"; * activeSheet.addNamedStyle(namedStyle); * activeSheet.setStyleName(1, 1, "style1"); // cell(1,1)'s backColor is green. * activeSheet.setStyleName(2, 1, "style1"); * ``` */ setStyleName(row: number, column: number, value: string, sheetArea?: GC.Spread.Sheets.SheetArea): void; /** * Sets the tag value for the specified cell in the specified sheet area. * @param {number} row The row index. * @param {number} col The column index. * @param {Object} tag The tag value to set for the specified cell. * @param {GC.Spread.Sheets.SheetArea} sheetArea The sheet area without corner. If this parameter is not provided, it defaults to `viewport`. * @example * ```javascript * activeSheet.setTag(1,1,"test"); * ``` */ setTag(row: number, col: number, tag: any, sheetArea?: GC.Spread.Sheets.SheetArea): void; /** * Sets the formatted text in the cell in the specified sheet area. * @param {number} row The row index. * @param {number} col The column index. * @param {string} value The text for the specified cell. * @param {GC.Spread.Sheets.SheetArea} [sheetArea] The sheet area. If this parameter is not provided, it defaults to `viewport`. * @example * ```javascript * activeSheet.setText(1, 0, "10"); * ``` */ setText(row: number, col: number, value: string, sheetArea?: GC.Spread.Sheets.SheetArea): void; /** * Sets the value for the specified cell in the specified sheet area. * @param {number} row The row index. * @param {number} col The column index. * @param {Object} value The value to set for the specified cell. if the value is rich text format, should include a richText field which type is a rich text style array. * @param {GC.Spread.Sheets.SheetArea} [sheetArea] The sheet area. If this parameter is not provided, it defaults to `viewport`. * @param {boolean} ignoreRecalc Whether to ignore recalculation. * @example * ```javascript * //This example uses the setValue method. * sheet.setValue(0,2,"ColumnHeader", GC.Spread.Sheets.SheetArea.colHeader); * sheet.setValue(2,0,{richText:[{style:{font:'bold 24px Arial'},text:'SpreadJS'}]}, GC.Spread.Sheets.SheetArea.rowHeader); * sheet.setValue(1, 1, {richText:[{style:{vertAlign: GC.Spread.Sheets.VertAlign.subscript},text:'SpreadJS'}]}, GC.Spread.Sheets.SheetArea.viewport); * ``` */ setValue(row: number, col: number, value: any, sheetArea?: GC.Spread.Sheets.SheetArea, ignoreRecalc?: boolean): void; /** * Moves the view of a cell to the specified position in the viewport. * @param {number} row The row index. * @param {number} col The column index. * @param {GC.Spread.Sheets.VerticalPosition} verticalPosition The vertical position in which to display the cell. * @param {GC.Spread.Sheets.HorizontalPosition} horizontalPosition The horizontal position in which to display the cell. * @example * ```javascript * //This example uses the showCell method. * //Set cell (3,3) as the active cell * activeSheet.setActiveCell(3, 3); * //Display the active cell at top left * activeSheet.showCell(3, 3, GC.Spread.Sheets.VerticalPosition.top, GC.Spread.Sheets.HorizontalPosition.left); * ``` */ showCell(row: number, col: number, verticalPosition: GC.Spread.Sheets.VerticalPosition, horizontalPosition: GC.Spread.Sheets.HorizontalPosition): void; /** * Moves the view of a column to the specified position in the viewport. * @param {number} col The column index. * @param {GC.Spread.Sheets.HorizontalPosition} horizontalPosition The horizontal position in which to display the column. * @example * ```javascript * activeSheet.showColumn(9, GC.Spread.Sheets.HorizontalPosition.left); * ``` */ showColumn(col: number, horizontalPosition: GC.Spread.Sheets.HorizontalPosition): void; /** * Gets or sets whether the column outline (range group) is visible. * @param {boolean} value Whether to display the column outline. * @returns {boolean | GC.Spread.Sheets.Worksheet} If no value is set, returns a value that indicates whether the column outline is displayed on this sheet; otherwise, returns the worksheet. * @example * ```javascript * //This example uses the showColumnOutline method. * activeSheet.showColumnOutline(false); * ``` */ showColumnOutline(value?: boolean): any; /** * Moves the view of a row to the specified position in the viewport. * @param {number} row The row index. * @param {GC.Spread.Sheets.VerticalPosition} verticalPosition The vertical position in which to display the row. * @example * ```javascript * activeSheet.showRow(9, GC.Spread.Sheets.VerticalPosition.top); * ``` */ showRow(row: number, verticalPosition: GC.Spread.Sheets.VerticalPosition): void; /** * Gets or sets whether the row outline (range group) is visible. * @param {boolean} value Whether to display the row outline. * @returns {boolean | GC.Spread.Sheets.Worksheet} If no value is set, returns a value that indicates whether the row outline is displayed on this sheet; otherwise, returns the worksheet. * @example * ```javascript * //This example uses the showRowOutline method. * activeSheet.showRowOutline(false); * ``` */ showRowOutline(value?: boolean): any; /** * Sorts a range of cells in this sheet in the data model. * @param {number} row The index of the starting row of the block of cells to sort. * @param {number} column The index of the starting column of the block of cells to sort. * @param {number} rowCount The number of rows in the block of cells. * @param {number} columnCount The number of columns in the block of cells. * @param {boolean} byRows Set to `true` to sort by rows, and `false` to sort by columns. * @param {Object} sortInfo The SortInfo object with sort criteria and information about how to perform the sort. For example, [{index:0,ascending:true}] * @param {number} sortInfo.index The index of the column or row on which to sort. * @param {boolean} sortInfo.ascending Whether the sort order is ascending When sort by value or custom sort. * @param {string} sortInfo.order Only support "top" and "bottom". color selected will group on top when order is "top". * @param {string | null} sortInfo.fontColor The font color of sort. * @param {string | Object} sortInfo.backColor The back color of sort. this paramter supports color string, gradient fill and pattern fill. * @param {Function} sortInfo.compareFunction Whether the sort order is ascending. function (value1, value2) {return 0;}. * @param {Object} sortOption The sortOption indicate the detail performance of the sort. * @param {GC.Spread.Sheets.GroupSort} sortOption.groupSort The groupSort indicate the sort action with group, whether sort all the groups and its inner content. * @param {boolean} sortOption.ignoreHidden Whether to ignore the hidden values and only sort visible values. * @returns {boolean} `true` if the data is sorted successfully; otherwise, `false`. * @example * ```javascript * //This example sorts a range. * sheet.setValue(0,0,"112"); * sheet.setValue(1,0,"10"); * sheet.setValue(2,0,"223"); * sheet.setValue(3,0,"20"); * sheet.setValue(4,0,"334"); * sheet.setValue(5,0,"30"); * function pinyinCompare (obj1, obj2) { * return obj1.toString().localeCompare(obj2.toString(), 'zh'); * } * sheet.sortRange(0, 0, 6, 1, true, [ * {index:0, ascending:true, compareFunction: pinyinCompare} * ], {groupSort: GC.Spread.Sheets.GroupSort.full, ignoreHidden: true}); * ``` */ sortRange(row: number, column: number, rowCount: number, columnCount: number, byRows: boolean, sortInfo: Array, sortOption?: GC.Spread.Sheets.ISortOptions): boolean; /** * Starts to edit the cell. * @param {boolean} selectAll Set to `true` to select all the text in the cell. * @param {string} defaultText The default text to display while editing the cell. * @example * ```javascript * //This example uses the startEdit method. * activeSheet.setActiveCell(5,5); * activeSheet.startEdit(true, "Test"); * ``` */ startEdit(selectAll?: boolean, defaultText?: string): void; /** * Suspends the calculation service. * @param {boolean} ignoreDirty Specifies whether to invalidate the dependency cells. * @example * ```javascript * //This example uses the suspendCalcService method. * activeSheet.suspendCalcService(false); * activeSheet.setValue(0,0,1); * activeSheet.setValue(0,1,2); * activeSheet.setValue(0,2,10); * activeSheet.getCell(1,1).formula("=SUM(A1:C1)"); * activeSheet.resumeCalcService(true); * ``` */ suspendCalcService(ignoreDirty?: boolean): void; /** * Suspends recording the dirty data. * @example * ```javascript * //This example uses the suspendDirty method. * var customers = [ * { ID: 0, Name: 'A', Info1: 'Info0' }, * { ID: 1, Name: 'B', Info1: 'Info1' }, * { ID: 2, Name: 'C', Info1: 'Info2' }, * ]; * activeSheet.setDataSource(customers); * activeSheet.suspendDirty(); * alert(activeSheet.isDirtySuspended()); * activeSheet.resumeDirty(); * alert(activeSheet.isDirtySuspended()); * ``` */ suspendDirty(): void; /** * Suspends the event. * @example * ```javascript * //This example suspends and resumes the event. * activeSheet.bind(GC.Spread.Sheets.Events.CellChanged, function (sender, args) { * if (args.propertyName === "value") { * alert(activeSheet.getValue(args.row, args.col)); * } * }); * activeSheet.suspendEvent(); * activeSheet.setValue(0, 0, "111"); * activeSheet.resumeEvent(); * activeSheet.setValue(1, 1, "222"); * ``` */ suspendEvent(): void; /** * Suspends the paint. */ suspendPaint(): void; /** * Gets or sets the tag value for the current sheet. * @param {Object} value The tag value to set for the current sheet. * @returns {Object | GC.Spread.Sheets.Worksheet} If no value is set, returns the tag value of the current sheet; otherwise, returns the worksheet. * @example * ```javascript * //This example sets the sheet tag. * activeSheet.tag("test"); * alert(activeSheet.tag()); * ``` */ tag(value?: any): any; /** * Saves the object state to a JSON string. * @param {Object} serializationOption Serialization option that contains the includeBindingSource argument. See the Remarks for more information. * @returns {Object} The sheet data. * @example * ```javascript * //This example uses the toJSON method. * activeSheet.getCell(0,0).value(123); * var jsonStr = null; * //export * jsonStr = JSON.stringify(activeSheet.toJSON()); * //import * activeSheet.fromJSON(JSON.parse(jsonStr)); * alert(jsonStr); * ``` */ toJSON(serializationOption?: Object): Object; /** * Removes the binding of an event to the sheet. * @param {string} type The event type. * @param {Function} fn Specifies the function for which to remove the binding. * @example * ```javascript * //This example unbinds the event after setting the first value. * activeSheet.bind(GC.Spread.Sheets.Events.CellChanged, function (sender, args) { * if (args.propertyName === "value") { * alert(activeSheet.getValue(args.row, args.col)); * } * }); * activeSheet.setValue(0, 0, "111"); * activeSheet.unbind(GC.Spread.Sheets.Events.CellChanged); * activeSheet.setValue(1, 0, "222"); * activeSheet.setValue(2, 0, "333"); * activeSheet.setValue(3, 0, "444"); * ``` */ unbind(type: string, fn?: Function): void; /** * Removes the binding of all events to the sheet. * @example * ```javascript * //This example cancels monitoring of all events. * activeSheet.bind(GC.Spread.Sheets.Events.CellChanged, function (sender, args) { * if (args.propertyName === "value") { * alert(activeSheet.getValue(args.row, args.col)); * } * }); * activeSheet.setValue(0, 0, "111"); * activeSheet.unbindAll(); //cancel monitoring of all events. * activeSheet.setValue(1, 0, "222"); * activeSheet.setValue(2, 0, "333"); * activeSheet.setValue(3, 0, "444"); * ``` */ unbindAll(): void; /** * Ungroups the sparklines in the specified group. * @param {GC.Spread.Sheets.Sparklines.SparklineGroup} group The sparkline group. * @example * ```javascript * //This example uses the ungroupSparkline method. * activeSheet.setValue(0, 0, "Data Range is A2-A9"); * activeSheet.setValue(1, 0, 1); * activeSheet.setValue(2, 0, -2); * activeSheet.setValue(3, 0, -1); * activeSheet.setValue(4, 0, 6); * activeSheet.setValue(5, 0, 4); * activeSheet.setValue(6, 0, -4); * activeSheet.setValue(7, 0, 3); * activeSheet.setValue(8, 0, 8); * var data = new GC.Spread.Sheets.Range(1, 0, 8, 1); * var setting = new GC.Spread.Sheets.Sparklines.SparklineSetting(); * var s1= activeSheet.setSparkline(11, 0, data, GC.Spread.Sheets.Sparklines.DataOrientation.Vertical, GC.Spread.Sheets.Sparklines.SparklineType.line, setting); * var s2 =activeSheet.setSparkline(11, 3, data, GC.Spread.Sheets.Sparklines.DataOrientation.Vertical, GC.Spread.Sheets.Sparklines.SparklineType.column, setting); * var s3= activeSheet.setSparkline(11, 6, data, GC.Spread.Sheets.Sparklines.DataOrientation.Vertical, GC.Spread.Sheets.Sparklines.SparklineType.winloss, setting); * var group = activeSheet.groupSparkline([s1,s2,s3]); * //activeSheet.ungroupSparkline(group); * ``` */ ungroupSparkline(group: GC.Spread.Sheets.Sparklines.SparklineGroup): void; /** * Unprotects a worksheet. * @property {string} password Sheet protection password. * @returns {boolean} Return true if password is correct or isProtect is false, otherwise return false. * @example * ```javascript * let password = "fe4c4be8" * sheet.protect(password); * sheet.unprotect(password); * ``` */ unprotect(password?: string): boolean; /** * Sets whether the worksheet is displayed. * @param {boolean | GC.Spread.Sheets.SheetTabVisible} [value] Whether the worksheet is displayed. * @returns {GC.Spread.Sheets.SheetTabVisible | GC.Spread.Sheets.Worksheet} If you call this function without a parameter, it returns a boolean indicating whether the sheet is visible; * otherwise, it returns the current worksheet object. * @example * ```javascript * activeSheet.visible(false); * ``` */ visible(value?: boolean | GC.Spread.Sheets.SheetTabVisible): any; /** * Gets or sets the zoom factor for the sheet. * @param {number} [factor] The zoom factor. * @returns {number|GC.Spread.Sheets.Worksheet} If no value is set, returns the zoom factor; otherwise, returns the worksheet. * @example * ```javascript * //This example zooms the sheet. * spread.options.allowUserZoom = false; * sheet.zoom(3); * ``` */ zoom(factor?: number): any; } module AI{ /** * @param {IAIConfig} config * @returns {Promise} */ export type AIRequestCallback = (config: IAIConfig) => Promise /** * @property {{ role: string; content: string }[]} [messages] * @property {number} [temperature] * @property {number} [max_tokens] * @property {boolean} [stream] */ export type IAIConfig = { messages: { role: string; content: string }[]; temperature?: number; max_tokens?: number; stream?: boolean; [key: string]: any; } /** * @property {string} model * @property {string} key * @property {string} basePath */ export type IAIEnvironment = { model: string; key: string; basePath: string; } } module AutoMerge{ export interface IRangeInfo{ range: GC.Spread.Sheets.Range; direction: GC.Spread.Sheets.AutoMerge.AutoMergeDirection; mode: GC.Spread.Sheets.AutoMerge.AutoMergeMode; sheetArea: GC.Spread.Sheets.SheetArea; selectionMode?: GC.Spread.Sheets.AutoMerge.SelectionMode; } /** * Indicates the auto merge direction. * @enum {number} */ export enum AutoMergeDirection{ /** * Indicates to cancel the auto merge. */ none= 0, /** * Indicates to apply the auto merge in column direction. */ column= 1, /** * Indicates to apply the auto merge in row direction. */ row= 2, /** * Indicates to apply the auto merge in column direction preferentially then in row direction. */ columnRow= 3, /** * Indicates to apply the auto merge in row direction preferentially then in column direction. */ rowColumn= 4 } /** * Indicates the auto merge mode. * @enum {number} */ export enum AutoMergeMode{ /** * Indicates to apply the auto merge when neighboring cells have same value. */ free= 0, /** * Indicates to apply the auto merge when neighboring cells have same value and the corresponding cells in previous row or column are merged automatically. */ restricted= 1 } /** * Indicates the auto merge selection mode. * @enum {number} */ export enum SelectionMode{ /** * Indicates to select individual cell when the auto merge is applied. */ source= 0, /** * Indicates to select all cells which have same value when the auto merge is applied. */ merged= 1 } } module Barcode{ export class Codabar extends GC.Spread.Sheets.Sparklines.SparklineEx{ /** * Represents the class for the Codabar. * @extends GC.Spread.Sheets.Sparklines.SparklineEx * @class */ constructor(); } export class Code128 extends GC.Spread.Sheets.Sparklines.SparklineEx{ /** * Represents the class for the Code128. * @extends GC.Spread.Sheets.Sparklines.SparklineEx * @class */ constructor(); } export class Code39 extends GC.Spread.Sheets.Sparklines.SparklineEx{ /** * Represents the class for the Code39. * @extends GC.Spread.Sheets.Sparklines.SparklineEx * @class */ constructor(); } export class Code49 extends GC.Spread.Sheets.Sparklines.SparklineEx{ /** * Represents the class for the Code49. * @extends GC.Spread.Sheets.Sparklines.SparklineEx * @class */ constructor(); } export class Code93 extends GC.Spread.Sheets.Sparklines.SparklineEx{ /** * Represents the class for the Code93. * @extends GC.Spread.Sheets.Sparklines.SparklineEx * @class */ constructor(); } export class DataMatrix extends GC.Spread.Sheets.Sparklines.SparklineEx{ /** * Represents the class for the DataMatrix. * @extends GC.Spread.Sheets.Sparklines.SparklineEx * @class */ constructor(); } export class EAN13 extends GC.Spread.Sheets.Sparklines.SparklineEx{ /** * Represents the class for the EAN13. * @extends GC.Spread.Sheets.Sparklines.SparklineEx * @class */ constructor(); } export class EAN8 extends GC.Spread.Sheets.Sparklines.SparklineEx{ /** * Represents the class for the EAN8. * @extends GC.Spread.Sheets.Sparklines.SparklineEx * @class */ constructor(); } export class GS1_128 extends GC.Spread.Sheets.Sparklines.SparklineEx{ /** * Represents the class for the GS1_128. * @extends GC.Spread.Sheets.Sparklines.SparklineEx * @class */ constructor(); } export class PDF417 extends GC.Spread.Sheets.Sparklines.SparklineEx{ /** * Represents the class for the PDF417. * @extends GC.Spread.Sheets.Sparklines.SparklineEx * @class */ constructor(); } export class QRCode extends GC.Spread.Sheets.Sparklines.SparklineEx{ /** * Represents the class for the QRCode. * @extends GC.Spread.Sheets.Sparklines.SparklineEx * @class */ constructor(); } } module Bindings{ export class CellBindingSource{ /** * Represents a source for cell binding. * @param {Object} source The data source. * @class * @example * ```javascript * var person = {name: "Wang feng", age: 25, address: {postcode: "710075"}}; * var source = new GC.Spread.Sheets.Bindings.CellBindingSource(person); * activeSheet.setBindingPath(0, 0, "name"); * activeSheet.setBindingPath(1, 1, "age"); * activeSheet.setBindingPath(3, 3, "address.postcode"); * activeSheet.setDataSource(source); * ``` */ constructor(source: Object); /** * Gets the wrapped data source for cell binding. * @returns {Object} The original data source. * @example * ```javascript * //This example gets the name. * var person = { name: "Wang feng", age: 25, address: { postcode: "710075" } }; * var source = new GC.Spread.Sheets.Bindings.CellBindingSource(person); * activeSheet.setBindingPath(0, 0, "name"); * activeSheet.setBindingPath(1, 1, "age"); * activeSheet.setBindingPath(3, 3, "address.postcode"); * activeSheet.setDataSource(source); * alert(source.getSource().name); * ``` */ getSource(): Object; /** * Gets the value of the source by the binding path. * @param {string} path The binding path. * @returns {Object} Returns the value of the binding source at the specified path. * @example * ```javascript * //This example gets the value. * var person = {name: "Wang feng", age: 25, address: {postcode: "710075"}}; * var source = new GC.Spread.Sheets.Bindings.CellBindingSource(person); * activeSheet.setBindingPath(0, 0, "name"); * activeSheet.setBindingPath(1, 1, "age"); * activeSheet.setBindingPath(3, 3, "address.postcode"); * activeSheet.setDataSource(source); * alert(source.getValue("name")); * ``` */ getValue(path: string): Object; /** * Sets the value of the source by the binding path. * @param {string} path The row index. * @param {Object} value The value to set. * @example * ```javascript * //This example sets the name value. * var person = {name: "Wang feng", age: 25, address: {postcode: "710075"}}; * var source = new GC.Spread.Sheets.Bindings.CellBindingSource(person); * activeSheet.setBindingPath(0, 0, "name"); * activeSheet.setBindingPath(1, 1, "age"); * activeSheet.setBindingPath(3, 3, "address.postcode"); * activeSheet.setDataSource(source); * source.setValue("name", "test"); * activeSheet.resumePaint(); * activeSheet.repaint(); * ``` */ setValue(path: string, value: Object): void; } } module CalcEngine{ /** * Evaluates the specified formula. * @param {object} context The evaluation context; in general, you should use the active sheet object. * @param {string} formula The formula string. * @param {number} [baseRow] The base row index of the formula. * @param {number} [baseColumn] The base column index of the formula. * @param {boolean} [useR1C1] Whether to use the r1c1 reference style. * @param {boolean} [preserveArrayResult] Whether to return the array when the result is array. Return one single value if it's false or undefined. * @example * ```javascript * var spread = new GC.Spread.Sheets.Workbook(document.getElementById('ss'), { sheetCount: 1 }); * sheet = spread.getSheet(0); * sheet.setValue(0, 0, 1); * sheet.setValue(1, 0, 2); * // Using EvaluateFormula() method to evaluate formula without setting formula in sheet's cell * var result = GC.Spread.Sheets.CalcEngine.evaluateFormula(sheet, "SUM(A1:A2)", 0, 0); * console.log("SUM(A1:A2) = " + result); * result = GC.Spread.Sheets.CalcEngine.evaluateFormula(sheet, "A1:A2", 0, 0, false, true); * console.log("A1:A2 = ", result); * ``` * @returns {object} The evaluated formula result. */ function evaluateFormula(context: Object, formula: string, baseRow?: number, baseColumn?: number, useR1C1?: boolean, preserveArrayResult?: boolean): any; /** * Evaluates the specified formula and return a promise of the formula result. * @param {object} context The evaluation context; in general, you should use the active sheet object. * @param {formula} string The formula string. * @param {number} [baseRow] The base row index of the formula. * @param {number} [baseColumn] The base column index of the formula. * @example * ```javascript * var spread = new GC.Spread.Sheets.Workbook(document.getElementById('ss'), { sheetCount: 1 }); * sheet = spread.getSheet(0); * sheet.setValue(0, 0, 1); * // Using evaluateFormulaAsync() method to evaluate formula without setting formula in sheet's cell * GC.Spread.Sheets.CalcEngine.evaluateFormulaAsync(sheet, 'WEBSERVICE("http://*.com/name/"&A1)', 0, 0).then(function (result) {console.log(result)}); * ``` * @returns {Promise} The Promise of formula result. */ function evaluateFormulaAsync(context: Object, formula: string, baseRow?: number, baseColumn?: number): Promise; /** * Unparse the specified expression tree to formula string. * @param {object} context The context; in general, you should use the active sheet object. * @param {GC.Spread.CalcEngine.Expression} expression The expression tree. * @param {number} [baseRow] The base row index of the formula. * @param {number} [baseColumn] The base column index of the formula. * @param {boolean} [useR1C1] Whether to use the r1c1 reference style. * @returns {string} The formula string. * @example * ```javascript * var spread = new GC.Spread.Sheets.Workbook(document.getElementById('ss'), { sheetCount: 1 }); * sheet = spread.getSheet(0); * sheet.setValue(0, 0, 1); * sheet.setValue(0, 1, 2); * sheet.setValue(0, 2, 3); * sheet.addCustomName("customName1", "=12", 0, 0); * sheet.addCustomName("customName2", "Average(20,45)", 0, 0); * sheet.addCustomName("customName3", "=$A$1:$C$1"); * sheet.setFormula(1, 0, "customName1"); * sheet.setFormula(1, 1, "customName2"); * sheet.setFormula(1, 2, "sum(customName3)"); * var cname = sheet.getCustomName("customName2"); * if (cname instanceof GC.Spread.Sheets.NameInfo) { * // Get CustomName * var name = cname.getName(); * // Get Expression * var expression = cname.getExpression(); * // Get Expression String * var expStr = GC.Spread.Sheets.CalcEngine.expressionToFormula(sheet, expression, 0, 0); * console.log("Name: " + name + " ; Expression: " + expStr); * } * ``` */ function expressionToFormula(context: Object, expression: GC.Spread.CalcEngine.Expression, baseRow?: number, baseColumn?: number, useR1C1?: boolean): string; /** * Parse the specified formula to expression tree. * @param {object} context The context; in general, you should use the active sheet object. * @param {string} formula The formula string. * @param {number} [baseRow] The base row index of the formula. * @param {number} [baseColumn] The base column index of the formula. * @param {boolean} [useR1C1] Whether to use the r1c1 reference style. * @returns {GC.Spread.CalcEngine.Expression} The expression tree. * @example * ```javascript * var spread = new GC.Spread.Sheets.Workbook(document.getElementById('ss'), { sheetCount: 1 }); * sheet = spread.getSheet(0); * sheet.setValue(0, 0, 1); * sheet.setValue(0, 1, 2); * sheet.setValue(0, 2, 3); * sheet.getCell(4, 4).formula("=SUM(A1:C1)"); * var formula = sheet.getFormula(4, 4); * var expression = GC.Spread.Sheets.CalcEngine.formulaToExpression(sheet, formula, 0, 0); * console.log("Function Name is: " + expression.functionName); * ``` */ function formulaToExpression(context: Object, formula: string, baseRow?: number, baseColumn?: number, useR1C1?: boolean): GC.Spread.CalcEngine.Expression; /** * Converts a formula string to the specified cell ranges. * @param {GC.Spread.Sheets.Worksheet} sheet The base sheet. * @param {string} formula The formula. * @param {number} baseRow The base row index of the formula. * @param {number} baseCol The base column index of the formula. * @returns {Array} The cell ranges that refers to the formula string. */ function formulaToRanges(sheet: GC.Spread.Sheets.Worksheet, formula: string, baseRow?: number, baseCol?: number): Object[]; /** * Attempts to find a value for one cell that produces the desired formula result in another cell. * @param {GC.Spread.Sheets.Worksheet} changingSheet The sheet that contains the cell that you want to adjust. * @param {number} changingRow The row index of the cell that contains the value that you want to adjust. * @param {number} changingColumn The column index of the cell that contains the value that you want to adjust. * @param {GC.Spread.Sheets.Worksheet} formulaSheet The sheet that contains the formula that you want to resolve. * @param {number} formulaRow The row index of the cell that contains the formula that you want to resolve. * @param {number} formulaColumn The column index of the cell that contains the formula that you want to resolve. * @param {number} desiredResult The formula result that you want. * @returns {boolean} Indicate that whether a solution has been found. * @example * ```javascript * // This sample shows how to use the goal seek. * // Loan amount is 10000, term is 18 months and pay 600 each month, evaluate what interest rate you will need to secure in order to meet your loan goal. * sheet.setValue(0, 1, 10000); // Loan Amount * sheet.setValue(1, 1, 18); // Term in Months * sheet.setFormatter(2, 1, "0%"); // Interest Rate * sheet.setFormatter(3, 1, "0.00"); * sheet.setFormula(3, 1, "PMT(B3/12,B2,B1)"); // Payment * GC.Spread.Sheets.CalcEngine.goalSeek(sheet, 2, 1, sheet, 3, 1, -600); // result in B3 is 10% * ``` */ function goalSeek(changingSheet: GC.Spread.Sheets.Worksheet, changingRow: number, changingColumn: number, formulaSheet: GC.Spread.Sheets.Worksheet, formulaRow: number, formulaColumn: number, desiredResult: number): boolean; /** * Converts the specified cell range to a formula string. * @param {GC.Spread.Sheets.Range[]} ranges The cell range in the sheet. * @param {number} [baseRow] The base row index of the formula. * @param {number} [baseCol] The base column index of the formula. * @param {GC.Spread.Sheets.CalcEngine.RangeReferenceRelative} [rangeReferenceRelative] Whether the range reference is relative or absolute. * @param {boolean} [useR1C1] Whether to use the r1c1 reference style. * @returns {string} The formula string that refers to the specified cell range. * @example * ```javascript * spread = new GC.Spread.Sheets.Workbook(document.getElementById('ss'), { sheetCount: 1 }); * sheet = spread.getSheet(0); * // Setting Value * sheet.setValue(0, 0, 1, 3); * sheet.setValue(1, 0, 50, 3); * sheet.setValue(2, 0, 100, 3); * sheet.setValue(3, 0, 2, 3); * sheet.setValue(4, 0, 60, 3); * sheet.setValue(5, 0, 90, 3); * sheet.setValue(6, 0, 3, 3); * sheet.setValue(7, 0, 40, 3); * sheet.clearSelection(); * // Adding selections * sheet.addSelection(0, 0, 3, 1); * sheet.addSelection(5, 0, 2, 1); * var ranges = sheet.getSelections(); * // getting range string * var rangesStr = GC.Spread.Sheets.CalcEngine.rangesToFormula(ranges); * // creating formula using selected ranges * var formula = "Sum(" + rangesStr + ")"; * // setting formula in Sheet's cell * sheet.setFormula(5, 5, formula, GC.Spread.Sheets.SheetArea.viewport); * ``` */ function rangesToFormula(ranges: GC.Spread.Sheets.Range[], baseRow?: number, baseCol?: number, rangeReferenceRelative?: GC.Spread.Sheets.CalcEngine.RangeReferenceRelative, useR1C1?: boolean): string; /** * Converts the specified cell range to a formula string. * @param {GC.Spread.Sheets.Range} range The cell range in the sheet. * @param {number} [baseRow] The base row index of the formula. * @param {number} [baseCol] The base column index of the formula. * @param {GC.Spread.Sheets.CalcEngine.RangeReferenceRelative} [rangeReferenceRelative] Whether the range reference is relative or absolute. * @param {boolean} [useR1C1] Whether to use the r1c1 reference style. * @returns {string} The formula string that refers to the specified cell range. * @example * ```javascript * var spread = new GC.Spread.Sheets.Workbook(document.getElementById('ss'), { sheetCount: 1 }); * sheet = spread.getSheet(0); * // setting value * sheet.setValue(0, 0, 1, 3); * sheet.setValue(1, 0, 50, 3); * sheet.setValue(2, 0, 100, 3); * sheet.setValue(3, 0, 2, 3); * sheet.setValue(4, 0, 60, 3); * sheet.setValue(5, 0, 90, 3); * sheet.clearSelection(); * // adding selection * sheet.addSelection(2, 0, 3, 1); * var range = sheet.getSelections(); * // Getting range string * var rangeStr = GC.Spread.Sheets.CalcEngine.rangeToFormula(range[0]); * // creating formula using selected range * var formula = "Sum(" + rangeStr + ")"; * // setting formula in Sheet's cell * sheet.setFormula(5, 5, formula, GC.Spread.Sheets.SheetArea.viewport); * ``` */ function rangeToFormula(range: GC.Spread.Sheets.Range, baseRow?: number, baseCol?: number, rangeReferenceRelative?: GC.Spread.Sheets.CalcEngine.RangeReferenceRelative, useR1C1?: boolean): string; /** * Specifies whether the range reference is relative or absolute. * @enum {number} */ export enum RangeReferenceRelative{ /** * Specifies all reference is absolute */ allAbsolute= 0, /** * Specifies start row is relative */ startRowRelative= 1, /** * Specifies start column is relative */ startColRelative= 2, /** * Specifies end row is relative */ endRowRelative= 4, /** * Specifies end column is relative */ endColRelative= 8, /** * Specifies row is relative */ rowRelative= 5, /** * Specifies column is relative */ colRelative= 10, /** * Specifies all reference is relative */ allRelative= 15 } } module CellState{ export class CellStateManager{ /** * Represents a cellstate manager that can manage all cell state in a sheet. * @class * @param {GC.Spread.Sheets.Worksheet} sheet The worksheet. */ constructor(sheet: GC.Spread.Sheets.Worksheet); /** * @description Add cell state instance for range , which will apply style of cellState when the state of range cell matched. * @param range {GC.Spread.Sheets.Range} The scope range which will apply style of cellState. * @param state {GC.Spread.Sheets.CellStatesType} Which state will use style. * @param style {GC.Spread.Sheets.Style} Which style when the state is matched. * @param sheetArea {GC.Spread.Sheets.SheetArea} The sheet area. If this parameter is not provided, it defaults to `viewport`. * @example * ```javascript * var style = new GC.Spread.Sheets.Style(); * style.backColor = 'blue'; * style.foreColor = 'red'; * var range = new GC.Spread.Sheets.Range(1,2,3,3); * sheet.cellStates.add(range, GC.Spread.Sheets.CellStatesType.hover, style, GC.Spread.Sheets.SheetArea.viewport); * ``` */ add(range: GC.Spread.Sheets.Range, state: GC.Spread.Sheets.CellStatesType, style: GC.Spread.Sheets.Style, sheetArea?: GC.Spread.Sheets.SheetArea): void; /** * @description Clear all style by range, after clear there are no style will be applied when the cell state is matched. * @param range {GC.Spread.Sheets.Range} The scope range for clear. * @param sheetArea {GC.Spread.Sheets.SheetArea} The sheet area. If this parameter is not provided, it defaults to `viewport`. * @example * ```javascript * var range = new GC.Spread.Sheets.Range(1,2,3,3); * sheet.cellStates.clear(range, GC.Spread.Sheets.SheetArea.viewport); * ``` */ clear(range: GC.Spread.Sheets.Range, sheetArea: GC.Spread.Sheets.SheetArea): void; } } module CellTypes{ export interface ICelltypeItemOption{ text: string; value: number | string; } export interface IDataBinding{ /** * Represents the data binding source. it can be a table name, or a formula. */ dataSource: string; /** * Represents the column name or column index of the data source that will binding to the text of the item of the ComboBox. */ text?: string | number; /** * Represents the column name or column index of the data source that will binding to the value of the item of the ComboBox. */ value?: string | number; } export interface IFileInfo{ name: string; blob?: Blob; dataUrl?: string; } export interface IFilePreviewInfo extends GC.Spread.Sheets.CellTypes.IFileInfo{ sheetName: string; row: number; col: number; } export interface IItemSpacing{ horizontal?: number; vertical?: number; } export interface IToggleOptions{ width?: number; height?: number; trackColorOn?: string; trackColorOff?: string; sliderColorOn?: string; sliderColorOff?: string; sliderMargin?: number; animationDuration?: number; trackRadius?: number; sliderRadius?: number; autoSize?: boolean; } /** * Specifies the text alignment for check box cells. * @enum {number} * @example * ```javascript * //This example creates a check box cell. * var cellType1 = new GC.Spread.Sheets.CellTypes.CheckBox(); * cellType1.caption("caption"); * cellType1.textTrue("true"); * cellType1.textFalse("false"); * cellType1.textIndeterminate("indeterminate"); * cellType1.textAlign(GC.Spread.Sheets.CellTypes.CheckBoxTextAlign.bottom); * cellType1.isThreeState(true); * cellType1.boxSize(20); * activeSheet.getCell(1, 1).cellType(cellType1); * ``` */ export enum CheckBoxTextAlign{ /** * Specifies text is on top of the check box. */ top= 0, /** * Specifies text is below the check box. */ bottom= 1, /** * Specifies text is to the left of the check box. */ left= 2, /** * Specifies text is to the right of the check box. */ right= 3, /** * Specifies text is inside the toggle button. */ inside= 4 } /** * Specifies the extend direction for radio list cells. * @enum {number} * @example * ```javascript * //This example creates a radio button list cell. * var cellType2 = new GC.Spread.Sheets.CellTypes.RadioButtonList(); * cellType2.items([{text:"a",value:1},{text:"b",value:2},{text:"c",value:3}]); * cellType2.direction(GC.Spread.Sheets.CellTypes.Direction.vertical); * activeSheet.getCell(2, 2).cellType(cellType2); * ``` */ export enum Direction{ /** * Specifies item extend by horizontal. */ horizontal= 0, /** * Specifies item extend by vertical. */ vertical= 1 } /** * Specifies what is the diverge direction of the diagonal cell type * @readonly * @enum {number} * @example * ```javascript * //This example uses the EditorValueType enumeration. * var diagonalCellType = new GC.Spread.Sheets.CellTypes.Diagonal(); * diagonalCellType.divergeDirection(GC.Spread.Sheets.CellTypes.DivergeDirection.topLeftToBottomRight) * activeSheet.getCell(2, 2).cellType(diagonalCellType); * ``` */ export enum DivergeDirection{ /** * Represents diverge from the TopLeft to the BottomRight. */ topLeftToBottomRight= 0, /** * Represents diverge from the BottomLeft to the TopRight. */ bottomLeftToTopRight= 1 } /** * Represents the editor type of text cell type. * @enum {number} * @example * ```javascript * //This example shows how to change the editor of text cell type to textarea. * var tempStyle = new GC.Spread.Sheets.Style(); * tempStyle.cellType = new GC.Spread.Sheets.CellTypes.Text(GC.Spread.Sheets.CellTypes.EditorType.textarea); * activeSheet.setDefaultStyle(tempStyle); * ``` */ export enum EditorType{ /** * Use textarea element as the editor of text cell type. */ textarea= 0, /** * Use editorable div element as the editor of text cell type. */ editableDiv= 1 } /** * Specifies what is written out to the data model for a selected item from * certain cell types that offer a selection of multiple values. * @readonly * @enum {number} * @example * ```javascript * //This example uses the EditorValueType enumeration. * var cellType2 = new GC.Spread.Sheets.CellTypes.ComboBox(); * cellType2.items(["a","b","c"]); * cellType2.editorValueType(GC.Spread.Sheets.CellTypes.EditorValueType.text); * activeSheet.getCell(2, 2).cellType(cellType2); * ``` */ export enum EditorValueType{ /** * Writes the text value of the selected item to the model. */ text= 0, /** * Writes the index of the selected item to the model. */ index= 1, /** * Writes the corresponding data value of the selected item to the model. */ value= 2 } /** * Specifies the hyperlink's target type. * @enum {number} * @example * ```javascript * //This example creates a hyperlink cell. * var cellType = new GC.Spread.Sheets.CellTypes.HyperLink(); * cellType.linkColor("blue"); * cellType.visitedLinkColor("#FFFF00"); * cellType.text("SpreadJS"); * cellType.linkToolTip("Company Web Site"); * cellType.target(GC.Spread.Sheets.CellTypes.HyperLinkTargetType.self); * activeSheet.getCell(0, 2).cellType(cellType).value("http://www.spreadjs.com/"); * ``` */ export enum HyperLinkTargetType{ /** * Opens the hyperlinked document in a new window or tab. */ blank= 0, /** * Opens the hyperlinked document in the same frame where the user clicked. */ self= 1, /** * Opens the hyperlinked document in the parent frame. */ parent= 2, /** * Opens the hyperlinked document in the full body of the window. */ top= 3 } /** * Specifies the text selection mode for buttonList cells. * @enum {number} * @example * ```javascript * //This example creates a buttonList cell. * var cellType2 = new GC.Spread.Sheets.CellTypes.ButtonList(); * cellType2.items([{text:"a",value:1},{text:"b",value:2},{text:"c",value:3}]); * cellType2.selectionMode(GC.Spread.Sheets.CellTypes.SelectionMode.single); * activeSheet.getCell(2, 2).cellType(cellType2); * ``` */ export enum SelectionMode{ /** * Specifies selection mode is single. */ single= 0, /** * Specifies selection mode is multiple. */ multiple= 1 } /** * Specifies the text alignment for check box cells. * @enum {number} * @example * ```javascript * //This example creates a check box cell. * var cellType = new GC.Spread.Sheets.CellTypes.RadioButtonList(); * cellType.items([{text:"a",value:1},{text:"b",value:2},{text:"c",value:3}]); * cellType.textAlign(GC.Spread.Sheets.CellTypes.TextAlign.left); * activeSheet.getCell(2, 2).cellType(cellType); * ``` */ export enum TextAlign{ /** * Specifies text is on the top. */ //top = 0, = 0, /** * Specifies text is on the bottom. */ //bottom = 1, = 1, /** * Specifies text is on the left. */ left= 2, /** * Specifies text is on the right. */ right= 3, /** * Specifies text is inside the toggle button. */ inside= 4 } export class Base{ /** * Represents the base class for the other cell type classes. * @class * @example * ```javascript * // define a custom cell type * function MyCellType(color) { * GC.Spread.Sheets.CellTypes.Base.apply(this, arguments); * this.color = color || "orange"; * this.typeName = "MyCellType"; * } * MyCellType.prototype = new GC.Spread.Sheets.CellTypes.Base(); * MyCellType.prototype.paint = function (ctx, value, x, y, width, height, style, context) { * var MARGIN = 5, * plotLeft = x + MARGIN, * plotWidth = width - 2 * MARGIN, * plotTop = y + MARGIN, * plotHeight = height - 2 * MARGIN, * halfHeight = plotHeight / 2, * halfWidth = plotWidth / 2; * * ctx.beginPath(); * ctx.moveTo(plotLeft, plotTop + halfHeight); * ctx.lineTo(plotLeft + halfWidth, plotTop); * ctx.lineTo(plotLeft + plotWidth, plotTop + halfHeight); * ctx.lineTo(plotLeft + halfWidth, plotTop + plotHeight); * ctx.lineTo(plotLeft, plotTop + halfHeight); * ctx.strokeStyle = this.color; * ctx.stroke(); * }; * // set the custom cell type to a cell * sheet.setCellType(0, 0, new MyCellType("green")); * ``` */ constructor(); /** * Represents the type name string used for supporting serialization. * @type {string} */ typeName: string; /** * Activates the editor, including setting properties or attributes for the editor and binding events for the editor. * @param {Object} editorContext The DOM element that was created by the createEditorElement method. * @param {GC.Spread.Sheets.Style} cellStyle The cell's actual style. * @param {GC.Spread.Sheets.Rect} cellRect The cell's layout information. * @param {Object} context The context associated with the cell type. See the Remarks for more information. */ activateEditor(editorContext: HTMLElement, cellStyle: GC.Spread.Sheets.Style, cellRect: GC.Spread.Sheets.Rect, context?: any): void; /** * Creates a DOM element then returns it. * @param {Object} context The context associated with the cell type. See the Remarks for more information. * @returns {HTMLElement} Returns a DOM element. */ createEditorElement(context?: any): HTMLElement; /** * Deactivates the editor, such as unbinding events for editor. * @param {Object} editorContext The DOM element that was created by the createEditorElement method. * @param {Object} context The context associated with the cell type. See the Remarks for more information. */ deactivateEditor(editorContext: HTMLElement, context?: any): void; /** * Focuses the editor DOM element. * @param {HTMLElement} editorContext The DOM element that was created by the createEditorElement method. * @param {Object} context The context associated with the cell type. See the Remarks for more information. */ focus(editorContext: HTMLElement, context?: any): void; /** * Formats a value with the specified format to a string. * @param {Object} value The object value to format. * @param {GC.Spread.Formatter.GeneralFormatter | string} format The format. * @param {Object} formattedData the formatted data. * @param {Array} [formattedData.content] - The formatted data array, each item is an object that has two properties type and value, And it may contain these types: 'number', 'text', 'fillingChar', 'placeholder', 'exponent', 'decimalSeparator', 'groupSeparator', 'numberPlaceholder', 'percent', 'permille' and 'currency'. For example: {type: 'number', value: '123'}. * @param {string} [formattedData.conditionalForeColor] - The conditional foreground color. * @param {Object} context The context associated with the cell type. See the Remarks for more information. * @returns {string} Returns the formatted string. */ format(value: any, format: GC.Spread.Formatter.GeneralFormatter | string, formattedData?: GC.Spread.Sheets.FormattedData, context?: any): string; /** * Loads the object state from the specified JSON string. * @param {Object} settings The cell type data from deserialization. */ fromJSON(settings: any): void; /** * Gets a cell's height that can be used to handle the row's automatic fit. * @param {Object} value The cell's value. * @param {string} text The cell's text. * @param {GC.Spread.Sheets.Style} cellStyle The cell's actual value. * @param {number} zoomFactor The current sheet's zoom factor. * @param {Object} context The context associated with the cell type. See the Remarks for more information. * @returns {number} Returns the cell's height that can be used to handle the row's automatic fit. */ getAutoFitHeight(value: any, text: string, cellStyle: GC.Spread.Sheets.Style, zoomFactor: number, context?: any): number; /** * Gets a cell's width that can be used to handle the column's automatic fit. * @param {Object} value The cell's value. * @param {string} text The cell's text. * @param {GC.Spread.Sheets.Style} cellStyle The cell's actual value. * @param {number} zoomFactor The current sheet's zoom factor. * @param {Object} context The context associated with the cell type. See the Remarks for more information. * @returns {number} Returns the cell's width that can be used to handle the column's automatic fit. */ getAutoFitWidth(value: any, text: string, cellStyle: GC.Spread.Sheets.Style, zoomFactor: number, context?: any): number; /** * Gets the editor's value. * @param {Object} editorContext The DOM element that was created by the createEditorElement method. * @param {Object} context The context associated with the cell type. See the Remarks for more information. * @returns {Object} Returns the editor's value. */ getEditorValue(editorContext: HTMLElement, context?: any): any; /** * Gets the cell type's hit information. * @param {number} x x-coordinate of pointer's current location relative to the canvas. * @param {number} y y-coordinate of pointer's current location relative to the canvas. * @param {GC.Spread.Sheets.Style} cellStyle The current cell's actual style. * @param {GC.Spread.Sheets.Rect} cellRect The current cell's layout information. * @param {Object} context The context associated with the cell type. See the Remarks for more information. * @returns {Object} Returns an object that contains the x, y, row, col, cellRect, and sheetArea parameters, and a value to indicate isReservedLocation. * isReservedLocation is `true` if the hit test is in a special area that the cell type needs to handle; otherwise, `false`. */ getHitInfo(x: number, y: number, cellStyle: GC.Spread.Sheets.Style, cellRect: GC.Spread.Sheets.Rect, context?: any): GC.Spread.Sheets.IHitTestCellTypeHitInfo; /** * Whether the editing value has changed. * @param {Object} oldValue Old editing value. * @param {Object} newValue New editing value. * @param {Object} context The context associated with the cell type. See the Remarks for more information. * @returns {boolean} `true` if oldValue equals newValue; otherwise, `false`. */ isEditingValueChanged(oldValue: any, newValue: any, context?: any): boolean; /** * Whether this cell type is aware of IME. * @param {Object} context The context associated with the cell type. See the Remarks for more information. * @returns {boolean} `true` if the cell type is aware of IME; otherwise, `false`. */ isImeAware(context?: any): boolean; /** * Whether the cell type handles the keyboard event itself. * @param {KeyboardEvent} e The KeyboardEvent. * @param {Object} context The context associated with the cell type. See the Remarks for more information. * @returns {boolean} Returns `true` if the cell type handles the keyboard event itself; otherwise, `false`. */ isReservedKey(e: KeyboardEvent, context?: any): boolean; /** * Paints a cell on the canvas. * @param {CanvasRenderingContext2D} ctx The canvas's two-dimensional context. * @param {Object} value The cell's value. * @param {number} x x-coordinate relative to the canvas. * @param {number} y y-coordinate relative to the canvas. * @param {number} w The cell's width. * @param {number} h The cell's height. * @param {GC.Spread.Sheets.Style} style The cell's actual style. * @param {Object} context The context associated with the cell type. See the Remarks for more information. */ paint(ctx: CanvasRenderingContext2D, value: any, x: number, y: number, w: number, h: number, style: GC.Spread.Sheets.Style, context?: any): void; /** * Paints the cell content area on the canvas. * @param {CanvasRenderingContext2D} ctx The canvas's two-dimensional context. * @param {Object} value The cell's value. * @param {number} x x-coordinate relative to the canvas. * @param {number} y y-coordinate relative to the canvas. * @param {number} w The cell content area's width. * @param {number} h The cell content area's height. * @param {GC.Spread.Sheets.Style} style The cell's actual style. * @param {Object} context The context associated with the cell type. See the Remarks for more information. */ paintContent(ctx: CanvasRenderingContext2D, value: any, x: number, y: number, w: number, h: number, style: GC.Spread.Sheets.Style, context?: any): void; /** * Parses the text with the specified format string to an object. * @param {string} text The parse text string. * @param {string} formatStr The parse format string. * @param {Object} context The context associated with the cell type. See the Remarks for more information. * @returns {Object} The parsed object. */ parse(text: string, formatStr: string, context?: any): any; /** * Processes key down in display mode. * @param {KeyboardEvent} event The KeyboardEvent. * @param {Object} context The context associated with the cell type. See the Remarks for more information. * @returns {boolean} Returns `true` if the process is successful; otherwise, `false`. */ processKeyDown(event: KeyboardEvent, context?: any): boolean; /** * Processes key up in display mode. * @param {KeyboardEvent} event The KeyboardEvent. * @param {Object} context The context associated with the cell type. See the Remarks for more information. * @returns {boolean} Returns `true` if the process is successful; otherwise, `false`. */ processKeyUp(event: KeyboardEvent, context?: any): boolean; /** * Processes mouse down in display mode. * @param {Object} hitInfo The hit test information returned by the getHitInfo method. See the Remarks for more information. * @returns {boolean} Returns `true` if the process is successful; otherwise, `false`. */ processMouseDown(hitInfo: GC.Spread.Sheets.IHitTestCellTypeHitInfo): boolean; /** * Processes mouse enter in display mode. * @param {Object} hitInfo The hit test information returned by the getHitInfo method. See the Remarks for more information. * @returns {boolean} Returns `true` if the process is successful; otherwise, `false`. */ processMouseEnter(hitInfo: GC.Spread.Sheets.IHitTestCellTypeHitInfo): boolean; /** * Processes mouse leave in display mode. * @param {Object} hitInfo The hit test information returned by the getHitInfo method. See the Remarks for more information. * @returns {boolean} Returns `true` if the process is successful; otherwise, `false`. */ processMouseLeave(hitInfo: GC.Spread.Sheets.IHitTestCellTypeHitInfo): boolean; /** * Processes mouse move in display mode. * @param {Object} hitInfo The hit test information returned by the getHitInfo method. See the Remarks for more information. * @returns {boolean} Returns `true` if the process is successful; otherwise, `false`. */ processMouseMove(hitInfo: GC.Spread.Sheets.IHitTestCellTypeHitInfo): boolean; /** * Processes mouse up in display mode. * @param {Object} hitInfo The hit test information returned by the getHitInfo method. See the Remarks for more information. * @returns {boolean} Returns `true` if the process is successful; otherwise, `false`. */ processMouseUp(hitInfo: GC.Spread.Sheets.IHitTestCellTypeHitInfo): boolean; /** * Selects all the text in the editor DOM element. * @param {Object} editorContext The DOM element that was created by the createEditorElement method. * @param {Object} context The context associated with the cell type. See the Remarks for more information. */ selectAll(editorContext: HTMLElement, context?: any): void; /** * Sets the editor's value. * @param {Object} editorContext The DOM element that was created by the createEditorElement method. * @param {Object} value The value returned from the active cell. * @param {Object} context The context associated with the cell type. See the Remarks for more information. */ setEditorValue(editorContext: HTMLElement, value: any, context?: any): void; /** * Saves the object state to a JSON string. * @returns {Object} The cell type data. */ toJSON(): any; /** * Updates the editor's size. * @param {Object} editorContext The DOM element that was created by the createEditorElement method. * @param {GC.Spread.Sheets.Style} cellStyle The cell's actual style. * @param {GC.Spread.Sheets.Rect} cellRect The cell's layout information. * @param {Object} context The context associated with the cell type. See the Remarks for more information. * @returns {GC.Spread.Sheets.Rect} Returns the new size for cell wrapper element, it should contain two properties 'width' and 'height'. */ updateEditor(editorContext: HTMLElement, cellStyle: GC.Spread.Sheets.Style, cellRect: GC.Spread.Sheets.Rect, context?: any): GC.Spread.Sheets.Rect; /** * Updates the cell wrapper element size. * @param {HTMLElement} editorContext The DOM element that was created by the createEditorElement method. * @param {GC.Spread.Sheets.Rect} editorBounds The cell wrapper element's new size. * @param {number} editorBounds.x - The cell wrapper element's x position. * @param {number} editorBounds.y - The cell wrapper element's y position. * @param {number} editorBounds.width - The cell wrapper element's new width value. * @param {number} editorBounds.height - The cell wrapper element's new height value. * @param {GC.Spread.Sheets.Style} cellStyle The cell's actual style. */ updateEditorContainer(editorContext: HTMLElement, editorBounds: GC.Spread.Sheets.Rect, cellStyle: GC.Spread.Sheets.Style): void; /** * Updates the editor's ime-mode. * @param {Object} editorContext The DOM element that was created by the createEditorElement method. * @param {GC.Spread.Sheets.ImeMode} imeMode The ime-mode from cell's actual style. * @param {Object} context The context associated with the cell type. See the Remarks for more information. */ updateImeMode(editorContext: HTMLElement, imeMode: GC.Spread.Sheets.ImeMode, context?: any): void; } export class Button extends Base{ /** * Represents a button cell. * @extends GC.Spread.Sheets.CellTypes.Base * @class * @example * ```javascript * //This example creates a button cell. * var spread = new GC.Spread.Sheets.Workbook(); * var sheet = spread.getActiveSheet(); * var cellType = new GC.Spread.Sheets.CellTypes.Button(); * cellType.buttonBackColor("#FFFF00"); * cellType.text("this is a button"); * sheet.setCellType(1,1,cellType); * //Bind event * spread.bind(GC.Spread.Sheets.Events.ButtonClicked, function (e, args) { * var sheet = args.sheet, row = args.row, col = args.col; * var cellType = sheet.getCellType(row, col); * if (cellType instanceof GC.Spread.Sheets.CellTypes.Button) { * alert("Button Clicked"); * } * }); * ``` */ constructor(); /** * Gets or sets the button's background color. * @param {string} value The button's background color. * @returns {string | GC.Spread.Sheets.CellTypes.Button} If no value is set, returns the background color; otherwise, returns the button cell type. * @example * ```javascript * //This example creates a button cell. * var cellType = new GC.Spread.Sheets.CellTypes.Button(); * cellType.buttonBackColor("#FFFF00"); * cellType.text("this is a button"); * activeSheet.getCell(0, 2).cellType(cellType); * ``` */ buttonBackColor(value?: string): any; /** * Gets or sets the button's bottom margin in pixels relative to the cell. * @param {number} value The button's bottom margin relative to the cell. * @returns {number | GC.Spread.Sheets.CellTypes.Button} If no value is set, returns the bottom margin in pixels; otherwise, returns the button cell type. * @example * ```javascript * //This example creates a button cell and sets its margins. * var cellType = new GC.Spread.Sheets.CellTypes.Button(); * cellType.buttonBackColor("#FFFF00"); * cellType.text("this is a button"); * cellType.marginTop(5).marginRight(8).marginBottom(10).marginLeft(12); * activeSheet.getCell(0, 2).cellType(cellType); * activeSheet.setColumnWidth(2, 120.0,GC.Spread.Sheets.SheetArea.viewport); * activeSheet.setRowHeight(0, 90.0,GC.Spread.Sheets.SheetArea.viewport); * ``` */ marginBottom(value?: number): any; /** * Gets or sets the button's left margin in pixels relative to the cell. * @param {number} value The button's left margin relative to the cell. * @returns {number | GC.Spread.Sheets.CellTypes.Button} If no value is set, returns the left margin in pixels; otherwise, returns the button cell type. * @example * ```javascript * //This example creates a button cell and sets its margins. * var cellType = new GC.Spread.Sheets.CellTypes.Button(); * cellType.buttonBackColor("#FFFF00"); * cellType.text("this is a button"); * cellType.marginTop(5).marginRight(8).marginBottom(10).marginLeft(12); * activeSheet.getCell(0, 2).cellType(cellType); * activeSheet.setColumnWidth(2, 120.0,GC.Spread.Sheets.SheetArea.viewport); * activeSheet.setRowHeight(0, 90.0,GC.Spread.Sheets.SheetArea.viewport); * ``` */ marginLeft(value?: number): any; /** * Gets or sets the button's right margin in pixels relative to the cell. * @param {number} value The button's right margin relative to the cell. * @returns {number | GC.Spread.Sheets.CellTypes.Button} If no value is set, returns the right margin in pixels; otherwise, returns the button cell type. * @example * ```javascript * //This example creates a button cell and sets its margins. * var cellType = new GC.Spread.Sheets.CellTypes.Button(); * cellType.buttonBackColor("#FFFF00"); * cellType.text("this is a button"); * cellType.marginTop(5).marginRight(8).marginBottom(10).marginLeft(12); * activeSheet.getCell(0, 2).cellType(cellType); * activeSheet.setColumnWidth(2, 120.0,GC.Spread.Sheets.SheetArea.viewport); * activeSheet.setRowHeight(0, 90.0,GC.Spread.Sheets.SheetArea.viewport); * ``` */ marginRight(value?: number): any; /** * Gets or sets the button's top margin in pixels relative to the cell. * @param {number} value The button's top margin relative to the cell. * @returns {number | GC.Spread.Sheets.CellTypes.Button} If no value is set, returns the top margin in pixels; otherwise, returns the button cell type. * @example * ```javascript * //This example creates a button cell and sets its margins. * var cellType = new GC.Spread.Sheets.CellTypes.Button(); * cellType.buttonBackColor("#FFFF00"); * cellType.text("this is a button"); * cellType.marginTop(5).marginRight(8).marginBottom(10).marginLeft(12); * activeSheet.getCell(0, 2).cellType(cellType); * activeSheet.setColumnWidth(2, 120.0,GC.Spread.Sheets.SheetArea.viewport); * activeSheet.setRowHeight(0, 90.0,GC.Spread.Sheets.SheetArea.viewport); * ``` */ marginTop(value?: number): any; /** * Gets or sets the button's content. * @param {string} value The button's content. * @returns {string | GC.Spread.Sheets.CellTypes.Button} If no value is set, returns the content; otherwise, returns the button cell type. * @example * ```javascript * //This example creates a button cell. * var cellType = new GC.Spread.Sheets.CellTypes.Button(); * cellType.buttonBackColor("#FFFF00"); * cellType.text("this is a button"); * activeSheet.getCell(0, 2).cellType(cellType); * ``` */ text(value?: string): any; } export class ButtonList extends Base{ /** * Represents an editable buttonList cell. * @extends GC.Spread.Sheets.CellTypes.Base * @class * @example * ```javascript * //This example creates a buttonList cell. * var cellType2 = new GC.Spread.Sheets.CellTypes.ButtonList(); * cellType2.items([{text:"a",value:1},{text:"b",value:2},{text:"c",value:3}]); * activeSheet.getCell(2, 2).cellType(cellType2); * ``` */ constructor(); /** * Gets or sets the buttonList list's orders. * @param {GC.Spread.Sheets.CellTypes.Direction} value Whether the order is vertical. * @returns {GC.Spread.Sheets.CellTypes.Direction | GC.Spread.Sheets.CellTypes.ButtonList} If no value is set, returns whether the buttonList list's orders is vertical; otherwise, returns the checkbox list cellType. * @example * ```javascript * //This example creates a buttonList list cell. * var cellType2 = new GC.Spread.Sheets.CellTypes.ButtonList(); * cellType2.items([{text:"a",value:1},{text:"b",value:2},{text:"c",value:3}]); * cellType2.direction(GC.Spread.Sheets.CellTypes.Direction.vertical); * activeSheet.getCell(2, 2).cellType(cellType2); * ``` */ direction(value?: GC.Spread.Sheets.CellTypes.Direction): any; /** * Gets or sets the buttonList list's layout is autofit. * @param {boolean} value Whether the layout is autofit. * @returns {boolean | GC.Spread.Sheets.CellTypes.ButtonList} If no value is set, returns whether the layout is autofit, returns the buttonList list cellType. * @example * ```javascript * //This example creates a buttonList list cell. * var cellType2 = new GC.Spread.Sheets.CellTypes.ButtonList(); * cellType2.items([{text:"a",value:1},{text:"b",value:2},{text:"c",value:3}]); * cellType2.isFlowLayout(true); * activeSheet.getCell(2, 2).cellType(cellType2); * ``` */ isFlowLayout(value?: boolean): any; /** * Gets or sets the items for the buttonList list. * @param {Array} items The items for the buttonList list. * @returns {Array | GC.Spread.Sheets.CellTypes.ButtonList} If no value is set, returns the items array; otherwise, returns the buttonList list cellType. * @example * ```javascript * //This example creates a buttonList list cell. * var cellType2 = new GC.Spread.Sheets.CellTypes.ButtonList(); * cellType2.items([{text:"a",value:1},{text:"b",value:2},{text:"c",value:3}]); * activeSheet.getCell(2, 2).cellType(cellType2); * ``` */ items(items?: GC.Spread.Sheets.CellTypes.ICelltypeItemOption[] | string[]): any; /** * Gets or sets the space for two items in the buttonList. * @param {object} value the space for two items in the buttonList. * @returns {object | GC.Spread.Sheets.CellTypes.ButtonList} If no value is set, returns the space for two items in the buttonList; otherwise, returns the buttonList cellType. * @example * ```javascript * //This example creates a buttonList cell. * var cellType2 = new GC.Spread.Sheets.CellTypes.ButtonList(); * cellType2.items([{text:"a",value:1},{text:"b",value:2},{text:"c",value:3}]); * cellType2.itemSpacing({ * horizontal:80, * vertical:20 * }); * ``` */ itemSpacing(value?: GC.Spread.Sheets.CellTypes.IItemSpacing): any; /** * Gets or sets the items for the buttonList list's column count. * @param {number} value The column count for the buttonList list. * @returns {number | GC.Spread.Sheets.CellTypes.ButtonList} If no value is set, returns the column count; otherwise, returns the buttonList list cellType. * @example * ```javascript * //This example creates a buttonList list cell. * var cellType2 = new GC.Spread.Sheets.CellTypes.ButtonList(); * cellType2.items([{text:"a",value:1},{text:"b",value:2},{text:"c",value:3}]); * cellType2.maxColumnCount(2); * activeSheet.getCell(2, 2).cellType(cellType2); * ``` */ maxColumnCount(value?: number): any; /** * Gets or sets the items for the buttonList list's row count. * @param {number} value The row count for the buttonList list. * @returns {number | GC.Spread.Sheets.CellTypes.ButtonList} If no value is set, returns the row count; otherwise, returns the buttonList list cellType. * @example * ```javascript * //This example creates buttonList list cell. * var cellType2 = new GC.Spread.Sheets.CellTypes.ButtonList(); * cellType2.items([{text:"a",value:1},{text:"b",value:2},{text:"c",value:3}]); * cellType2.maxRowCount(2); * activeSheet.getCell(2, 2).cellType(cellType2); * ``` */ maxRowCount(value?: number): any; /** * Gets or sets the buttonList's padding in pixels relative to the cell. * @param {string} value The buttonList's padding relative to the cell. * @returns {string | GC.Spread.Sheets.CellTypes.ButtonList} If no value is set, returns the padding in pixels; otherwise, returns the buttonList cell type. * @example * ```javascript * //This example creates a buttonList cell and sets its padding. * var cellType = new GC.Spread.Sheets.CellTypes.ButtonList(); * cellType.padding("5"); * activeSheet.getCell(0, 2).cellType(cellType); * activeSheet.setColumnWidth(2, 120.0,GC.Spread.Sheets.SheetArea.viewport); * activeSheet.setRowHeight(0, 90.0,GC.Spread.Sheets.SheetArea.viewport); * ``` */ padding(value?: string): any; /** * Gets or sets the selected buttonList's background color. * @param {string} value The selected buttonList's background color. * @returns {string | GC.Spread.Sheets.CellTypes.ButtonList} If no value is set, returns the background color; otherwise, returns the buttonList cell type. * @example * ```javascript * //This example creates a buttonList cell. * var cellType = new GC.Spread.Sheets.CellTypes.ButtonList(); * cellType.selectedBackColor("#FFFF00"); * activeSheet.getCell(0, 2).cellType(cellType); * ``` */ selectedBackColor(value?: string): any; /** * Gets or sets the selected buttonList's fore color. * @param {string} value The selected buttonList's fore color. * @returns {string | GC.Spread.Sheets.CellTypes.ButtonList} If no value is set, returns the fore color; otherwise, returns the buttonList cell type. * @example * ```javascript * //This example creates a buttonList cell. * var cellType = new GC.Spread.Sheets.CellTypes.ButtonList(); * cellType.selectedForeColor("#FFFF00"); * activeSheet.getCell(0, 2).cellType(cellType); * ``` */ selectedForeColor(value?: string): any; /** * Gets or sets the buttonList's select mode. * @param {GC.Spread.Sheets.CellTypes.SelectionMode} value The selected buttonList's select mode. * @returns {GC.Spread.Sheets.CellTypes.SelectionMode | GC.Spread.Sheets.CellTypes.ButtonList} If no value is set, returns the select mode; otherwise, returns the buttonList cell type. * @example * ```javascript * //This example creates a buttonList cell. * var cellType = new GC.Spread.Sheets.CellTypes.ButtonList(); * cellType.selectionMode(GC.Spread.Sheets.CellTypes.SelectionMode.single); * activeSheet.getCell(0, 2).cellType(cellType); * ``` */ selectionMode(value?: GC.Spread.Sheets.CellTypes.SelectionMode): any; } export class CheckBox extends Base{ /** * Represents a check box cell. * @extends GC.Spread.Sheets.CellTypes.Base * @class * @example * ```javascript * //This example creates a check box cell. * var cellType1 = new GC.Spread.Sheets.CellTypes.CheckBox(); * cellType1.caption("caption"); * cellType1.textTrue("true"); * cellType1.textFalse("false"); * cellType1.textIndeterminate("indeterminate"); * cellType1.textAlign(GC.Spread.Sheets.CellTypes.CheckBoxTextAlign.bottom); * cellType1.isThreeState(true); * cellType1.boxSize(20); * activeSheet.getCell(1, 1).cellType(cellType1); * ``` */ constructor(); /** * Gets or sets a value that indicates the check box size * @param {number | string} value The size of check box. this value support number and "auto". * @returns {number | string | GC.Spread.Sheets.CellTypes.CheckBox} If no value is set, returns the size of check box. * @example * ```javascript * // This example creates a check box cell. * var cellType1 = new GC.Spread.Sheets.CellTypes.CheckBox(); * cellType1.caption("caption"); * cellType1.textTrue("true"); * cellType1.textFalse("false"); * cellType1.textIndeterminate("indeterminate"); * cellType1.textAlign(GC.Spread.Sheets.CellTypes.CheckBoxTextAlign.bottom); * cellType1.isThreeState(true); * cellType1.boxSize(20); * activeSheet.getCell(1, 1).cellType(cellType1); * ``` */ boxSize(value?: number | string): any; /** * Gets or sets the caption of the cell type. * @param {string} value The caption of the cell type. * @returns {string | GC.Spread.Sheets.CellTypes.CheckBox} If no value is set, returns the caption; otherwise, returns the check box cell type. * @example * ```javascript * //This example creates a check box cell. * var cellType1 = new GC.Spread.Sheets.CellTypes.CheckBox(); * cellType1.caption("caption"); * cellType1.textTrue("true"); * cellType1.textFalse("false"); * cellType1.textIndeterminate("indeterminate"); * cellType1.textAlign(GC.Spread.Sheets.CellTypes.CheckBoxTextAlign.bottom); * cellType1.isThreeState(true); * cellType1.boxSize(20); * activeSheet.getCell(1, 1).cellType(cellType1); * ``` */ caption(value?: string): any; /** * Gets or sets a value that indicates whether the check box supports three states. * @param {boolean} value Whether the check box supports three states. * @returns {boolean | GC.Spread.Sheets.CellTypes.CheckBox} If no value is set, returns whether the check box supports three states; otherwise, returns the check box cell type. * @example * ```javascript * //This example creates a check box cell. * var cellType1 = new GC.Spread.Sheets.CellTypes.CheckBox(); * cellType1.caption("caption"); * cellType1.textTrue("true"); * cellType1.textFalse("false"); * cellType1.textIndeterminate("indeterminate"); * cellType1.textAlign(GC.Spread.Sheets.CellTypes.CheckBoxTextAlign.bottom); * cellType1.isThreeState(true); * cellType1.boxSize(20); * activeSheet.getCell(1, 1).cellType(cellType1); * ``` */ isThreeState(value?: boolean): any; /** * Gets or sets a value that indicates the mode of the checkbox cell type. * @param {'checkbox' | 'toggle'} value The mode of the checkbox cell type. * @returns {'checkbox' | 'toggle' | GC.Spread.Sheets.CellTypes.CheckBox} If no value is set, returns the mode of the checkbox cell type. * @example * ```javascript * // This example creates a check box cell. * var cellType1 = new GC.Spread.Sheets.CellTypes.CheckBox(); * cellType1.caption("caption"); * cellType1.textTrue("true"); * cellType1.textFalse("false"); * cellType1.textAlign(GC.Spread.Sheets.CellTypes.CheckBoxTextAlign.bottom); * cellType1.mode("toggle"); * activeSheet.getCell(1, 1).cellType(cellType1); * ``` */ mode(value?: 'checkbox' | 'toggle'): any; /** * Gets or sets the text alignment relative to the check box. * @param {GC.Spread.Sheets.CellTypes.CheckBoxTextAlign} value The text alignment relative to the check box. * @returns {GC.Spread.Sheets.CellTypes.CheckBoxTextAlign | GC.Spread.Sheets.CellTypes.CheckBox} If no value is set, returns the text alignment relative to the check box; otherwise, returns the check box cell type. * @example * ```javascript * //This example creates a check box cell. * var cellType1 = new GC.Spread.Sheets.CellTypes.CheckBox(); * cellType1.caption("caption"); * cellType1.textTrue("true"); * cellType1.textFalse("false"); * cellType1.textIndeterminate("indeterminate"); * cellType1.textAlign(GC.Spread.Sheets.CellTypes.CheckBoxTextAlign.bottom); * cellType1.isThreeState(true); * cellType1.boxSize(20); * activeSheet.getCell(1, 1).cellType(cellType1); * ``` */ textAlign(value?: GC.Spread.Sheets.CellTypes.CheckBoxTextAlign): any; /** * Gets or sets the text in the cell when the cell's value is `false`. * @param {string} value The text in the cell when the cell's value is `false`. * @returns {string | GC.Spread.Sheets.CellTypes.CheckBox} If no value is set, returns the text in the cell when the cell's value is `false`. If a value is set, returns the check box cell type. * @example * ```javascript * //This example creates a check box cell. * var cellType1 = new GC.Spread.Sheets.CellTypes.CheckBox(); * cellType1.caption("caption"); * cellType1.textTrue("true"); * cellType1.textFalse("false"); * cellType1.textIndeterminate("indeterminate"); * cellType1.textAlign(GC.Spread.Sheets.CellTypes.CheckBoxTextAlign.bottom); * cellType1.isThreeState(true); * cellType1.boxSize(20); * activeSheet.getCell(1, 1).cellType(cellType1); * ``` */ textFalse(value?: string): any; /** * Gets or sets the text in the cell when the cell's value is indeterminate (neither `true` nor `false`). * @param {string} value The text in the cell when the cell's value is indeterminate. * @returns {string | GC.Spread.Sheets.CellTypes.CheckBox} If no value is set, returns the text in the cell when the cell's value is indeterminate. If a value is set, returns the check box cell type. * @example * ```javascript * //This example creates a check box cell. * var cellType1 = new GC.Spread.Sheets.CellTypes.CheckBox(); * cellType1.caption("caption"); * cellType1.textTrue("true"); * cellType1.textFalse("false"); * cellType1.textIndeterminate("indeterminate"); * cellType1.textAlign(GC.Spread.Sheets.CellTypes.CheckBoxTextAlign.bottom); * cellType1.isThreeState(true); * cellType1.boxSize(20); * activeSheet.getCell(1, 1).cellType(cellType1); * ``` */ textIndeterminate(value?: string): any; /** * Gets or sets the text in the cell when the cell's value is `true`. * @param {string} value The text when the cell's value is `true`. * @returns {string | GC.Spread.Sheets.CellTypes.CheckBox} If no value is set, returns the text when the cell's value is `true`. If a value is set, returns the check box cell type. * @example * ```javascript * //This example creates a check box cell. * var cellType1 = new GC.Spread.Sheets.CellTypes.CheckBox(); * cellType1.caption("caption"); * cellType1.textTrue("true"); * cellType1.textFalse("false"); * cellType1.textIndeterminate("indeterminate"); * cellType1.textAlign(GC.Spread.Sheets.CellTypes.CheckBoxTextAlign.bottom); * cellType1.isThreeState(true); * cellType1.boxSize(20); * activeSheet.getCell(1, 1).cellType(cellType1); * ``` */ textTrue(value?: string): any; /** * Gets or sets a value that indicates the toggle options * @param {GC.Spread.Sheets.CellTypes.IToggleOptions} value The toggle options. * @returns {GC.Spread.Sheets.CellTypes.IToggleOptions | GC.Spread.Sheets.CellTypes.CheckBox} If no value is set, returns the toggle options. * @example * ```javascript * // This example creates a check box cell. * var cellType1 = new GC.Spread.Sheets.CellTypes.CheckBox(); * cellType1.caption("caption"); * cellType1.textTrue("ON"); * cellType1.textFalse("OFF"); * cellType1.mode("toggle"); * cellType1.textAlign(GC.Spread.Sheets.CellTypes.CheckBoxTextAlign.inside); * cellType1.toggleOptions({ * width: 60, * height: 30, * trackColorOn: '#4CAF50', * trackColorOff: '#767577', * sliderColorOn: '#ffffff', * sliderColorOff: '#ffffff', * sliderMargin: 2, * animationDuration: 100, * trackRadius: 8, * sliderRadius: 4 * }); * activeSheet.getCell(1, 1).cellType(cellType1); * ``` */ toggleOptions(value?: GC.Spread.Sheets.CellTypes.IToggleOptions): any; } export class CheckBoxList extends Base{ /** * Represents an editable CheckBoxList cell. * @extends GC.Spread.Sheets.CellTypes.Base * @class * @example * ```javascript * //This example creates a CheckBoxList cell. * var cellType2 = new GC.Spread.Sheets.CellTypes.CheckBoxList(); * cellType2.items([{text:"a",value:1},{text:"b",value:2},{text:"c",value:3}]); * activeSheet.getCell(2, 2).cellType(cellType2); * ``` */ constructor(); /** * Gets or sets the text of checkbox's size, only support number and "auto". If use illegal value, the size won't change. * @param {number | string} value the size of checkbox. If the value is "auto", the size of radio button will change with the font size. * @returns {number | string | GC.Spread.Sheets.CellTypes.CheckBoxList} If no value is set, return the size of checkbox. otherwise, returns the checkbox list cellType. * @example * ```javascript * // This example creates a checkbox list cell. * var cellType2 = new GC.Spread.Sheets.CellTypes.CheckBoxList(); * cellType2.items([{text:"a",value:1},{text:"b",value:2},{text:"c",value:3}]); * cellType2.boxSize(20); * activeSheet.getCell(2, 2).cellType(cellType2); * ``` */ boxSize(value?: number|string): any; /** * Gets or sets the checkbox list's orders. * @param {GC.Spread.Sheets.CellTypes.Direction} value Whether the order is vertical. * @returns {GC.Spread.Sheets.CellTypes.Direction | GC.Spread.Sheets.CellTypes.CheckBoxList} If no value is set, returns whether the checkbox list's orders is vertical; otherwise, returns the checkbox list cellType. * @example * ```javascript * //This example creates a checkbox list cell. * var cellType2 = new GC.Spread.Sheets.CellTypes.CheckBoxList(); * cellType2.items([{text:"a",value:1},{text:"b",value:2},{text:"c",value:3}]); * cellType2.direction(GC.Spread.Sheets.CellTypes.Direction.vertical); * activeSheet.getCell(2, 2).cellType(cellType2); * ``` */ direction(value?: GC.Spread.Sheets.CellTypes.Direction): any; /** * Gets or sets the checkbox list's layout is autofit. * @param {boolean} value Whether the layout is autofit. * @returns {boolean | GC.Spread.Sheets.CellTypes.CheckBoxList} If no value is set, returns whether the layout is autofit, returns the checkbox list cellType. * @example * ```javascript * //This example creates a checkbox list cell. * var cellType2 = new GC.Spread.Sheets.CellTypes.CheckBoxList(); * cellType2.items([{text:"a",value:1},{text:"b",value:2},{text:"c",value:3}]); * cellType2.isFlowLayout(true); * activeSheet.getCell(2, 2).cellType(cellType2); * ``` */ isFlowLayout(value?: boolean): any; /** * Gets or sets the items for the checkbox list. * @param {Array} items The items for the checkbox list. * @returns {Array | GC.Spread.Sheets.CellTypes.CheckBoxList} If no value is set, returns the items array; otherwise, returns the checkbox list cellType. * @example * ```javascript * //This example creates a checkbox list cell. * var cellType2 = new GC.Spread.Sheets.CellTypes.CheckBoxList(); * cellType2.items([{text:"a",value:1},{text:"b",value:2},{text:"c",value:3}]); * activeSheet.getCell(2, 2).cellType(cellType2); * ``` */ items(items?: GC.Spread.Sheets.CellTypes.ICelltypeItemOption[] | string[]): any; /** * Gets or sets the space for two items in the checkbox list. * @param {object} value the space for two items in the checkbox list. * @returns {object | GC.Spread.Sheets.CellTypes.CheckBoxList} If no value is set, returns the space for two items in the checkbox list; otherwise, returns the checkbox list cellType. * @example * ```javascript * //This example creates a checkbox list cell. * var cellType2 = new GC.Spread.Sheets.CellTypes.CheckBoxList(); * cellType2.items([{text:"a",value:1},{text:"b",value:2},{text:"c",value:3}]); * cellType2.itemSpacing({ * horizontal:80, * vertical:20 * }); * ``` */ itemSpacing(value?: GC.Spread.Sheets.CellTypes.IItemSpacing): any; /** * Gets or sets the items for the checkbox list's column count. * @param {number} value The column count for the checkbox list. * @returns {number | GC.Spread.Sheets.CellTypes.CheckBoxList} If no value is set, returns the column count; otherwise, returns the checkbox list cellType. * @example * ```javascript * //This example creates a checkbox list cell. * var cellType2 = new GC.Spread.Sheets.CellTypes.CheckBoxList(); * cellType2.items([{text:"a",value:1},{text:"b",value:2},{text:"c",value:3}]); * cellType2.maxColumnCount(2); * activeSheet.getCell(2, 2).cellType(cellType2); * ``` */ maxColumnCount(value?: number): any; /** * Gets or sets the items for the checkbox list's row count. * @param {number} value The row count for the checkbox list. * @returns {number | GC.Spread.Sheets.CellTypes.CheckBoxList} If no value is set, returns the row count; otherwise, returns the checkbox list cellType. * @example * ```javascript * //This example creates checkbox list cell. * var cellType2 = new GC.Spread.Sheets.CellTypes.CheckBoxList(); * cellType2.items([{text:"a",value:1},{text:"b",value:2},{text:"c",value:3}]); * cellType2.maxRowCount(2); * activeSheet.getCell(2, 2).cellType(cellType2); * ``` */ maxRowCount(value?: number): any; /** * Gets or sets a value that indicates the mode of the checkbox list cell type. * @param {'checkbox' | 'toggle'} value The mode of the checkbox list cell type. * @returns {'checkbox' | 'toggle' | GC.Spread.Sheets.CellTypes.CheckBoxList} If no value is set, returns the mode of the checkbox list cell type. * @example * ```javascript * // This example creates a check box list cell. * var cellType = new GC.Spread.Sheets.CellTypes.CheckBoxList(); * cellType.items([{text:"a",value:1},{text:"b",value:2},{text:"c",value:3}]); * cellType.mode("toggle"); * activeSheet.getCell(2, 2).cellType(cellType); * ``` */ mode(value?: 'checkbox' | 'toggle'): any; /** * Gets or sets the text of checkbox's position, only support left and right . * @param {GC.Spread.Sheets.CellTypes.TextAlign} value the text of checkbox's position. * @returns {GC.Spread.Sheets.CellTypes.TextAlign | GC.Spread.Sheets.CellTypes.CheckBoxList} If no value is set, returns the text of checkbox's position, returns the checkbox list cellType. * @example * ```javascript * //This example creates a checkbox list cell. * var cellType2 = new GC.Spread.Sheets.CellTypes.CheckBoxList(); * cellType2.items([{text:"a",value:1},{text:"b",value:2},{text:"c",value:3}]); * cellType2.textAlign(GC.Spread.Sheets.CellTypes.TextAlign.left); * activeSheet.getCell(2, 2).cellType(cellType2); * ``` */ textAlign(value?: GC.Spread.Sheets.CellTypes.TextAlign): any; /** * Gets or sets a value that indicates the toggle options * @param {GC.Spread.Sheets.CellTypes.IToggleOptions} value The toggle options. * @returns {GC.Spread.Sheets.CellTypes.IToggleOptions | GC.Spread.Sheets.CellTypes.CheckBoxList} If no value is set, returns the toggle options. * @example * ```javascript * // This example creates a check box list cell. * var cellType = new GC.Spread.Sheets.CellTypes.CheckBoxList(); * cellType.items([{text:"a",value:1},{text:"b",value:2},{text:"c",value:3}]); * cellType.mode("toggle"); * cellType.toggleOptions({ * width: 60, * height: 30, * trackColorOn: '#4CAF50', * trackColorOff: '#767577', * sliderColorOn: '#ffffff', * sliderColorOff: '#ffffff', * sliderMargin: 2, * animationDuration: 100, * trackRadius: 8, * sliderRadius: 4 * }); * activeSheet.getCell(2, 2).cellType(cellType); * ``` */ toggleOptions(value?: GC.Spread.Sheets.CellTypes.IToggleOptions): any; } export class ColumnHeader extends Base{ /** * Represents the painter of the column header cells. * @extends GC.Spread.Sheets.CellTypes.Base * @class */ constructor(); } export class ComboBox extends Base{ /** * Represents an editable combo box cell. * @extends GC.Spread.Sheets.CellTypes.Base * @class * @example * ```javascript * //This example creates a combo box cell. * var cellType2 = new GC.Spread.Sheets.CellTypes.ComboBox(); * cellType2.items(["a","b","c"]); * activeSheet.getCell(2, 2).cellType(cellType2); * ``` */ constructor(); /** * Gets or sets whether the combo box's dropdown is allowed to overflow outside of Spread. * @param {boolean} [value] Whether the combo box's dropdown is allowed to overflow outside of Spread. * @returns {boolean | GC.Spread.Sheets.CellTypes.ComboBox} If no value is set, returns the combo box's dropdown is allowed to overflow outside of Spread; otherwise, returns the combo box cellType. * @example * ```javascript * //This example sets the allowFloat method. * var items2 = ["a", "ab", "abc", "apple", "boy", "cat", "dog"]; * var comboBoxCellType = new GC.Spread.Sheets.CellTypes.ComboBox().items(items2); * comboBoxCellType.allowFloat(false); * activeSheet.getCell(1, 3).cellType(comboBoxCellType); * ``` */ allowFloat(value?: boolean): any; /** * Gets or sets the data binding of the ComboBox cell type. * @param {GC.Spread.Sheets.CellTypes.IDataBinding} [value] the data binding of the ComboBox. * @returns {GC.Spread.Sheets.CellTypes.IDataBinding | GC.Spread.Sheets.CellTypes.ComboBox} If no value is set, returns the combo box's data binding; otherwise, returns the combo box cellType. * @example * ```javascript * //This example shows binding a table name to the ComboBox cell type. * var tableName = { dataSource: "productName", text: "productName", value: "productId" }; * var cellType = new GC.Spread.Sheets.CellTypes.ComboBox(); * cellType.dataBinding(tableName); * activeSheet.getCell(1, 3).cellType(cellType); * ``` * @example * ```javascript * //This example shows binding a formula to the ComboBox cell type. * var formula = { dataSource: '=SORT(UNIQUE(QUERY("Products", {"productName","productId"})))', text: 0, value: 1 }; * var cellType2 = new GC.Spread.Sheets.CellTypes.ComboBox(); * cellType2.dataBinding(formula); * activeSheet.getCell(10, 3).cellType(cellType2); * ``` */ dataBinding(value?: GC.Spread.Sheets.CellTypes.IDataBinding): GC.Spread.Sheets.CellTypes.IDataBinding | GC.Spread.Sheets.CellTypes.ComboBox; /** * Gets or sets whether the combo box is editable. * @param {boolean} value Whether the combo box is editable. * @returns {boolean | GC.Spread.Sheets.CellTypes.ComboBox} If no value is set, returns whether the combo box is editable; otherwise, returns the combo box cellType. * @example * ```javascript * //This example sets the editable method. * var items2 = ["a", "ab", "abc", "apple", "boy", "cat", "dog"]; * var eComboBoxCellType = new GC.Spread.Sheets.CellTypes.ComboBox().items(items2).editable(true); * activeSheet.getCell(1, 3).cellType(eComboBoxCellType); * activeSheet.setColumnWidth(0,120); * activeSheet.setColumnWidth(2,120); * ``` */ editable(value?: boolean): any; /** * Gets or sets the value that is written to the underlying data model. * @param {GC.Spread.Sheets.CellTypes.EditorValueType} value The type of editor value. * @returns {GC.Spread.Sheets.CellTypes.EditorValueType | GC.Spread.Sheets.CellTypes.ComboBox} If no value is set, returns the type of editor value; otherwise, returns the combo box cellType. * @example * ```javascript * //This example gets the type. * var cellType2 = new GC.Spread.Sheets.CellTypes.ComboBox(); * cellType2.items(["a","b","c"]); * activeSheet.getCell(2, 2).cellType(cellType2); * alert(cellType2.editorValueType()); * ``` */ editorValueType(value?: GC.Spread.Sheets.CellTypes.EditorValueType): any; /** * Gets or sets the height of each item. * @param {number} value The height of each item. * @returns {number | GC.Spread.Sheets.CellTypes.ComboBox} If no value is set, returns the height of each item; otherwise, returns the combo box cellType. * @example * ```javascript * //This example sets the item height. * var cellType2 = new GC.Spread.Sheets.CellTypes.ComboBox(); * cellType2.items(["a","b","c"]); * cellType2.itemHeight(30); * activeSheet.getCell(2, 2).cellType(cellType2); * ``` */ itemHeight(value?: number): any; /** * Gets or sets the items for the drop-down list in the combo box. * @param {Array} items The items for the combo box. * @returns {Array | GC.Spread.Sheets.CellTypes.ComboBox} If no value is set, returns the items array; otherwise, returns the combo box cellType. * @example * ```javascript * //This example creates a combo box cell. * var cellType2 = new GC.Spread.Sheets.CellTypes.ComboBox(); * cellType2.items(["a","b","c"]); * activeSheet.getCell(2, 2).cellType(cellType2); * ``` */ items(items?: any[]): any; /** * Gets or sets the maximum item count of the drop-down list per page. * @param {number} value The maximum item count of the drop-down list per page. * @returns {number | GC.Spread.Sheets.CellTypes.ComboBox} If no value is set, returns the maximum item count of the drop-down list per page; otherwise, returns the combo box cellType. * @example * ```javascript * //This example shows three items in the list at a time. * var cellType2 = new GC.Spread.Sheets.CellTypes.ComboBox(); * cellType2.items(["a", "b", "c", "d", "e", "f", "g", "h"]); * cellType2.maxDropDownItems(3); * activeSheet.getCell(2, 2).cellType(cellType2); * }); * ``` */ maxDropDownItems(value?: number): any; } export class Corner extends Base{ /** * Represents the painter of the corner cell. * @extends GC.Spread.Sheets.CellTypes.Base * @class */ constructor(); } export class DataObject extends Text{ /** * Represents a data object cell type. * @extends GC.Spread.Sheets.CellTypes.Text * @class * @param {string} format The format string, that contains PROPERTY function or dot operator. It decides how to display the cell value which type is object as a string. * @example * ```javascript * //set a DataObject celltype which uses WEBSERVICE function to provide data * sheet.setFormula(1, 1, '=FILTERJSON(WEBSERVICE("https://demodata.mescius.io/northwind/api/v1/Products/1"))'); * var cellType1 = new GC.Spread.Sheets.CellTypes.DataObject('=@.productName & " " & @.unitPrice'); * sheet.setCellType(1, 1, cellType1); * ``` */ constructor(); } export class Diagonal extends Text{ /** * Represents a diagonal lines cell. * @extends GC.Spread.Sheets.CellTypes.Text * @class * @example * ```javascript * //This example creates a diagonal cell. * var diagonalCellType = new GC.Spread.Sheets.CellTypes.Diagonal(); * activeSheet.getCell(2, 2).cellType(diagonalCellType).value('Year,Product,Region'); * ``` */ constructor(); /** * Gets or sets the diverge direction of the diagonal cell type. * @param {GC.Spread.Sheets.CellTypes.DivergeDirection} value The type of diverge direction. * @returns {GC.Spread.Sheets.CellTypes.DivergeDirection | GC.Spread.Sheets.CellTypes.Diagonal} If no value is set, returns the type of diverge direction; otherwise, returns the diagonal cellType. * @example * ```javascript * //This example gets the diverge direction type. * var cellType = new GC.Spread.Sheets.CellTypes.Diagonal(); * activeSheet.getCell(2, 2).cellType(cellType); * alert(cellType.divergeDirection()); * ``` */ divergeDirection(value?: GC.Spread.Sheets.CellTypes.DivergeDirection): GC.Spread.Sheets.CellTypes.DivergeDirection | GC.Spread.Sheets.CellTypes.Diagonal; /** * Gets or sets the line border of the diagonal cell type. * @param {GC.Spread.Sheets.LineBorder} value The type of line border. * @returns {GC.Spread.Sheets.LineBorder | GC.Spread.Sheets.CellTypes.Diagonal} If no value is set, returns the type of line border; otherwise, returns the diagonal cellType. * @example * ```javascript * //This example gets the diverge direction type. * var cellType = new GC.Spread.Sheets.CellTypes.Diagonal(); * activeSheet.getCell(2, 2).cellType(cellType); * alert(cellType.lineBorder()); * ``` */ lineBorder(value?: GC.Spread.Sheets.LineBorder): GC.Spread.Sheets.LineBorder | GC.Spread.Sheets.CellTypes.Diagonal; } export class FileUpload extends Base{ /** * Represents a file upload cell type. * @extends GC.Spread.Sheets.CellTypes.Base * @class * @example * ```javascript * // set a FileUpload celltype * const cellType1 = new GC.Spread.Sheets.CellTypes.FileUpload(); * sheet.setCellType(1, 1, cellType1); * // FileUpload support the valuePath property, will parse the cell value with valuePath to GC.Spread.Sheets.CellTypes.IFileInfo * sheet.getCellType(1, 1).valuePath("blob"); * sheet.setValue(1, 1, blob); // value path is "blob" * sheet.getCellType(2, 2).valuePath("dataUrl"); * sheet.setValue(2, 2, dataUrl); // value path is "dataUrl" * sheet.getCellType(3, 3).valuePath(undefined); * sheet.setValue(3, 3, { name: 'test1.png', blob: blob }); // value path is undefined * sheet.setValue(3, 3, { name: 'test2.txt', dataUrl: dataUrl }); // value path is undefined * ``` */ constructor(); /** * Customize personalized preview logic and UI display by setting event callbacks or SJS commands after clicking the preview button. * @type {string | ((file: GC.Spread.Sheets.CellTypes.IFilePreviewInfo) => void)} * @returns {void} * @example * ```javascript * // This example creates a file upload cell. * // Customize your preview function. * fileUpload.previewCommand = function (fileInfo) { * // Custom preview logic * } * * // Customize your preview command. * fileUpload.previewCommand = 'openPreviewDialog'; * * activeSheet.getCell(1, 1).cellType(fileUpload); * ``` */ previewCommand?: string | ((file: GC.Spread.Sheets.CellTypes.IFilePreviewInfo) => void); /** * Gets or sets the file types that can be uploaded. * @param {string} value The file types that can be uploaded. * @returns {string} Returns the file types that can be uploaded. * @example * ```javascript * // This example creates a file upload cell. * const fileUpload = new GC.Spread.Sheets.CellTypes.FileUpload(); * fileUpload.accept('image/*'); * activeSheet.getCell(1, 1).cellType(fileUpload); * ``` */ accept(value?: string): string; /** * Gets or sets whether to display the file clear button. * @param {string} value Whether to display the file clear button. * @returns {string} Returns the currently displayed file clear button. * @example * ```javascript * // This example creates a file upload cell. * const fileUpload = new GC.Spread.Sheets.CellTypes.FileUpload(); * fileUpload.isClearEnabled(false); * activeSheet.getCell(1, 1).cellType(fileUpload); * ``` */ isClearEnabled(value?: boolean): boolean; /** * Gets or sets whether to display the file download button. * @param {string} value Whether to display the file download button. * @returns {string} Returns the currently displayed file download button. * @example * ```javascript * // This example creates a file upload cell. * const fileUpload = new GC.Spread.Sheets.CellTypes.FileUpload(); * fileUpload.isDownloadEnabled(false); * activeSheet.getCell(1, 1).cellType(fileUpload); * ``` */ isDownloadEnabled(value?: boolean): boolean; /** * Gets or sets whether to display the file preview button. * @param {string} value Whether to display the file preview button. * @returns {string} Returns the currently displayed file preview button. * @example * ```javascript * // This example creates a file upload cell. * const fileUpload = new GC.Spread.Sheets.CellTypes.FileUpload(); * fileUpload.isPreviewEnabled(false); * activeSheet.getCell(1, 1).cellType(fileUpload); * ``` */ isPreviewEnabled(value?: boolean): boolean; /** * Gets or sets the margin bottom value. * @param {number} value The margin bottom value. * @returns {number} If no value is set, return current margin bottom. * @example * ```javascript * // This example creates a file upload cell. * const fileUpload = new GC.Spread.Sheets.CellTypes.FileUpload(); * fileUpload.marginBottom(10); * activeSheet.getCell(1, 1).cellType(fileUpload); * ``` */ marginBottom(value?: number): number; /** * Gets or sets the margin left value. * @param {number} value The margin left value. * @returns {number} If no value is set, return current margin left. * @example * ```javascript * // This example creates a file upload cell. * const fileUpload = new GC.Spread.Sheets.CellTypes.FileUpload(); * fileUpload.marginLeft(10); * activeSheet.getCell(1, 1).cellType(fileUpload); * ``` */ marginLeft(value?: number): number; /** * Gets or sets the margin right value. * @param {number} value The margin right value. * @returns {number} If no value is set, return current margin right. * @example * ```javascript * // This example creates a file upload cell. * const fileUpload = new GC.Spread.Sheets.CellTypes.FileUpload(); * fileUpload.marginRight(10); * activeSheet.getCell(1, 1).cellType(fileUpload); * ``` */ marginRight(value?: number): number; /** * Gets or sets the margin top value. * @param {number} value The margin top value. * @returns {number} If no value is set, return current margin top. * @example * ```javascript * // This example creates a file upload cell. * const fileUpload = new GC.Spread.Sheets.CellTypes.FileUpload(); * fileUpload.marginTop(10); * activeSheet.getCell(1, 1).cellType(fileUpload); * ``` */ marginTop(value?: number): number; /** * Gets or sets the maximum file size that can be uploaded. * @param {number} value The maximum file size that can be uploaded. * @returns {number} Returns the maximum file size that can be uploaded. * @example * ```javascript * // This example creates a file upload cell. * const fileUpload = new GC.Spread.Sheets.CellTypes.FileUpload(); * fileUpload.maxSize(10000); * activeSheet.getCell(1, 1).cellType(fileUpload); * ``` */ maxSize(value?: number): number; /** * Gets or sets the value path for fileUpload cellType, the cell will get vale by the valuePath from the cell fileInfo. * @param {string} value The value path value. * @returns {string} If no value is set, return current value path, the default value path is dataUrl. * @example * ```javascript * // This example creates a file upload cell and setValue with dataUrl. * const fileUpload = new GC.Spread.Sheets.CellTypes.FileUpload(); * fileUpload.valuePath("dataUrl"); // set valuePath dataUrl, default is dataUrl * activeSheet.getCell(1, 1).cellType(fileUpload); * activeSheet.setValue(1, 1, 'data:text/plain;base64,MQ==') * ``` */ valuePath(value?: string): string; } export class HyperLink extends Base{ /** * Represents the hyperlink cell. * @extends GC.Spread.Sheets.CellTypes.Base * @class * @example * ```javascript * var cellType = new GC.Spread.Sheets.CellTypes.HyperLink(); * cellType.linkColor("blue"); * cellType.visitedLinkColor("#FF2235"); * cellType.text("SpreadJS"); * cellType.linkToolTip("Company Web Site"); * activeSheet.getCell(1, 1).cellType(cellType).value("http://www.spreadjs.com/"); * activeSheet.getCell(1, -1).height(30); * ``` * @example * ```javascript * var cellType = new GC.Spread.Sheets.CellTypes.HyperLink(); * cellType.linkColor("blue"); * cellType.visitedLinkColor("#FF2235"); * cellType.text("SpreadJS"); * cellType.linkToolTip("Company Web Site"); * activeSheet.getCell(0, 2).cellType(cellType).value("formula.html"); * ``` */ constructor(); /** * Gets or sets whether to move to the active cell when clicked. * @param {boolean} value Whether to move to the active cell when clicked. * @returns {boolean | GC.Spread.Sheets.CellTypes.HyperLink} If no value is set, returns a value that indicates whether to move to the active cell; otherwise, returns the hyperlink cell type. * @example * ```javascript * //This example uses the activeOnClick method. * var h1 = new GC.Spread.Sheets.CellTypes.HyperLink(); * h1.text("SpreadsJS"); * h1.linkToolTip("link to SpreadJS Web page"); * h1.linkColor("rgb(0, 100, 200)"); * h1.visitedLinkColor("rgb(0, 200, 100)"); * h1.activeOnClick(true); * activeSheet.setCellType(1, 1, h1); * activeSheet.getCell(1, 1, GC.Spread.Sheets.SheetArea.viewport).value("http://www.spreadjs.com/").hAlign(GC.Spread.Sheets.HorizontalAlign.center); * ``` */ activeOnClick(value?: boolean): any; /** * Gets or sets the color of the hyperlink. * @param {string} value The hyperlink color. * @returns {string | GC.Spread.Sheets.CellTypes.HyperLink} If no value is set, returns the hyperlink color; otherwise, returns the hyperLink cell type. * @example * ```javascript * //This example creates a hyperlink cell. * cellType = new GC.Spread.Sheets.CellTypes.HyperLink(); * cellType.linkColor("blue"); * cellType.visitedLinkColor("#FF2235"); * cellType.text("SpreadJS"); * cellType.linkToolTip("Company Web Site"); * activeSheet.getCell(1, 1).cellType(cellType).value("http://www.spreadjs.com/"); * activeSheet.getCell(1, -1).height(30); * ``` */ linkColor(value?: string): any; /** * Gets or sets the tooltip for the hyperlink. * @param {string} value The tooltip text. * @returns {string | GC.Spread.Sheets.CellTypes.HyperLink} If no value is set, returns the tooltip text; otherwise, returns the hyperLink cell type. * @example * ```javascript * //This example creates a hyperlink cell. * cellType = new GC.Spread.Sheets.CellTypes.HyperLink(); * cellType.linkColor("blue"); * cellType.visitedLinkColor("#FF2235"); * cellType.text("SpreadJS"); * cellType.linkToolTip("Company Web Site"); * activeSheet.getCell(1, 1).cellType(cellType).value("http://www.spreadjs.com/"); * activeSheet.getCell(1, -1).height(30); * ``` */ linkToolTip(value?: string): any; /** * Gets or sets the callback of the hyperlink, If execute the function will represent the context for the callback. * @param {Function} value The callback of the hyperlink. * @returns {Function | GC.Spread.Sheets.CellTypes.HyperLink} If no value is set, return a value that indicates the callback of the hyperlink; otherwise, returns the hyperlink cell type. * @example * ```javascript * //This example sets the tab color when selecting the hyperlink. * var h2 = new GC.Spread.Sheets.CellTypes.HyperLink(); * h2.text("set sheet tab style"); * h2.linkToolTip("set sheet tab style"); * h2.linkColor("blue"); * h2.visitedLinkColor("#FF2235"); * activeSheet.getCell(2, 1).cellType(h2).value("set sheet tab style").hAlign(GC.Spread.Sheets.HorizontalAlign.center); * h2.activeOnClick(true); * h2.onClickAction(function () { * var setSheetTabColor = { * canUndo: true, * execute: function (context, options, isUndo) { * activeSheet.name("Hyperlink"); * activeSheet.options.sheetTabColor = "red"; * } * }; * var commandManager = spread.commandManager(); * var commandName = "setSheetTabStyle"; * commandManager.register(commandName, setSheetTabColor, null, false, false, false, false); * commandManager.execute({cmd: commandName}) * }); * ``` */ onClickAction(value?: Function): any; /** * Gets or sets the type for the hyperlink's target. * @param {GC.Spread.Sheets.CellTypes.HyperLinkTargetType} value The hyperlink's target type. * @returns {GC.Spread.Sheets.CellTypes.HyperLinkTargetType | GC.Spread.Sheets.CellTypes.HyperLink} If no value is set, returns the hyperlink's target type; otherwise, returns the hyperLink cell type. * @example * ```javascript * //This example creates a hyperlink cell. * var cellType = new GC.Spread.Sheets.CellTypes.HyperLink(); * cellType.linkColor("blue"); * cellType.visitedLinkColor("#FFFF00"); * cellType.text("SpreadJS"); * cellType.linkToolTip("Company Web Site"); * cellType.target(GC.Spread.Sheets.CellTypes.HyperLinkTargetType.self); * activeSheet.getCell(0, 2).cellType(cellType).value("http://www.spreadjs.com/"); * ``` */ target(value?: GC.Spread.Sheets.CellTypes.HyperLinkTargetType): any; /** * Gets or sets the text string for the hyperlink. * @param {string} value The text displayed in the hyperlink. * @returns {string | GC.Spread.Sheets.CellTypes.HyperLink} If no value is set, returns the text in the hyperlink; otherwise, returns the hyperLink cell type. * @example * ```javascript * //This example creates a hyperlink cell. * var cellType = new GC.Spread.Sheets.CellTypes.HyperLink(); * cellType.linkColor("blue"); * cellType.visitedLinkColor("#FFFF00"); * cellType.text("SpreadJS"); * cellType.linkToolTip("Company Web Site"); * cellType.target(GC.Spread.Sheets.CellTypes.HyperLinkTargetType.self); * activeSheet.getCell(0, 2).cellType(cellType).value("http://www.spreadjs.com/"); * ``` */ text(value?: string): any; /** * Gets or sets the color of visited links. * @param {string} value The visited link color. * @returns {string | GC.Spread.Sheets.CellTypes.HyperLink} If no value is set, returns the visited link color; otherwise, returns the hyperLink cell type. * @example * ```javascript * //This example creates a hyperlink cell. * var cellType = new GC.Spread.Sheets.CellTypes.HyperLink(); * cellType.linkColor("blue"); * cellType.visitedLinkColor("#FFFF00"); * cellType.text("SpreadJS"); * cellType.linkToolTip("Company Web Site"); * cellType.target(GC.Spread.Sheets.CellTypes.HyperLinkTargetType.self); * activeSheet.getCell(0, 2).cellType(cellType).value("http://www.spreadjs.com/"); * ``` */ visitedLinkColor(value?: string): any; } export class RadioButtonList extends Base{ /** * Represents an editable radio button list cell. * @extends GC.Spread.Sheets.CellTypes.Base * @class * @example * ```javascript * //This example creates a radio button list cell. * var cellType2 = new GC.Spread.Sheets.CellTypes.RadioButtonList(); * cellType2.items([{text:"a",value:1},{text:"b",value:2},{text:"c",value:3}]); * activeSheet.getCell(2, 2).cellType(cellType2); * ``` */ constructor(); /** * Gets or sets the size of radio button, only support number and "auto". * @param {number | string} value the size of radio button. If the value is "auto", the size of radio button will change with the font size. * @returns {number | string | GC.Spread.Sheets.CellTypes.RadioButtonList} If no value is set, return the size of radio button. otherwise, return the radio list cellType. * @example * ```javascript * // This example create a radio button list cell. * var cellType2 = new GC.Spread.Sheets.CellTypes.RadioButtonList(); * cellType2.items([{text:"a",value:1},{text:"b",value:2},{text:"c",value:3}]); * cellType2.boxSize(20); * activeSheet.getCell(2, 2).cellType(cellType2); * ``` */ boxSize(value?: number | string): any; /** * Gets or sets the radio button list's orders. * @param {GC.Spread.Sheets.CellTypes.Direction} value the order is vertical. * @returns {GC.Spread.Sheets.CellTypes.Direction | GC.Spread.Sheets.CellTypes.RadioButtonList} If no value is set, returns whether the radio button list's orders is vertical; otherwise, returns the radio button list cellType. * @example * ```javascript * //This example creates a radio button list cell. * var cellType2 = new GC.Spread.Sheets.CellTypes.RadioButtonList(); * cellType2.items([{text:"a",value:1},{text:"b",value:2},{text:"c",value:3}]); * cellType2.direction(GC.Spread.Sheets.CellTypes.Direction.vertical); * activeSheet.getCell(2, 2).cellType(cellType2); * ``` */ direction(value?: GC.Spread.Sheets.CellTypes.Direction): any; /** * Gets or sets the radio button list's layout is autofit. * @param {boolean} value Whether the layout is autofit. * @returns {boolean | GC.Spread.Sheets.CellTypes.RadioButtonList} If no value is set, returns whether the layout is autofit, returns the radio button list cellType. * @example * ```javascript * //This example creates a radio button list cell. * var cellType2 = new GC.Spread.Sheets.CellTypes.RadioButtonList(); * cellType2.items([{text:"a",value:1},{text:"b",value:2},{text:"c",value:3}]); * cellType2.isFlowLayout(true); * activeSheet.getCell(2, 2).cellType(cellType2); * ``` */ isFlowLayout(value?: boolean): any; /** * Gets or sets the items for the radio-button list. * @param {Array} items The items for the radio button list. * @returns {Array | GC.Spread.Sheets.CellTypes.RadioButtonList} If no value is set, returns the items array; otherwise, returns the radio button list cellType. * @example * ```javascript * //This example creates a radio button list cell. * var cellType2 = new GC.Spread.Sheets.CellTypes.RadioButtonList(); * cellType2.items([{text:"a",value:1},{text:"b",value:2},{text:"c",value:3}]); * activeSheet.getCell(2, 2).cellType(cellType2); * ``` */ items(items?: GC.Spread.Sheets.CellTypes.ICelltypeItemOption[] | string[]): any; /** * Gets or sets the space for two items in the radio button list. * @param {object} value the space for two items in the radio button list. * @returns {object | GC.Spread.Sheets.CellTypes.RadioButtonList} If no value is set, returns the space for two items in the radio button list; otherwise, returns the radio button list cellType. * @example * ```javascript * //This example creates a radio button list cell. * var cellType2 = new GC.Spread.Sheets.CellTypes.RadioButtonList(); * cellType2.items([{text:"a",value:1},{text:"b",value:2},{text:"c",value:3}]); * cellType2.itemSpacing({ * horizontal:80, * vertical:20 * }); * activeSheet.getCell(2, 2).cellType(cellType2); * ``` */ itemSpacing(value?: GC.Spread.Sheets.CellTypes.IItemSpacing): any; /** * Gets or sets the items for the radio button list's column count. * @param {number} value The column count for the radio button list. * @returns {number | GC.Spread.Sheets.CellTypes.RadioButtonList} If no value is set, returns the column count; otherwise, returns the radio button list cellType. * @example * ```javascript * //This example creates a radio button list cell. * var cellType2 = new GC.Spread.Sheets.CellTypes.RadioButtonList(); * cellType2.items([{text:"a",value:1},{text:"b",value:2},{text:"c",value:3}]); * cellType2.maxColumnCount(2); * activeSheet.getCell(2, 2).cellType(cellType2); * ``` */ maxColumnCount(value?: number): any; /** * Gets or sets the items for the radio button list's row count. * @param {number} value The row count for the radio button list. * @returns {number | GC.Spread.Sheets.CellTypes.RadioButtonList} If no value is set, returns the row count; otherwise, returns the radio button list cellType. * @example * ```javascript * //This example creates radio button list cell. * var cellType2 = new GC.Spread.Sheets.CellTypes.RadioButtonList(); * cellType2.items([{text:"a",value:1},{text:"b",value:2},{text:"c",value:3}]); * cellType2.maxRowCount(2); * activeSheet.getCell(2, 2).cellType(cellType2); * ``` */ maxRowCount(value?: number): any; /** * Gets or sets the text of radio button's position, only support left and right . * @param {GC.Spread.Sheets.CellTypes.TextAlign} value the text of radio button's position. * @returns {GC.Spread.Sheets.CellTypes.TextAlign | GC.Spread.Sheets.CellTypes.RadioButtonList} If no value is set, returns the text of radio button's position, returns the radio button list cellType. * @example * ```javascript * //This example creates a radio button list cell. * var cellType2 = new GC.Spread.Sheets.CellTypes.RadioButtonList(); * cellType2.items([{text:"a",value:1},{text:"b",value:2},{text:"c",value:3}]); * cellType2.textAlign(GC.Spread.Sheets.CellTypes.TextAlign.left); * activeSheet.getCell(2, 2).cellType(cellType2); * ``` */ textAlign(value?: GC.Spread.Sheets.CellTypes.TextAlign): any; } export class RangeTemplate extends GC.Spread.Sheets.CellTypes.Base{ /** * @description RangeTemplate provide a template from a range of referenced worksheet,it can apply to a cell.It will render the cell same as the tempalte and fill data different.If the param row,col, rowCount, colCount not set , it will use the whole sheet as the range scope. * @extends GC.Spread.Sheets.CellTypes.Base * @param {GC.Spread.Sheets.Worksheet} sheet the referenced worksheet, the sheet could be an individual sheet outside the workbook. * @param {number} [row] the template scope start row. * @param {number} [col] the template scope start col. * @param {number} [rowCount] the template scope row count. * @param {number} [colCount] the template scope col count. * @class * @example * ```javascript * var spread = new GC.Spread.Sheets.Workbook(document.getElementById("ss"), { sheetCount: 2 }); * var sheet = spread.getActiveSheet(); * var sheet2 = spread.getSheetFromName("Sheet2"); * var celltype = new GC.Spread.Sheets.CellTypes.RangeTemplate(sheet2, 0, 0, 6, 4); * sheet.getRange(0,0,2,2).cellType(celltype); * ``` */ constructor(sheet: GC.Spread.Sheets.Worksheet, row?: number, col?: number, rowCount?: number, colCount?: number); } export class RowHeader extends Base{ /** * Represents the painter of the row header cells. * @extends GC.Spread.Sheets.CellTypes.Base * @class */ constructor(); } export class Text extends Base{ /** * Represents a text cell type. * @extends GC.Spread.Sheets.CellTypes.Base * @class * @param {GC.Spread.Sheets.CellTypes.EditorType} editorType The editor type of the text cell type. * @example * ```javascript * // set text cell type to a cell * var textCellType = new GC.Spread.Sheets.CellTypes.Text(GC.Spread.Sheets.CellTypes.EditorType.textarea); * sheet.setCellType(1, 1, textCellType); * ``` */ constructor(editorType?: GC.Spread.Sheets.CellTypes.EditorType); } } module Charts{ /** * Get the specified color by colorScheme, index * @param {GC.Spread.Sheets.Charts.ColorScheme} colorScheme The color scheme. * @param {number} index The specified index. * @param {number} [count] The total collection count. * @return {string} returns the specified color. * @example * ```javascript * GC.Spread.Sheets.Charts.getColor([GC.Spread.Sheets.Charts.ColorRule.acrossLinear, ['Accent 1', 'Accent 4']], 6, 10); // return 'Accent 1 23' * ``` */ function getColor(colorScheme: GC.Spread.Sheets.Charts.ColorScheme, index: number, count?: number): string; export interface ErrorBarItem{ /** * The error bar type */ type?: number; /** * The error bar value type. */ valueType?: number; /** * The error bar has end cap or not. */ noEndCap?: boolean; /** * The error bar value, just take effect on the FixedValue(1) / Percentage(2) / StandardDeviation(3) value type. */ value?: number; /** * The error bar custom formulas, it contains positive formula and negative formula, just take effect on the Custom(0) value type. */ custom?: GC.Spread.Sheets.Charts.ErrorBarItemCustom; /** * The error bar styles. */ style?: GC.Spread.Sheets.Charts.ErrorBarItemStyle; } export interface ErrorBarItemCustom{ /** * The error bar custom positive formula. */ positive: string; /** * The error bar custom negative formula. */ negative: string; } export interface ErrorBarItems{ /** * The vertical error bar of the series, each series may has different direction error bar(s) based on chart type. */ vertical?: GC.Spread.Sheets.Charts.ErrorBarItem; /** * The horizontal error bar of the series, each series may has different direction error bar(s) based on chart type. */ horizontal?: GC.Spread.Sheets.Charts.ErrorBarItem; } export interface ErrorBarItemStyle{ /** * The error bar color. */ color?: string; /** * The error bar width. */ width?: number; /** * The error bar transparency. */ transparency?: number; /** * The error bar dashStyle. */ dashStyle?: GC.Spread.Sheets.Charts.ILineStyle; /** * The error bar visible info. */ visible?: boolean; } export interface IAxes{ /** * The primary category axis of the chart. */ primaryCategory?: GC.Spread.Sheets.Charts.IAxis; /** * The primary value axis of the chart. */ primaryValue?: GC.Spread.Sheets.Charts.IAxis; /** * The secondary category axis of the chart. */ secondaryCategory?: GC.Spread.Sheets.Charts.IAxis; /** * The secondary value axis of the chart. */ secondaryValue?: GC.Spread.Sheets.Charts.IAxis; } export interface IAxis{ /** * Indicates if the specified axis should be shown. */ visible?: boolean; /** * The axis tick label position. */ tickLabelPosition?: GC.Spread.Sheets.Charts.TickLabelPosition; /** * The axis tick label spacing. */ tickLabelSpacing?: number; /** * The line style of the axis. */ lineStyle?: GC.Spread.Sheets.Charts.IBorder; /** * The style of the axis. */ style?: GC.Spread.Sheets.Charts.IAxisStyle; /** * The major tick position of the axis. */ majorTickPosition?: GC.Spread.Sheets.Charts.TickMark; /** * The minor tick position of the axis. */ minorTickPosition?: GC.Spread.Sheets.Charts.TickMark; /** * The base unit scale of the date category axis. */ baseUnit?: GC.Spread.Sheets.Charts.TimeUnit; /** * The major unit of the primary category axis. */ majorUnit?: number; /** * The major unit scale of the date category axis. */ majorUnitScale?: GC.Spread.Sheets.Charts.TimeUnit; /** * The minor unit of the primary category axis. */ minorUnit?: number; /** * The minor unit scale of the date category axis. */ minorUnitScale?: GC.Spread.Sheets.Charts.TimeUnit; /** * The minimum value of the related axis. (for value / date axis only) */ min?: number | Date; /** * The maximum value of the related axis. (for value / date axis only) */ max?: number | Date; /** * The format of the axis. */ format?: string; /** * Whether to apply the format of the linked data source. */ numberFormatLinked?: boolean; /** * The title of the axis. */ title?: GC.Spread.Sheets.Charts.IAxisTitle; /** * The major grid line of the axis. */ majorGridLine?: GC.Spread.Sheets.Charts.IGridLine; /** * The minor grid line of the axis. */ minorGridLine?: GC.Spread.Sheets.Charts.IGridLine; /** * The label angle of the axis. */ labelAngle?: number; /** * The scaling informations of the axis. */ scaling?: GC.Spread.Sheets.Charts.IScaling; /** * The display unit informations of the axis. */ displayUnit?: GC.Spread.Sheets.Charts.IDisplayUnit; /** * Indicates the axis crosses value. */ crossPoint?: number | GC.Spread.Sheets.Charts.AxisCrossPoint } export interface IAxisStyle{ color?: string; transparency?: number; fontFamily?: string; fontSize?: number; } export interface IAxisTitle{ text?: string; color?: string; transparency?: number; fontFamily?: string; fontSize?: number; } export interface IBorder{ color?: string; width?: number; transparency?: number; dashStyle?: GC.Spread.Sheets.Charts.LineType; } export interface IChartArea{ /** * The background color of the chart area. */ backColor?: string | GC.Spread.Sheets.Charts.IPatternFillBackColor; /** * The transparency of the chart area backColor. */ backColorTransparency?: number; /** * The font family of the chart area. */ fontFamily?: string; /** * The font size of the chart area, its unit is pixel. */ fontSize?: number; /** * The color of the chart area. */ color?: string; /** * The transparency of the chart area color. */ transparency?: number; /** * The border of the chart area. */ border?: GC.Spread.Sheets.Charts.IBorder; } export interface IChartLegend{ /** * The position of the chart legend. */ position?: GC.Spread.Sheets.Charts.LegendPosition; /** * The visibility of the chart legend. */ visible?: boolean; /** * The backgroundColor of the chart legend. */ backColor?: string | GC.Spread.Sheets.Charts.IPatternFillBackColor; /** * The transparency of the chart legend color */ backColorTransparency?: number; /** * The borderStyle of the chart legend. */ borderStyle?: GC.Spread.Sheets.Charts.IBorder; /** * The border color of the chart legend. */ color?: string; /** * The font family of the chart legend text. */ fontFamily?: string; /** * The font size of the chart legend text. */ fontSize?: number; /** * whether the legend display without overlapping chart area. */ showLegendWithoutOverlapping?: boolean; layout?: GC.Spread.Sheets.Charts.IChartLegendLayout } export interface IChartLegendLayout{ /** * The x position of the chart legend, it's percentage, and the base line is chart's left edge. */ x?:number; /** * The y position of the chart legend, it's percentage, and the base line is chart's top edge. */ y?:number; /** * The width of the chart legend, it's percentage, and it's based on the chart's width. */ width?: number; /** * The height of the chart legend, it's percentage, and it's based on the chart's height. */ height?: number; } export interface IChartTextStyle{ color?: string; fontFamily?: string; fontSize?: number | string; transparency?: number; } export interface IChartTitle{ /** * The text of the chart title. */ text?: string; /** * The font family of the chart title. */ fontFamily?: string; /** * The font size of the chart title, its unit is pixel. */ fontSize?: number; /** * The color of the chart title. */ color?: string; /** * The transparency of the chart title color */ transparency?:number; /** * The background color of the chart title area. */ backColor?: string | GC.Spread.Sheets.Charts.IPatternFillBackColor; /** * The transparency of the chart title area backColor. */ backColorTransparency?: number; } export interface IDataLabels{ /** * Whether to show category name in data labels. */ showCategoryName?: boolean; /** * Whether to show series name in data labels. */ showSeriesName?: boolean; /** * Whether to show value in data labels. */ showValue?: boolean; /** * Whether to show the percent value in data labels. */ showPercentage?: boolean; /** * Whether to show the reference cells text in data labels. */ showDataLabelsRange?: boolean; /** * The data labels range formula; */ dataLabelsRange?: string; /** * The position of the chart data labels. */ position?: GC.Spread.Sheets.Charts.DataLabelPosition; /** * The format of the chart data labels. */ format?: string; /** * Whether to apply the format of the linked data source. */ numberFormatLinked?: boolean; /** * The color of the chart data labels. */ color?: string; /** * The transparency of the chart data labels color. */ transparency?: number; /** * the separator of the series data labels. */ separator?: string; /** * The background color of the series data labels. */ backColor?: string | GC.Spread.Sheets.Charts.IPatternFillBackColor; /** * The background color transparency of the series data labels. */ backColorTransparency?: number; /** * The border color of the series data labels. */ borderColor?: string; /** * The border width of the series data labels. */ borderWidth?: number; /** * The border color transparency of the series data labels. */ borderColorTransparency?: number; } export interface IDataPoint{ /** * The background color of the data point or symbol point. */ backColor?: string | GC.Spread.Sheets.Charts.IPatternFillBackColor; /** * The background color transparency of the data point or symbol point. */ backColorTransparency?: number; /** * The border style of the data point. */ border?: GC.Spread.Sheets.Charts.ISeriesItemBorder; /** * The symbol size of the data point. */ symbolSize?: number; /** * The symbol shape of the data point. */ symbolShape?: GC.Spread.Sheets.Charts.SymbolShape; /** * The symbol border of the data point. */ symbolBorder?: GC.Spread.Sheets.Charts.ISeriesItemBorder; } export interface IDataPoints{ [key: number]: GC.Spread.Sheets.Charts.IDataPoint; } export interface IDisplayUnit{ /** * The built-in display unit string or custom number display unit of the axis. */ unit?: number | GC.Spread.Sheets.Charts.DisplayUnit; /** * The display unit label visible of the axis. */ visible?: boolean; /** * The display unit label style of the axis. */ style?: GC.Spread.Sheets.Charts.IChartTextStyle; } export interface IFormatOver{ /** * The background color of the specific points collection. */ backColor?: string | GC.Spread.Sheets.Charts.IPatternFillBackColor; /** * The background color transparency of the specific points collection. */ backColorTransparency?: number; /** * The border style of the specific points collection. */ borderStyle?: GC.Spread.Sheets.Charts.ISeriesItemBorder; } export interface IFormatOvers{ /** * The object type that key is number type, For waterfall chart, 0 represents increase,1 represents decrease, 2 represents totals, the key value is IFormatOver type. */ [key: number]: GC.Spread.Sheets.Charts.IFormatOver; } export interface IGridLine{ color?: string; transparency?: number; visible?: boolean; width?: number; } export interface IHoverStyle{ /** * The color of the dataPoint been hovered. */ color?:string; /** * The color transparency of the dataPoint been hovered. */ transparency?:number; /** * The border of the dataPoint been hovered. */ borderStyle?: GC.Spread.Sheets.Charts.IBorder; /** * The symbol style of the dataPoint been hovered. */ symbolStyle?: GC.Spread.Sheets.Charts.IHoverSymbolStyle; } export interface IHoverSymbolStyle{ color?:string; transparency?:number; borderStyle?: GC.Spread.Sheets.Charts.IBorder; } export interface ILegacyChartPaintCallBack{ (chart: GC.Spread.Sheets.Charts.Chart, chartHost: HTMLElement) : void; } export interface ILineStyle{ color?: string; width?: number; transparency?: number; dashStyle?: GC.Spread.Sheets.Charts.LineType; } export interface IPaintCallBack{ (chart: GC.Spread.Sheets.Charts.Chart, ctx: CanvasRenderingContext2D, width: number, height: number) : void; } export interface IPatternFillBackColor{ type: GC.Spread.Sheets.Charts.PatternType; foregroundColor?: string; backgroundColor?: string; } export interface IScaling{ /** * Indicates the specified axis order. */ orientation?: number | GC.Spread.Sheets.Charts.AxisOrientation; /** * The logarithmic scaling base value of the primary category axis. */ logBase?: number; } export interface ISeries{ /** * The chart type of the series. */ chartType?: GC.Spread.Sheets.Charts.ChartType; /** * The axis group of the series. */ axisGroup?: GC.Spread.Sheets.Charts.AxisGroup; /** * The name formula of the series. */ name?: string; /** * The x values formula of the series. */ xValues?: string; /** * The y values formula of the series. */ yValues?: string; /** * The background color of the series. */ backColor?: string | GC.Spread.Sheets.Charts.IPatternFillBackColor; /** * The series point value is negative color when seriesItem type is column or bar chart and invertIfNegative is true. */ invertIfNegative?: boolean; /** * Whether the series show connector lines. This is used for waterfall chart, The default value is false. */ showConnectorLines?: boolean; /** * The waterfall chart set as total points index array(0 base). This is used for waterfall chart, The default value is empty array. */ subtotals?: number[]; /** * The series point value is negative color when seriesItem type is column or bar chart and invertIfNegative is true. */ invertColor?: string; /** * The transparency of the series background color. */ backColorTransparency?: number; /** * The border of the series. */ border?: GC.Spread.Sheets.Charts.ISeriesItemBorder; /** * The first slice angle of the chart whose chart type is pie. The default value is 0, which represents the 12 o'clock position. */ startAngle?: number; /** * The bubble sizes formula of the series. This is used for bubble chart. */ bubbleSizes?: string; /** * The data labels of the series. */ dataLabels?: GC.Spread.Sheets.Charts.IDataLabels; /** * The symbol of the series. */ symbol?: GC.Spread.Sheets.Charts.ISymbol; /** * The error bars of the series. */ errorBars?: GC.Spread.Sheets.Charts.ErrorBarItems; /** * The trendlines of the series. */ trendlines?: GC.Spread.Sheets.Charts.TrendlineItem[]; /** * Whether to show data in hidden rows and columns. */ plotVisibleOnly?: boolean; /** * The hole size of the doughnut chart. This is used for doughnut chart, The maximum value is 0.9, the minimum value is 0. */ doughnutHoleSize?: number; /** * Whether to display smooth lines. This is used for line chart and scatter chart. */ smooth?: boolean; /** * The gap width of the bar and column chart group. The maximum value is 5, the minimum value is 0. */ gapWidth?: number; /** * The overlap of the bar and column chart group. The maximum value is 1, the minimum value is -1. */ overlap?: number; /** * The data points of the series. */ dataPoints?: GC.Spread.Sheets.Charts.IDataPoints; /** * The scale factor for the bubble chart. It can be an integer value from 0 to 300, corresponding to a percentage of the default size. Default value is 100. */ bubbleScale?: number; } export interface ISeriesItemBorder{ color?: string; colorTransparency?: number; transparency?: number; width?: number; lineType?: GC.Spread.Sheets.Charts.LineType; } export interface ISeriesSymbolBorder{ /** * The symbol border color of the series. */ color?: string; /** * The transparency of the symbol border color. */ colorTransparency?: number; /** * The transparency of the symbol border color. */ transparency?: number; /** * The symbol border width of the series. */ width?: number; /** * The symbol border line Type of the series. */ lineType?: number; } export interface ISymbol{ /** * The symbol fill color of the series. */ fill: string; /** * The transparency of the symbol fill color. */ fillColorTransparency: number; /** * The symbol size of the series. */ size: number; /** * The symbol shape of the series. */ shape: GC.Spread.Sheets.Charts.SymbolShape; /** * The symbol border of the series. */ border: GC.Spread.Sheets.Charts.ISeriesSymbolBorder; } export interface TrendlineItem{ /** * The type of the trendline. */ type?: GC.Spread.Sheets.Charts.TrendlineType; /** * The order of the polynomial trendline. */ order?: number; /** * The period of the movingAverage trendline. */ period?: number; /** * The line style of the trendline. */ style?: GC.Spread.Sheets.Charts.ILineStyle; /** * The intercept of the trendline. */ intercept?: number; /** * The forward of the trendline. */ forward?: number; /** * The backward of the trendline. */ backward?: number; /** * Whether display the equation of the trendline. */ displayEquation?: boolean; /** * Whether display the R squared of the trendline. */ displayRSquared?: boolean; /** * The name of the trendline. */ name?: string; /** * The fontFamily of the trendline. */ fontFamily?: string; /** * The fontSize of the trendline. */ fontSize?: number; /** * The fontColor of the trendline. */ fontColor?: string; } /** * @typedef {Array} GC.Spread.Sheets.Charts.ColorScheme * @property {GC.Spread.Sheets.Charts.ColorRule} 0 - The color rule * @property {string[]} 1 - The colors list */ export type ColorScheme = (GC.Spread.Sheets.Charts.ColorRule | string[])[] /** * Specifies the point on the specified axis where the other axis crosses. * @enum {string} */ export enum AxisCrossPoint{ /** * The axis crosses at the auto value. */ automatic= "auto", /** * The axis crosses at the maximum value. */ maximum= "max", /** * The axis crosses at the minimum value. */ minimum= "min" } /** * Specifies the type of axis group. * @enum {number} */ export enum AxisGroup{ /** * Primary axis group. */ primary= 0, /** * Secondary axis group. */ secondary= 1 } /** * Specifies the specified axis orientation * @enum {number} */ export enum AxisOrientation{ /** * The axis order is from min to max. */ minMax= 0, /** * The axis order is from max to min. */ maxMin= 1 } /** * Specifies the chart type. * @enum {number} */ export enum ChartType{ /** * Combo */ combo= 0, /** * Scatter */ xyScatter= 1, /** * Radar */ radar= 2, /** * Doughnut */ doughnut= 3, /** * Area */ area= 8, /** * Line */ line= 9, /** * Pie */ pie= 10, /** * Bubble */ bubble= 11, /** * Clustered Column */ columnClustered= 12, /** * Stacked Column */ columnStacked= 13, /** * 100% Stacked Column */ columnStacked100= 14, /** * Clustered Bar */ barClustered= 18, /** * Stacked Bar */ barStacked= 19, /** * 100% Stacked Bar */ barStacked100= 20, /** * Stacked Line */ lineStacked= 24, /** * 100% Stacked Line */ lineStacked100= 25, /** * Line with Markers */ lineMarkers= 26, /** * Stacked Line with Markers */ lineMarkersStacked= 27, /** * 100% Stacked Line with Markers */ lineMarkersStacked100= 28, /** * Scatter with Smoothed Lines */ xyScatterSmooth= 33, /** * Scatter with Smoothed Lines and No Data Markers */ xyScatterSmoothNoMarkers= 34, /** * Scatter with Lines. */ xyScatterLines= 35, /** * Scatter with Lines and No Data Markers */ xyScatterLinesNoMarkers= 36, /** * Stacked Area */ areaStacked= 37, /** * 100% Stacked Area */ areaStacked100= 38, /** * Radar with data makers */ radarMarkers= 42, /** * Filled Radar */ radarFilled= 43, /** * High-Low-Close */ stockHLC= 49, /** * Open-High-Low-Close */ stockOHLC= 50, /** * Volume-High-Low-Close */ stockVHLC= 51, /** * Volume-Open-High-Low-Close */ stockVOHLC= 52, /** * Box & Whisker */ boxWhisker= 53, /** * Funnel */ funnel= 54, /** * Pareto */ paretoLine= 55, /** * map */ regionMap= 56, /** * sunburst */ sunburst= 57, /** * tree map */ treemap= 58, /** * Waterfall */ waterfall= 59, /** * Histogram */ clusteredColumn= 60 } /** * Specifies the color rule of the color style * @enum {number} */ export enum ColorRule{ /** * Specifies the color picked from the color list is the index modulus the color list length. */ cycle= 0, /** * Specifies the color picked from the color list is the first color with a brightness that varies from darker to lighter based on how close the index is from 0 and the count of the chart series being colored respectively. */ withinLinear= 1, /** * Specifies the color picked from the color list is the index modulus the color list length. The color has a brightness that varies from darker to lighter based on how close the index is from 0 and the count of the chart series being colored respectively. */ acrossLinear= 2, /** * Specifies the color picked from the color list is the first color with a brightness that varies from lighter to darker based on how close the index is from 0 and the count of the chart series being colored respectively. */ withinLinearReversed= 3, /** * Specifies the color picked from the color list is the index modulus the color list length. The color has a brightness that varies from lighter to darker based on how close the index is from 0 and the count of the chart series being colored respectively. */ acrossLinearReversed= 4 } /** * Specifies where the data label is positioned. * @enum {number} */ export enum DataLabelPosition{ /** * Adjust data label position automatically. */ bestFit= 0, /** * Data label below point. */ below= 1, /** * Data label centered on data point or inside bar or pie. */ center= 2, /** * Data label positioned arbitrarily. */ insideBase= 3, /** * Data label positioned arbitrarily. */ insideEnd= 4, /** * Data label positioned at bottom of bar or pie. */ left= 5, /** * Data label positioned at top of bar or pie. */ outsideEnd= 6, /** * Data label positioned at top of bar or pie. */ right= 7, /** * Data label above point. */ above= 8 } /** * Specifies the way of the chart display blank data. * @enum {number} */ export enum DisplayBlanksAs{ /** * Specifies display empty cells as connected */ connected= 0, /** * Specifies display empty cells as gaps */ gaps= 1, /** * Specifies display empty cells as zero */ zero= 2 } /** * Specifies the built-in type of axis display unit. * @enum {number} */ export enum DisplayUnit{ /** * The hundreds of built-in type. */ hundreds= "hundreds", /** * The thousands of built-in type. */ thousands= "thousands", /** * The ten thousands of built-in type. */ tenThousands= "tenThousands", /** * The hundred thousands of built-in type. */ hundredThousands= "hundredThousands", /** * The millions of built-in type. */ millions= "millions", /** * The ten millions of built-in type. */ tenMillions= "tenMillions", /** * The hundred millions of built-in type. */ hundredMillions= "hundredMillions", /** * The billions of built-in type. */ billions= "billions", /** * The trillions of built-in type. */ trillions= "trillions" } /** * Specifies the type of error bar in series * @enum {number} */ export enum ErrorBarType{ /** * Specifies each error bar has both minus and plus type at each data point. */ both= 0, /** * Specifies each error bar has minus type at each data point. */ minus= 1, /** * Specifies each error bar has plus type at each data point. */ plus= 2 } /** * Specifies the value type of error bar in series * @enum {number} */ export enum ErrorBarValueType{ /** * Specifies error bar has custom value type, each error bars has it own value, each values may be different. */ custom= 0, /** * Specifies each error bar has fixed value type at each data point. */ fixedValue= 1, /** * Specifies each error bar has percentage value type at each data point. */ percentage= 2, /** * Specifies each error bar has calculated standard deviation value type at each data point. */ standardDeviation= 3, /** * Specifies each error bar has calculated standard error value type at each data point. */ standardError= 4 } /** * Specifies the position of the legend on a chart. * @enum {number} */ export enum LegendPosition{ /** * Above the chart. */ top= 1, /** * To the right of the chart. */ right= 2, /** * To the left of the chart. */ left= 3, /** * Below the chart. */ bottom= 4, /** * In the upper right-hand corner of the chart border. */ topRight= 5 } /** * Specifies the type of line in series * @enum {number} */ export enum LineType{ /** * Specifies a solid line type */ solid= 0, /** * Specifies a dot line type */ dot= 1, /** * Specifies a dash line type */ dash= 2, /** * Specifies a large dash line type */ lgDash= 3, /** * Specifies a dash and a dot line type */ dashDot= 4, /** * Specifies a large dash and a dot line type */ lgDashDot= 5, /** * Specifies a large dash and a dot and a dot line type */ lgDashDotDot= 6, /** * Specifies a small dash line type */ sysDash= 7, /** * Specifies a small dot line type */ sysDot= 8, /** * Specifies a small dash and a dot line type */ sysDashDot= 9, /** * Specifies a small dash and a dot and a dot line type */ sysDashDotDot= 10 } /** * Specifies the pattern type of chart element background color * @enum {number} */ export enum PatternType{ /** * not supported */ none= 0, /** * 5% of the foreground color. */ dottedPercent5= 1, /** * 10% of the foreground color. */ dottedPercent10= 2, /** * 20% of the foreground color. */ dottedPercent20= 3, /** * 25% of the foreground color. */ dottedPercent25= 4, /** * 30% of the foreground color. */ dottedPercent30= 5, /** * 40% of the foreground color. */ dottedPercent40= 6, /** * 50% of the foreground color. */ dottedPercent50= 7, /** * 60% of the foreground color. */ dottedPercent60= 8, /** * 70% of the foreground color. */ dottedPercent70= 9, /** * 75% of the foreground color. */ dottedPercent75= 10, /** * 80% of the foreground color. */ dottedPercent80= 11, /** * 90% of the foreground color. */ dottedPercent90= 12, /** * Thick horizontal lines in the foreground color. */ darkHorizontal= 13, /** * Thick vertical lines in the foreground color. */ darkVertical= 14, /** * Thick lines in the foreground color running from the top to the right-hand side of the shape */ darkDownwardDiagonal= 15, /** * Thick lines in the foreground color running from the top to the left-hand side of the shape. */ darkUpwardDiagonal= 16, /** * Small squares in alternating foreground/background colors. */ smallCheckerBoard= 17, /** * Trellis pattern in the foreground color. */ trellis= 18, /** * Thin horizontal lines in the foreground color. */ lightHorizontal= 19, /** * Thin vertical lines in the foreground color. */ lightVertical= 20, /** * Thin lines in the foreground color running from the top to the right-hand side of the shape. */ lightDownwardDiagonal= 21, /** * Thin lines in the foreground color running from the top to the left-hand side of the shape. */ lightUpwardDiagonal= 22, /** * Solid, closely spaced perpendicular lines in the foreground color running horizontally and vertically to form grid lines across the shape. */ smallGrid= 23, /** * Dotted perpendicular lines in the foreground color running diagonally to form diamonds across the shape. */ dottedDiamond= 24, /** * Widely spaced lines in the foreground color running from the top to the right-hand side of the shape. */ wideDownwardDiagonal= 25, /** * Widely spaced lines in the foreground color running from the top to the left-hand side of the shape. */ wideUpwardDiagonal= 26, /** * Dashed lines in the foreground color running from the top to the left-hand side of the shape. */ dashedUpwardDiagonal= 27, /** * Dashed lines in the foreground color running from the top to the right-hand side of the shape. */ dashedDownwardDiagonal= 28, /** * Narrowly spaced vertical lines in the foreground color. */ narrowVertical= 29, /** * Narrowly spaced horizontal lines in the foreground color. */ narrowHorizontal= 30, /** * Dashed vertical lines in the foreground color. */ dashedVertical= 31, /** * Dashed horizontal lines in the foreground color. */ dashedHorizontal= 32, /** * Large dots in the foreground color scattered across the shape. */ largeConfetti= 33, /** * Solid, widely spaced perpendicular lines in the foreground color running horizontally and vertically to form grid lines across the shape. */ largeGrid= 34, /** * Rectangular brick pattern running horizontally across the shape. */ horizontalBrick= 35, /** * Squares in alternating foreground/background colors. */ largeCheckerBoard= 36, /** * Small dots in the foreground color scattered across the shape. */ smallConfetti= 37, /** * Zigzag lines running horizontally across the shape. */ zigZag= 38, /** * Diamond shapes in alternating foreground/background colors. */ solidDiamond= 39, /** * Rectangular brick pattern running diagonally across the shape. */ diagonalBrick= 40, /** * Solid perpendicular lines in the foreground color running diagonally to form diamonds across the shape. */ outlinedDiamond= 41, /** * Very thick solid lines in the foreground color running vertically, coupled with very thick lines and 40% of the foreground color running horizontally. */ plaid= 42, /** * Circles that use foreground and background colors to make them appear three-dimensional, oriented in rows across the shape. */ sphere= 43, /** * Weave pattern in the foreground color running diagonally across the shape. */ weave= 44, /** * Dotted perpendicular lines in the foreground color running horizontally and vertically to form grid lines across the shape. */ dottedGrid= 45, /** * Small angled shapes in the foreground color running in alternating rows down the shape. */ divot= 46, /** * Overlapping curved rectangles running diagonally across the shape. */ shingle= 47, /** * Wavy lines in the foreground color. */ wave= 48 } /** * Specifies whether the values corresponding to a particular data series are in rows or columns. * @enum {number} */ export enum RowCol{ /** * Data series is in a column. */ rows= 0, /** * Data series is in a row. */ columns= 1 } /** * Specifies the shape of symbol in series * @enum {number} */ export enum SymbolShape{ /** * Specifies a circle shall be drawn at each data point. */ circle= 0, /** * Specifies a dash shall be drawn at each data point. */ dash= 1, /** * Specifies a diamond shall be drawn at each data point. */ diamond= 2, /** * Specifies a dot shall be drawn at each data point. */ dot= 3, /** * Doesn't draw any symbol at each data point. */ none= 4, /** * Specifies a picture shall be drawn at each data point. */ picture= 5, /** * Specifies a plus shall be drawn at each data point. */ plus= 6, /** * Specifies a square shall be drawn at each data point. */ square= 7, /** * Specifies a star shall be drawn at each data point. */ star= 8, /** * Specifies a triangle shall be drawn at each data point. */ triangle= 9, /** * Specifies an X shall be drawn at each data point. */ x= 10 } /** * Specifies the position of tick-mark labels on the specified axis. * @enum {number} */ export enum TickLabelPosition{ /** * Top or right side of the chart. */ high= 0, /** * Bottom or left side of the chart. */ low= 1, /** * Next to axis (where axis is not at either side of the chart). */ nextToAxis= 2, /** * No tick marks. */ none= 3 } /** * Specifies the position of major and minor tick marks for an axis. * @enum {number} */ export enum TickMark{ /** * Crosses the axis. */ cross= 0, /** * Inside the axis. */ inside= 1, /** * No mark. */ none= 2, /** * Outside the axis. */ outside= 3 } /** * Specifies unit of time for chart axis and data series. * @enum {number} */ export enum TimeUnit{ /** * Days. */ days= 0, /** * Months. */ months= 1, /** * Years. */ years= 2 } /** * Specifies how the trendline that smoothes out fluctuations in the data is calculated. * @enum {number} */ export enum TrendlineType{ /** * Uses an equation to calculate the least squares fit through points. */ exponential= 0, /** * Uses the linear equation y = mx + b to calculate the least squares fit through points. */ linear= 1, /** * Uses the equation y = c ln x + b to calculate the least squares fit through points. */ logarithmic= 2, /** * Uses a sequence of averages computed from parts of the data series. The number * of points equals the total number of points in the series less the number * specified for the period. */ movingAverage= 3, /** * Uses an equation to calculate the least squares fit through points. */ polynomial= 4, /** * Uses an equation to calculate the least squares fit through points. */ power= 5 } export class Chart{ /** * Represents a chart. * @class * @param {GC.Spread.Sheets.Worksheet} sheet The host sheet of the chart. * @param {string} name The name of the chart. * @param {GC.Spread.Sheets.Charts.ChartType} chartType The type of the chart. * @param {number} x The x location of the chart. * @param {number} y The y location of the chart. * @param {number} width The width of the chart. * @param {number} height The height of the chart. * @param {string} [dataRange] The formula string of data range for the chart. * @param {GC.Spread.Sheets.Charts.RowCol} [dataOrientation] The orientation of data for series. * @param {GC.Spread.Sheets.Charts.ColorScheme} [colorScheme] The color scheme of the chart. */ constructor(sheet: GC.Spread.Sheets.Worksheet, name: string, chartType: GC.Spread.Sheets.Charts.ChartType, x: number, y: number, width: number, height: number, dataRange?: string, dataOrientation?: GC.Spread.Sheets.Charts.RowCol, colorScheme?: GC.Spread.Sheets.Charts.ColorScheme); /** Represents the type name string used for supporting serialization. * @type {string} */ typeName: string; /** * Gets or sets whether to disable moving the chart. * @param {boolean} value The setting for whether to disable moving the chart. * @returns {boolean | GC.Spread.Sheets.Charts.Chart} If no value is set, returns the setting for whether to disable moving the chart; otherwise, returns the chart. */ allowMove(value?: boolean): any; /** * Gets or sets whether to disable resizing the chart. * @param {boolean} value The setting for whether to disable resizing the chart. * @returns {boolean | GC.Spread.Sheets.Charts.Chart} If no value is set, returns the setting for whether to disable resizing the chart; otherwise, returns the chart. */ allowResize(value?: boolean): any; /** * Gets or sets the alternative text of the chart for screen readers. * @param {string} value The alternative text of the chart. * @returns {string} The alternative text of the chart. */ alt(value?: string): any; /** * Gets or sets the chart axes of the chart. * @param {GC.Spread.Sheets.Charts.IAxes} [value] The chart axes of the chart. * @returns {GC.Spread.Sheets.Charts.IAxes | GC.Spread.Sheets.Charts.Chart} If no value is set, returns the chart axes of the chart; otherwise, returns the chart. */ axes(value?: GC.Spread.Sheets.Charts.IAxes): any; /** * Gets or sets whether this chart is printable. * @param {boolean} value The value that indicates whether this chart is printable. * @returns {boolean | void} If no value is set, returns whether this chart is printable. */ canPrint(value?: boolean): any; /** * Gets or sets the chart area style of the chart. * @param {GC.Spread.Sheets.Charts.IChartArea} [value] The chart area style of the chart. * @returns {GC.Spread.Sheets.Charts.IChartArea | GC.Spread.Sheets.Charts.Chart} If no value is set, returns the chart area style of the chart; otherwise, returns the chart. */ chartArea(value?: GC.Spread.Sheets.Charts.IChartArea): any; /** * Gets or sets the type of the chart. * @param {GC.Spread.Sheets.Charts.ChartType} [value] The type of the chart. * @returns {GC.Spread.Sheets.Charts.ChartType | GC.Spread.Sheets.Charts.Chart} If no value is set, returns the type of the chart; otherwise, returns the chart. */ chartType(value?: GC.Spread.Sheets.Charts.ChartType): any; /** * Gets a copy of the current content of the instance. * @returns {HTMLElement} A copy of the current content of the instance. * @deprecated since version 17.0.0, This method is not available in the charts plugin, to use this method, please use the legacy-charts plugin. */ cloneContent(): HTMLElement; /** * Gets or sets the chart colors. * @param {GC.Spread.Sheets.Charts.ColorScheme} value that represent the chart color style. * @returns {GC.Spread.Sheets.Charts.ColorScheme | GC.Spread.Sheets.Charts.Chart} If no value is set, returns the current chart color style, otherwise, returns the chart. */ colorScheme(value?: GC.Spread.Sheets.Charts.ColorScheme): GC.Spread.Sheets.Charts.ColorScheme | GC.Spread.Sheets.Charts.Chart; /** * Gets or sets the content of the custom chart. * @param {HTMLElement} value The content of the custom chart. * @returns {HTMLElement | GC.Spread.Sheets.Charts.Chart} If no value is set, returns the content of the custom chart; otherwise, returns the chart. * @deprecated since version 17.0.0, This method is not available in the charts plugin, to use this method, please use the legacy-charts plugin. */ content(value?: HTMLElement): any; /** * Gets or sets the chart data labels style of the chart. * @param {GC.Spread.Sheets.Charts.IDataLabels} [value] The chart data labels style of the chart. * @returns {GC.Spread.Sheets.Charts.IDataLabels | GC.Spread.Sheets.Charts.Chart} If no value is set, returns the chart data labels style of the chart; otherwise, returns the chart. */ dataLabels(value?: GC.Spread.Sheets.Charts.IDataLabels): any; /** * Gets or sets the whole data range of the chart as formula string. * @param {string} [value] The formula string of the data range for the chart. * @returns {string | GC.Spread.Sheets.Charts.Chart} If no value is set, returns the formula string of the whole data range for the chart; otherwise, returns the chart. */ dataRange(value?: string): any; /** * Gets or sets the way that the chart display blank data. * @param {GC.Spread.Sheets.Charts.DisplayBlanksAs} [value] the way that the chart display blank data. * @returns {GC.Spread.Sheets.Charts.DisplayBlanksAs | GC.Spread.Sheets.Charts.Chart} If no value is set, returns the way that the chart display blank data, otherwise, returns the chart. */ displayBlanksAs(value?: GC.Spread.Sheets.Charts.DisplayBlanksAs): any; /** * Gets or sets whether to show #N/A cells as blank cells. * @param {boolean} value that whether to show #N/A cells as blank cells. * @returns { boolean | GC.Spread.Sheets.Charts.Chart} If no value is set, returns whether to show #N/A cells as blank cells, otherwise, returns the chart. */ displayNaAsBlank(value?: boolean): boolean | GC.Spread.Sheets.Charts.Chart; /** * Gets or sets whether the object moves when hiding or showing, resizing, or moving rows or columns. * @param {boolean} value The value indicates whether the object moves when hiding or showing, resizing, or moving rows or columns. * @returns {boolean | GC.Spread.Sheets.Charts.Chart} If no value is set, returns whether this chart dynamically moves; otherwise, returns the chart. */ dynamicMove(value?: boolean): any; /** * Gets or sets whether the position of the chart is fixed. When fixedPosition is true, dynamicMove and dynamicSize are disabled. * @param {boolean} value The value indicates whether the position of the chart is fixed. * @returns {boolean | GC.Spread.Sheets.Charts.Chart} If no value is set, returns whether the position of the chart is fixed; otherwise, returns the chart. */ dynamicSize(value?: boolean): any; /** * Gets or sets the end column index of the chart position. * @param {number} value The end column index of the chart position. * @returns {number | GC.Spread.Sheets.Charts.Chart} If no value is set, returns the end column index of the chart position; otherwise, returns the chart. */ endColumn(value?: number): any; /** * Gets or sets the offset relative to the end column of the chart. * @param {number} value The offset relative to the end column of the chart. * @returns {number | GC.Spread.Sheets.Charts.Chart} If no value is set, returns the offset relative to the end column of the chart; otherwise, returns the chart. */ endColumnOffset(value?: number): any; /** * Gets or sets the end row index of the chart position. * @param {number} value The end row index of the chart position. * @returns {number | GC.Spread.Sheets.Charts.Chart} If no value is set, returns the end row index of the chart position; otherwise, returns the chart. */ endRow(value?: number): any; /** * Gets or sets the offset relative to the end row of the chart. * @param {number} value The offset relative to the end row of the chart. * @returns {number | GC.Spread.Sheets.Charts.Chart} If no value is set, returns the offset relative to the end row of the chart; otherwise, returns the chart. */ endRowOffset(value?: number): any; /** * Gets or sets whether the size of the object changes when hiding or showing, resizing, or moving rows or columns. * @param {boolean} value The value indicates whether the size of the object changes when hiding or showing, resizing, or moving rows or columns. * @returns {boolean | GC.Spread.Sheets.Charts.Chart} If no value is set, returns whether this chart dynamically changes size; otherwise, returns the chart. * @deprecated since version 17.0.0, This method is not available in the charts plugin, to use this method, please use the legacy-charts plugin. */ fixedPosition(value: boolean): any; /** * Gets or sets waterfall chart different points collection style. * @param {Object.} value The specific data points collection style of the waterfall chart. * @returns { GC.Spread.Sheets.Charts.IFormatOvers | GC.Spread.Sheets.Charts.Chart} If no value is set, return waterfall chart different points collection styles */ formatOvers(value?: GC.Spread.Sheets.Charts.IFormatOvers): GC.Spread.Sheets.Charts.IFormatOvers | GC.Spread.Sheets.Charts.Chart; /** * Gets the formula string from the chart by the path. * @param {string} path The path which can accept a formula string, it could be one of "x", "y", "width", "height". * @returns {string} Returns the formula string from the chart by the path. */ getFormula(path: string): string; /** * Gets the dom host of the custom content. * @returns {HTMLElement[]} * @deprecated since version 17.0.0, This method is not available in the charts plugin, to use this method, please use the legacy-charts plugin. */ getHost(): HTMLElement[]; /** * Gets or sets the height of a chart. * @param {number} value The height of a chart. * @returns {number | GC.Spread.Sheets.Charts.Chart} If no value is set, returns the height of a chart; otherwise, returns the chart. */ height(value?: number): any; /** * Gets or sets the style when user hover over the dataPoint. * @param {GC.Spread.Sheets.Charts.IHoverStyle} [value] The hover style of the dataPoint been hovered. * @returns {GC.Spread.Sheets.Charts.IHoverStyle | GC.Spread.Sheets.Charts.Chart} If no value is set, returns the current hover style of the chart; otherwise, returns the chart. */ hoverStyle(value?: GC.Spread.Sheets.Charts.IHoverStyle): any; /** * Gets or sets the way that if the chart display hidden rows and columns data. * @param {boolean} value the value that if the chart display hidden rows and columns data. * @returns {boolean | GC.Spread.Sheets.Charts.Chart} If no value is set, returns the value that if the chart display hidden rows and columns data, otherwise, returns the chart. */ ignoreHidden(value?: boolean): boolean | GC.Spread.Sheets.Charts.Chart; /** * Gets or sets whether this chart is locked. * @param {boolean} value The value that indicates whether this chart is locked. * @returns {boolean | GC.Spread.Sheets.Charts.Chart} If no value is set, returns whether this chart is locked; otherwise, returns the chart. */ isLocked(value?: boolean): any; /** * Gets or sets whether this chart is selected. * @param {boolean} value The value that indicates whether this chart is selected. * @returns {boolean | GC.Spread.Sheets.Charts.Chart} If no value is set, returns whether this chart is selected; otherwise, returns the chart. */ isSelected(value?: boolean): any; /** * Gets or sets whether this chart is visible. * @param {boolean} value The value that indicates whether this chart is visible. * @returns {boolean | GC.Spread.Sheets.Charts.Chart} If no value is set, returns whether this chart is visible; otherwise, returns the chart. */ isVisible(value?: boolean): any; /** * Gets or sets the legend of the chart. * @param {GC.Spread.Sheets.Charts.IChartLegend} [value] The legend of the chart. * @returns {GC.Spread.Sheets.Charts.IChartLegend | GC.Spread.Sheets.Charts.Chart} If no value is set, returns the legend of the chart; otherwise, returns the chart. */ legend(value?: GC.Spread.Sheets.Charts.IChartLegend): any; /** * Gets the name of the chart. * @param {string} value The name of the chart. * @returns {string | GC.Spread.Sheets.Charts.Chart} If no value is set, returns the name of the chart; otherwise, returns the chart. */ name(value?: string): any; /** * Refreshes the chart, in most cases does not need to call this method. */ refreshContent(): void; /** * Gets the series collection of the chart. * @returns {GC.Spread.Sheets.Charts.SeriesCollection} Returns the series collection of the chart. */ series(): GC.Spread.Sheets.Charts.SeriesCollection; /** * Sets the formula string to the chart by the path. * @param {string} path The path which can accept a formula string, it could be one of "x", "y", "width", "height". * @param {string} formula The formula string. */ setFormula(path: string, formula: string): void; /** * Gets or sets the starting column index of the chart position. * @param {number} value The starting column index of the chart position. * @returns {number | GC.Spread.Sheets.Charts.Chart} If no value is set, returns the starting column index of the chart position; otherwise, returns the chart. */ startColumn(value?: number): any; /** * Gets or sets the offset relative to the start column of the chart. * @param {number} value The offset relative to the start column of the chart. * @returns {number | GC.Spread.Sheets.Charts.Chart} If no value is set, returns the offset relative to the start column of the chart; otherwise, returns the chart. */ startColumnOffset(value?: number): any; /** * Gets or sets the starting row index of the chart position. * @param {number} value The starting row index of the chart position. * @returns {number | GC.Spread.Sheets.Charts.Chart} If no value is set, returns the starting row index of the chart position; otherwise, returns the chart. */ startRow(value?: number): any; /** * Gets or sets the offset relative to the start row of the chart. * @param {number} value The offset relative to the start row of the chart. * @returns {number | GC.Spread.Sheets.Charts.Chart} If no value is set, returns the offset relative to the start row of the chart; otherwise, returns the chart. */ startRowOffset(value?: number): any; /** * Switches the data orientation between rows and columns. * @returns {boolean} Returns true when data orienetation is changable and successful switched; otherwise, false. */ switchDataOrientation(): boolean; /** * Gets or sets the title of the chart. * @param {GC.Spread.Sheets.Charts.IChartTitle} [value] The title of the chart. * @returns {GC.Spread.Sheets.Charts.IChartTitle | GC.Spread.Sheets.Charts.Chart} If no value is set, returns the title of the chart; otherwise, returns the chart. */ title(value?: GC.Spread.Sheets.Charts.IChartTitle): any; /** * Get the chart Image src of type Base64 string. * @returns {String} return the chart Image Base64 src string. * @example * ```javascript * let chartImageSrc = sheet.charts.all()[0].toImageSrc(); * ``` */ toImageSrc(): string; /** * Get the chart Image src of type Base64 string. * @returns {Promise} return the chart Image Base64 src string. * @example * ```javascript * let chartImageSrc = await sheet.charts.all()[0].toImageSrcAsync(); * ``` */ toImageSrcAsync(): Promise; /** * Gets or sets whether apply animation to the chart. * @param {boolean} [value] whether apply animation to the chart. * @returns {boolean | GC.Spread.Sheets.Charts.Chart} If no value is set, returns whether apply animation to the chart; otherwise, returns the chart. */ useAnimation(value?: boolean): any; /** * Gets or sets the width of a chart. * @param {number} value The width of a chart. * @returns {number | GC.Spread.Sheets.Charts.Chart} If no value is set, returns the width of a chart; otherwise, returns the chart. */ width(value?: number): any; /** * Gets or sets the horizontal location of the chart. * @param {number} value The horizontal location of the chart. * @return {number | GC.Spread.Sheets.Charts.Chart} If no value is set, returns the horizontal location of the chart; otherwise, returns the chart. */ x(value?: number): any; /** * Gets or sets the vertical location of the chart. * @param {number} value The vertical location of the chart. * @return {number | GC.Spread.Sheets.Charts.Chart} If no value is set, returns the vertical location of the chart; otherwise, returns the chart. */ y(value?: number): any; } export class ChartCollection{ /** * Represents a chart manager that managers all charts in a sheet. * @class * @param {GC.Spread.Sheets.Worksheet} sheet The worksheet. */ constructor(); /** * Adds a chart to the sheet. * @param {string} name The name of the chart that will be added to the sheet. * @param {GC.Spread.Sheets.Charts.ChartType} chartType The type of the chart. * @param {number} x The x location of the chart. * @param {number} y The y location of the chart. * @param {number} width The width of the chart. * @param {number} height The height of the chart. * @param {string} dataRange The formula string of data range for the chart. * @param {GC.Spread.Sheets.Charts.RowCol} dataOrientation The orientation of data for series. * @param {GC.Spread.Sheets.Charts.ColorScheme} [colorScheme] The color style of the chart. * @return {GC.Spread.Sheets.Charts.Chart} The chart that has been added to the sheet. * @example * ```javascript * //This example shows how to add a chart. * var dataRange = "A1:D4"; * var chart = activeSheet.charts.add('Chart1', GC.Spread.Sheets.Charts.ChartType.columnClustered, 250, 20, 600, 400, dataRange); * ``` */ add(name: string, chartType: GC.Spread.Sheets.Charts.ChartType, x: number, y: number, width: number, height: number, dataRange?: string, dataOrientation?: GC.Spread.Sheets.Charts.RowCol, colorScheme?: GC.Spread.Sheets.Charts.ColorScheme): GC.Spread.Sheets.Charts.Chart; /** * Gets all of the charts in the sheet. * @return {GC.Spread.Sheets.Charts.Chart[]} The collection of all the charts in the sheet. * @example * ```javascript * var dataRange = "A1:D4"; * activeSheet.charts.add('Chart1', GC.Spread.Sheets.Charts.ChartType.columnClustered, 250, 20, 600, 180, dataRange); * var dataRange2 = "A20:D24"; * activeSheet.charts.add('Chart2', GC.Spread.Sheets.Charts.ChartType.columnClustered, 250, 220, 600, 180, dataRange2); * var charts = activeSheet.charts.all(); * for (var i = 0; i < charts.length; i++) { * alert("Name of chart " + i + " is: " + charts[i].name()) * } * ``` */ all(): GC.Spread.Sheets.Charts.Chart[]; /** * Removes all charts in the sheet. */ clear(): void; /** * Gets a chart from the sheet by the indicate name. * @param {string} name The name of the chart. * @return {GC.Spread.Sheets.Charts.Chart} The chart in the sheet with the indicate name. * @example * ```javascript * var dataRange = "A1:D4"; * activeSheet.charts.add('Chart1', GC.Spread.Sheets.Charts.ChartType.columnClustered, 250, 20, 600, 400, dataRange); * //button * $("#button1").click(function () { * var chart = activeSheet.charts.get("f2"); * }); * ``` */ get(name: string): GC.Spread.Sheets.Charts.Chart; /** * Gets or sets if preserve unsupport chart when import. * @param {boolean} flag indicates whether preserve unsupport chart when import, the default value is false, if set true, it will be painted as paintCallBack. * @param {Function} paintCallBack the display content function for unsupport chart. * @returns {boolean} If no value is set, return the flag value, otherwise, return undefined; * @example * ```javascript * sheet.charts.preserveUnsupportedChart(true, function(chart, ctx, width, height){ * ctx.textBaseline = 'middle'; * ctx.textAlign = 'center'; * ctx.fillStyle = '#000000'; * ctx.fillText("to be continue", width / 2, height / 2, width); * }) * ``` */ preserveUnsupportedChart(flag?: boolean, paintCallBack?: GC.Spread.Sheets.Charts.IPaintCallBack | GC.Spread.Sheets.Charts.ILegacyChartPaintCallBack): boolean | undefined; /** * Removes a chart from the sheet by the indicate name. * @param {string} name The name of the chart. * @example * ```javascript * var dataRange = "A1:D4"; * activeSheet.charts.add('Chart1', GC.Spread.Sheets.Charts.ChartType.columnClustered, 250, 20, 600, 400, dataRange); * //button * $("#button1").click(function () { * activeSheet.resumePaint(); * activeSheet.charts.remove("f2"); * activeSheet.repaint(); * }); * ``` */ remove(name: string): void; /** * Gets or sets the z-index of chart. * @param {string} name The name of the chart. * @param {number} zIndex The z-index of the chart. * @return {number | *} If the parameter 'zIndex' is null or undefined,it will return the z-index of the chart with the indicate name. * @example * ```javascript * var dataRange = "A1:D4"; * activeSheet.charts.add('Chart1', GC.Spread.Sheets.Charts.ChartType.columnClustered, 250, 20, 600, 180, dataRange); * var dataRange2 = "A20:D24"; * activeSheet.charts.add('Chart2', GC.Spread.Sheets.Charts.ChartType.columnClustered, 250, 180, 600, 180, dataRange2); * activeSheet.charts.zIndex('Chart1', 897); * activeSheet.charts.zIndex('Chart2', 890); * ``` */ zIndex(name: string, zIndex?: number): any; } export class ColorSchemes{ /** * Represents a built-in chart color scheme collection. * @class */ constructor(); /** * Gets the colorfulPalette1 style. * @returns {GC.Spread.Sheets.Charts.ColorScheme} * @example * ```javascript * var chart = sheet.charts.add('Chart1', GC.Spread.Sheets.Charts.ChartType.columnClustered, 250, 20, 600, 400, "A1:D4", GC.Spread.Sheets.Charts.RowCol.rows, GC.Spread.Sheets.Charts.ColorSchemes.colorfulPalette1); * ``` */ static colorfulPalette1: GC.Spread.Sheets.Charts.ColorScheme; /** * Gets the colorfulPalette2 style. * @returns {GC.Spread.Sheets.Charts.ColorScheme} * @example * ```javascript * var chart = sheet.charts.add('Chart1', GC.Spread.Sheets.Charts.ChartType.columnClustered, 250, 20, 600, 400, "A1:D4", GC.Spread.Sheets.Charts.RowCol.rows, GC.Spread.Sheets.Charts.ColorSchemes.colorfulPalette2); * ``` */ static colorfulPalette2: GC.Spread.Sheets.Charts.ColorScheme; /** * Gets the colorfulPalette3 style. * @returns {GC.Spread.Sheets.Charts.ColorScheme} * @example * ```javascript * var chart = sheet.charts.add('Chart1', GC.Spread.Sheets.Charts.ChartType.columnClustered, 250, 20, 600, 400, "A1:D4", GC.Spread.Sheets.Charts.RowCol.rows, GC.Spread.Sheets.Charts.ColorSchemes.colorfulPalette3); * ``` */ static colorfulPalette3: GC.Spread.Sheets.Charts.ColorScheme; /** * Gets the colorfulPalette4 style. * @returns {GC.Spread.Sheets.Charts.ColorScheme} * @example * ```javascript * var chart = sheet.charts.add('Chart1', GC.Spread.Sheets.Charts.ChartType.columnClustered, 250, 20, 600, 400, "A1:D4", GC.Spread.Sheets.Charts.RowCol.rows, GC.Spread.Sheets.Charts.ColorSchemes.colorfulPalette4); * ``` */ static colorfulPalette4: GC.Spread.Sheets.Charts.ColorScheme; /** * Gets the monochromaticPalette1 style. * @returns {GC.Spread.Sheets.Charts.ColorScheme} * @example * ```javascript * var chart = sheet.charts.add('Chart1', GC.Spread.Sheets.Charts.ChartType.columnClustered, 250, 20, 600, 400, "A1:D4", GC.Spread.Sheets.Charts.RowCol.rows, GC.Spread.Sheets.Charts.ColorSchemes.monochromaticPalette1); * ``` */ static monochromaticPalette1: GC.Spread.Sheets.Charts.ColorScheme; /** * Gets the monochromaticPalette10 style. * @returns {GC.Spread.Sheets.Charts.ColorScheme} * @example * ```javascript * var chart = sheet.charts.add('Chart1', GC.Spread.Sheets.Charts.ChartType.columnClustered, 250, 20, 600, 400, "A1:D4", GC.Spread.Sheets.Charts.RowCol.rows, GC.Spread.Sheets.Charts.ColorSchemes.monochromaticPalette10); * ``` */ static monochromaticPalette10: GC.Spread.Sheets.Charts.ColorScheme; /** * Gets the monochromaticPalette11 style. * @returns {GC.Spread.Sheets.Charts.ColorScheme} * @example * ```javascript * var chart = sheet.charts.add('Chart1', GC.Spread.Sheets.Charts.ChartType.columnClustered, 250, 20, 600, 400, "A1:D4", GC.Spread.Sheets.Charts.RowCol.rows, GC.Spread.Sheets.Charts.ColorSchemes.monochromaticPalette11); * ``` */ static monochromaticPalette11: GC.Spread.Sheets.Charts.ColorScheme; /** * Gets the monochromaticPalette12 style. * @returns {GC.Spread.Sheets.Charts.ColorScheme} * @example * ```javascript * var chart = sheet.charts.add('Chart1', GC.Spread.Sheets.Charts.ChartType.columnClustered, 250, 20, 600, 400, "A1:D4", GC.Spread.Sheets.Charts.RowCol.rows, GC.Spread.Sheets.Charts.ColorSchemes.monochromaticPalette12); * ``` */ static monochromaticPalette12: GC.Spread.Sheets.Charts.ColorScheme; /** * Gets the monochromaticPalette13 style. * @returns {GC.Spread.Sheets.Charts.ColorScheme} * @example * ```javascript * var chart = sheet.charts.add('Chart1', GC.Spread.Sheets.Charts.ChartType.columnClustered, 250, 20, 600, 400, "A1:D4", GC.Spread.Sheets.Charts.RowCol.rows, GC.Spread.Sheets.Charts.ColorSchemes.monochromaticPalette13); * ``` */ static monochromaticPalette13: GC.Spread.Sheets.Charts.ColorScheme; /** * Gets the monochromaticPalette2 style. * @returns {GC.Spread.Sheets.Charts.ColorScheme} * @example * ```javascript * var chart = sheet.charts.add('Chart1', GC.Spread.Sheets.Charts.ChartType.columnClustered, 250, 20, 600, 400, "A1:D4", GC.Spread.Sheets.Charts.RowCol.rows, GC.Spread.Sheets.Charts.ColorSchemes.monochromaticPalette2); * ``` */ static monochromaticPalette2: GC.Spread.Sheets.Charts.ColorScheme; /** * Gets the monochromaticPalette3 style. * @returns {GC.Spread.Sheets.Charts.ColorScheme} * @example * ```javascript * var chart = sheet.charts.add('Chart1', GC.Spread.Sheets.Charts.ChartType.columnClustered, 250, 20, 600, 400, "A1:D4", GC.Spread.Sheets.Charts.RowCol.rows, GC.Spread.Sheets.Charts.ColorSchemes.monochromaticPalette3); * ``` */ static monochromaticPalette3: GC.Spread.Sheets.Charts.ColorScheme; /** * Gets the monochromaticPalette4 style. * @returns {GC.Spread.Sheets.Charts.ColorScheme} * @example * ```javascript * var chart = sheet.charts.add('Chart1', GC.Spread.Sheets.Charts.ChartType.columnClustered, 250, 20, 600, 400, "A1:D4", GC.Spread.Sheets.Charts.RowCol.rows, GC.Spread.Sheets.Charts.ColorSchemes.monochromaticPalette4); * ``` */ static monochromaticPalette4: GC.Spread.Sheets.Charts.ColorScheme; /** * Gets the monochromaticPalette5 style. * @returns {GC.Spread.Sheets.Charts.ColorScheme} * @example * ```javascript * var chart = sheet.charts.add('Chart1', GC.Spread.Sheets.Charts.ChartType.columnClustered, 250, 20, 600, 400, "A1:D4", GC.Spread.Sheets.Charts.RowCol.rows, GC.Spread.Sheets.Charts.ColorSchemes.monochromaticPalette5); * ``` */ static monochromaticPalette5: GC.Spread.Sheets.Charts.ColorScheme; /** * Gets the monochromaticPalette6 style. * @returns {GC.Spread.Sheets.Charts.ColorScheme} * @example * ```javascript * var chart = sheet.charts.add('Chart1', GC.Spread.Sheets.Charts.ChartType.columnClustered, 250, 20, 600, 400, "A1:D4", GC.Spread.Sheets.Charts.RowCol.rows, GC.Spread.Sheets.Charts.ColorSchemes.monochromaticPalette6); * ``` */ static monochromaticPalette6: GC.Spread.Sheets.Charts.ColorScheme; /** * Gets the monochromaticPalette7 style. * @returns {GC.Spread.Sheets.Charts.ColorScheme} * @example * ```javascript * var chart = sheet.charts.add('Chart1', GC.Spread.Sheets.Charts.ChartType.columnClustered, 250, 20, 600, 400, "A1:D4", GC.Spread.Sheets.Charts.RowCol.rows, GC.Spread.Sheets.Charts.ColorSchemes.monochromaticPalette7); * ``` */ static monochromaticPalette7: GC.Spread.Sheets.Charts.ColorScheme; /** * Gets the monochromaticPalette8 style. * @returns {GC.Spread.Sheets.Charts.ColorScheme} * @example * ```javascript * var chart = sheet.charts.add('Chart1', GC.Spread.Sheets.Charts.ChartType.columnClustered, 250, 20, 600, 400, "A1:D4", GC.Spread.Sheets.Charts.RowCol.rows, GC.Spread.Sheets.Charts.ColorSchemes.monochromaticPalette8); * ``` */ static monochromaticPalette8: GC.Spread.Sheets.Charts.ColorScheme; /** * Gets the monochromaticPalette9 style. * @returns {GC.Spread.Sheets.Charts.ColorScheme} * @example * ```javascript * var chart = sheet.charts.add('Chart1', GC.Spread.Sheets.Charts.ChartType.columnClustered, 250, 20, 600, 400, "A1:D4", GC.Spread.Sheets.Charts.RowCol.rows, GC.Spread.Sheets.Charts.ColorSchemes.monochromaticPalette9); * ``` */ static monochromaticPalette9: GC.Spread.Sheets.Charts.ColorScheme; } export class Points{ /** * Represents the dataPoint collection that managers all dataPoints in a chart series. * @class */ constructor(); } export class SeriesCollection{ /** * Represents the series manager that managers all series in a chart. * @class */ constructor(); /** * Adds a new series to series collection. * @param {GC.Spread.Sheets.Charts.ISeries | GC.Spread.Sheets.Charts.ISeries[]} series The series of the chart. * @example * ```javascript * // This example shows how to add a new series. * var dataRange = "A1:D4"; * var chart = activeSheet.charts.add('Chart1', GC.Spread.Sheets.Charts.ChartType.columnClustered, 250, 20, 600, 400, dataRange); * chart.series().add({ * chartType: GC.Spread.Sheets.Charts.ChartType.columnClustered, * axisGroup: GC.Spread.Sheets.Charts.AxisGroup.primary, * backColor: { * color: "lightblue", * width: 2 * }, * xValues: "A2:A4", * yValues: "B2:B4" * }); * ``` */ add(series: GC.Spread.Sheets.Charts.ISeries | GC.Spread.Sheets.Charts.ISeries[]): void; /** * Gets all series or a specified series from series collection. * @param {number} [index] The index of the series. * @return {GC.Spread.Sheets.Charts.ISeries | GC.Spread.Sheets.Charts.ISeries[]} The series of the chart. * @example * ```javascript * // This example shows how to get a series. * var dataRange = "A1:D4"; * var chart = activeSheet.charts.add('Chart1', GC.Spread.Sheets.Charts.ChartType.columnClustered, 250, 20, 600, 400, dataRange); * var series1 = chart.series().get(0); * ``` */ get(index?: number): any; /** * Removes a specified series from series collection. * @param {number} index The index of the series. * @example * ```javascript * // This example shows how to remove a specified series. * var dataRange = "A1:D4"; * var chart = activeSheet.charts.add('Chart1', GC.Spread.Sheets.Charts.ChartType.columnClustered, 250, 20, 600, 400, dataRange); * chart.series().remove(0); * ``` */ remove(index: number): void; /** * Updates the specified series's property. * @param {number} index The index of the series. * @param {GC.Spread.Sheets.Charts.ISeries} series The series of the chart. * @example * ```javascript * // This example shows how to update the property of a series. * var dataRange = "A1:D4"; * var chart = activeSheet.charts.add('Chart1', GC.Spread.Sheets.Charts.ChartType.columnClustered, 250, 20, 600, 400, dataRange); * var series1 = chart.series().get(0); * series1.backColor = "red"; * chart.series().set(0, series1); * ``` */ set(index: number, series: GC.Spread.Sheets.Charts.ISeries): void; } } module Collaboration{ export interface IChangeSet{ ops: GC.Spread.Sheets.Collaboration.IOpComponent[]; } export interface IOpComponent{ type: GC.Spread.Sheets.Collaboration.OpType; } export interface IOT_Type{ uri?: string; transform?: (op1: GC.Spread.Sheets.Collaboration.IChangeSet, op2: GC.Spread.Sheets.Collaboration.IChangeSet, side: 'left' | 'right') => GC.Spread.Sheets.Collaboration.IChangeSet; transformX?: (op1: GC.Spread.Sheets.Collaboration.IChangeSet, op2: GC.Spread.Sheets.Collaboration.IChangeSet, side: 'left' | 'right') => GC.Spread.Sheets.Collaboration.IChangeSet[]; } /** * This callback is used to handle the change set * @param {GC.Spread.Sheets.Collaboration.IChangeSet} changeSet - The change set to handle */ export type IChangeSetHandler = (changeSet: GC.Spread.Sheets.Collaboration.IChangeSet)=> void; /** * @property {GC.Spread.Sheets.Collaboration.BrowsingMode} [mode] * @property {GC.Spread.Sheets.Collaboration.PermissionTypes} [viewModePermissions] */ export type IPermission = { mode?: GC.Spread.Sheets.Collaboration.BrowsingMode; viewModePermissions?: GC.Spread.Sheets.Collaboration.PermissionTypes; } /** * @property {GC.Spread.Sheets.Collaboration.IUser} [user] * @property {GC.Spread.Sheets.Collaboration.IStatus} [status] */ export type IPresence = { user?: GC.Spread.Sheets.Collaboration.IUser; status?: GC.Spread.Sheets.Collaboration.IStatus; } /** * @property {GC.Spread.Sheets.IRange[]} [selections] * @property {string} [sheetId] */ export type ISelections = { selections?: GC.Spread.Sheets.IRange[]; sheetId?: string; } /** * @property {GC.Spread.Sheets.Collaboration.ISelections} [selections] */ export type IStatus = { selections?: GC.Spread.Sheets.Collaboration.ISelections; } /** * @property {string} [id] * @property {string} [name] * @property {string} [color] * @property {GC.Spread.Sheets.Collaboration.IPermission} [permission] */ export type IUser = { id?: string; name: string; color?: string; permission?: GC.Spread.Sheets.Collaboration.IPermission; } /** * Enumerates the browsing modes for document interaction. * @enum {number} * @public */ export enum BrowsingMode{ /** Allows the user to edit the document. */ edit= 0, /** Restricts the user to viewing the document only. */ view= 1 } /** * Defines the Operational type * @enum {number} * @public */ export enum OpType{ /** * addSheet */ addSheet= 1, /** * removeSheet */ removeSheet= 2, /** * clearSheets */ clearSheets= 3, /** * reorderSheet */ reorderSheet= 4, /** * setStartSheetIndex */ setStartSheetIndex= 5, /** * setActiveSheetId */ setActiveSheetId= 6, /** * setWorkbookOptions */ setWorkbookOptions= 7, /** * addNamedStyle */ addNamedStyle= 8, /** * removeNamedStyle */ removeNamedStyle= 9, /** * addSheetNamedStyle */ addSheetNamedStyle= 10, /** * removeSheetNamedStyle */ removeSheetNamedStyle= 11, /** * addCustomTheme */ addCustomTheme= 12, /** * removeCustomTheme */ removeCustomTheme= 13, /** * updateCustomTheme */ updateCustomTheme= 14, /** * addSheetTabStyle */ addSheetTabStyle= 15, /** * removeSheetTabStyle */ removeSheetTabStyle= 16, /** * clearSheetTabStyle */ clearSheetTabStyle= 17, /** * updateDocProp */ updateDocProp= 18, /** * updateDocPropForApp */ updateDocPropForApp= 19, /** * updateDocPropForCore */ updateDocPropForCore= 20, /** * addCustomDocProp */ addCustomDocProp= 21, /** * removeCustomDocProp */ removeCustomDocProp= 22, /** * clearCustomDocProp */ clearCustomDocProp= 23, /** * updateCustomDocProp */ updateCustomDocProp= 24, /** * setCustomDocProps */ setCustomDocProps= 25, /** * setTabSelected */ setTabSelected= 26, /** * setSheetName */ setSheetName= 27, /** * setRange */ setRange= 28, /** * setCustomName */ setCustomName= 29, /** * setSheetScopeCustomName */ setSheetScopeCustomName= 30, /** * clearCustomName */ clearCustomName= 31, /** * clearSheetScopeCustomName */ clearSheetScopeCustomName= 32, /** * addRows */ addRows= 33, /** * deleteRows */ deleteRows= 34, /** * addSpan */ addSpan= 35, /** * removeSpan */ removeSpan= 36, /** * updateSpan */ updateSpan= 37, /** * addColumns */ addColumns= 39, /** * deleteColumns */ deleteColumns= 40, /** * setRowCount */ setRowCount= 41, /** * setColumnCount */ setColumnCount= 42, /** * setFrozen */ setFrozen= 43, /** * setAxisSize */ setAxisSize= 45, /** * updateZoom */ updateZoom= 46, /** * setAxisOptions */ setAxisOptions= 47, /** * setWorksheetOptions */ setWorksheetOptions= 49, /** * setCurrentTheme */ setCurrentTheme= 50, /** * clearRange */ clearRange= 51, /** * setSheetVisible */ setSheetVisible= 52, /** * setFileInfo */ setFileInfo= 53, /** * updateTopLeftPosition */ updateTopLeftPosition= 54, /** * setWorkbookProperty */ setWorkbookProperty= 55, /** * setSheetBackgroundImage */ setSheetBackgroundImage= 56, /** * setCustomFunction */ setCustomFunction= 57, /** * setSheetScopeCustomFunction */ setSheetScopeCustomFunction= 58, /** * clearCustomFunction */ clearCustomFunction= 59, /** * clearSheetScopeCustomFunction */ clearSheetScopeCustomFunction= 60, /** * updateSheetDefaultsOptions */ updateSheetDefaultsOptions= 61, /** * setFormatStringName */ setFormatStringName= 62, /** * clearFormatStringName */ clearFormatStringName= 63, /** * addExternalReference */ addExternalReference= 101, /** * updateExternalReference */ updateExternalReference= 102, /** * sortSwap */ sortSwap= 111, /** * updateSortState */ updateSortState= 112, /** * setFilter */ setFilter= 121, /** * updateFilterSortInfo */ updateFilterSortInfo= 124, /** * updateFilterButtonVisibleInfo */ updateFilterButtonVisibleInfo= 125, /** * updateFilterRange */ updateFilterRange= 126, /** * updateFilterData */ updateFilterData= 128, /** * setDirection */ setDirection= 145, /** * showOutline */ showOutline= 146, /** * insertGroupItem */ insertGroupItem= 147, /** * setGroupItems */ setGroupItems= 148, /** * deleteGroupItem */ deleteGroupItem= 149, /** * addComment */ addComment= 161, /** * removeComment */ removeComment= 162, /** * updateComment */ updateComment= 163, /** * addTable */ addTable= 171, /** * removeTable */ removeTable= 172, /** * showHeader */ showHeader= 173, /** * showFooter */ showFooter= 174, /** * setTableProperty */ setTableProperty= 175, /** * setTableLayoutStyle */ setTableLayoutStyle= 176, /** * addTableRow */ addTableRow= 177, /** * removeTableRow */ removeTableRow= 178, /** * updateTablePosition */ updateTablePosition= 179, /** * addTableColumn */ addTableColumn= 180, /** * removeTableColumn */ removeTableColumn= 181, /** * setTableColumnProperty */ setTableColumnProperty= 182, /** * addShape */ addShape= 201, /** * removeShape */ removeShape= 202, /** * reorderShape */ reorderShape= 203, /** * updateShapeProp */ updateShapeProp= 204, /** * updateShapeFormula */ updateShapeFormula= 205, /** * updateShapeTransform */ updateShapeTransform= 206, /** * reorderChildShape */ reorderChildShape= 209, /** * updateChartSeries */ updateChartSeries= 221, /** * updateChart */ updateChart= 222, /** * addPivotCache */ addPivotCache= 251, /** * removePivotCache */ removePivotCache= 252, /** * updatePivotCache */ updatePivotCache= 253, /** * switchPivotCache */ switchPivotCache= 254, /** * updatePivotCacheField */ updatePivotCacheField= 255, /** * addPivotTable */ addPivotTable= 271, /** * removePivotTable */ removePivotTable= 272, /** * updatePivotTableLayout */ updatePivotTableLayout= 273, /** * updateFieldsModel */ updateFieldsModel= 274, /** * addPivotField */ addPivotField= 275, /** * removePivotField */ removePivotField= 276, /** * addRule */ addRule= 301, /** * updateRule */ updateRule= 302, /** * removeRule */ removeRule= 303, /** * clearRule */ clearRule= 304, /** * addAutoMerge */ addAutoMerge= 311, /** * removeAutoMerge */ removeAutoMerge= 312, /** * setSheetAreaAutoMerge */ setSheetAreaAutoMerge= 313, /** * addSparklineEx */ addSparklineEx= 321, /** * removeSparklineEx */ removeSparklineEx= 322, /** * updateSparklineGroup */ updateSparklineGroup= 323, /** * addSparklineGroup */ addSparklineGroup= 324, /** * removeSparklineGroup */ removeSparklineGroup= 325, /** * groupSparkline */ groupSparkline= 326, /** * setGroupSparklines */ setGroupSparklines= 327, /** * addSparklineForGroup */ addSparklineForGroup= 328, /** * removeSparklineForGroup */ removeSparklineForGroup= 329, /** * clearSparklineForGroup */ clearSparklineForGroup= 330, /** * updateSparkline */ updateSparkline= 331, /** * addCellState */ addCellState= 351, /** * removeCellState */ removeCellState= 352, /** * updateCellState */ updateCellState= 353, /** * setCellState */ setCellState= 354, /** * addDataValidator */ addDataValidator= 361, /** * updateDataValidator */ updateDataValidator= 362, /** * removeDataValidator */ removeDataValidator= 363, /** * setDataValidatorRange */ setDataValidatorRange= 364, /** * setOutlineColumnOptions */ setOutlineColumnOptions= 371, /** * setOutlineColumnProperty */ setOutlineColumnProperty= 372, /** * setPrintInfo */ setPrintInfo= 381, /** * setPrintInfoOption */ setPrintInfoOption= 382 } /** * Enumerates permission types for viewers. * @enum {number} * @public */ export enum PermissionTypes{ /** * Permits non-data-modifying operations */ allowNonDataModifyingOperations= 1, /** * Permits hide or unhide rows/columns. */ allowHideRowsOrColumns= 2, /** * Permits resizing rows/columns. */ allowResizeRowsOrColumns= 4, /** * Permits filtering ranges. */ allowFilter= 8, /** * Permits sorting. */ allowSort= 16 } export class Collaboration{ /** * Represents a collaboration manager that can manage collaboration status. * @class * @param {GC.Spread.Sheets.Workbook} workbook - The workbook. */ constructor(workbook: GC.Spread.Sheets.Workbook); /** * Only used in collaboration case, to apply doc's op. * @param {changeSet: GC.Spread.Sheets.Collaboration.IChangeSet} changeSet - change set */ applyChangeSet(changeSet: GC.Spread.Sheets.Collaboration.IChangeSet): void; /** * Ends the current batch operation, finalizing the collection of operations into a single ChangeSet. * This method must be called after `startBatchOp` to complete the batch process. * * @example * ```javascript * spread.collaboration.startBatchOp(); * sheet.setValue(0, 1, "World"); * sheet.setFormula(0, 2, "=SUM(A1:B1)"); * spread.collaboration.endBatchOp(); // The value and formula changes are merged into one ChangeSet. * ``` */ endBatchOp(): void; /** * Only used in collaboration case, to restore the snapshot to workbook state. * @param {object} snapshot - snapshot object */ fromSnapshot(snapshot: Object): void; /** * Get presences for workbook * @returns {GC.Spread.Sheets.Collaboration.IPresence[]} presences - The presences info. * @example * ```javascript * // This example gets presences. * const presences = spread.collaboration.getPresences(); * ``` */ getPresences(): GC.Spread.Sheets.Collaboration.IPresence[]; /** * Get user for workbook * @returns {GC.Spread.Sheets.Collaboration.IUser} * @example * ```javascript * // this example gets the current user. * const user = spread.collaboration.getUser(); * ``` */ getUser(): GC.Spread.Sheets.Collaboration.IUser; /** * Only used in collaboration case, to watch change set. * @param {changeSetHandler: GC.Spread.Sheets.Collaboration.IChangeSetHandler} onOpHandler - callback to watch change set */ onChangeSet(onOpHandler: GC.Spread.Sheets.Collaboration.IChangeSetHandler): void; /** * Only used in collaboration case, to register collaboration type. * @param {GC.Spread.Sheets.Collaboration.IOT_Type} type - collaboration type */ registerCollaborationType(type: GC.Spread.Sheets.Collaboration.IOT_Type): void; /** * Set the presences info. * @param {GC.Spread.Sheets.Collaboration.IPresence[]} presences - The presences info. * @example * ```javascript * //This example updates the current presences. * let presences = [{ * user: { * id: '1', * name: 'User1', * color: '#FF0000', * permission: { * mode: GC.Spread.Sheets.Collaboration.BrowsingMode.edit, * } * }, * status: { * selections: { * selections: [new GC.Spread.Sheets.Range(0, 0, 1, 1)], * sheetId: 'sheet1' * } * } * }, { * user: { * id: '2', * name: 'User2', * permission: { * mode: GC.Spread.Sheets.Collaboration.BrowsingMode.edit, * } * }, * status: { * selections: { * selections: [new GC.Spread.Sheets.Range(2, 2, 3, 5)], * sheetId: 'sheet1' * } * } * }] * spread.collaboration.setPresences(presences); * ``` */ setPresences(presences: GC.Spread.Sheets.Collaboration.IPresence[]): void; /** * Sets the current user. * @param {GC.Spread.Sheets.Collaboration.IUser} user The current user. * @example * ```javascript * //This example sets the current user. * let user = { * id: '1', * name: 'User1', * color: '#FF0000', * permission: { * mode: GC.Spread.Sheets.Collaboration.BrowsingMode.edit, * } * } * spread.collaboration.setUser(user); * ``` */ setUser(user: GC.Spread.Sheets.Collaboration.IUser): void; /** * Starts a batch operation, allowing multiple operations to be grouped and merged into a single ChangeSet. * When called, all operations performed until `endBatchOp` is invoked are collected and treated as a single atomic change in the SpreadJS workbook. * * @example * ```javascript * spread.collaboration.startBatchOp(); * sheet.setValue(0, 0, "Hello"); * sheet.setFormula(0, 2, "=SUM(A1:B1)"); * spread.collaboration.endBatchOp(); // All operations above are merged into a single ChangeSet. * ``` */ startBatchOp(): void; /** * Only used in collaboration case, to save workbook state to snapshot. * @return {object} snapshot - snapshot object */ toSnapshot(): Object; } } module Commands{ /** * Represents the command used to automatically resize the column in a sheet. * @property {boolean} canUndo - indicates whether the command supports undo and redo operations. * @property {function} execute - performs an execute or undo operation. * The arguments of the execute method are as follows. * @property {GC.Spread.Sheets.Workbook} context The context of the operation. * @property {Object} options The options of the operation. * @property {string} options.sheetName The sheet name. * @property {Array} options.columns The resize columns; each item is an object which has a col. * @property {boolean} options.rowHeader Whether the resized columns are in the row header area. * @property {GC.Spread.Sheets.AutoFitType} options.autoFitType Whether the auto-fit action includes the header text. * @property {boolean} isUndo `true` if this is an undo operation; otherwise, `false`. * @example * ```javascript * var columns = [ { col: 3 } ]; * spread.options.allowUndo = true; * spread.commandManager().execute({cmd: "autoFitColumn", sheetName: "Sheet1", columns: columns, rowHeader: false, autoFitType: GC.Spread.Sheets.AutoFitType.cell}); * ``` */ var autoFitColumn: { canUndo: boolean, execute(context: GC.Spread.Sheets.Workbook, options: {sheetName: string, columns: Object[], rowHeader: boolean, autoFitType: GC.Spread.Sheets.AutoFitType}, isUndo: boolean): any}; /** * Represents the command used to automatically resize the row in a sheet. * @property {boolean} canUndo - indicates whether the command supports undo and redo operations. * @property {function} execute - performs an execute or undo operation. * The arguments of the execute method are as follows. * @property {GC.Spread.Sheets.Workbook} context The context of the operation. * @property {Object} options The options of the operation. * @property {string} options.sheetName The sheet name. * @property {Array} options.rows The resize rows; each item is an object which has a row. * @property {boolean} options.columnHeader Whether the resized rows are in the column header area. * @property {GC.Spread.Sheets.AutoFitType} options.autoFitType Whether the auto-fit action includes the header text. * @property {boolean} isUndo `true` if this is an undo operation; otherwise, `false`. * @example * ```javascript * spread.options.allowUndo = true; * var rows = [ { row: 3 } ]; * spread.commandManager().execute({cmd: "autoFitRow", sheetName: "Sheet1", rows: rows, columnHeader: false, autoFitType: GC.Spread.Sheets.AutoFitType.cell}); * ``` */ var autoFitRow: { canUndo: boolean, execute(context: GC.Spread.Sheets.Workbook, options: {sheetName: string, rows: Object[], columnHeader: boolean, autoFitType: GC.Spread.Sheets.AutoFitType}, isUndo: boolean): any}; /** * Represents the command used to stop cell editing and cancel input. * @property {boolean} canUndo - indicates whether the command supports undo and redo operations. * @property {function} execute - performs an execute or undo operation. * The arguments of the execute method are as follows. * @property {GC.Spread.Sheets.Workbook} context The context of the operation. * @property {Object} options The options of the operation. * @property {string} options.sheetName The sheet name. * @property {boolean} isUndo `true` if this is an undo operation; otherwise, `false`. * @example * ```javascript * // stop cell editing with invoking command * // this sample will cancel the input editor after 2 Second * activeSheet.setValue(0, 0, '12312'); * activeSheet.startEdit(); * window.setTimeout(function() { * spread.commandManager().execute({ cmd: "cancelInput", sheetName: "Sheet1" }); * }, 2000); * ``` */ var cancelInput: { canUndo: boolean, execute(context: GC.Spread.Sheets.Workbook, options: {sheetName: string}): any}; /** * Represents the command used to switch the editor status between enter and edit mode when a cell is editing. * @property {boolean} canUndo - indicates whether the command supports undo and redo operations. * @property {function} execute - performs an execute or undo operation. * The arguments of the execute method are as follows. * @property {GC.Spread.Sheets.Workbook} context The context of the operation. * @property {Object} options The options of the operation. * @property {string} options.sheetName The sheet name. * @property {boolean} isUndo `true` if this is an undo operation; otherwise, `false`. * @example * ```javascript * // start editing a cell with invoking command * spread.commandManager().execute({cmd: "changeEditorStatus", sheetName: "Sheet1"}); * ``` */ var changeEditorStatus: { canUndo: boolean, execute(context: GC.Spread.Sheets.Workbook, options: {sheetName: string}): any}; /** * Represents the command used to switch the formula reference between relative, absolute, and mixed when editing formulas. * @property {boolean} canUndo - indicates whether the command supports undo and redo operations. * @property {function} execute - performs an execute or undo operation. * The arguments of the execute method are as follows. * @property {GC.Spread.Sheets.Workbook} context The context of the operation. * @property {Object} options The options of the operation. * @property {string} options.sheetName The sheet name. * @property {boolean} isUndo `true` if this is an undo operation; otherwise, `false`. * //This example uses the changeFormulaReference action to switch the formula reference. * spread.commandManager().execute({cmd: "changeFormulaReference", sheetName: "Sheet1"}); */ var changeFormulaReference: { canUndo: boolean, execute(context: GC.Spread.Sheets.Workbook, options: {sheetName: string}): any}; /** * Represents the command used to clear the cell value. * @property {boolean} canUndo - indicates whether the command supports undo and redo operations. * @property {function} execute - performs an execute or undo operation. * The arguments of the execute method are as follows. * @property {GC.Spread.Sheets.Workbook} context The context of the operation. * @property {Object} options The options of the operation. * @property {string} options.sheetName The sheet name. * @property {boolean} isUndo `true` if this is an undo operation; otherwise, `false`. * @example * ```javascript * // clear selected cells with the tab key * spread.commandManager().setShortcutKey('clear', GC.Spread.Commands.Key.tab, false, false, false, false); // Tab key * * // clear selected cells with invoking command * spread.commandManager().execute({cmd: "clear", sheetName: "Sheet1"}); * ``` */ var clear: { canUndo: boolean, execute(context: GC.Spread.Sheets.Workbook, options: {sheetName: string}): any}; /** * Represents the command used to clear the active cell value and enters edit mode. * @property {boolean} canUndo - indicates whether the command supports undo and redo operations. * @property {function} execute - performs an execute or undo operation. * The arguments of the execute method are as follows. * @property {GC.Spread.Sheets.Workbook} context The context of the operation. * @property {Object} options The options of the operation. * @property {string} options.sheetName The sheet name. * @property {boolean} isUndo `true` if this is an undo operation; otherwise, `false`. * @example * ```javascript * // clear active cell and enter edit mode with invoking command * spread.commandManager().execute({cmd: "clearAndEditing", sheetName: "Sheet1"}); * ``` */ var clearAndEditing: { canUndo: boolean, execute(context: GC.Spread.Sheets.Workbook, options: {sheetName: string}): any}; /** * Represents the command used to clear cell values on a worksheet. * @property {boolean} canUndo - indicates whether the command supports undo and redo operations. * @property {function} execute - performs an execute or undo operation. * The arguments of the execute method are as follows. * @property {GC.Spread.Sheets.Workbook} context The context of the operation. * @property {Object} options The options of the operation. * @property {string} options.sheetName The sheet name. * @property {Array} options.ranges The clear cell value ranges whose item type is GC.Spread.Sheets.Range. * @property {boolean} isUndo `true` if this is an undo operation; otherwise, `false`. * @example * ```javascript * spread.options.allowUndo = true; * spread.commandManager().execute({cmd: "clearValues", sheetName: "Sheet1", ranges: [new GC.Spread.Sheets.Range(8, 5, 2, 1)]}); * ``` */ var clearValues: { canUndo: boolean, execute(context: GC.Spread.Sheets.Workbook, options: {sheetName: string, ranges:GC.Spread.Sheets.Range[]}, isUndo: boolean): any}; /** * Represents the command used for a Clipboard paste on the worksheet. * @property {boolean} canUndo - indicates whether the command supports undo and redo operations. * @property {function} execute - performs an execute or undo operation. * The arguments of the execute method are as follows. * @property {GC.Spread.Sheets.Workbook} context The context of the operation. * @property {Object} options The options of the operation. * @property {string} options.sheetName The sheet name. * @property {GC.Spread.Sheets.Worksheet} options.fromSheet The source sheet. * @property {Array} options.fromRanges The source range array which item type is GC.Spread.Sheets.Range. * @property {Array} options.pastedRanges The target range array which item type is GC.Spread.Sheets.Range. * @property {boolean} options.isCutting Whether the operation is cutting or copying. * @property {string} options.clipboardText The text on the clipboard. * @property {GC.Spread.Sheets.ClipboardPasteOptions} options.pasteOption The Clipboard pasting option that indicates which content to paste. * @property {boolean} isUndo `true` if this is an undo operation; otherwise, `false`. * @example * ```javascript * //This example uses the clipboardPaste method. * activeSheet.setValue(0, 0, 1, GC.Spread.Sheets.SheetArea.viewport); * activeSheet.setValue(1, 0, 2, GC.Spread.Sheets.SheetArea.viewport); * activeSheet.setFormula(2, 0, "=A1+A2", GC.Spread.Sheets.SheetArea.viewport); * activeSheet.setValue(0, 1, 3, GC.Spread.Sheets.SheetArea.viewport); * activeSheet.setValue(1, 1, 4, GC.Spread.Sheets.SheetArea.viewport); * activeSheet.setFormula(2, 1, "=B1+B2", GC.Spread.Sheets.SheetArea.viewport); * var fromRange = [new GC.Spread.Sheets.Range(0, 0, 3, 2)]; * var toRanges = [new GC.Spread.Sheets.Range(5, 0, 3, 2)]; * spread.commandManager().execute({cmd: "clipboardPaste", sheetName: "Sheet1", fromSheet: activeSheet, fromRanges: fromRange, pastedRanges: toRanges, isCutting: true, clipboardText: "", pasteOption: GC.Spread.Sheets.ClipboardPasteOptions.all}); * ``` */ var clipboardPaste: { canUndo: boolean, execute(context: GC.Spread.Sheets.Workbook, options: {sheetName: string, fromSheet: GC.Spread.Sheets.Worksheet, fromRanges: GC.Spread.Sheets.Range[], pastedRanges: GC.Spread.Sheets.Range[], isCutting: boolean, clipboardText: string, pasteOption: GC.Spread.Sheets.ClipboardPasteOptions}, isUndo: boolean): any}; /** * Represents the command used to commit the cell editing and sets the array formula to the active range. * @property {boolean} canUndo - indicates whether the command supports undo and redo operations. * @property {function} execute - performs an execute or undo operation. * The arguments of the execute method are as follows. * @property {GC.Spread.Sheets.Workbook} context The context of the operation. * @property {Object} options The options of the operation. * @property {string} options.sheetName The sheet name. * @property {boolean} isUndo `true` if this is an undo operation; otherwise, `false`. * @example * ```javascript * // commit the cell editing and sets the array formula to the active range with invoking command * spread.commandManager().execute({cmd: "commitArrayFormula", sheetName: "Sheet1"}); * ``` */ var commitArrayFormula: { canUndo: boolean, execute(context: GC.Spread.Sheets.Workbook, options: {sheetName: string}): any}; /** * Represents the command used to stop cell editing and moves the active cell to the next row. * @property {boolean} canUndo - indicates whether the command supports undo and redo operations. * @property {function} execute - performs an execute or undo operation. * The arguments of the execute method are as follows. * @property {GC.Spread.Sheets.Workbook} context The context of the operation. * @property {Object} options The options of the operation. * @property {string} options.sheetName The sheet name. * @property {boolean} isUndo `true` if this is an undo operation; otherwise, `false`. * @example * ```javascript * // stop cell editing and moves the active cell to the next row with invoking command * activeSheet.setValue(1, 1, '12312'); * activeSheet.setActiveCell(1,1); * activeSheet.startEdit(); * window.setTimeout(function() { * spread.commandManager().execute({cmd: "commitInputNavigationDown", sheetName: "Sheet1"}); * }, 1000); * ``` */ var commitInputNavigationDown: { canUndo: boolean, execute(context: GC.Spread.Sheets.Workbook, options: {sheetName: string}): any}; /** * Represents the command used to stop cell editing and moves the active cell to the previous row. * @property {boolean} canUndo - indicates whether the command supports undo and redo operations. * @property {function} execute - performs an execute or undo operation. * The arguments of the execute method are as follows. * @property {GC.Spread.Sheets.Workbook} context The context of the operation. * @property {Object} options The options of the operation. * @property {string} options.sheetName The sheet name. * @property {boolean} isUndo `true` if this is an undo operation; otherwise, `false`. * @example * ```javascript * // stop cell editing and moves the active cell to the previous row with invoking command * activeSheet.setValue(1, 1, 'SpreadJS'); * activeSheet.setActiveCell(1,1); * activeSheet.startEdit(); * window.setTimeout(function() { * spread.commandManager().execute({cmd: "commitInputNavigationUp", sheetName: "Sheet1"}); * }, 1000); * ``` */ var commitInputNavigationUp: { canUndo: boolean, execute(context: GC.Spread.Sheets.Workbook, options: {sheetName: string}): any}; /** * Represents the command used to copy the selected item text to the Clipboard. * @property {boolean} canUndo - indicates whether the command supports undo and redo operations. * @property {function} execute - performs an execute or undo operation. * The arguments of the execute method are as follows. * @property {GC.Spread.Sheets.Workbook} context The context of the operation. * @property {Object} options The options of the operation. * @property {string} options.sheetName The sheet name. * @property {boolean} isUndo `true` if this is an undo operation; otherwise, `false`. * @example * ```javascript * // copy the selected items text to the Clipboard with invoking command * spread.commandManager().execute({cmd: "copy", sheetName: "Sheet1"}); * ``` */ var copy: { canUndo: boolean, execute(context: GC.Spread.Sheets.Workbook, options: {sheetName: string}): any}; /** * Represents the command used to copy sheet. * @property {boolean} canUndo - indicates whether the command supports undo and redo operations. * @property {function} execute - performs an execute or undo operation. * The arguments of the execute method are as follows. * @property {GC.Spread.Sheets.Workbook} context The context of the operation. * @property {Object} options The options of the operation. * @property {string} options.sheetName The clone sheet name. * @property {number} options.targetIndex The target index. * @property {number} options.newName The new sheet name. * @property {boolean} options.includeBindingSource Whether to bind data source to clone sheet * @example * ```javascript * //This example copy a sheet. * spread.commandManager().execute({cmd: "copySheet", sheetName: "Sheet1", targetIndex: targetIndex, newName: "Sheet1 (2)", includeBindingSource: true}); * ``` */ var copySheet: { canUndo: boolean, execute(context: GC.Spread.Sheets.Workbook, options: {sheetName: string, targetIndex: number, newName: string, includeBindingSource: boolean}): void}; /** * Represents the command used to cut the selected item text to the Clipboard. * @property {boolean} canUndo - indicates whether the command supports undo and redo operations. * @property {function} execute - performs an execute or undo operation. * The arguments of the execute method are as follows. * @property {GC.Spread.Sheets.Workbook} context The context of the operation. * @property {Object} options The options of the operation. * @property {string} options.sheetName The sheet name. * @property {boolean} isUndo `true` if this is an undo operation; otherwise, `false`. * @example * ```javascript * // cut the selected items text to the Clipboard with invoking command * spread.commandManager().execute({cmd: "cut", sheetName: "Sheet1"}); * ``` */ var cut: { canUndo: boolean, execute(context: GC.Spread.Sheets.Workbook, options: {sheetName: string}): any}; /** * Represents the command used to define the column. * @property {boolean} canUndo - indicates whether the command supports undo and redo operations. * @property {function} execute - performs an execute or undo operation. * The arguments of the execute method are as follows. * @property {GC.Spread.Sheets.Workbook} context The context of the operation. * @property {Object} options The options of the operation. * @property {string} options.sheetName The sheet name. * @property {number} [options.col] The specified col for inserting, optional. * @property {GC.Data.IColumn} options.column The defined column. * @property {boolean} isUndo `true` if this is an undo operation; otherwise, `false`. * @example * ```javascript * //This example uses the define column action. * // define the column properties * spread.commandManager().execute({cmd: "DefineColumn", sheetName: "Sheet1", { col: 1, column: { value: 'column1' }}}); * ``` */ var DefineColumn: { canUndo: boolean, execute(context: GC.Spread.Sheets.Workbook, options: {sheetName: string, col?: number, column: GC.Data.IColumn}): any}; /** * Represents the command for deleting the floating objects. * @property {boolean} canUndo - indicates whether the command supports undo and redo operations. * @property {function} execute - performs an execute or undo operation. * The arguments of the execute method are as follows. * @property {GC.Spread.Sheets.Workbook} context The context of the operation. * @property {Object} options The options of the operation. * @property {string} options.sheetName The sheet name. * @property {boolean} isUndo `true` if this is an undo operation; otherwise, `false`. * @example * ```javascript * // delete the floating objects with invoking command * spread.commandManager().execute({cmd: "deleteFloatingObjects", sheetName: "Sheet1"}); * ``` */ var deleteFloatingObjects: { canUndo: boolean, execute(context: GC.Spread.Sheets.Workbook, options: {sheetName: string}, isUndo: boolean): boolean}; /** * Represents the command used to drag and copy the floating objects on the sheet. * @property {boolean} canUndo - indicates whether the command supports undo and redo operations. * @property {function} execute - performs an execute or undo operation. * The arguments of the execute method are as follows. * @property {GC.Spread.Sheets.Workbook} context The context of the operation. * @property {Object} options The options of the operation. * @property {string} options.sheetName The sheet name. * @property {Array} options.floatingObjects The names array of floating objects. * @property {number} options.offsetX The horizontal offset. * @property {number} options.offsetY The vertical offset. * @property {boolean} isUndo `true` if this is an undo operation; otherwise `false`. * @example * ```javascript * // copy floating objects with invoking command * var customFloatingObject = new GC.Spread.Sheets.FloatingObjects.FloatingObject("floatingObject1", 10, 10, 60, 64); * var div = document.createElement('div'); * div.innerHTML = ' SpreadJS supports FloatingObject.'+ * '
' + * '
  • First list
  • Second list
'; * customFloatingObject.content(div); * activeSheet.floatingObjects.add(customFloatingObject); * spread.commandManager().execute({cmd: "dragCopyFloatingObjects", sheetName: "Sheet1", floatingObjects: ["floatingObject1"], offsetX: 100, offsetY: 200}); * ``` */ var dragCopyFloatingObjects: { canUndo: boolean, execute(context: GC.Spread.Sheets.Workbook, options: {sheetName: string, floatingObjects: string[], offsetX: number, offsetY: number}, isUndo: boolean): boolean}; /** * Represents the command used to drag a range and drop it onto another range on the worksheet. * @property {boolean} canUndo - indicates whether the command supports undo and redo operations. * @property {function} execute - performs an execute or undo operation. * The arguments of the execute method are as follows. * @property {GC.Spread.Sheets.Workbook} context The context of the operation. * @property {Object} commandOptions The options of the operation. * @property {string} commandOptions.sheetName The sheet name. * @property {number} commandOptions.fromRow The source row index for the drag drop. * @property {number} commandOptions.fromColumn The source column index for the drag drop. * @property {number} commandOptions.toRow The destination row index for the drag drop. * @property {number} commandOptions.toColumn The destination column index for the drag drop. * @property {number} commandOptions.rowCount The row count for the drag drop. * @property {number} commandOptions.columnCount The column count for the drag drop. * @property {boolean} commandOptions.copy If set to `true` copy; otherwise, cut if `false`. * @property {boolean} commandOptions.insert If set to `true` inserts the drag data in the drop row or column. * @property {GC.Spread.Sheets.CopyToOptions} commandOptions.option Indicates the content type to drag and drop. * @property {boolean} isUndo `true` if this is an undo operation; otherwise, `false`. * @example * ```javascript * spread.options.allowUndo = true; * spread.commandManager().execute({cmd: "dragDrop", sheetName: "Sheet1", fromRow:2, fromColumn:1, toRow:12, toColumn:2, rowCount:2, columnCount:2, copy: true, insert: false, option: GC.Spread.Sheets.CopyToOptions.value}); * ``` */ var dragDrop: { canUndo: boolean, execute(context: GC.Spread.Sheets.Workbook, options: {sheetName: string, fromRow: number, fromColumn: number, toRow: number, toColumn: number, rowCount: number, columnCount: number, copy: boolean, insert: boolean, option: GC.Spread.Sheets.CopyToOptions}, isUndo: boolean): boolean}; /** * Represents the command used to apply a new value to a cell on the worksheet. * @property {boolean} canUndo - indicates whether the command supports undo and redo operations. * @property {function} execute - performs an execute or undo operation. * The arguments of the execute method are as follows. * @property {GC.Spread.Sheets.Workbook} context The context of the operation. * @property {Object} options The options of the operation. * @property {string} options.sheetName The sheet name. * @property {number} options.row The row index of the cell. * @property {number} options.col The column index of the cell. * @property {Object} options.newValue The new value of the cell. * @property {boolean} options.autoFormat Whether to format the new value automatically. * @property {boolean} isUndo `true` if this is an undo operation; otherwise, `false`. * @example * ```javascript * // apply a new value to a cell with invoking command * spread.commandManager().execute({cmd: "editCell", sheetName: "Sheet1", row: 1, col: 1, newValue: "123", autoFormat: true}); * ``` */ var editCell: { canUndo: boolean, execute(context: GC.Spread.Sheets.Workbook, options: {sheetName: string, row: number, col: number, newValue: any, autoFormat: boolean}, isUndo: boolean): any}; /** * Represents the command to expand or collapse a column range group. * @property {boolean} canUndo - indicates whether the command supports undo and redo operations. * @property {function} execute - performs an execute or undo operation. * The arguments of the execute method are as follows. * @property {GC.Spread.Sheets.Workbook} context The context of the operation. * @property {Object} options The options of the operation. * @property {string} options.sheetName The sheet name. * @property {number} options.index The outline summary index. * @property {number} options.level The outline level. * @property {boolean} options.collapsed Whether to make the outline collapsed or expanded. * @property {boolean} isUndo `true` if this is an undo operation; otherwise, `false`. * @example * ```javascript * // collapse a column range group with invoking command * spread.commandManager().execute({cmd: "expandColumnOutline", sheetName: "Sheet1", index: 5, level: 0, collapsed: true}); * ``` */ var expandColumnOutline: { canUndo: boolean, execute(context: GC.Spread.Sheets.Workbook, options: {sheetName: string, index: number, level: number, collapsed: boolean}, isUndo: boolean): boolean}; /** * Represents the command used to expand or collapse column range groups on the same level. * @property {boolean} canUndo - indicates whether the command supports undo and redo operations. * @property {function} execute - performs an execute or undo operation. * The arguments of the execute method are as follows. * @property {GC.Spread.Sheets.Workbook} context The context of the operation. * @property {Object} options The options of the operation. * @property {string} options.sheetName The sheet name. * @property {number} options.level The outline level. * @property {boolean} isUndo `true` if this an undo operation; otherwise, `false`. * @example * ```javascript * // expand or collapse a column range group with invoking command * spread.commandManager().execute({cmd: "expandColumnOutlineForLevel", sheetName: "Sheet1", level: 0}); * ``` */ var expandColumnOutlineForLevel: { canUndo: boolean, execute(context: GC.Spread.Sheets.Workbook, options: {sheetName: string, level: number}, isUndo: boolean): boolean}; /** * Represents the command to expand or collapse a row range group. * @property {boolean} canUndo - indicates whether the command supports undo and redo operations. * @property {function} execute - performs an execute or undo operation. * The arguments of the execute method are as follows. * @property {GC.Spread.Sheets.Workbook} context The context of the operation. * @property {Object} options The options of the operation. * @property {string} options.sheetName The sheet name. * @property {number} options.index The outline summary index. * @property {number} options.level The outline level. * @property {boolean} options.collapsed Whether to make the outline collapsed or expanded. * @property {boolean} isUndo `true` if this is an undo operation; otherwise, `false`. * @example * ```javascript * // expand a row range group with invoking command * spread.commandManager().execute({cmd: "expandRowOutline", sheetName: "Sheet1", index: 5, level: 0, collapsed: false}); * ``` */ var expandRowOutline: { canUndo: boolean, execute(context: GC.Spread.Sheets.Workbook, options: {sheetName: string, index: number, level: number, collapsed: boolean}, isUndo: boolean): boolean}; /** * Represents the command used to expand or collapse row range groups on the same level. * @property {boolean} canUndo - indicates whether the command supports undo and redo operations. * @property {function} execute - performs an execute or undo operation. * The arguments of the execute method are as follows. * @property {GC.Spread.Sheets.Workbook} context The context of the operation. * @property {Object} options The options of the operation. * @property {string} options.sheetName The sheet name. * @property {number} options.level The outline level. * @property {boolean} isUndo `true` if this is an undo operation; otherwise, `false`. * @example * ```javascript * // expand or collapse a row range group with invoking command * spread.commandManager().execute({cmd: "expandRowOutlineForLevel", sheetName: "Sheet1", level: 0}); * ``` */ var expandRowOutlineForLevel: { canUndo: boolean, execute(context: GC.Spread.Sheets.Workbook, options: {sheetName: string, level: number}, isUndo: boolean): boolean}; /** * Represents the command used to drag and fill a range on the sheet. * @property {boolean} canUndo - indicates whether the command supports undo and redo operations. * @property {function} execute - performs an execute or undo operation. * The arguments of the execute method are as follows. * @property {GC.Spread.Sheets.Workbook} context The context of the operation. * @property {Object} options The options of the operation. * @property {string} options.sheetName The sheet name. * @property {GC.Spread.Sheets.Range} options.startRange The start range. * @property {GC.Spread.Sheets.Range} options.fillRange The fill range. * @property {GC.Spread.Sheets.Fill.AutoFillType} options.autoFillType The auto fill type. * @property {GC.Spread.Sheets.Fill.FillDirection} options.fillDirection The fill direction. * @property {boolean} isUndo `true` if an undo operation; otherwise, `false`. * @example * ```javascript * spread.options.allowUndo = true; * var srange = new GC.Spread.Sheets.Range(10, 5, 1, 1); * var frange = new GC.Spread.Sheets.Range(11, 5, 5, 1); * spread.commandManager().execute({cmd: "fill", sheetName: "Sheet1", startRange: srange, fillRange: frange, autoFillType: GC.Spread.Sheets.Fill.AutoFillType.fillSeries, fillDirection: GC.Spread.Sheets.Fill.FillDirection.down }); * ``` */ var fill: { canUndo: boolean, execute(context: GC.Spread.Sheets.Workbook, options: {sheetName: string, startRange: GC.Spread.Sheets.Range, fillRange: GC.Spread.Sheets.Range, autoFillType: GC.Spread.Sheets.Fill.AutoFillType, fillDirection: GC.Spread.Sheets.Fill.FillDirection}, isUndo: boolean): boolean}; /** * Represents the command used to modify the column. * @property {boolean} canUndo - indicates whether the command supports undo and redo operations. * @property {function} execute - performs an execute or undo operation. * The arguments of the execute method are as follows. * @property {GC.Spread.Sheets.Workbook} context The context of the operation. * @property {Object} options The options of the operation. * @property {string} options.sheetName The sheet name. * @property {number} options.col The specified col. * @property {GC.Data.IColumn} options.column The modified column. * @property {boolean} isUndo `true` if this is an undo operation; otherwise, `false`. * @example * ```javascript * //This example uses the modify column action. * // modify the column properties * spread.commandManager().execute({cmd: "ModifyColumn", sheetName: "Sheet1", { col: 1, column: { value: 'column1' }}}); * ``` */ var ModifyColumn: { canUndo: boolean, execute(context: GC.Spread.Sheets.Workbook, options: {sheetName: string, col: number, column: GC.Data.IColumn}): any}; /** * Represents the command for moving floating objects. * @property {boolean} canUndo - indicates whether the command supports undo and redo operations. * @property {function} execute - performs an execute or undo operation. * The arguments of the execute method are as follows. * @property {GC.Spread.Sheets.Workbook} context The context of the operation. * @property {Object} options The options of the operation. * @property {string} options.sheetName The sheet name. * @property {Array} options.floatingObjects The names array of floating objects. * @property {number} options.offsetX The horizontal offset. * @property {number} options.offsetY The vertical offset. * @property {boolean} isUndo `true` if this is an undo operation; otherwise, `false`. * @example * ```javascript * // move floating objects with invoking command * spread.commandManager().execute({cmd: "moveFloatingObjects", sheetName: "Sheet1", floatingObjects: ["floatingObject1", "floatingObject2"], offsetX: 10, offsetY: 20}); * ``` */ var moveFloatingObjects: { canUndo: boolean, execute(context: GC.Spread.Sheets.Workbook, options: {sheetName: string, floatingObjects: string[], offsetX: number, offsetY: number}, isUndo: boolean): boolean}; /** * Represents the command used to move sheet. * @property {boolean} canUndo - indicates whether the command supports undo and redo operations. * @property {function} execute - performs an execute or undo operation. * The arguments of the execute method are as follows. * @property {GC.Spread.Sheets.Workbook} context The context of the operation. * @property {Object} options The options of the operation. * @property {string} options.sheetName The sheet name. * @property {number} options.targetIndex The target index. * @example * ```javascript * //This example move a sheet. * spread.commandManager().execute({cmd: "moveSheet", sheetName: "Sheet1", targetIndex: targetIndex}); * ``` */ var moveSheet: { canUndo: boolean, execute(context: GC.Spread.Sheets.Workbook, options: {sheetName: string, targetIndex: number}): boolean}; /** * Represents the command used to move the active cell to the next cell. * @property {boolean} canUndo - indicates whether the command supports undo and redo operations. * @property {function} execute - performs an execute or undo operation. * The arguments of the execute method are as follows. * @property {GC.Spread.Sheets.Workbook} context The context of the operation. * @property {Object} options The options of the operation. * @property {string} options.sheetName The sheet name. * @property {boolean} isUndo `true` if this is an undo operation; otherwise, `false`. * @example * ```javascript * //This example maps the moveToNextCell action. * spread.focus(); * spread.commandManager().setShortcutKey('moveToNextCell', GC.Spread.Commands.Key.a, false, false, false, false); // a * * // move the active cell to the next cell with invoking command * spread.commandManager().execute({cmd: "moveToNextCell", sheetName: "Sheet1"}); * ``` */ var moveToNextCell: { canUndo: boolean, execute(context: GC.Spread.Sheets.Workbook, options: {sheetName: string}): any}; /** * Represents the command used to select the next control if the active cell is the last visible cell; otherwise, move the active cell to the next cell. * @property {boolean} canUndo - indicates whether the command supports undo and redo operations. * @property {function} execute - performs an execute or undo operation. * The arguments of the execute method are as follows. * @property {GC.Spread.Sheets.Workbook} context The context of the operation. * @property {Object} options The options of the operation. * @property {string} options.sheetName The sheet name. * @property {boolean} isUndo `true` if this is an undo operation; otherwise, `false`. * @example * ```javascript * //This example maps the moveToNextCellThenControl action. * spread.commandManager().setShortcutKey('moveToNextCellThenControl', GC.Spread.Commands.Key.tab, false, false, false, false); // Tab key * spread.commandManager().setShortcutKey('moveToPreviousCellThenControl', GC.Spread.Commands.Key.tab, false, true, false, false); // Shift key and Tab key * ``` */ var moveToNextCellThenControl: { canUndo: boolean, execute(context: GC.Spread.Sheets.Workbook, options: {sheetName: string}): any}; /** * Represents the command used to move the active cell to the previous cell. * @property {boolean} canUndo - indicates whether the command supports undo and redo operations. * @property {function} execute - performs an execute or undo operation. * The arguments of the execute method are as follows. * @property {GC.Spread.Sheets.Workbook} context The context of the operation. * @property {Object} options The options of the operation. * @property {string} options.sheetName The sheet name. * @property {boolean} isUndo `true` if this is an undo operation; otherwise, `false`. * @example * ```javascript * //This example uses the moveToPreviousCell action. * spread.commandManager().setShortcutKey('moveToPreviousCell', GC.Spread.Commands.Key.a, false, false, false, false); // a * * // move the active cell to the previous cell with invoking command * spread.commandManager().execute({cmd: "moveToPreviousCell", sheetName: "Sheet1"}); * ``` */ var moveToPreviousCell: { canUndo: boolean, execute(context: GC.Spread.Sheets.Workbook, options: {sheetName: string}): any}; /** * Represents the command used to select the previous control if the active cell is the first visible cell; otherwise, move the active cell to the previous cell. * @property {boolean} canUndo - indicates whether the command supports undo and redo operations. * @property {function} execute - performs an execute or undo operation. * The arguments of the execute method are as follows. * @property {GC.Spread.Sheets.Workbook} context The context of the operation. * @property {Object} options The options of the operation. * @property {string} options.sheetName The sheet name. * @property {boolean} isUndo `true` if this is an undo operation; otherwise, `false`. * @example * ```javascript * //This example maps the moveToPreviousCellThenControl action. * spread.commandManager().setShortcutKey('moveToNextCellThenControl', GC.Spread.Commands.Key.tab, false, false, false, false); // Tab key * spread.commandManager().setShortcutKey('moveToPreviousCellThenControl', GC.Spread.Commands.Key.tab, false, true, false, false); // Shift key and Tab key * ``` */ var moveToPreviousCellThenControl: { canUndo: boolean, execute(context: GC.Spread.Sheets.Workbook, options: {sheetName: string}): any}; /** * Represents the command used to move the active cell to the last row. * @property {boolean} canUndo - indicates whether the command supports undo and redo operations. * @property {function} execute - performs an execute or undo operation. * The arguments of the execute method are as follows. * @property {GC.Spread.Sheets.Workbook} context The context of the operation. * @property {Object} options The options of the operation. * @property {string} options.sheetName The sheet name. * @property {boolean} isUndo `true` if this is an undo operation; otherwise, `false`. * @example * ```javascript * //This example maps the navigationBottom action to the Tab key. * spread.commandManager().setShortcutKey('navigationDown', GC.Spread.Commands.Key.tab, false, false, false, false); // Tab key * spread.commandManager().setShortcutKey('navigationBottom', GC.Spread.Commands.Key.tab, false, true, false, false); // Shift key and Tab key * ``` */ var navigationBottom: { canUndo: boolean, execute(context: GC.Spread.Sheets.Workbook, options: {sheetName: string}): any}; /** * Represents the command used to move the active cell to the next row. * @property {boolean} canUndo - indicates whether the command supports undo and redo operations. * @property {function} execute - performs an execute or undo operation. * The arguments of the execute method are as follows. * @property {GC.Spread.Sheets.Workbook} context The context of the operation. * @property {Object} options The options of the operation. * @property {string} options.sheetName The sheet name. * @property {boolean} isUndo `true` if this is an undo operation; otherwise, `false`. * @example * ```javascript * //This example maps the navigationDown key. * spread.commandManager().setShortcutKey('navigationDown', GC.Spread.Commands.Key.tab, false, false, false, false); // Tab key * spread.commandManager().setShortcutKey('navigationBottom', GC.Spread.Commands.Key.tab, false, true, false, false); // Shift key and Tab key * ``` */ var navigationDown: { canUndo: boolean, execute(context: GC.Spread.Sheets.Workbook, options: {sheetName: string}): any}; /** * Represents the command used to move the active cell to the last column. * @property {boolean} canUndo - indicates whether the command supports undo and redo operations. * @property {function} execute - performs an execute or undo operation. * The arguments of the execute method are as follows. * @property {GC.Spread.Sheets.Workbook} context The context of the operation. * @property {Object} options The options of the operation. * @property {string} options.sheetName The sheet name. * @property {boolean} isUndo `true` if this is an undo operation; otherwise, `false`. * @example * ```javascript * //This example uses the navigationEnd method. * spread.commandManager().setShortcutKey('navigationEnd', GC.Spread.Commands.Key.tab, false, false, false, false); // Tab key * ``` */ var navigationEnd: { canUndo: boolean, execute(context: GC.Spread.Sheets.Workbook, options: {sheetName: string}): any}; /** * Represents the command used to move the active cell to the last column without regard to frozen trailing columns. * @property {boolean} canUndo - indicates whether the command supports undo and redo operations. * @property {function} execute - performs an execute or undo operation. * The arguments of the execute method are as follows. * @property {GC.Spread.Sheets.Workbook} context The context of the operation. * @property {Object} options The options of the operation. * @property {string} options.sheetName The sheet name. * @property {boolean} isUndo `true` if this is an undo operation; otherwise, `false`. * @example * ```javascript * //This example uses the navigationEnd2 action. * spread.commandManager().setShortcutKey("navigationEnd2", GC.Spread.Commands.Key.a, false, false, false, false); * ``` */ var navigationEnd2: { canUndo: boolean, execute(context: GC.Spread.Sheets.Workbook, options: {sheetName: string}): any}; /** * Represents the command used to move the active cell to the first cell in the sheet. * @property {boolean} canUndo - indicates whether the command supports undo and redo operations. * @property {function} execute - performs an execute or undo operation. * The arguments of the execute method are as follows. * @property {GC.Spread.Sheets.Workbook} context The context of the operation. * @property {Object} options The options of the operation. * @property {string} options.sheetName The sheet name. * @property {boolean} isUndo `true` if this is an undo operation; otherwise, `false`. * @example * ```javascript * //This example uses the navigationFirst action. * spread.commandManager().setShortcutKey("navigationFirst", GC.Spread.Commands.Key.a, false, false, false, false); * ``` */ var navigationFirst: { canUndo: boolean, execute(context: GC.Spread.Sheets.Workbook, options: {sheetName: string}): any}; /** * Represents the command used to move the active cell to the first column. * @property {boolean} canUndo - indicates whether the command supports undo and redo operations. * @property {function} execute - performs an execute or undo operation. * The arguments of the execute method are as follows. * @property {GC.Spread.Sheets.Workbook} context The context of the operation. * @property {Object} options The options of the operation. * @property {string} options.sheetName The sheet name. * @property {boolean} isUndo `true` if this is an undo operation; otherwise, `false`. * @example * ```javascript * //This example uses the navigationHome action. * spread.commandManager().setShortcutKey("navigationHome", GC.Spread.Commands.Key.a, false, false, false, false); * ``` */ var navigationHome: { canUndo: boolean, execute(context: GC.Spread.Sheets.Workbook, options: {sheetName: string}): any}; /** * Represents the command used to move the active cell to the first column without regard to frozen columns. * @property {boolean} canUndo - indicates whether the command supports undo and redo operations. * @property {function} execute - performs an execute or undo operation. * The arguments of the execute method are as follows. * @property {GC.Spread.Sheets.Workbook} context The context of the operation. * @property {Object} options The options of the operation. * @property {string} options.sheetName The sheet name. * @property {boolean} isUndo `true` if this is an undo operation; otherwise, `false`. * @example * ```javascript * //This example uses the navigationHome2 action. * spread.commandManager().setShortcutKey("navigationHome2", GC.Spread.Commands.Key.a, false, false, false, false); * ``` */ var navigationHome2: { canUndo: boolean, execute(context: GC.Spread.Sheets.Workbook, options: {sheetName: string}): any}; /** * Represents the command used to move the active cell to the last cell in the sheet. * @property {boolean} canUndo - indicates whether the command supports undo and redo operations. * @property {function} execute - performs an execute or undo operation. * The arguments of the execute method are as follows. * @property {GC.Spread.Sheets.Workbook} context The context of the operation. * @property {Object} options The options of the operation. * @property {string} options.sheetName The sheet name. * @property {boolean} isUndo `true` if this is an undo operation; otherwise, `false`. * @example * ```javascript * //This example uses the navigationLast action. * spread.commandManager().setShortcutKey("navigationLast", GC.Spread.Commands.Key.a, false, false, false, false); * ``` */ var navigationLast: { canUndo: boolean, execute(context: GC.Spread.Sheets.Workbook, options: {sheetName: string}): any}; /** * Represents the command used to move the active cell to the previous column. * @property {boolean} canUndo - indicates whether the command supports undo and redo operations. * @property {function} execute - performs an execute or undo operation. * The arguments of the execute method are as follows. * @property {GC.Spread.Sheets.Workbook} context The context of the operation. * @property {Object} options The options of the operation. * @property {string} options.sheetName The sheet name. * @property {boolean} isUndo `true` if this is an undo operation; otherwise, `false`. * @example * ```javascript * //This example uses the navigationLeft action. * spread.commandManager().setShortcutKey("navigationLeft", GC.Spread.Commands.Key.a, false, false, false, false); * ``` */ var navigationLeft: { canUndo: boolean, execute(context: GC.Spread.Sheets.Workbook, options: {sheetName: string}): any}; /** * Represents the command used to move the active sheet to the next sheet. * @property {boolean} canUndo - indicates whether the command supports undo and redo operations. * @property {function} execute - performs an execute or undo operation. * The arguments of the execute method are as follows. * @property {GC.Spread.Sheets.Workbook} context The context of the operation. * @property {Object} options The options of the operation. * @property {string} options.sheetName The sheet name. * @property {boolean} isUndo `true` if this is an undo operation; otherwise, `false`. * @example * ```javascript * //This example uses the navigationNextSheet action. * spread.commandManager().setShortcutKey("navigationNextSheet", GC.Spread.Commands.Key.a, false, false, false, false); * ``` */ var navigationNextSheet: { canUndo: boolean, execute(context: GC.Spread.Sheets.Workbook, options: {sheetName: string}): any}; /** * Represents the command used to move the active cell down one page of rows. * @property {boolean} canUndo - indicates whether the command supports undo and redo operations. * @property {function} execute - performs an execute or undo operation. * The arguments of the execute method are as follows. * @property {GC.Spread.Sheets.Workbook} context The context of the operation. * @property {Object} options The options of the operation. * @property {string} options.sheetName The sheet name. * @property {boolean} isUndo `true` if this is an undo operation; otherwise, `false`. * @example * ```javascript * //This example uses the navigationPageDown action. * spread.commandManager().setShortcutKey("navigationPageDown", GC.Spread.Commands.Key.a, false, false, false, false); * ``` */ var navigationPageDown: { canUndo: boolean, execute(context: GC.Spread.Sheets.Workbook, options: {sheetName: string}): any}; /** * Represents the command used to move the active cell up one page of rows. * @property {boolean} canUndo - indicates whether the command supports undo and redo operations. * @property {function} execute - performs an execute or undo operation. * The arguments of the execute method are as follows. * @property {GC.Spread.Sheets.Workbook} context The context of the operation. * @property {Object} options The options of the operation. * @property {string} options.sheetName The sheet name. * @property {boolean} isUndo `true` if this is an undo operation; otherwise, `false`. * @example * ```javascript * //This example uses the navigationPageUp action. * spread.commandManager().setShortcutKey("navigationPageUp", GC.Spread.Commands.Key.a, false, false, false, false); * ``` */ var navigationPageUp: { canUndo: boolean, execute(context: GC.Spread.Sheets.Workbook, options: {sheetName: string}): any}; /** * Represents the command used to move the active sheet to the previous sheet. * @property {boolean} canUndo - indicates whether the command supports undo and redo operations. * @property {function} execute - performs an execute or undo operation. * The arguments of the execute method are as follows. * @property {GC.Spread.Sheets.Workbook} context The context of the operation. * @property {Object} options The options of the operation. * @property {string} options.sheetName The sheet name. * @property {boolean} isUndo `true` if this is an undo operation; otherwise, `false`. * @example * ```javascript * //This example uses the navigationPreviousSheet action. * spread.commandManager().setShortcutKey("navigationNextSheet", GC.Spread.Commands.Key.a, false, false, false, false); * spread.commandManager().setShortcutKey("navigationPreviousSheet", GC.Spread.Commands.Key.c, false, false, false, false); * ``` */ var navigationPreviousSheet: { canUndo: boolean, execute(context: GC.Spread.Sheets.Workbook, options: {sheetName: string}, isUndo: boolean): any}; /** * Represents the command used to move the active cell to the next column. * @property {boolean} canUndo - indicates whether the command supports undo and redo operations. * @property {function} execute - performs an execute or undo operation. * The arguments of the execute method are as follows. * @property {GC.Spread.Sheets.Workbook} context The context of the operation. * @property {Object} options The options of the operation. * @property {string} options.sheetName The sheet name. * @property {boolean} isUndo `true` if this is an undo operation; otherwise, `false`. * @example * ```javascript * //This example uses the navigationRight action. * spread.commandManager().setShortcutKey("navigationRight", GC.Spread.Commands.Key.a, false, false, false, false); * ``` */ var navigationRight: { canUndo: boolean, execute(context: GC.Spread.Sheets.Workbook, options: {sheetName: string}): any}; /** * Represents the command used to move the active cell to the first row. * @property {boolean} canUndo - indicates whether the command supports undo and redo operations. * @property {function} execute - performs an execute or undo operation. * The arguments of the execute method are as follows. * @property {GC.Spread.Sheets.Workbook} context The context of the operation. * @property {Object} options The options of the operation. * @property {string} options.sheetName The sheet name. * @property {boolean} isUndo `true` if this is an undo operation; otherwise, `false`. * @example * ```javascript * //This example uses the navigationTop action. * spread.commandManager().setShortcutKey("navigationTop", GC.Spread.Commands.Key.a, false, false, false, false); * ``` */ var navigationTop: { canUndo: boolean, execute(context: GC.Spread.Sheets.Workbook, options: {sheetName: string}): any}; /** * Represents the command used to move the active cell to the previous row. * @property {boolean} canUndo - indicates whether the command supports undo and redo operations. * @property {function} execute - performs an execute or undo operation. * The arguments of the execute method are as follows. * @property {GC.Spread.Sheets.Workbook} context The context of the operation. * @property {Object} options The options of the operation. * @property {string} options.sheetName The sheet name. * @property {boolean} isUndo `true` if this is an undo operation; otherwise, `false`. * @example * ```javascript * //This example maps the navigationUp action to a. * spread.commandManager().setShortcutKey('navigationUp', GC.Spread.Commands.Key.a, false, false, false, false); // a * ``` */ var navigationUp: { canUndo: boolean, execute(context: GC.Spread.Sheets.Workbook, options: {sheetName: string}): any}; /** * Represents the command used to open a calculator picker in specified cell. * @property {boolean} canUndo - indicates whether the command supports undo and redo operations. * @property {function} execute - performs an execute or undo operation. * The arguments of the execute method are as follows. * @property {GC.Spread.Sheets.Workbook} context The context of the operation. * @property {Object} options The options of the operation. * @property {string} options.sheetName The sheet name. * @property {GC.Spread.Sheets.SheetArea} options.sheetArea The sheet area. * @property {number} options.row The rowIndex. * @property {number} options.col The columnIndex. * @property {boolean} isUndo `true` if this is an undo operation; otherwise, `false`. * @example * ```javascript * // open a calculator with invoking command * spread.commandManager().execute({cmd: "openCalculator", sheetName: "Sheet1", row: 1, col: 2}); * ``` */ var openCalculator: { canUndo: boolean, execute(context: GC.Spread.Sheets.Workbook, options: {sheetName: string, row: number, col: number, sheetArea: GC.Spread.Sheets.SheetArea}, isUndo: boolean): any}; /** * Represents the command used to open a color picker in specified cell. * @property {boolean} canUndo - indicates whether the command supports undo and redo operations. * @property {function} execute - performs an execute or undo operation. * The arguments of the execute method are as follows. * @property {GC.Spread.Sheets.Workbook} context The context of the operation. * @property {Object} options The options of the operation. * @property {string} options.sheetName The sheet name. * @property {GC.Spread.Sheets.SheetArea} options.sheetArea The sheet area. * @property {number} options.row The rowIndex. * @property {number} options.col The columnIndex. * @property {boolean} isUndo `true` if this is an undo operation; otherwise, `false`. * @example * ```javascript * // open a color picker with invoking command * spread.commandManager().execute({cmd: "openColorPicker", sheetName: "Sheet1", row: 1, col: 2}); * ``` */ var openColorPicker: { canUndo: boolean, execute(context: GC.Spread.Sheets.Workbook, options: {sheetName: string, row: number, col: number, sheetArea: GC.Spread.Sheets.SheetArea}, isUndo: boolean): any}; /** * Represents the command used to open a datetime picker in specified cell. * @property {boolean} canUndo - indicates whether the command supports undo and redo operations. * @property {function} execute - performs an execute or undo operation. * The arguments of the execute method are as follows. * @property {GC.Spread.Sheets.Workbook} context The context of the operation. * @property {Object} options The options of the operation. * @property {string} options.sheetName The sheet name. * @property {GC.Spread.Sheets.SheetArea} options.sheetArea The sheet area. * @property {number} options.row The rowIndex. * @property {number} options.col The columnIndex. * @property {boolean} isUndo `true` if this is an undo operation; otherwise, `false`. * @example * ```javascript * // open a dateTimePicker with invoking command * spread.commandManager().execute({cmd: "openDateTimePicker", sheetName: "Sheet1", row: 1, col: 2}); * ``` */ var openDateTimePicker: { canUndo: boolean, execute(context: GC.Spread.Sheets.Workbook, options: {sheetName: string, row: number, col: number, sheetArea: GC.Spread.Sheets.SheetArea}, isUndo: boolean): any}; /** * Represents the command used to open a list picker in specified cell. * @property {boolean} canUndo - indicates whether the command supports undo and redo operations. * @property {function} execute - performs an execute or undo operation. * The arguments of the execute method are as follows. * @property {GC.Spread.Sheets.Workbook} context The context of the operation. * @property {Object} options The options of the operation. * @property {string} options.sheetName The sheet name. * @property {GC.Spread.Sheets.SheetArea} options.sheetArea The sheet area. * @property {number} options.row The rowIndex. * @property {number} options.col The columnIndex. * @property {boolean} isUndo `true` if this is an undo operation; otherwise, `false`. * @example * ```javascript * // open a list with invoking command * spread.commandManager().execute({cmd: "openList", sheetName: "Sheet1", row: 1, col: 2}); * ``` */ var openList: { canUndo: boolean, execute(context: GC.Spread.Sheets.Workbook, options: {sheetName: string, row: number, col: number, sheetArea: GC.Spread.Sheets.SheetArea}, isUndo: boolean): any}; /** * Represents the command used to open a month picker in specified cell. * @property {boolean} canUndo - indicates whether the command supports undo and redo operations. * @property {function} execute - performs an execute or undo operation. * The arguments of the execute method are as follows. * @property {GC.Spread.Sheets.Workbook} context The context of the operation. * @property {Object} options The options of the operation. * @property {string} options.sheetName The sheet name. * @property {GC.Spread.Sheets.SheetArea} options.sheetArea The sheet area. * @property {number} options.row The rowIndex. * @property {number} options.col The columnIndex. * @property {boolean} isUndo `true` if this is an undo operation; otherwise, `false`. * @example * ```javascript * // open a month picker with invoking command * spread.commandManager().execute({cmd: "openMonthPicker", sheetName: "Sheet1", row: 1, col: 2}); * ``` */ var openMonthPicker: { canUndo: boolean, execute(context: GC.Spread.Sheets.Workbook, options: {sheetName: string, row: number, col: number, sheetArea: GC.Spread.Sheets.SheetArea}, isUndo: boolean): any}; /** * Represents the command used to open a multi-column list picker in specified cell. * @property {boolean} canUndo - indicates whether the command supports undo and redo operations. * @property {function} execute - performs an execute or undo operation. * The arguments of the execute method are as follows. * @property {GC.Spread.Sheets.Workbook} context The context of the operation. * @property {Object} options The options of the operation. * @property {string} options.sheetName The sheet name. * @property {GC.Spread.Sheets.SheetArea} options.sheetArea The sheet area. * @property {number} options.row The rowIndex. * @property {number} options.col The columnIndex. * @property {boolean} isUndo `true` if this is an undo operation; otherwise, `false`. * @example * ```javascript * // open a MultiColumn with invoking command * spread.commandManager().execute({cmd: "openMultiColumn", sheetName: "Sheet1", row: 1, col: 2}); * ``` */ var openMultiColumn: { canUndo: boolean, execute(context: GC.Spread.Sheets.Workbook, options: {sheetName: string, row: number, col: number, sheetArea: GC.Spread.Sheets.SheetArea}, isUndo: boolean): any}; /** * Represents the command used to open paste special dialog. * @property context The context of the operation. * @example * ```javascript * //This example opens the paste special dialog. * spread.commandManager().execute({cmd: "openPasteSpecialDialog", sheetName: spread.getActiveSheet().name()}); * ``` */ var openPasteSpecialDialog: { canUndo: boolean, execute(context: GC.Spread.Sheets.Workbook): void}; /** * Represents the command used to open a slider picker in specified cell. * @property {boolean} canUndo - indicates whether the command supports undo and redo operations. * @property {function} execute - performs an execute or undo operation. * The arguments of the execute method are as follows. * @property {GC.Spread.Sheets.Workbook} context The context of the operation. * @property {Object} options The options of the operation. * @property {string} options.sheetName The sheet name. * @property {GC.Spread.Sheets.SheetArea} options.sheetArea The sheet area. * @property {number} options.row The rowIndex. * @property {number} options.col The columnIndex. * @property {boolean} isUndo `true` if this is an undo operation; otherwise, `false`. * @example * ```javascript * // open a slider with invoking command * spread.commandManager().execute({cmd: "openSlider", sheetName: "Sheet1", row: 1, col: 2}); * ``` */ var openSlider: { canUndo: boolean, execute(context: GC.Spread.Sheets.Workbook, options: {sheetName: string, row: number, col: number, sheetArea: GC.Spread.Sheets.SheetArea}, isUndo: boolean): any}; /** * Represents the command used to open a time picker in specified cell. * @property {boolean} canUndo - indicates whether the command supports undo and redo operations. * @property {function} execute - performs an execute or undo operation. * The arguments of the execute method are as follows. * @property {GC.Spread.Sheets.Workbook} context The context of the operation. * @property {Object} options The options of the operation. * @property {string} options.sheetName The sheet name. * @property {GC.Spread.Sheets.SheetArea} options.sheetArea The sheet area. * @property {number} options.row The rowIndex. * @property {number} options.col The columnIndex. * @property {boolean} isUndo `true` if this is an undo operation; otherwise, `false`. * @example * ```javascript * // open a TimePicker with invoking command * spread.commandManager().execute({cmd: "openTimePicker", sheetName: "Sheet1", row: 1, col: 2}); * ``` */ var openTimePicker: { canUndo: boolean, execute(context: GC.Spread.Sheets.Workbook, options: {sheetName: string, row: number, col: number, sheetArea: GC.Spread.Sheets.SheetArea}, isUndo: boolean): any}; /** * Represents the command used to open the url of the hyperlink cell. * @property {boolean} canUndo - indicates whether the command supports undo and redo operations. * @property {function} execute - performs an execute or undo operation. * The arguments of the execute method are as follows. * @property {GC.Spread.Sheets.Workbook} context The context of the operation. * @property {Object} options The options of the operation. * @property {string} options.sheetName The sheet name. * @property {string} options.url The url string. * @property {GC.Spread.Sheets.Hyperlink.HyperlinkTargetType} options.target The target type, it's default is blank. * @property {boolean} isUndo `true` if this is an undo operation; otherwise, `false`. * @example * ```javascript * // clear open the url of the hyperlink cell with invoking command * spread.commandManager().execute({cmd: "openUrl", sheetName: "Sheet1", url: "https://www.spreadjs.com", target: GC.Spread.Sheets.Hyperlink.HyperlinkTargetType.blank}); * ``` */ var openUrl: { canUndo: boolean, execute(context: GC.Spread.Sheets.Workbook, options: { sheetName: string, url: string, target?: GC.Spread.Sheets.Hyperlink.HyperlinkTargetType }, isUndo: boolean): any}; /** * Represents the command used to open a workflow list picker in specified cell. * @property {boolean} canUndo - indicates whether the command supports undo and redo operations. * @property {function} execute - performs an execute or undo operation. * The arguments of the execute method are as follows. * @property {GC.Spread.Sheets.Workbook} context The context of the operation. * @property {Object} options The options of the operation. * @property {string} options.sheetName The sheet name. * @property {GC.Spread.Sheets.SheetArea} options.sheetArea The sheet area. * @property {number} options.row The rowIndex. * @property {number} options.col The columnIndex. * @property {boolean} isUndo `true` if this is an undo operation; otherwise, `false`. * @example * ```javascript * // open a color picker with invoking command * spread.commandManager().execute({cmd: "openWorkflowList", sheetName: "Sheet1", row: 1, col: 2}); * ``` */ var openWorkflowList: { canUndo: boolean, execute(context: GC.Spread.Sheets.Workbook, options: {sheetName: string, row: number, col: number, sheetArea: GC.Spread.Sheets.SheetArea}, isUndo: boolean): any}; /** * Represents the command for grouping a column outline (range group) on a sheet. * @property {boolean} canUndo - indicates whether the command supports undo and redo operations. * @property {function} execute - performs an execute or undo operation. * The arguments of the execute method are as follows. * @property {GC.Spread.Sheets.Workbook} context The context of the operation. * @property {Object} options The options of the operation. * @property {string} options.sheetName The sheet name. * @property {number} options.index The outline starting index. * @property {number} options.count The number of rows or columns to group or ungroup in the outline. * @property {boolean} isUndo `true` if this is an undo operation; otherwise, `false`. * @example * ```javascript * //This example creates a group. * spread.options.allowUndo = true; * spread.commandManager().execute({cmd: "outlineColumn", sheetName: "Sheet1", index: 3, count: 5}); * ``` */ var outlineColumn: { canUndo: boolean, execute(context: GC.Spread.Sheets.Workbook, options: {sheetName: string, index: number, count: number}, isUndo: boolean): boolean}; /** * Represents the command for grouping a row outline (range group) on a sheet. * @property {boolean} canUndo - indicates whether the command supports undo and redo operations. * @property {function} execute - performs an execute or undo operation. * The arguments of the execute method are as follows. * @property {GC.Spread.Sheets.Workbook} context The context of the operation. * @property {Object} options The options of the operation. * @property {string} options.sheetName The sheet name. * @property {number} options.index The outline starting index. * @property {number} options.count The number of rows or columns to group or ungroup in the outline. * @property {boolean} isUndo `true` if this is an undo operation; otherwise, `false`. * @example * ```javascript * //This example undoes an action. * spread.options.allowUndo = true; * spread.commandManager().execute({cmd: "outlineRow", sheetName: "Sheet1", index: 3, count: 5}); * ``` */ var outlineRow: { canUndo: boolean, execute(context: GC.Spread.Sheets.Workbook, options: {sheetName: string, index: number, count: number}, isUndo: boolean): boolean}; /** * Represents the command used to paste the selected items from the Clipboard to the current sheet. * @property {boolean} canUndo - indicates whether the command supports undo and redo operations. * @property {function} execute - performs an execute or undo operation. * The arguments of the execute method are as follows. * @property {GC.Spread.Sheets.Workbook} context The context of the operation. * @property {Object} options The options of the operation. * @property {string} options.sheetName The sheet name. * @property {GC.Spread.Sheets.InsertShiftCell} options.shiftCells The inserted data needs to be moved in the direction. * @property {GC.Spread.Sheets.ClipboardPasteOptions} options.pasteOption The option of paste. * @property {string} options.pasteText The pasting text of clipboard. * @property {string} options.pasteHtml The pasting HTML of clipboard. * @property {Object} options.pasteSpecialOptions * @property {GC.Spread.Sheets.PasteOperationOptions} options.pasteSpecialOptions.operationOptions The option of paste operation. * @property {boolean} options.pasteSpecialOptions.skipBlanks whether to skip the blank cells in the copied range without replacing the corresponding cells. * @property {boolean} options.pasteSpecialOptions.transpose whether to change columns of copied data to rows and vice versa. * @property {boolean} options.pasteSpecialOptions.pasteLink whether to paste cell references. * @property {string} options.pasteSpecialOptions.transformFormula Represents the formula for cell transform when pasting. * @property {GC.Spread.Sheets.TransformScope} options.pasteSpecialOptions.transformScope Represents the work scope for cell transform when pasting. * @property {boolean} isUndo `true` if this is an undo operation; otherwise, `false`. * @example * ```javascript * // paste the selected items from the Clipboard to the current sheet with invoking command * spread.commandManager().execute({cmd: "paste", sheetName: "Sheet1", pasteText: "test"}); * ``` */ var paste: { canUndo: boolean, execute(context: GC.Spread.Sheets.Workbook, options: {sheetName: string, shiftCells?: GC.Spread.Sheets.InsertShiftCell, pasteOption:GC.Spread.Sheets.ClipboardPasteOptions, pasteSpecialOptions: Object}): any}; /** * Represents the command for pasting the floating objects on the sheet. * @property {boolean} canUndo - indicates whether the command supports undo and redo operations. * @property {function} execute - performs an execute or undo operation. * The arguments of the execute method are as follows. * @property {GC.Spread.Sheets.Workbook} context The context of the operation. * @property {Object} options The options of the operation. * @property {string} options.sheetName The sheet name. * @property {boolean} isUndo `true` if this is an undo operation; otherwise, `false`. * @example * ```javascript * // paste the floating objects with invoking command * spread.commandManager().execute({cmd: "pasteFloatingObjects", sheetName: "Sheet1"}); * ``` */ var pasteFloatingObjects: { canUndo: boolean, execute(context: GC.Spread.Sheets.Workbook, options: {sheetName: string}, isUndo: boolean): boolean}; /** * Represents the command used to perform a redo of the most recently undone edit or action. * @property {boolean} canUndo - indicates whether the command supports undo and redo operations. * @property {function} execute - performs an execute or undo operation. * The arguments of the execute method are as follows. * @property {GC.Spread.Sheets.Workbook} context The context of the operation. * @property {Object} options The options of the operation. * @property {string} options.sheetName The sheet name. * @property {boolean} isUndo `true` if this is an undo operation; otherwise, `false`. * @example * ```javascript * //This example uses the redo command. * spread.commandManager().execute({cmd: "redo", sheetName: "Sheet1"}); * ``` */ var redo: { canUndo: boolean, execute(context: GC.Spread.Sheets.Workbook, options: {sheetName: string}): any}; /** * Represents the command used to remove the column. * @property {boolean} canUndo - indicates whether the command supports undo and redo operations. * @property {function} execute - performs an execute or undo operation. * The arguments of the execute method are as follows. * @property {GC.Spread.Sheets.Workbook} context The context of the operation. * @property {Object} options The options of the operation. * @property {string} options.sheetName The sheet name. * @property {number} options.col The specified col. * @property {boolean} isUndo `true` if this is an undo operation; otherwise, `false`. * @example * ```javascript * //This example uses the remove column action. * // remove the column properties * spread.commandManager().execute({cmd: "RemoveColumn", sheetName: "Sheet1", { col: 1 }}); * ``` */ var RemoveColumn: { canUndo: boolean, execute(context: GC.Spread.Sheets.Workbook, options: {sheetName: string, col: number}): any}; /** * Represents the command for ungrouping a column outline (range group) on a sheet. * @property {boolean} canUndo - indicates whether the command supports undo and redo operations. * @property {function} execute - performs an execute or undo operation. * The arguments of the execute method are as follows. * @property {GC.Spread.Sheets.Workbook} context The context of the operation. * @property {Object} options The options of the operation. * @property {string} options.sheetName The sheet name. * @property {number} options.index The outline starting index. * @property {number} options.count The number of rows or columns to group or ungroup in the outline. * @property {boolean} isUndo `true` if this is an undo operation; otherwise, `false`. * @example * ```javascript * // ungroup a column outline with invoking command * spread.commandManager().execute({cmd: "removeColumnOutline", sheetName: "Sheet1", index: 1, count: 3}); * ``` */ var removeColumnOutline: { canUndo: boolean, execute(context: GC.Spread.Sheets.Workbook, options: {sheetName: string, index: number, count: number}, isUndo: boolean): boolean}; /** * Represents the command for ungrouping a row outline (range group) on a sheet. * @property {boolean} canUndo - indicates whether the command supports undo and redo operations. * @property {function} execute - performs an execute or undo operation. * The arguments of the execute method are as follows. * @property {GC.Spread.Sheets.Workbook} context The context of the operation. * @property {Object} options The options of the operation. * @property {string} options.sheetName The sheet name. * @property {number} options.index The outline starting index. * @property {number} options.count The number of rows or columns to group or ungroup in the outline. * @property {boolean} isUndo `true` if this is an undo operation; otherwise, `false`. * @example * ```javascript * // ungroup a row outline with invoking command * spread.commandManager().execute({cmd: "removeRowOutline", sheetName: "Sheet1", index: 1, count: 3}); * ``` */ var removeRowOutline: { canUndo: boolean, execute(context: GC.Spread.Sheets.Workbook, options: {sheetName: string, index: number, count: number}, isUndo: boolean): boolean}; /** * Represents the command used to rename a worksheet. * @property {boolean} canUndo - indicates whether the command supports undo and redo operations. * @property {function} execute - performs an execute or undo operation. * The arguments of the execute method are as follows. * @property {GC.Spread.Sheets.Workbook} context The context of the operation. * @property {Object} options The options of the operation. * @property {string} options.sheetName The sheet name. * @property {string} options.name The sheet's new name. * @property {boolean} isUndo `true` if this is an undo operation; otherwise, `false`. * @example * ```javascript * //This example renames a sheet. * spread.commandManager().execute({cmd: "renameSheet", sheetName: "Sheet1", name: "SheetName"}); * ``` */ var renameSheet: { canUndo: boolean, execute(context: GC.Spread.Sheets.Workbook, options: {sheetName: string, name: string}, isUndo: boolean): any}; /** * Represents the command used to change the report chart preview visible in reportSheet cell binding chart. * @property {boolean} canUndo - indicates whether the command supports undo and redo operations. * @property {function} execute - performs an execute or undo operation. * The arguments of the execute method are as follows. * @property {GC.Spread.Sheets.Workbook} context The context of the operation. * @property {Object} options The options of the operation. * @property {string} options.sheetName The sheet name. * @property {number} options.row The data chart row number. * @property {number} options.col The data chart column number. * @property {boolean} options.visible The data chart visible. * @property {boolean} isUndo `true` if this is an undo operation; otherwise, `false`. * @example * ```javascript * // change the data chart preview visible in reportSheet while in Design mode with invoking command. * spread.commandManager().execute({cmd: "ReportChartPreviewVisible", sheetName: "Report1", row: 1, col: 1, visible: true}); * ``` */ var ReportChartPreviewVisible: { canUndo: boolean, execute(context: GC.Spread.Sheets.Workbook, options: {sheetName: string, row: number, col: number, visible: boolean}, isUndo: boolean): boolean}; /** * Represents the command used to toggle one collapse button in reportSheet. * @property {boolean} canUndo - indicates whether the command supports undo and redo operations. * @property {function} execute - performs an execute or undo operation. * The arguments of the execute method are as follows. * @property {GC.Spread.Sheets.Workbook} context The context of the operation. * @property {Object} options The options of the operation. * @property {string} options.sheetName The sheet name. * @property {number} options.row The collapse button row. * @property {number} options.col The collapse button col. * @property {boolean} isUndo `true` if this is an undo operation; otherwise, `false`. * @example * ```javascript * // toggle one collapse button with invoking command. * spread.commandManager().execute({cmd: "ReportCollapseButtonToggle", sheetName: "Report1", row: 1, col: 1}); * ``` */ var ReportCollapseButtonToggle: { canUndo: boolean, execute(context: GC.Spread.Sheets.Workbook, options: {sheetName: string, row: number, col: number}, isUndo: boolean): boolean}; /** * Represents the command used to add record in reportSheet. * @property {boolean} canUndo - indicates whether the command supports undo and redo operations. * @property {function} execute - performs an execute or undo operation. * The arguments of the execute method are as follows. * @property {GC.Spread.Sheets.Workbook} context The context of the operation. * @property {Object} options The options of the operation. * @property {string} options.sheetName The sheet name. * @property {number} options.activeRow The add record active row number. * @property {number} options.activeCol The add record active column number. * @property {boolean} isUndo `true` if this is an undo operation; otherwise, `false`. * @example * ```javascript * // add record in reportSheet while in DataEntry mode with invoking command. * spread.commandManager().execute({cmd: "reportSheetAddRecord", sheetName: "Report1", activeRow: 1, activeCol: 1}); * ``` */ var reportSheetAddRecord: { canUndo: boolean, execute(context: GC.Spread.Sheets.Workbook, options: {sheetName: string, activeRow: number, activeCol: number}, isUndo: boolean): boolean}; /** * Represents the command used to collapse all collapse button in reportSheet. * @property {boolean} canUndo - indicates whether the command supports undo and redo operations. * @property {function} execute - performs an execute or undo operation. * The arguments of the execute method are as follows. * @property {GC.Spread.Sheets.Workbook} context The context of the operation. * @property {Object} options The options of the operation. * @property {string} options.sheetName The sheet name. * @property {GC.Spread.Sheets.Range[]} options.selections The collapse button selections. * @property {boolean} isUndo `true` if this is an undo operation; otherwise, `false`. * @example * ```javascript * // collapse all collapse button while in DataEntry mode with invoking command. * spread.commandManager().execute({cmd: "reportSheetCollapseAll", sheetName: "Report1", selections: [new GC.Spread.Sheets.Range(1, 1, 1, 1)]}); * ``` */ var reportSheetCollapseAll: { canUndo: boolean, execute(context: GC.Spread.Sheets.Workbook, options: {sheetName: string, selections: GC.Spread.Sheets.Range[]}, isUndo: boolean): boolean}; /** * Represents the command used to delete record in reportSheet. * @property {boolean} canUndo - indicates whether the command supports undo and redo operations. * @property {function} execute - performs an execute or undo operation. * The arguments of the execute method are as follows. * @property {GC.Spread.Sheets.Workbook} context The context of the operation. * @property {Object} options The options of the operation. * @property {string} options.sheetName The sheet name. * @property {number} options.activeRow The deleted record active row number. * @property {number} options.activeCol The deleted record active column number. * @property {boolean} isUndo `true` if this is an undo operation; otherwise, `false`. * @example * ```javascript * // delete record in reportSheet while in DataEntry mode with invoking command. * spread.commandManager().execute({cmd: "reportSheetDeleteRecord", sheetName: "Report1", activeRow: 2, activeCol: 1}); * ``` */ var reportSheetDeleteRecord: { canUndo: boolean, execute(context: GC.Spread.Sheets.Workbook, options: {sheetName: string, activeRow: number, activeCol: number}, isUndo: boolean): boolean}; /** * Represents the command used to expand all collapse button in reportSheet. * @property {boolean} canUndo - indicates whether the command supports undo and redo operations. * @property {function} execute - performs an execute or undo operation. * The arguments of the execute method are as follows. * @property {GC.Spread.Sheets.Workbook} context The context of the operation. * @property {Object} options The options of the operation. * @property {string} options.sheetName The sheet name. * @property {GC.Spread.Sheets.Range[]} options.selections The collapse button selections. * @property {boolean} isUndo `true` if this is an undo operation; otherwise, `false`. * @example * ```javascript * // expand all collapse button while in DataEntry mode with invoking command. * spread.commandManager().execute({cmd: "reportSheetExpandAll", sheetName: "Report1", selections: [new GC.Spread.Sheets.Range(1, 1, 1, 1)]}); * ``` */ var reportSheetExpandAll: { canUndo: boolean, execute(context: GC.Spread.Sheets.Workbook, options: {sheetName: string, selections: GC.Spread.Sheets.Range[]}, isUndo: boolean): boolean}; /** * Represents the command used to regenerate reportSheet. * @property {boolean} canUndo - indicates whether the command supports undo and redo operations. * @property {function} execute - performs an execute or undo operation. * The arguments of the execute method are as follows. * @property {GC.Spread.Sheets.Workbook} context The context of the operation. * @property {Object} options The options of the operation. * @property {string} options.sheetName The sheet name. * @property {boolean} isUndo `true` if this is an undo operation; otherwise, `false`. * @example * ```javascript * // regenerate reportSheet with invoking command. * spread.commandManager().execute({cmd: "reportSheetRegenerateReport", sheetName: "Report1"}); * ``` */ var reportSheetRegenerateReport: { canUndo: boolean, execute(context: GC.Spread.Sheets.Workbook, options: {sheetName: string}, isUndo: boolean): boolean}; /** * Represents the command used to reset all selected cells value in reportSheet. * @property {boolean} canUndo - indicates whether the command supports undo and redo operations. * @property {function} execute - performs an execute or undo operation. * The arguments of the execute method are as follows. * @property {GC.Spread.Sheets.Workbook} context The context of the operation. * @property {Object} options The options of the operation. * @property {string} options.sheetName The sheet name. * @property {GC.Spread.Sheets.Range[]} options.selections The reset value selections. * @property {boolean} isUndo `true` if this is an undo operation; otherwise, `false`. * @example * ```javascript * // reset all selected cells value while in DataEntry mode with invoking command. * spread.commandManager().execute({cmd: "reportSheetResetCellValue", sheetName: "Report1", selections: [new GC.Spread.Sheets.Range(1, 1, 1, 1)]}); * ``` */ var reportSheetResetCellValue: { canUndo: boolean, execute(context: GC.Spread.Sheets.Workbook, options: {sheetName: string, selections: GC.Spread.Sheets.Range[]}, isUndo: boolean): boolean}; /** * Represents the command used to submit the data entry changes in reportSheet. * @property {boolean} canUndo - indicates whether the command supports undo and redo operations. * @property {function} execute - performs an execute or undo operation. * The arguments of the execute method are as follows. * @property {GC.Spread.Sheets.Workbook} context The context of the operation. * @property {Object} options The options of the operation. * @property {string} options.sheetName The sheet name. * @property {boolean} isUndo `true` if this is an undo operation; otherwise, `false`. * @example * ```javascript * // submit the data entry changes with invoking command. * spread.commandManager().execute({cmd: "reportSheetSubmit", sheetName: "Report1"}); * ``` */ var reportSheetSubmit: { canUndo: boolean, execute(context: GC.Spread.Sheets.Workbook, options: {sheetName: string}, isUndo: boolean): boolean}; /** * Represents the command used to resize the column on a worksheet. * @property {boolean} canUndo - indicates whether the command supports undo and redo operations. * @property {function} execute - performs an execute or undo operation. * The arguments of the execute method are as follows. * @property {GC.Spread.Sheets.Workbook} context The context of the operation. * @property {Object} options The options of the operation. * @property {string} options.sheetName The sheet name. * @property {Array} options.columns The resize columns; each item is an object which has firstCol and lastCol. * @property {number} options.size The size of the column that is being resized. * @property {boolean} options.rowHeader Whether the column being resized is in the row header area. * @property {boolean} isUndo `true` if this is an undo operation; otherwise, `false`. * @example * ```javascript * // resize the col with invoking command * spread.commandManager().execute({cmd: "resizeColumn", sheetName: "Sheet1", columns: [{firstCol: 1, lastCol: 5}], size: 200, rowHeader: false}); * ``` */ var resizeColumn: { canUndo: boolean, execute(context: GC.Spread.Sheets.Workbook, options: {sheetName: string, columns: Object[], size: number, rowHeader: boolean}, isUndo: boolean): any}; /** * Represents the command for resizing floating objects. * @property {boolean} canUndo - indicates whether the command supports undo and redo operations. * @property {function} execute - performs an execute or undo operation. * The arguments of the execute method are as follows. * @property {GC.Spread.Sheets.Workbook} context The context of the operation. * @property {Object} options The options of the operation. * @property {string} options.sheetName The sheet name. * @property {Array} options.floatingObjects The names array of floating objects. * @property {number} options.offsetX The offset left. * @property {number} options.offsetY The offset top. * @property {number} options.offsetWidth The offset width. * @property {number} options.offsetHeight The offset height. * @property {boolean} isUndo `true` if this is an undo operation; otherwise, `false`. * @example * ```javascript * // resize floating objects with invoking command * spread.commandManager().execute({cmd: "resizeFloatingObjects", sheetName: "Sheet1", floatingObjects: ["floatingObject1", "floatingObject2"], offsetWidth: 100, offsetHeight: 100}); * ``` */ var resizeFloatingObjects: { canUndo: boolean, execute(context: GC.Spread.Sheets.Workbook, options: {sheetName: string, floatingObjects: string[], offsetX: number, offsetY: number, offsetWidth: number, offsetHeight: number}, isUndo: boolean): boolean}; /** * Represents the command used to resize the row on a worksheet. * @property {boolean} canUndo - indicates whether the command supports undo and redo operations. * @property {function} execute - performs an execute or undo operation. * The arguments of the execute method are as follows. * @property {GC.Spread.Sheets.Workbook} context The context of the operation. * @property {Object} options The options of the operation. * @property {string} options.sheetName The sheet name. * @property {Array} options.rows The resize rows; each item is an object which has firstRow and lastRow. * @property {number} options.size The size of the row that is being resized. * @property {boolean} options.columnHeader Whether the row being resized is in the column header area. * @property {boolean} isUndo `true` if this is an undo operation; otherwise, `false`. * @example * ```javascript * // resize the row with invoking command * spread.commandManager().execute({cmd: "resizeRow", sheetName: "Sheet1", rows: [{firstRow: 1, lastRow: 5}], size: 100, rowHeader: false}); * ``` */ var resizeRow: { canUndo: boolean, execute(context: GC.Spread.Sheets.Workbook, options: {sheetName: string, rows: Object[], size: number, columnHeader: boolean}, isUndo: boolean): any}; /** * Represents the command used to extend the selection to the last row. * @property {boolean} canUndo - indicates whether the command supports undo and redo operations. * @property {function} execute - performs an execute or undo operation. * The arguments of the execute method are as follows. * @property {GC.Spread.Sheets.Workbook} context The context of the operation. * @property {Object} options The options of the operation. * @property {string} options.sheetName The sheet name. * @property {boolean} isUndo `true` if this is an undo operation; otherwise, `false`. * @example * ```javascript * //This example uses the selectionBottom action. * spread.commandManager().setShortcutKey('selectionBottom', GC.Spread.Commands.Key.a, false, false, false, false); * ``` */ var selectionBottom: { canUndo: boolean, execute(context: GC.Spread.Sheets.Workbook, options: {sheetName: string}): any}; /** * Represents the command used to extend the selection down one row. * @property {boolean} canUndo - indicates whether the command supports undo and redo operations. * @property {function} execute - performs an execute or undo operation. * The arguments of the execute method are as follows. * @property {GC.Spread.Sheets.Workbook} context The context of the operation. * @property {Object} options The options of the operation. * @property {string} options.sheetName The sheet name. * @property {boolean} isUndo `true` if this is an undo operation; otherwise, `false`. * @example * ```javascript * //This example uses the selectionDown action. * spread.commandManager().setShortcutKey('selectionDown', GC.Spread.Commands.Key.a, false, false, false, false); * ``` */ var selectionDown: { canUndo: boolean, execute(context: GC.Spread.Sheets.Workbook, options: {sheetName: string}): any}; /** * Represents the command used to extend the selection to the last column. * @property {boolean} canUndo - indicates whether the command supports undo and redo operations. * @property {function} execute - performs an execute or undo operation. * The arguments of the execute method are as follows. * @property {GC.Spread.Sheets.Workbook} context The context of the operation. * @property {Object} options The options of the operation. * @property {string} options.sheetName The sheet name. * @property {boolean} isUndo `true` if this is an undo operation; otherwise, `false`. * @example * ```javascript * //This example uses the selectionEnd action. * spread.focus(); * spread.commandManager().setShortcutKey('selectionEnd', GC.Spread.Commands.Key.a, false, false, false, false); * ``` */ var selectionEnd: { canUndo: boolean, execute(context: GC.Spread.Sheets.Workbook, options: {sheetName: string}): any}; /** * Represents the command used to extend the selection to the first cell. * @property {boolean} canUndo - indicates whether the command supports undo and redo operations. * @property {function} execute - performs an execute or undo operation. * The arguments of the execute method are as follows. * @property {GC.Spread.Sheets.Workbook} context The context of the operation. * @property {Object} options The options of the operation. * @property {string} options.sheetName The sheet name. * @property {boolean} isUndo `true` if this is an undo operation; otherwise, `false`. * @example * ```javascript * //This example uses the selectionFirst action. * spread.focus(); * spread.commandManager().setShortcutKey('selectionFirst', GC.Spread.Commands.Key.a, false, false, false, false); * ``` */ var selectionFirst: { canUndo: boolean, execute(context: GC.Spread.Sheets.Workbook, options: {sheetName: string}): any}; /** * Represents the command used to extend the selection to the first column. * @property {boolean} canUndo - indicates whether the command supports undo and redo operations. * @property {function} execute - performs an execute or undo operation. * The arguments of the execute method are as follows. * @property {GC.Spread.Sheets.Workbook} context The context of the operation. * @property {Object} options The options of the operation. * @property {string} options.sheetName The sheet name. * @property {boolean} isUndo `true` if this is an undo operation; otherwise, `false`. * @example * ```javascript * //This example uses the selectionHome action. * spread.focus(); * spread.commandManager().setShortcutKey('selectionHome', GC.Spread.Commands.Key.a, false, false, false, false); * ``` */ var selectionHome: { canUndo: boolean, execute(context: GC.Spread.Sheets.Workbook, options: {sheetName: string}): any}; /** * Represents the command used to extend the selection to the last cell. * @property {boolean} canUndo - indicates whether the command supports undo and redo operations. * @property {function} execute - performs an execute or undo operation. * The arguments of the execute method are as follows. * @property {GC.Spread.Sheets.Workbook} context The context of the operation. * @property {Object} options The options of the operation. * @property {string} options.sheetName The sheet name. * @property {boolean} isUndo `true` if this is an undo operation; otherwise, `false`. * @example * ```javascript * //This example uses the selectionLast action. * spread.focus(); * spread.commandManager().setShortcutKey('selectionLast', GC.Spread.Commands.Key.a, false, false, false, false); * ``` */ var selectionLast: { canUndo: boolean, execute(context: GC.Spread.Sheets.Workbook, options: {sheetName: string}): any}; /** * Represents the command used to extend the selection one column to the left. * @property {boolean} canUndo - indicates whether the command supports undo and redo operations. * @property {function} execute - performs an execute or undo operation. * The arguments of the execute method are as follows. * @property {GC.Spread.Sheets.Workbook} context The context of the operation. * @property {Object} options The options of the operation. * @property {string} options.sheetName The sheet name. * @property {boolean} isUndo `true` if this is an undo operation; otherwise, `false`. * @example * ```javascript * //This example uses the selectionLeft action. * spread.commandManager().setShortcutKey('selectionLeft', GC.Spread.Commands.Key.a, false, false, false, false); * ``` */ var selectionLeft: { canUndo: boolean, execute(context: GC.Spread.Sheets.Workbook, options: {sheetName: string}, isUndo: boolean): any}; /** * Represents the command used to extend the selection down to include one page of rows. * @property {boolean} canUndo - indicates whether the command supports undo and redo operations. * @property {function} execute - performs an execute or undo operation. * The arguments of the execute method are as follows. * @property {GC.Spread.Sheets.Workbook} context The context of the operation. * @property {Object} options The options of the operation. * @property {string} options.sheetName The sheet name. * @property {boolean} isUndo `true` if this is an undo operation; otherwise, `false`. * @example * ```javascript * //This example uses the selectionPageDown action. * spread.commandManager().setShortcutKey('selectionPageDown', GC.Spread.Commands.Key.a, false, false, false, false); * ``` */ var selectionPageDown: { canUndo: boolean, execute(context: GC.Spread.Sheets.Workbook, options: {sheetName: string}): any}; /** * Represents the command used to extend the selection up to include one page of rows. * @property {boolean} canUndo - indicates whether the command supports undo and redo operations. * @property {function} execute - performs an execute or undo operation. * The arguments of the execute method are as follows. * @property {GC.Spread.Sheets.Workbook} context The context of the operation. * @property {Object} options The options of the operation. * @property {string} options.sheetName The sheet name. * @property {boolean} isUndo `true` if this is an undo operation; otherwise, `false`. * @example * ```javascript * //This example uses the selectionPageUp action. * spread.commandManager().setShortcutKey('selectionPageUp', GC.Spread.Commands.Key.a, false, false, false, false); * ``` */ var selectionPageUp: { canUndo: boolean, execute(context: GC.Spread.Sheets.Workbook, options: {sheetName: string}): any}; /** * Represents the command used to extend the selection one column to the right. * @property {boolean} canUndo - indicates whether the command supports undo and redo operations. * @property {function} execute - performs an execute or undo operation. * The arguments of the execute method are as follows. * @property {GC.Spread.Sheets.Workbook} context The context of the operation. * @property {Object} options The options of the operation. * @property {string} options.sheetName The sheet name. * @property {boolean} isUndo `true` if this is an undo operation; otherwise, `false`. * @example * ```javascript * //This example uses the selectionRight action. * spread.commandManager().setShortcutKey("selectionRight", GC.Spread.Commands.Key.a, false, false, false, false); * ``` */ var selectionRight: { canUndo: boolean, execute(context: GC.Spread.Sheets.Workbook, options: {sheetName: string}): any}; /** * Represents the command used to extend the selection to the first row. * @property {boolean} canUndo - indicates whether the command supports undo and redo operations. * @property {function} execute - performs an execute or undo operation. * The arguments of the execute method are as follows. * @property {GC.Spread.Sheets.Workbook} context The context of the operation. * @property {Object} options The options of the operation. * @property {string} options.sheetName The sheet name. * @property {boolean} isUndo `true` if this is an undo operation; otherwise, `false`. * @example * ```javascript * //This example uses the selectionTop action. * spread.commandManager().setShortcutKey("selectionTop", GC.Spread.Commands.Key.a, false, false, false, false); * ``` */ var selectionTop: { canUndo: boolean, execute(context: GC.Spread.Sheets.Workbook, options: {sheetName: string}): any}; /** * Represents the command used to extend the selection up one row. * @property {boolean} canUndo - indicates whether the command supports undo and redo operations. * @property {function} execute - performs an execute or undo operation. * The arguments of the execute method are as follows. * @property {GC.Spread.Sheets.Workbook} context The context of the operation. * @property {Object} options The options of the operation. * @property {string} options.sheetName The sheet name. * @property {boolean} isUndo `true` if this is an undo operation; otherwise, `false`. * @example * ```javascript * //This example uses the selectionUp action. * spread.commandManager().setShortcutKey("selectionUp", GC.Spread.Commands.Key.a, false, false, false, false); * ``` */ var selectionUp: { canUndo: boolean, execute(context: GC.Spread.Sheets.Workbook, options: {sheetName: string}): any}; /** * Represents the command used to select the next control. * @property {boolean} canUndo - indicates whether the command supports undo and redo operations. * @property {function} execute - performs an execute or undo operation. * The arguments of the execute method are as follows. * @property {GC.Spread.Sheets.Workbook} context The context of the operation. * @property {Object} options The options of the operation. * @property {string} options.sheetName The sheet name. * @property {boolean} isUndo `true` if this is an undo operation; otherwise, `false`. * @example * ```javascript * //This example maps the selectNextControl action to the Tab key. * spread.commandManager().setShortcutKey('selectNextControl', GC.Spread.Commands.Key.tab, false, false, false, false); // Tab key * spread.commandManager().setShortcutKey('selectPreviousControl', GC.Spread.Commands.Key.tab, false, true, false, false); // Shift key and Tab key * ``` */ var selectNextControl: { canUndo: boolean, execute(context: GC.Spread.Sheets.Workbook, options: {sheetName: string}): any}; /** * Represents the command used to select the previous control. * @property {boolean} canUndo - indicates whether the command supports undo and redo operations. * @property {function} execute - performs an execute or undo operation. * The arguments of the execute method are as follows. * @property {GC.Spread.Sheets.Workbook} context The context of the operation. * @property {Object} options The options of the operation. * @property {string} options.sheetName The sheet name. * @property {boolean} isUndo `true` if this is an undo operation; otherwise, `false`. * @example * ```javascript * //This example maps the selectPreviousControl action to the Shift + Tab key combination. * spread.commandManager().setShortcutKey('selectNextControl', GC.Spread.Commands.Key.tab, false, false, false, false); // Tab key * spread.commandManager().setShortcutKey('selectPreviousControl', GC.Spread.Commands.Key.tab, false, true, false, false); // Shift key and Tab key * ``` */ var selectPreviousControl: { canUndo: boolean, execute(context: GC.Spread.Sheets.Workbook, options: {sheetName: string}): any}; /** * Represents the command used to split resize the column on a worksheet. * @property {boolean} canUndo - indicates whether the command supports undo and redo operations. * @property {function} execute - performs an execute or undo operation. * The arguments of the execute method are as follows. * @property {GC.Spread.Sheets.Workbook} context The context of the operation. * @property {Object} options The options of the operation. * @property {string} options.sheetName The sheet name. * @property {Array} options.columns The resize columns; each item is an object which has firstCol and lastCol. * @property {number} options.size The size of the column that is being resized. * @property {boolean} options.rowHeader Whether the column being resized is in the row header area. * @property {boolean} isUndo `true` if this is an undo operation; otherwise, `false`. * @example * ```javascript * // split resize the column with invoking command * spread.commandManager().execute({cmd: "splitResizeColumn", sheetName: "Sheet1", columns: [{firstCol: 1, lastCol: 2}]}, size: 100, rowHeader: false); * ``` */ var splitResizeColumn: { canUndo: boolean, execute(context: GC.Spread.Sheets.Workbook, options: { sheetName: string, columns: Object[], size: number, rowHeader: boolean }, isUndo: boolean): any}; /** * Represents the command used to split resize the row on a worksheet. * @property {boolean} canUndo - indicates whether the command supports undo and redo operations. * @property {function} execute - performs an execute or undo operation. * The arguments of the execute method are as follows. * @property {GC.Spread.Sheets.Workbook} context The context of the operation. * @property {Object} options The options of the operation. * @property {string} options.sheetName The sheet name. * @property {Array} options.rows The resize rows; each item is an object which has firstRow and lastRow. * @property {number} options.size The size of the row that is being resized. * @property {boolean} options.columnHeader Whether the row being resized is in the column header area. * @property {boolean} isUndo `true` if this is an undo operation; otherwise, `false`. * @example * ```javascript * // split resize the row with invoking command * spread.commandManager().execute({cmd: "splitResizeRow", sheetName: "Sheet1", rows: [{firstRow: 1, lastRow: 2}]}, size: 100, columnHeader: false); * ``` */ var splitResizeRow: { canUndo: boolean, execute(context: GC.Spread.Sheets.Workbook, options: { sheetName: string, rows: Object[], size: number, columnHeader: boolean }, isUndo: boolean): any}; /** * Represents the command used to start editing the active cell with the edit mode. * @property {boolean} canUndo - indicates whether the command supports undo and redo operations. * @property {function} execute - performs an execute or undo operation. * The arguments of the execute method are as follows. * @property {GC.Spread.Sheets.Workbook} context The context of the operation. * @property {Object} options The options of the operation. * @property {string} options.sheetName The sheet name. * @property {boolean} isUndo `true` if this is an undo operation; otherwise, `false`. * @example * ```javascript * // start editing a cell with invoking command * spread.commandManager().execute({cmd: "startEdit", sheetName: "Sheet1"}); * ``` */ var startEdit: { canUndo: boolean, execute(context: GC.Spread.Sheets.Workbook, options: {sheetName: string}): any}; /** * Represents the command used to delete columns for table. * @property {boolean} canUndo - indicates whether the command supports undo and redo operations. * @property {function} execute - performs an execute or undo operation. * The arguments of the execute method are as follows. * @property {GC.Spread.Sheets.Workbook} context The context of the operation. * @property {Object} options The options of the operation. * @property {string} options.sheetName The sheet name. * @property {string} options.tableName The table name. * @property {number} options.col The index of the starting column to delete, the col index is based on table index. * @property {number} options.count The number of columns to delete. * @property {boolean} isUndo `true` if this is an undo operation; otherwise, `false`. * @example * ```javascript * // delete columns for table with invoking command * spread.commandManager().execute({cmd: "tableDeleteColumns", sheetName: "Sheet1", tableName: "table1", col: 1, count: 3}); * ``` */ var tableDeleteColumns: { canUndo: boolean, execute(context: GC.Spread.Sheets.Workbook, options: {sheetName: string, tableName: string, col: number, count: number}, isUndo: boolean): boolean}; /** * Represents the command used to delete rows for table. * @property {boolean} canUndo - indicates whether the command supports undo and redo operations. * @property {function} execute - performs an execute or undo operation. * The arguments of the execute method are as follows. * @property {GC.Spread.Sheets.Workbook} context The context of the operation. * @property {Object} options The options of the operation. * @property {string} options.sheetName The sheet name. * @property {string} options.tableName The table name. * @property {number} options.row The index of the starting row to delete, the row index is based on table index. * @property {number} options.count The number of rows to delete. * @property {boolean} isUndo `true` if this is an undo operation; otherwise, `false`. * @example * ```javascript * // delete rows for table with invoking command * spread.commandManager().execute({cmd: "tableDeleteRows", sheetName: "Sheet1", tableName: "table1", row: 1, count: 3}); * ``` */ var tableDeleteRows: { canUndo: boolean, execute(context: GC.Spread.Sheets.Workbook, options: {sheetName: string, tableName: string, row: number, count: number}, isUndo: boolean): boolean}; /** * Represents the command used to insert columns for table. * @property {boolean} canUndo - indicates whether the command supports undo and redo operations. * @property {function} execute - performs an execute or undo operation. * The arguments of the execute method are as follows. * @property {GC.Spread.Sheets.Workbook} context The context of the operation. * @property {Object} options The options of the operation. * @property {string} options.sheetName The sheet name. * @property {string} options.tableName The table name. * @property {number} options.col The index of the starting column to insert, the col index is based on table index. * @property {number} options.count The number of columns to insert. * @property {boolean} isUndo `true` if this is an undo operation; otherwise, `false`. * @example * ```javascript * // insert columns for table with invoking command * spread.commandManager().execute({cmd: "tableInsertColumns", sheetName: "Sheet1", tableName: "table1", col: 1, count: 3}); * ``` */ var tableInsertColumns: { canUndo: boolean, execute(context: GC.Spread.Sheets.Workbook, options: {sheetName: string, tableName: string, col: number, count: number}, isUndo: boolean): boolean}; /** * Represents the command used to insert rows for table. * @property {boolean} canUndo - indicates whether the command supports undo and redo operations. * @property {function} execute - performs an execute or undo operation. * The arguments of the execute method are as follows. * @property {GC.Spread.Sheets.Workbook} context The context of the operation. * @property {Object} options The options of the operation. * @property {string} options.sheetName The sheet name. * @property {string} options.tableName The table name. * @property {number} options.row The index of the starting row to insert, the row index is based on table index. * @property {number} options.count The number of rows to insert. * @property {boolean} isUndo `true` if this is an undo operation; otherwise, `false`. * @example * ```javascript * // insert rows for table with invoking command * spread.commandManager().execute({cmd: "tableInsertRows", sheetName: "Sheet1", tableName: "table1", row: 1, count: 3}); * ``` */ var tableInsertRows: { canUndo: boolean, execute(context: GC.Spread.Sheets.Workbook, options: {sheetName: string, tableName: string, row: number, count: number}, isUndo: boolean): boolean}; /** * Represents the command used to resize table. * @property {boolean} canUndo - indicates whether the command supports undo and redo operations. * @property {function} execute - performs an execute or undo operation. * The arguments of the execute method are as follows. * @property {GC.Spread.Sheets.Workbook} context The context of the operation. * @property {Object} options The options of the operation. * @property {string} options.sheetName The sheet name. * @property {string} options.tableName The table name. * @property {GC.Spread.Sheets.Range} options.resizeToRange The resized table range. * @property {boolean} isUndo `true` if this is an undo operation; otherwise, `false`. * @example * ```javascript * // resize table with invoking command * spread.commandManager().execute({cmd: "tableResize", sheetName: "Sheet1", tableName: "table1", resizeToRange: new GC.Spread.Sheets.Range(1, 1, 5, 3)}); * ``` */ var tableResize: { canUndo: boolean, execute(context: GC.Spread.Sheets.Workbook, options: {sheetName: string, tableName: string, resizeToRange: GC.Spread.Sheets.Range}, isUndo: boolean): boolean}; /** * Represents the command used to submit changes of the tables which bind data manager tables. * @property {boolean} canUndo - indicates whether the command supports undo and redo operations. * @property {function} execute - performs an execute or undo operation. * The arguments of the execute method are as follows. * @property {GC.Spread.Sheets.Workbook} context The context of the operation. * @property {Object} options The options of the operation. * @property {string} [options.sheetName] The sheet name, from active sheet by default. * @property {string[]} [options.tableNames] The table names, from active table by default. * @property {boolean} isUndo `true` if this is an undo operation; otherwise, `false`. * @example * ```javascript * // submit changes of the tables which bind the data manager tables with invoking command * spread.commandManager().execute({cmd: "tableSubmitChanges", sheetName: "Sheet1", tableNames: ["table1"]}); * ``` */ var tableSubmitChanges: { canUndo: boolean, execute(context: GC.Spread.Sheets.Workbook, options: {sheetName?: string, tableNames?: string[] }, isUndo: boolean): boolean}; /** * Represents the command used to perform an undo of the most recent edit or action. * @property {boolean} canUndo - indicates whether the command supports undo and redo operations. * @property {function} execute - performs an execute or undo operation. * The arguments of the execute method are as follows. * @property {GC.Spread.Sheets.Workbook} context The context of the operation. * @property {Object} options The options of the operation. * @property {string} options.sheetName The sheet name. * @property {boolean} isUndo `true` if this is an undo operation; otherwise, `false`. * @example * ```javascript * //This example uses the undo command. * spread.commandManager().execute({cmd: "undo", sheetName: "Sheet1"}); * ``` */ var undo: { canUndo: boolean, execute(context: GC.Spread.Sheets.Workbook, options: {sheetName: string}): any}; /** * Represents the command used to zoom the sheet. * @property {boolean} canUndo - indicates whether the command supports undo and redo operations. * @property {function} execute - performs an execute or undo operation. * The arguments of the execute method are as follows. * @property {GC.Spread.Sheets.Workbook} context The context of the operation. * @property {Object} options The options of the operation. * @property {string} options.sheetName The sheet name. * @property {number} options.zoomFactor The zoom factor. * @property {boolean} isUndo `true` if this is an undo operation; otherwise, `false`. * @example * ```javascript * // zoom the sheet with invoking command * spread.commandManager().execute({cmd: "zoom", sheetName: "Sheet1", zoomFactor: 3}); * ``` */ var zoom: { canUndo: boolean, execute(context: GC.Spread.Sheets.Workbook, options: {sheetName: string, zoomFactor: number}, isUndo: boolean): any}; /** * Ends a transaction. During the transaction, the changes of the data model will be saved. * @property {GC.Spread.Sheets.Workbook} context The context of the operation. * @property {Object} options The options of the operation. * @property {string|string[]} [options.sheetName] The sheet name. If the current transaction need change multiple worksheets, the sheetName could be a string Array. * @example * ```javascript * //For example, the following code registers the changeBackColor command and then executes the command. * var command = { * canUndo: true, * execute: function (context, options, isUndo) { * var Commands = GC.Spread.Sheets.Commands; * options.cmd = "changeBackColor"; * if (isUndo) { * Commands.undoTransaction(context, options); * return true; * } else { * Commands.startTransaction(context, options); * var sheet = context.getSheetFromName(options.sheetName); * var cell = sheet.getCell(options.row, options.col); * cell.backColor(options.backColor); * Commands.endTransaction(context, options); * return true; * } * } * }; * var spread = GC.Spread.Sheets.findControl(document.getElementById("ss")); * var commandManager = spread.commandManager(); * commandManager.register("changeBackColor", command); * commandManager.execute({cmd: "changeBackColor", sheetName: spread.getSheet(0).name(), row: 1, col: 2, backColor: "red"}); * ``` */ function endTransaction(context: GC.Spread.Sheets.Workbook, options: any): void; /** * Starts a transaction. During the transaction, the changes of the data model will be saved. * @property {GC.Spread.Sheets.Workbook} context The context of the operation. * @property {Object} options The options of the operation. * @property {string|string[]} [options.sheetName] The sheet name. If the current transaction need change multiple worksheets, the sheetName could be a string Array. * @example * ```javascript * //For example, the following code registers the changeBackColor command and then executes the command. * var command = { * canUndo: true, * execute: function (context, options, isUndo) { * var Commands = GC.Spread.Sheets.Commands; * options.cmd = "changeBackColor"; * if (isUndo) { * Commands.undoTransaction(context, options); * return true; * } else { * Commands.startTransaction(context, options); * var sheet = context.getSheetFromName(options.sheetName); * var cell = sheet.getCell(options.row, options.col); * cell.backColor(options.backColor); * Commands.endTransaction(context, options); * return true; * } * } * }; * var spread = GC.Spread.Sheets.findControl(document.getElementById("ss")); * var commandManager = spread.commandManager(); * commandManager.register("changeBackColor", command); * commandManager.execute({cmd: "changeBackColor", sheetName: spread.getSheet(0).name(), row: 1, col: 2, backColor: "red"}); * ``` */ function startTransaction(context: GC.Spread.Sheets.Workbook, options: any): void; /** * Undo the changes made in a transaction. * @property {GC.Spread.Sheets.Workbook} context The context of the operation. * @property {Object} options The options of the operation. * @property {string|string[]} [options.sheetName] The sheet name. If the current transaction need change multiple worksheets, the sheetName could be a string Array. * @example * ```javascript * //For example, the following code registers the changeBackColor command and then executes the command. * var command = { * canUndo: true, * execute: function (context, options, isUndo) { * var Commands = GC.Spread.Sheets.Commands; * options.cmd = "changeBackColor"; * if (isUndo) { * Commands.undoTransaction(context, options); * return true; * } else { * Commands.startTransaction(context, options); * var sheet = context.getSheetFromName(options.sheetName); * var cell = sheet.getCell(options.row, options.col); * cell.backColor(options.backColor); * Commands.endTransaction(context, options); * return true; * } * } * }; * var spread = GC.Spread.Sheets.findControl(document.getElementById("ss")); * var commandManager = spread.commandManager(); * commandManager.register("changeBackColor", command); * commandManager.execute({cmd: "changeBackColor", sheetName: spread.getSheet(0).name(), row: 1, col: 2, backColor: "red"}); * ``` */ function undoTransaction(context: GC.Spread.Sheets.Workbook, options: any): void; } module Comments{ /** * Defines the comment state. * @enum {number} * @example * ```javascript * //This example gets the comment state. * var comment = new GC.Spread.Sheets.Comments.Comment(); * comment.text("new comment!"); * comment.backColor("yellow"); * comment.foreColor("green"); * comment.displayMode(GC.Spread.Sheets.Comments.DisplayMode.alwaysShown); * activeSheet.getCell(5,5).comment(comment); * alert(comment.commentState()); * ``` */ export enum CommentState{ /** * Specifies that the comment is in an active state. * In the active state, the comment is currently being selected. * User can move the comment's position or resize the comment. */ active= 1, /** * Specifies that the comment is in an editing state. * The edit state of an comment signifies that the comment is actively being modified or updated. * This state occurs when a user is making changes to the content of the comment. */ edit= 2, /** * Specifies that the comment is in a normal state. * In the normal state, the comment is currently not being selected. * User cannot interact with a comment in normal state. * Clicking on the comment will change the state into active or edit. */ normal= 3 } /** * Defines when the comment is displayed. * @enum {number} * @example * ```javascript * //This example uses the DisplayMode enumeration. * var comment = new GC.Spread.Sheets.Comments.Comment(); * comment.text("new comment!"); * comment.backColor("yellow"); * comment.foreColor("green"); * comment.displayMode(GC.Spread.Sheets.Comments.DisplayMode.alwaysShown); * activeSheet.getCell(5,5).comment(comment); * ``` */ export enum DisplayMode{ /** * Specifies that the comment is always displayed. */ alwaysShown= 1, /** * Specifies that the comment is displayed only when the pointer hovers over the comment's owner cell. */ hoverShown= 2 } export class Comment{ /** * Represents a comment. * @class * @param {string} [text] The text of the comment. * @example * ```javascript * var comment = new GC.Spread.Sheets.Comments.Comment(); * comment.text("new comment!"); * comment.backColor("yellow"); * comment.foreColor("green"); * comment.displayMode(GC.Spread.Sheets.Comments.DisplayMode.alwaysShown); * comment.autoSize(true); * activeSheet.getCell(5,5).comment(comment); * ``` */ constructor(text?: string); /** * Gets or sets whether the comment automatically sizes based on its content. * @param {boolean} value Whether the comment automatically sizes. * @returns {boolean | GC.Spread.Sheets.Comments.Comment} If no value is set, returns whether the comment automatically sizes; otherwise, returns the comment. * @example * ```javascript * //This example uses the autoSize method. * var comment = new GC.Spread.Sheets.Comments.Comment(); * comment.text("new comment!"); * comment.backColor("yellow"); * comment.foreColor("green"); * comment.displayMode(GC.Spread.Sheets.Comments.DisplayMode.alwaysShown); * comment.autoSize(true); * activeSheet.getCell(5,5).comment(comment); * ``` */ autoSize(value?: boolean): any; /** * Gets or sets the background color of the comment. * @param {string} value The background color of the comment. * @returns {string | GC.Spread.Sheets.Comments.Comment} If no value is set, returns the background color of the comment; otherwise, returns the comment. * @example * ```javascript * //This example sets the backColor method. * var comment = new GC.Spread.Sheets.Comments.Comment(); * comment.text("new comment!"); * comment.backColor("yellow"); * comment.foreColor("green"); * comment.displayMode(GC.Spread.Sheets.Comments.DisplayMode.alwaysShown); * activeSheet.getCell(5,5).comment(comment); * ``` */ backColor(value?: string): any; /** * Gets or sets the border color for the comment. * @param {string} value The border color for the comment. * @returns {string | GC.Spread.Sheets.Comments.Comment} If no value is set, returns the border color for the comment; otherwise, returns the comment. * @example * ```javascript * //This example sets the borderColor method. * var comment = new GC.Spread.Sheets.Comments.Comment(); * comment.text("new comment!"); * comment.backColor("yellow"); * comment.foreColor("green"); * comment.displayMode(GC.Spread.Sheets.Comments.DisplayMode.alwaysShown); * comment.borderWidth(2); * comment.borderStyle("dotted"); * comment.borderColor("red"); * activeSheet.getCell(5,5).comment(comment); * activeSheet.suspendPaint(); * activeSheet.resumePaint(); * ``` */ borderColor(value?: string): any; /** * Gets or sets the border style for the comment. * @param {string} value The border style for the comment. * @returns {string | GC.Spread.Sheets.Comments.Comment} If no value is set, returns the border style for the comment; otherwise, returns the comment. * @example * ```javascript * //This example sets the borderStyle method. * var comment = new GC.Spread.Sheets.Comments.Comment(); * comment.text("new comment!"); * comment.backColor("yellow"); * comment.foreColor("green"); * comment.displayMode(GC.Spread.Sheets.Comments.DisplayMode.alwaysShown); * comment.borderWidth(2); * comment.borderStyle("dotted"); * comment.borderColor("red"); * activeSheet.getCell(5,5).comment(comment); * activeSheet.suspendPaint(); * activeSheet.resumePaint(); * ``` */ borderStyle(value?: string): any; /** * Gets or sets the border width for the comment. * @param {number} value The border width for the comment. * @returns {number | GC.Spread.Sheets.Comments.Comment} If no value is set, returns the border width for the comment; otherwise, returns the comment. * @example * ```javascript * //This example sets the borderWidth method. * var comment = new GC.Spread.Sheets.Comments.Comment(); * comment.text("new comment!"); * comment.backColor("yellow"); * comment.foreColor("green"); * comment.displayMode(GC.Spread.Sheets.Comments.DisplayMode.alwaysShown); * comment.borderWidth(2); * comment.borderStyle("dotted"); * comment.borderColor("red"); * activeSheet.getCell(5,5).comment(comment); * activeSheet.suspendPaint(); * activeSheet.resumePaint(); * ``` */ borderWidth(value?: number): any; /** * Gets or sets the state of the comment. * @param {GC.Spread.Sheets.Comments.CommentState} value The state of the comment. * @returns {GC.Spread.Sheets.Comments.CommentState | GC.Spread.Sheets.Comments.Comment} If no value is set, returns the state of the comment; otherwise, returns the comment. * @example * ```javascript * //This example gets the comment state. * var comment = new GC.Spread.Sheets.Comments.Comment(); * comment.text("new comment!"); * comment.backColor("yellow"); * comment.foreColor("green"); * comment.displayMode(GC.Spread.Sheets.Comments.DisplayMode.alwaysShown); * activeSheet.getCell(5,5).comment(comment); * alert(comment.commentState()); * ``` */ commentState(value?: GC.Spread.Sheets.Comments.CommentState): any; /** * Gets or sets the display mode for the comment. * @param {GC.Spread.Sheets.Comments.DisplayMode} value The display mode for the comment. * @returns {GC.Spread.Sheets.Comments.DisplayMode | GC.Spread.Sheets.Comments.Comment} If no value is set, returns the display mode for the comment; otherwise, returns the comment. * @example * ```javascript * //This example sets the displayMode method. * var comment = new GC.Spread.Sheets.Comments.Comment(); * comment.text("new comment!"); * comment.backColor("yellow"); * comment.foreColor("green"); * comment.displayMode(GC.Spread.Sheets.Comments.DisplayMode.alwaysShown); * activeSheet.getCell(5,5).comment(comment); * ``` */ displayMode(value?: GC.Spread.Sheets.Comments.DisplayMode): any; /** * Gets or sets whether the comment dynamically moves. * @param {boolean} value Whether the comment dynamically moves. * @returns {boolean | GC.Spread.Sheets.Comments.Comment} If no value is set, returns whether the comment dynamically moves; otherwise, returns the comment. * @example * ```javascript * //This example uses the dynamicMove method. * var comment = new GC.Spread.Sheets.Comments.Comment(); * comment.text("new comment!"); * comment.backColor("yellow"); * comment.foreColor("green"); * comment.displayMode(GC.Spread.Sheets.Comments.DisplayMode.alwaysShown); * comment.dynamicMove(true); * comment.dynamicSize(true); * activeSheet.getCell(5,5).comment(comment); * ``` */ dynamicMove(value?: boolean): any; /** * Gets or sets whether the comment is dynamically sized. * @param {boolean} value Whether the comment is dynamically sized. * @returns {boolean | GC.Spread.Sheets.Comments.Comment} If no value is set, returns whether the comment is dynamically sized; otherwise, returns the comment. * @example * ```javascript * //This example uses the dynamicSize method. * var comment = new GC.Spread.Sheets.Comments.Comment(); * comment.text("new comment!"); * comment.backColor("yellow"); * comment.foreColor("green"); * comment.displayMode(GC.Spread.Sheets.Comments.DisplayMode.alwaysShown); * comment.dynamicMove(true); * comment.dynamicSize(true); * activeSheet.getCell(5,5).comment(comment); * ``` */ dynamicSize(value?: boolean): any; /** * Gets or sets the font family for the comment. * @param {string} value The font family for the comment. * @returns {string | GC.Spread.Sheets.Comments.Comment} If no value is set, returns the font family for the comment; otherwise, returns the comment. * @example * ```javascript * //This example uses the fontFamily method. * var comment = new GC.Spread.Sheets.Comments.Comment(); * comment.text("new comment!"); * comment.backColor("yellow"); * comment.foreColor("green"); * comment.displayMode(GC.Spread.Sheets.Comments.DisplayMode.alwaysShown); * comment.fontFamily("Comic Sans MS"); * comment.fontSize("10pt"); * activeSheet.getCell(5,5).comment(comment); * ``` */ fontFamily(value?: string): any; /** * Gets or sets the font size for the comment. Valid value is numbers followed by "pt" (required), such as "12pt". * @param {string} value The font size for the comment. * @returns {string | GC.Spread.Sheets.Comments.Comment} If no value is set, returns the font size for the comment; otherwise, returns the comment. * @example * ```javascript * //This example uses the fontSize method. * var comment = new GC.Spread.Sheets.Comments.Comment(); * comment.text("new comment!"); * comment.backColor("yellow"); * comment.foreColor("green"); * comment.displayMode(GC.Spread.Sheets.Comments.DisplayMode.alwaysShown); * comment.fontFamily("Comic Sans MS"); * comment.fontSize("10pt"); * activeSheet.getCell(5,5).comment(comment); * ``` */ fontSize(value?: string): any; /** * Gets or sets the font style of the comment. * @param {string} value The font style of the comment. * @returns {string | GC.Spread.Sheets.Comments.Comment} If no value is set, returns the font style of the comment; otherwise, returns the comment. * @example * ```javascript * //This example uses the fontStyle method. * var comment = new GC.Spread.Sheets.Comments.Comment(); * comment.text("new comment!"); * comment.backColor("yellow"); * comment.foreColor("green"); * comment.displayMode(GC.Spread.Sheets.Comments.DisplayMode.alwaysShown); * comment.fontFamily("Comic Sans MS"); * comment.fontStyle("normal"); * comment.fontWeight("normal"); * activeSheet.getCell(5,5).comment(comment); * ``` */ fontStyle(value?: string): any; /** * Gets or sets the font weight for the comment. * @param {string} value The font weight for the comment. * @returns {string | GC.Spread.Sheets.Comments.Comment} If no value is set, returns the font weight for the comment; otherwise, returns the comment. * @example * ```javascript * //This example uses the fontWeight method. * var comment = new GC.Spread.Sheets.Comments.Comment(); * comment.text("new comment!"); * comment.backColor("yellow"); * comment.foreColor("green"); * comment.displayMode(GC.Spread.Sheets.Comments.DisplayMode.alwaysShown); * comment.fontFamily("Comic Sans MS"); * comment.fontStyle("normal"); * comment.fontWeight("normal"); * activeSheet.getCell(5,5).comment(comment); * ``` */ fontWeight(value?: string): any; /** * Gets or sets the text color for the comment. * @param {string} value The text color for the comment. * @returns {string | GC.Spread.Sheets.Comments.Comment} If no value is set, returns the text color for the comment; otherwise, returns the comment. * @example * ```javascript * //This example sets the foreColor method. * var comment = new GC.Spread.Sheets.Comments.Comment(); * comment.text("new comment!"); * comment.backColor("yellow"); * comment.foreColor("green"); * comment.displayMode(GC.Spread.Sheets.Comments.DisplayMode.alwaysShown); * activeSheet.getCell(5,5).comment(comment); * ``` */ foreColor(value?: string): any; /** * Gets or sets the height of the comment. * @param {number} value The height of the comment. * @returns {number | GC.Spread.Sheets.Comments.Comment} If no value is set, returns the height of the comment; otherwise, returns the comment. * @example * ```javascript * //This example sets the height method. * var comment = new GC.Spread.Sheets.Comments.Comment(); * comment.text("new comment!"); * comment.backColor("yellow"); * comment.foreColor("green"); * comment.displayMode(GC.Spread.Sheets.Comments.DisplayMode.alwaysShown); * comment.height(50); * comment.width(90); * activeSheet.getCell(5,5).comment(comment); * activeSheet.suspendPaint(); * activeSheet.resumePaint(); * ``` */ height(value?: number): any; /** * Gets or sets the horizontal alignment of the comment. * @param {GC.Spread.Sheets.HorizontalAlign} value The horizontal alignment of the comment. * @returns {GC.Spread.Sheets.HorizontalAlign | GC.Spread.Sheets.Comments.Comment} If no value is set, returns the horizontal alignment of the comment; otherwise, returns the comment. * @example * ```javascript * //This example uses the horizontalAlign method. * var comment = new GC.Spread.Sheets.Comments.Comment(); * comment.text("new comment!"); * comment.backColor("yellow"); * comment.foreColor("green"); * comment.displayMode(GC.Spread.Sheets.Comments.DisplayMode.alwaysShown); * comment.horizontalAlign(GC.Spread.Sheets.HorizontalAlign.center); * activeSheet.getCell(5,5).comment(comment); * ``` */ horizontalAlign(value?: GC.Spread.Sheets.HorizontalAlign): any; /** * Gets or sets the indicatorColor for the comment. * @param {string} value The indicatorColor for the comment. * @returns {string | GC.Spread.Sheets.Comments.Comment} If no value is set, returns the color for the commentAdorner; otherwise, returns the comment. * @example * ```javascript * //This example uses the indicatorColor method. * var comment = new GC.Spread.Sheets.Comments.Comment(); * var color1 = "red"; * var color2 = "#FFFFFF"; * var color2 = "rgba(255, 255, 255, 0.01)"; * comment.indicatorColor(color1); * activeSheet.comments.add(5, 5, comment); * activeSheet.getCell(5,5).comment(comment); * ``` */ indicatorColor(value?: string): any; /** * Gets or sets the indicatorColor for the comment. * @param {number} value The indicatorColor for the comment. * @returns {number | GC.Spread.Sheets.Comments.Comment} If no value is set, returns the size for the commentAdorner; otherwise, returns the comment. * @example * ```javascript * //This example uses the indicatorColor method. * var comment = new GC.Spread.Sheets.Comments.Comment(); * comment.indicatorSize(6); * activeSheet.comments.add(5, 5, comment); * activeSheet.getCell(5,5).comment(comment); * ``` */ indicatorSize(value?: number): any; /** * Gets or sets the location of the comment. * @param {GC.Spread.Sheets.Point} value The location of the comment. * @returns {GC.Spread.Sheets.Point | GC.Spread.Sheets.Comments.Comment} If no value is set, returns the location of the comment; otherwise, returns the comment. * @example * ```javascript * //This example uses the location method. * var comment = new GC.Spread.Sheets.Comments.Comment(); * comment.text("new comment!"); * comment.backColor("yellow"); * comment.foreColor("green"); * comment.displayMode(GC.Spread.Sheets.Comments.DisplayMode.alwaysShown); * comment.location(new GC.Spread.Sheets.Point(10, 10)); * activeSheet.getCell(5,5).comment(comment); * ``` */ location(value?: GC.Spread.Sheets.Point): any; /** * Gets or sets the locked setting for the comment. * @param {boolean} value The locked setting for the comment. * @returns {boolean | GC.Spread.Sheets.Comments.Comment} If no value is set, returns the locked setting for the comment; otherwise, returns the comment. * @example * ```javascript * //This example uses the locked method. * var comment = new GC.Spread.Sheets.Comments.Comment(); * comment.text("new comment!"); * comment.backColor("yellow"); * comment.foreColor("green"); * comment.lockText(false); * comment.locked(false); * comment.displayMode(GC.Spread.Sheets.Comments.DisplayMode.alwaysShown); * activeSheet.options.isProtected = true; * activeSheet.getCell(5,5).comment(comment); * ``` */ locked(value?: boolean): any; /** * Gets or sets the locked text for the comment. * @param {boolean} value The locked text for the comment. * @returns {boolean | GC.Spread.Sheets.Comments.Comment} If no value is set, returns the locked text for the comment; otherwise, returns the comment. * @example * ```javascript * //This example uses the lockText method. * var comment = new GC.Spread.Sheets.Comments.Comment(); * comment.text("new comment!"); * comment.backColor("yellow"); * comment.foreColor("green"); * comment.lockText(false); * comment.locked(false); * comment.displayMode(GC.Spread.Sheets.Comments.DisplayMode.alwaysShown); * activeSheet.options.isProtected = true; * activeSheet.getCell(5,5).comment(comment); * ``` */ lockText(value?: boolean): any; /** * Gets or sets the opacity of the comment. * @param {number} value The opacity of the comment. * @returns {number | GC.Spread.Sheets.Comments.Comment} If no value is set, returns the opacity of the comment; otherwise, returns the comment. * @example * ```javascript * //This example sets the opacity. * var comment = new GC.Spread.Sheets.Comments.Comment(); * comment.text("new comment!"); * comment.backColor("yellow"); * comment.foreColor("green"); * comment.displayMode(GC.Spread.Sheets.Comments.DisplayMode.alwaysShown); * comment.opacity(10); * activeSheet.getCell(5,5).comment(comment); * ``` */ opacity(value?: number): any; /** * Gets or sets the padding for the comment. * @param {GC.Spread.Sheets.Comments.Padding} value The padding for the comment. * @returns {GC.Spread.Sheets.Comments.Padding | GC.Spread.Sheets.Comments.Comment} If no value is set, returns the padding for the comment; otherwise, returns the comment. * @example * ```javascript * //This example uses the padding method. * var comment = new GC.Spread.Sheets.Comments.Comment(); * comment.text("new comment!"); * comment.backColor("yellow"); * comment.foreColor("green"); * comment.displayMode(GC.Spread.Sheets.Comments.DisplayMode.alwaysShown); * comment.padding(new GC.Spread.Sheets.Comments.Padding(2, 2, 2, 2)); * activeSheet.getCell(5,5).comment(comment); * ``` */ padding(value?: GC.Spread.Sheets.Comments.Padding): any; /** * Gets or sets whether the comment displays a shadow. * @param {boolean} value Whether the comment displays a shadow. * @returns {boolean | GC.Spread.Sheets.Comments.Comment} If no value is set, returns whether the comment displays a shadow; otherwise, returns the comment. * @example * ```javascript * //This example uses the showShadow method. * var comment = new GC.Spread.Sheets.Comments.Comment(); * comment.text("new comment!"); * comment.backColor("yellow"); * comment.foreColor("green"); * comment.displayMode(GC.Spread.Sheets.Comments.DisplayMode.alwaysShown); * comment.borderWidth(2); * comment.borderStyle("dotted"); * comment.borderColor("red"); * comment.showShadow(true); * activeSheet.getCell(5,5).comment(comment); * activeSheet.suspendPaint(); * activeSheet.resumePaint(); * ``` */ showShadow(value?: boolean): any; /** * Gets or sets the text of the comment. * @param {string} value The text of the comment. * @returns {string | GC.Spread.Sheets.Comments.Comment} If no value is set, returns the text of the comment; otherwise, returns the comment. * @example * ```javascript * //This example sets the text method. * var comment = new GC.Spread.Sheets.Comments.Comment(); * comment.text("new comment!"); * comment.backColor("yellow"); * comment.foreColor("green"); * comment.displayMode(GC.Spread.Sheets.Comments.DisplayMode.alwaysShown); * activeSheet.getCell(5,5).comment(comment); * ``` */ text(value?: string): any; /** * Gets or sets the text decoration for the comment. * @param {GC.Spread.Sheets.TextDecorationType} value The text decoration for the comment. * @returns {GC.Spread.Sheets.TextDecorationType | GC.Spread.Sheets.Comments.Comment} If no value is set, returns the text decoration for the comment; otherwise, returns the comment. * @example * ```javascript * //This example uses the textDecoration method. * var comment = new GC.Spread.Sheets.Comments.Comment(); * comment.text("new comment!"); * comment.backColor("yellow"); * comment.foreColor("green"); * comment.displayMode(GC.Spread.Sheets.Comments.DisplayMode.alwaysShown); * comment.textDecoration(GC.Spread.Sheets.TextDecorationType.underline); * activeSheet.getCell(5,5).comment(comment); * activeSheet.suspendPaint(); * activeSheet.resumePaint(); * ``` */ textDecoration(value?: GC.Spread.Sheets.TextDecorationType): any; /** * Gets or sets the width of the comment. * @param {number} value The width of the comment. * @returns {number | GC.Spread.Sheets.Comments.Comment} If no value is set, returns the width of the comment; otherwise, returns the comment. * @example * ```javascript * //This example sets the width method. * var comment = new GC.Spread.Sheets.Comments.Comment(); * comment.text("new comment!"); * comment.backColor("yellow"); * comment.foreColor("green"); * comment.displayMode(GC.Spread.Sheets.Comments.DisplayMode.alwaysShown); * comment.height(50); * comment.width(90); * activeSheet.getCell(5,5).comment(comment); * activeSheet.suspendPaint(); * activeSheet.resumePaint(); * ``` */ width(value?: number): any; /** * Gets or sets the z-index of the comment. * @param {number} value The z-index of the comment. * @returns {number | GC.Spread.Sheets.Comments.Comment} If no value is set, returns the z-index of the comment; otherwise, returns the comment. * @example * ```javascript * //This example gets the index. * var comment = new GC.Spread.Sheets.Comments.Comment(); * comment.text("new comment!"); * comment.backColor("yellow"); * comment.foreColor("green"); * comment.displayMode(GC.Spread.Sheets.Comments.DisplayMode.alwaysShown); * activeSheet.getCell(5,5).comment(comment); * alert(comment.zIndex()); * ``` */ zIndex(value?: number): any; } export class CommentManager{ /** * Represents a comment manager that can manage all comments in a sheet. * @class * @param {GC.Spread.Sheets.Worksheet} sheet The worksheet. */ constructor(sheet: GC.Spread.Sheets.Worksheet); /** * Adds a comment to the cell for the indicated row and column. * @param {number} row The row index of the cell. * @param {number} col The column index of the cell. * @param {string} text The text of the comment. * @returns {GC.Spread.Sheets.Comments.Comment} The comment that has been added to the cell. */ add(row: number, col: number, text: string): GC.Spread.Sheets.Comments.Comment; /** * Gets all comments in the sheet. * @returns {GC.Spread.Sheets.Comments.Comment[]} */ all(): GC.Spread.Sheets.Comments.Comment[]; /** * Clears all of the comments in the indicated range on the sheet. When the range is not specified, it clears all the comments in the sheet. * @param {GC.Spread.Sheets.Range} range The range that you want clear all comments from. */ clear(range: GC.Spread.Sheets.Range): void; /** * Gets the comment in the cell with the indicated row and column. * @param {number} row The row index of the cell. * @param {number} col The column index of the cell. * @returns {GC.Spread.Sheets.Comments.Comment} The comment in the indicated cell. */ get(row: number, col: number): GC.Spread.Sheets.Comments.Comment; /** *Removes the comment from the cell for the indicated row and column. * @param {number} row The row index of the cell. * @param {number} col The column index of the cell. */ remove(row: number, col: number): void; } export class Padding{ /** * Represents the padding information. * @class * @param {number} top The top padding. * @param {number} right The right padding. * @param {number} bottom The bottom padding. * @param {number} left The left padding. * @example * ```javascript * var comment = activeSheet.comments.add(2, 2, 'this is a comment'); * comment.displayMode(GC.Spread.Sheets.Comments.DisplayMode.alwaysShown) * console.log(comment.padding()); // undefined * comment.padding(new GC.Spread.Sheets.Comments.Padding(10, 20, 30, 40)); * console.log(comment.padding()); // Padding {top: 10, right: 20, bottom: 30, left: 40} * ``` */ constructor(top?: number, right?: number, bottom?: number, left?: number); } } module ConditionalFormatting{ export interface IIconInfo{ iconSetType:GC.Spread.Sheets.ConditionalFormatting.IconSetType; iconIndex:number; } /** * Specifies the average condition type. * @enum {number} * @example * ```javascript * //This example creates an average rule. * activeSheet.setValue(0,0, 1,3); * activeSheet.setValue(1,0, 50,3); * activeSheet.setValue(2,0, 100,3); * activeSheet.setValue(3,0, 2,3); * activeSheet.setValue(4,0, 60,3); * activeSheet.setValue(5,0, 90,3); * activeSheet.setValue(6,0, 3,3); * activeSheet.setValue(7,0, 40,3); * activeSheet.setValue(8,0, 70,3); * activeSheet.setValue(9,0, 5,3); * activeSheet.setValue(10,0, 35,3); * var style = new GC.Spread.Sheets.Style(); * style.backColor = "red"; * style.borderLeft =new GC.Spread.Sheets.LineBorder("blue",GC.Spread.Sheets.LineStyle.medium); * style.borderTop = new GC.Spread.Sheets.LineBorder("blue",GC.Spread.Sheets.LineStyle.medium); * style.borderRight = new GC.Spread.Sheets.LineBorder("blue",GC.Spread.Sheets.LineStyle.medium); * style.borderBottom = new GC.Spread.Sheets.LineBorder("blue",GC.Spread.Sheets.LineStyle.medium); * var rule = new GC.Spread.Sheets.ConditionalFormatting.NormalConditionRule(); * rule.ruleType(GC.Spread.Sheets.ConditionalFormatting.RuleType.averageRule); * rule.ranges([new GC.Spread.Sheets.Range(0, 0, 10, 3)]); * rule.style(style); * rule.type(GC.Spread.Sheets.ConditionalFormatting.AverageConditionType.above); * activeSheet.conditionalFormats.addRule(rule); * ``` */ export enum AverageConditionType{ /** Specifies the above average condition. * @type {number} */ above= 0, /** Specifies the below average condition. * @type {number} */ below= 1, /** Specifies the above average or equal average condition. * @type {number} */ equalOrAbove= 2, /** Specifies the below average or equal average condition. * @type {number} */ equalOrBelow= 3, /** Specifies the above standard deviation condition. * @type {number} */ above1StdDev= 4, /** Specifies the below standard deviation condition. * @type {number} */ below1StdDev= 5, /** Specifies above the two standard deviation condition. * @type {number} */ above2StdDev= 6, /** Specifies below the two standard deviation condition. * @type {number} */ below2StdDev= 7, /** Specifies above the three standard deviation condition. * @type {number} */ above3StdDev= 8, /** Specifies below the three standard deviation condition. * @type {number} */ below3StdDev= 9 } /** * Specifies the data bar direction. * @enum {number} * @example * ```javascript * //This example creates a data bar rule. * activeSheet.setValue(0,0,1,3); * activeSheet.setValue(1,0,15,3); * activeSheet.setValue(2,0,25,3); * activeSheet.setValue(3,0,-1,3); * var dataBarRule = new GC.Spread.Sheets.ConditionalFormatting.DataBarRule(); * dataBarRule.ranges([new GC.Spread.Sheets.Range(0,0,4,1)]); * dataBarRule.minType(GC.Spread.Sheets.ConditionalFormatting.ScaleValueType.number); * dataBarRule.minValue(-1); * dataBarRule.maxType(GC.Spread.Sheets.ConditionalFormatting.ScaleValueType.number); * dataBarRule.maxValue(40); * dataBarRule.color("green"); * dataBarRule.showBorder(true); * dataBarRule.borderColor("orange"); * dataBarRule.dataBarDirection(GC.Spread.Sheets.ConditionalFormatting.BarDirection.leftToRight); * dataBarRule.negativeFillColor("yellow"); * dataBarRule.useNegativeFillColor(true); * dataBarRule.negativeBorderColor("red"); * dataBarRule.useNegativeBorderColor(true); * dataBarRule.axisPosition(GC.Spread.Sheets.ConditionalFormatting.DataBarAxisPosition.automatic); * dataBarRule.axisColor("blue"); * dataBarRule.showBarOnly(false); * activeSheet.conditionalFormats.addRule(dataBarRule); * ``` */ export enum BarDirection{ /** Specifies whether to display the data bar from left to right. * @type {number} */ leftToRight= 0, /** Specifies whether to display the data bar from right to left. * @type {number} */ rightToLeft= 1 } /** * Specifies the color compare type. * @enum {number} * @example * ```javascript * //This example filters using colors. * activeSheet.suspendPaint(); * var rowFilter = new GC.Spread.Sheets.Filter.HideRowFilter(new GC.Spread.Sheets.Range(-1, 0, -1, 1)); * activeSheet.rowFilter(rowFilter); * activeSheet.getCell(0, 0).value("A1").backColor("blue"); * activeSheet.getCell(1, 0).value("A2").backColor("yellow"); * activeSheet.getCell(2, 0).value("A3").backColor("red"); * activeSheet.getCell(3, 0).value("A4").backColor("green"); * activeSheet.getCell(4, 0).value("A5").backColor("yellow"); * var nCondition = new GC.Spread.Sheets.ConditionalFormatting.Condition(GC.Spread.Sheets.ConditionalFormatting.ConditionType.colorCondition, {compareType: GC.Spread.Sheets.ConditionalFormatting.ColorCompareType.backgroundColor, expected: "yellow"}); * var filter = activeSheet.rowFilter(); * filter.addFilterItem(0, nCondition); * filter.filter(0); * activeSheet.resumePaint(); * ``` */ export enum ColorCompareType{ /** Indicates whether the cell background color is equal to a specified color. * @type {number} */ backgroundColor= 0, /** Indicates whether the cell foreground color is equal to a specified color. * @type {number} */ foregroundColor= 1 } /** * Specifies the comparison operator. * @enum {number} * @example * ```javascript * spread.options.highlightInvalidData = true; * var dv = GC.Spread.Sheets.DataValidation.createDateValidator(GC.Spread.Sheets.ConditionalFormatting.ComparisonOperators.between, new Date(2012, 11, 31), new Date(2013, 11, 31)); * dv.showInputMessage(true); * dv.inputMessage("Enter a date between 12/31/2012 and 12/31/2013."); * dv.inputTitle("Tip"); * activeSheet.getCell(1, -1).validator(dv); * ``` */ export enum ComparisonOperators{ /** Determines whether a cell value is equal to the parameter value. * @type {number} */ equalsTo= 0, /** Determines whether a cell value is not equal to the parameter value. * @type {number} */ notEqualsTo= 1, /** Determines whether a cell value is greater than the parameter value. * @type {number} */ greaterThan= 2, /** Determines whether a cell value is greater than or equal to the parameter value. * @type {number} */ greaterThanOrEqualsTo= 3, /** Determines whether a cell value is less than the parameter value. * @type {number} */ lessThan= 4, /** Determines whether a cell value is less than or equal to the parameter value. * @type {number} */ lessThanOrEqualsTo= 5, /** Determines whether a cell value is between the two parameter values. * @type {number} */ between= 6, /** Determines whether a cell value is not between the two parameter values. * @type {number} */ notBetween= 7 } /** * Specifies the condition type. * @enum {number} */ export enum ConditionType{ /** Specifies the relation condition. * @type {number} */ relationCondition= 0, /** Specifies the number condition. * @type {number} */ numberCondition= 1, /** Specifies the text condition. * @type {number} */ textCondition= 2, /** Specifies the color condition. * @type {number} */ colorCondition= 3, /** Specifies the formula condition. * @type {number} */ formulaCondition= 4, /** Specifies the date condition. * @type {number} */ dateCondition= 5, /** Specifies the dateex condition. * @type {number} */ dateExCondition= 6, /** Specifies the text length condition. * @type {number} */ textLengthCondition= 7, /** Specifies the top 10 condition. * @type {number} */ top10Condition= 8, /** Specifies the unique condition. * @type {number} */ uniqueCondition= 9, /** Specifies the average condition. * @type {number} */ averageCondition= 10, /** Specifies the cell value condition. * @type {number} */ cellValueCondition= 11, /** Specifies the area condition. * @type {number} */ areaCondition= 12 } /** * Specifies the custom value type. * @enum {number} * @example * ```javascript * var nCondition = new GC.Spread.Sheets.ConditionalFormatting.Condition(GC.Spread.Sheets.ConditionalFormatting.ConditionType.formulaCondition, {compareType: GC.Spread.Sheets.ConditionalFormatting.CustomValueType.nonEmpty}); * var validator = new GC.Spread.Sheets.DataValidation.DefaultDataValidator(nCondition); * validator.ignoreBlank(false); * activeSheet.getCell(0, 0, GC.Spread.Sheets.SheetArea.viewport).validator(validator); * spread.options.highlightInvalidData = true; * ``` */ export enum CustomValueType{ /** Indicates whether the cell value is empty or null. * @type {number} */ empty= 0, /** Indicates whether the cell value is not empty or null. * @type {number} */ nonEmpty= 1, /** Indicates whether the cell value contains a calculation error. * @type {number} */ error= 2, /** Indicates whether the cell value does not contain a calculation error. * @type {number} */ nonError= 3, /** Indicates whether the cell value is a formula. * @type {number} */ formula= 4 } /** * Specifies the position of the data bar's axis. * @enum {number} * @example * ```javascript * //This example creates a data bar rule. * activeSheet.setValue(0,0,1,3); * activeSheet.setValue(1,0,15,3); * activeSheet.setValue(2,0,25,3); * activeSheet.setValue(3,0,-1,3); * var dataBarRule = new GC.Spread.Sheets.ConditionalFormatting.DataBarRule(); * dataBarRule.ranges([new GC.Spread.Sheets.Range(0,0,4,1)]); * dataBarRule.minType(GC.Spread.Sheets.ConditionalFormatting.ScaleValueType.number); * dataBarRule.minValue(-1); * dataBarRule.maxType(GC.Spread.Sheets.ConditionalFormatting.ScaleValueType.number); * dataBarRule.maxValue(40); * dataBarRule.color("green"); * dataBarRule.showBorder(true); * dataBarRule.borderColor("orange"); * dataBarRule.dataBarDirection(GC.Spread.Sheets.ConditionalFormatting.BarDirection.leftToRight); * dataBarRule.negativeFillColor("yellow"); * dataBarRule.useNegativeFillColor(true); * dataBarRule.negativeBorderColor("red"); * dataBarRule.useNegativeBorderColor(true); * dataBarRule.axisPosition(GC.Spread.Sheets.ConditionalFormatting.DataBarAxisPosition.automatic); * dataBarRule.axisColor("blue"); * dataBarRule.showBarOnly(false); * activeSheet.conditionalFormats.addRule(dataBarRule); * ``` */ export enum DataBarAxisPosition{ /** Specifies whether to display at a variable position based on negative values. * @type {number} */ automatic= 0, /** Specifies whether to display at the cell midpoint. * @type {number} */ cellMidPoint= 1, /** Specifies whether to display value bars in the same direction as positive values. * @type {number} */ none= 2 } /** * Specifies the date compare type. * @enum {number} * @example * ```javascript * //This example validates cell data. * var nCondition = new GC.Spread.Sheets.ConditionalFormatting.Condition(GC.Spread.Sheets.ConditionalFormatting.ConditionType.dateCondition, {compareType: GC.Spread.Sheets.ConditionalFormatting.DateCompareType.before, expected: new Date(2012, 11, 31)}); * var validator = new GC.Spread.Sheets.DataValidation.DefaultDataValidator(nCondition); * validator.type(GC.Spread.Sheets.DataValidation.CriteriaType.custom); * activeSheet.getCell(0, 0, GC.Spread.Sheets.SheetArea.viewport).validator(validator); * spread.options.highlightInvalidData = true; * activeSheet.setValue(0, 0, new Date(2012, 12, 12)); * ``` */ export enum DateCompareType{ /** Indicates whether the date time is equal to a certain time. * @type {number} */ equalsTo= 0, /** Indicates whether the date time is not equal to a certain time. * @type {number} */ notEqualsTo= 1, /** Indicates whether the date time is before a certain time. * @type {number} */ before= 2, /** Indicates whether the date time is before or equal to a certain time. * @type {number} */ beforeEqualsTo= 3, /** Indicates whether the date time is after a certain time. * @type {number} */ after= 4, /** Indicates whether the date time is after or equal to a certain time. * @type {number} */ afterEqualsTo= 5 } /** * Specifies the date occurring type. * @enum {number} * @example * ```javascript * //This example creates a rule. * var style = new GC.Spread.Sheets.Style(); * style.backColor = "red"; * var rule = new GC.Spread.Sheets.ConditionalFormatting.NormalConditionRule(GC.Spread.Sheets.ConditionalFormatting.RuleType.dateOccurringRule, [new GC.Spread.Sheets.Range(0,0,10,1)], style, null, null, null, null, null, GC.Spread.Sheets.ConditionalFormatting.DateOccurringType.nextWeek); * activeSheet.conditionalFormats.addRule(rule); * var d = new Date(); * activeSheet.setValue(0, 0, d); * activeSheet.setValue(1, 0, new Date(d.setDate(d.getDate()+1))); * activeSheet.setValue(2, 0, new Date(d.setDate(d.getDate()+5))); * activeSheet.setValue(3, 0,new Date(d.setDate(d.getDate()+6))); * activeSheet.setValue(4, 0,new Date(d.setDate(d.getDate()+7))); * activeSheet.setValue(5, 0, new Date(d.setDate(d.getDate()+8))); * ``` */ export enum DateOccurringType{ /** Specifies today. * @type {number} */ today= 0, /** Specifies yesterday. * @type {number} */ yesterday= 1, /** Specifies tomorrow. * @type {number} */ tomorrow= 2, /** Specifies the last seven days. * @type {number} */ last7Days= 3, /** Specifies this month. * @type {number} */ thisMonth= 4, /** Specifies last month. * @type {number} */ lastMonth= 5, /** Specifies next month. * @type {number} */ nextMonth= 6, /** Specifies this week. * @type {number} */ thisWeek= 7, /** Specifies last week. * @type {number} */ lastWeek= 8, /** Specifies next week. * @type {number} */ nextWeek= 9, /** Specifies next Quarter. * @type {number} */ nextQuarter= 10, /** Specifies this Quarter. * @type {number} */ thisQuarter= 11, /** Specifies last Quarter. * @type {number} */ lastQuarter= 12, /** Specifies next Year. * @type {number} */ nextYear= 13, /** Specifies this Year. * @type {number} */ thisYear= 14, /** Specifies last Year. * @type {number} */ lastYear= 15 } /** * Specifies the general operator. * @enum {number} * @example * ```javascript * //This example validates a cell value. * var nCondition = new GC.Spread.Sheets.ConditionalFormatting.Condition(GC.Spread.Sheets.ConditionalFormatting.ConditionType.cellValueCondition); * nCondition.compareType(GC.Spread.Sheets.ConditionalFormatting.GeneralComparisonOperators.equalsTo); * nCondition.expected(0); * //When the option is false, the validation fails and the red alert is displayed. * //When the option is true, the blank cell is treated as zero and the validation is successful. * nCondition.treatNullValueAsZero(false); * var validator = new GC.Spread.Sheets.DataValidation.DefaultDataValidator(nCondition); * validator.type(GC.Spread.Sheets.DataValidation.CriteriaType.custom); * validator.ignoreBlank(false); * activeSheet.getCell(0, 0, GC.Spread.Sheets.SheetArea.viewport).validator(validator); * spread.options.highlightInvalidData = true; * activeSheet.setValue(0, 0, null); * alert(validator.value2()); * ``` */ export enum GeneralComparisonOperators{ /** Indicates whether the number is equal to a specified number. * @type {number} */ equalsTo= 0, /** Indicates whether the number is not equal to a specified number. * @type {number} */ notEqualsTo= 1, /** Indicates whether the number is greater than a specified number. * @type {number} */ greaterThan= 2, /** Indicates whether the number is greater than or equal to a specified number. * @type {number} */ greaterThanOrEqualsTo= 3, /** Indicates whether the number is less than a specified number. * @type {number} */ lessThan= 4, /** Indicates whether the number is less than or equal to a specified number. * @type {number} */ lessThanOrEqualsTo= 5 } /** * Specifies the icon set. * @enum {number} * @example * ```javascript * //This example creates a rule. * activeSheet.setValue(0,0,1,3); * activeSheet.setValue(1,0,15,3); * activeSheet.setValue(2,0,25,3); * activeSheet.setValue(3,0,-1,3); * var iconSetRule = new GC.Spread.Sheets.ConditionalFormatting.IconSetRule(); * iconSetRule.ranges([new GC.Spread.Sheets.Range(0,0,4,1)]); * iconSetRule.iconSetType(GC.Spread.Sheets.ConditionalFormatting.IconSetType.fourTrafficLights); * var iconCriteria = iconSetRule.iconCriteria(); * iconCriteria[0] = new GC.Spread.Sheets.ConditionalFormatting.IconCriterion(true, GC.Spread.Sheets.ConditionalFormatting.IconValueType.number, 1); * iconCriteria[1] = new GC.Spread.Sheets.ConditionalFormatting.IconCriterion(true, GC.Spread.Sheets.ConditionalFormatting.IconValueType.number, 10); * iconCriteria[2] = new GC.Spread.Sheets.ConditionalFormatting.IconCriterion(true, GC.Spread.Sheets.ConditionalFormatting.IconValueType.number, 20); * iconSetRule.reverseIconOrder(false); * iconSetRule.showIconOnly(false); * activeSheet.conditionalFormats.addRule(iconSetRule); * ``` */ export enum IconSetType{ /** Specifies three colored arrows. * @type {number} */ threeArrowsColored= 0, /** Specifies three gray arrows. * @type {number} */ threeArrowsGray= 1, /** Specifies three trangles. * @type {number} */ threeTriangles= 2, /** Specifies three stars. * @type {number} */ threeStars= 3, /** Specifies three flags. * @type {number} */ threeFlags= 4, /** Specifies three traffic lights (unrimmed). * @type {number} */ threeTrafficLightsUnrimmed= 5, /** Specifies three traffic lights (rimmed). * @type {number} */ threeTrafficLightsRimmed= 6, /** Specifies three signs. * @type {number} */ threeSigns= 7, /** Specifies three symbols (circled). * @type {number} */ threeSymbolsCircled= 8, /** Specifies three symbols (uncircled). * @type {number} */ threeSymbolsUncircled= 9, /** Specifies four colored arrows. * @type {number} */ fourArrowsColored= 10, /** Specifies four gray arrows. * @type {number} */ fourArrowsGray= 11, /** Specifies four red to black icons. * @type {number} */ fourRedToBlack= 12, /** Specifies four ratings. * @type {number} */ fourRatings= 13, /** Specifies four traffic lights. * @type {number} */ fourTrafficLights= 14, /** Specifies five colored arrows. * @type {number} */ fiveArrowsColored= 15, /** Specifies five gray arrows. * @type {number} */ fiveArrowsGray= 16, /** Specifies five ratings. * @type {number} */ fiveRatings= 17, /** Specifies five quarters. * @type {number} */ fiveQuarters= 18, /** Specifies five boxes. * @type {number} */ fiveBoxes= 19, /** Specifies no cell icon. * @type {number} */ noIcons= 20 } /** * Specifies the icon value type. * @enum {number} * @example * ```javascript * //This example creates a rule. * activeSheet.setValue(0,0,1,3); * activeSheet.setValue(1,0,15,3); * activeSheet.setValue(2,0,25,3); * activeSheet.setValue(3,0,-1,3); * var iconSetRule = new GC.Spread.Sheets.ConditionalFormatting.IconSetRule(); * iconSetRule.ranges([new GC.Spread.Sheets.Range(0,0,4,1)]); * iconSetRule.iconSetType(GC.Spread.Sheets.ConditionalFormatting.IconSetType.fourTrafficLights); * var iconCriteria = iconSetRule.iconCriteria(); * iconCriteria[0] = new GC.Spread.Sheets.ConditionalFormatting.IconCriterion(true, GC.Spread.Sheets.ConditionalFormatting.IconValueType.number, 1); * iconCriteria[1] = new GC.Spread.Sheets.ConditionalFormatting.IconCriterion(true, GC.Spread.Sheets.ConditionalFormatting.IconValueType.number, 10); * iconCriteria[2] = new GC.Spread.Sheets.ConditionalFormatting.IconCriterion(true, GC.Spread.Sheets.ConditionalFormatting.IconValueType.number, 20); * iconSetRule.reverseIconOrder(false); * iconSetRule.showIconOnly(false); * activeSheet.conditionalFormats.addRule(iconSetRule); * ``` */ export enum IconValueType{ /** Indicates whether to return a specified number directly. * @type {number} */ number= 1, /** Indicates whether to return the percentage of a cell value in a specified cell range. * @type {number} */ percent= 4, /** Indicates whether to return the result of a formula calculation. * @type {number} */ formula= 7, /** Indicates whether to return the percentile of a cell value in a specified cell range. * @type {number} */ percentile= 5 } /** * Specifies the relation operator. * @enum {number} * @example * ```javascript * //This example validates data. * var condition1 = new GC.Spread.Sheets.ConditionalFormatting.Condition(GC.Spread.Sheets.ConditionalFormatting.ConditionType.dateCondition, {compareType: GC.Spread.Sheets.ConditionalFormatting.DateCompareType.afterEqualsTo, expected: new Date(2012, 11, 31)}); * var condition2 = new GC.Spread.Sheets.ConditionalFormatting.Condition(GC.Spread.Sheets.ConditionalFormatting.ConditionType.dateCondition, {compareType: GC.Spread.Sheets.ConditionalFormatting.DateCompareType.beforeEqualsTo, expected: new Date(2013, 11, 31)}); * var nCondition = new GC.Spread.Sheets.ConditionalFormatting.Condition(GC.Spread.Sheets.ConditionalFormatting.ConditionType.relationCondition, {compareType: GC.Spread.Sheets.ConditionalFormatting.LogicalOperators.and, item1: condition1, item2: condition2}); * var validator = new GC.Spread.Sheets.DataValidation.DefaultDataValidator(nCondition); * validator.type(GC.Spread.Sheets.DataValidation.CriteriaType.custom); * activeSheet.getCell(0, 0, GC.Spread.Sheets.SheetArea.viewport).validator(validator); * spread.options.highlightInvalidData = true; * activeSheet.setValue(0, 0, new Date(2012, 11, 25)); * ``` */ export enum LogicalOperators{ /** Specifies the Or relation. * @type {number} */ or= 0, /** Specifies the And relation. * @type {number} */ and= 1 } /** * Specifies the quarter type. * @enum {number} */ export enum QuarterType{ /** Indicates the first quarter of a year. * @type {number} */ quarter1= 0, /** Indicates the second quarter of a year. * @type {number} */ quarter2= 1, /** Indicates the third quarter of a year. * @type {number} */ quarter3= 2, /** Indicates the fourth quarter of a year. * @type {number} */ quarter4= 3 } /** * Specifies the rule type. * @enum {number} * @example * ```javascript * // this example show how to set a rule type for NormalConditionRule. * activeSheet.setArray(0, 0, [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]); * activeSheet.setArray(0, 2, [1, 2, 3, 4, 5, 6, 5, 8, 1, 10]); * var greatThan = new GC.Spread.Sheets.ConditionalFormatting.NormalConditionRule(); * greatThan.ruleType(GC.Spread.Sheets.ConditionalFormatting.RuleType.cellValueRule); * greatThan.operator(GC.Spread.Sheets.ConditionalFormatting.ComparisonOperators.greaterThan); * greatThan.value1(4); * greatThan.ranges([new GC.Spread.Sheets.Range(0, 0, 10, 1)]); * var style = new GC.Spread.Sheets.Style(); * style.backColor = "red"; * greatThan.style(style); * activeSheet.conditionalFormats.addRule(greatThan); * var unique = new GC.Spread.Sheets.ConditionalFormatting.NormalConditionRule(); * unique.ruleType(GC.Spread.Sheets.ConditionalFormatting.RuleType.uniqueRule); * unique.operator(GC.Spread.Sheets.ConditionalFormatting.ComparisonOperators.greaterThan); * unique.value1(5); * unique.ranges([new GC.Spread.Sheets.Range(0, 2, 10, 1)]); * var style = new GC.Spread.Sheets.Style(); * style.backColor = "gold"; * unique.style(style); * activeSheet.conditionalFormats.addRule(unique); * ``` */ export enum RuleType{ /** Specifies the base rule of the condition. * @type {number} */ conditionRuleBase= 0, /** Specifies the cell value rule. * @type {number} */ cellValueRule= 1, /** Specifies the specific text rule. * @type {number} */ specificTextRule= 2, /** Specifies the formula rule. * @type {number} */ formulaRule= 3, /** Specifies the date occurring rule. * @type {number} */ dateOccurringRule= 4, /** Specifies the top 10 rule. * @type {number} */ top10Rule= 5, /** Specifies the unique rule. * @type {number} */ uniqueRule= 6, /** Specifies the duplicate rule. * @type {number} */ duplicateRule= 7, /** Specifies the average rule. * @type {number} */ averageRule= 8, /** Specifies the two scale rule. * @type {number} */ twoScaleRule= 10, /** Specifies the three scale rule. * @type {number} */ threeScaleRule= 11, /** Specifies the data bar rule. * @type {number} */ dataBarRule= 12, /** Specifies the icon set rule. * @type {number} */ iconSetRule= 13, /** Specifies the row state rule. * @type {number} */ rowStateRule= 14, /** Specifies the column state rule. * @type {number} */ columnStateRule= 15 } /** * Specifies the scale value type. * @enum {number} * @example * ```javascript * //This example creates a data bar rule. * activeSheet.setValue(0,0,1,3); * activeSheet.setValue(1,0,15,3); * activeSheet.setValue(2,0,25,3); * activeSheet.setValue(3,0,-1,3); * var dataBarRule = new GC.Spread.Sheets.ConditionalFormatting.DataBarRule(); * dataBarRule.ranges([new GC.Spread.Sheets.Range(0,0,4,1)]); * dataBarRule.minType(GC.Spread.Sheets.ConditionalFormatting.ScaleValueType.number); * dataBarRule.minValue(-1); * dataBarRule.maxType(GC.Spread.Sheets.ConditionalFormatting.ScaleValueType.number); * dataBarRule.maxValue(40); * dataBarRule.color("green"); * dataBarRule.showBorder(true); * dataBarRule.borderColor("orange"); * dataBarRule.dataBarDirection(GC.Spread.Sheets.ConditionalFormatting.BarDirection.leftToRight); * dataBarRule.negativeFillColor("yellow"); * dataBarRule.useNegativeFillColor(true); * dataBarRule.negativeBorderColor("red"); * dataBarRule.useNegativeBorderColor(true); * dataBarRule.axisPosition(GC.Spread.Sheets.ConditionalFormatting.DataBarAxisPosition.automatic); * dataBarRule.axisColor("blue"); * dataBarRule.showBarOnly(false); * activeSheet.conditionalFormats.addRule(dataBarRule); * ``` */ export enum ScaleValueType{ /** Indicates whether to return a specified number directly. * @type {number} */ number= 0, /** Indicates whether to return the lowest value in a specified cell range. * @type {number} */ lowestValue= 1, /** Indicates whether to return the highest value in a specified cell range. * @type {number} */ highestValue= 2, /** Indicates whether to return the percentage of a cell value in a specified cell range. * @type {number} */ percent= 3, /** Indicates whether to return the percentile of a cell value in a specified cell range. * @type {number} */ percentile= 4, /** Indicates whether to return the automatic minimum value in a specified range. * @type {number} */ automin= 5, /** Indicates whether to return the result of a formula calculation. * @type {number} */ formula= 6, /** Indicates whether to return the automatic maximum value in a specified range. * @type {number} */ automax= 7 } /** * Specifies the text compare type. * @enum {number} * @example * ```javascript * //This example uses the TextCompareType enumeration. * var nCondition = new GC.Spread.Sheets.ConditionalFormatting.Condition(GC.Spread.Sheets.ConditionalFormatting.ConditionType.textCondition, {compareType: GC.Spread.Sheets.ConditionalFormatting.TextCompareType.contains, expected: "test"}); * var validator = new GC.Spread.Sheets.DataValidation.DefaultDataValidator(nCondition); * validator.type(GC.Spread.Sheets.DataValidation.CriteriaType.custom); * activeSheet.getCell(0, 0, GC.Spread.Sheets.SheetArea.viewport).validator(validator); * spread.options.highlightInvalidData = true; * activeSheet.setValue(0, 0, "testing"); * //Type text in 0,0 that does not contain "test" to see invalid symbol * ``` */ export enum TextCompareType{ /** Indicates whether the string is equal to a specified string. * @type {number} */ equalsTo= 0, /** Indicates whether the string is not equal to a specified string. * @type {number} */ notEqualsTo= 1, /** Indicates whether the string starts with a specified string. * @type {number} */ beginsWith= 2, /** Indicates whether the string does not start with a specified string. * @type {number} */ doesNotBeginWith= 3, /** Indicates whether the string ends with a specified string. * @type {number} */ endsWith= 4, /** Indicates whether the string does not end with a specified string. * @type {number} */ doesNotEndWith= 5, /** Indicates whether the string contains a specified string. * @type {number} */ contains= 6, /** Indicates whether the string does not contain a specified string. * @type {number} */ doesNotContain= 7 } /** * Specifies the text comparison operator. * @enum {number} * @example * ```javascript * //This example creates a rule. * var style = new GC.Spread.Sheets.Style(); * style.backColor = "red"; * var ranges=[new GC.Spread.Sheets.Range(0,0,10,1)]; * activeSheet.conditionalFormats.addSpecificTextRule(GC.Spread.Sheets.ConditionalFormatting.TextComparisonOperators.contains, "test", style, ranges); * activeSheet.setValue(0, 0, "testing"); * activeSheet.setValue(1, 0, "test"); * activeSheet.setValue(2, 0, "a"); * activeSheet.setValue(3, 0, "t"); * ``` */ export enum TextComparisonOperators{ /** Determines whether a cell value contains the parameter value. * @type {number} */ contains= 0, /** Determines whether a cell value does not contain the parameter value. * @type {number} */ doesNotContain= 1, /** Determines whether a cell value begins with the parameter value. * @type {number} */ beginsWith= 2, /** Determines whether a cell value ends with the parameter value. * @type {number} */ endsWith= 3 } /** * Specifies the top 10 condition type. * @enum {number} * @example * ```javascript * //This example uses the Top10ConditionType enumeration. * var style = new GC.Spread.Sheets.Style(); * style.backColor = "red"; * var ranges=[new GC.Spread.Sheets.Range(0,0,10,1)]; * activeSheet.conditionalFormats.addTop10Rule(GC.Spread.Sheets.ConditionalFormatting.Top10ConditionType.top, 2, style, ranges); * activeSheet.setValue(0, 0, 1); * activeSheet.setValue(1, 0, 50); * activeSheet.setValue(2, 0, 11); * activeSheet.setValue(3, 0, 5); * ``` */ export enum Top10ConditionType{ /** Specifies the top condition. * @type {number} */ top= 0, /** Specifies the bottom condition. * @type {number} */ bottom= 1 } export class Condition{ /** * Represents a conditional item using the parameter object. * @param {GC.Spread.Sheets.ConditionalFormatting.ConditionType} conditionType * @param {Object} args * @constructor * @example * ```javascript * var nCondition = new GC.Spread.Sheets.ConditionalFormatting.Condition(GC.Spread.Sheets.ConditionalFormatting.ConditionType.averageCondition, {compareType: GC.Spread.Sheets.ConditionalFormatting.AverageConditionType.above}); * nCondition.ranges([new GC.Spread.Sheets.Range(0, 0, 10, 3)]); * var validator = new GC.Spread.Sheets.DataValidation.DefaultDataValidator(nCondition); * validator.type(GC.Spread.Sheets.DataValidation.CriteriaType.custom); * activeSheet.getCell(0, 0, GC.Spread.Sheets.SheetArea.viewport).validator(validator); * spread.options.highlightInvalidData = true; * activeSheet.setValue(0, 0, 5); * activeSheet.setValue(1, 0, 15); * ``` */ constructor(conditionType: GC.Spread.Sheets.ConditionalFormatting.ConditionType, args: Object); /** * Gets or sets the rule compare type. * @param {GC.Spread.Sheets.ConditionalFormatting.LogicalOperators | GC.Spread.Sheets.ConditionalFormatting.GeneralComparisonOperators | GC.Spread.Sheets.ConditionalFormatting.TextCompareType | GC.Spread.Sheets.ConditionalFormatting.ColorCompareType | GC.Spread.Sheets.ConditionalFormatting.DateCompareType} value The rule compare type. * @returns {GC.Spread.Sheets.ConditionalFormatting.LogicalOperators | GC.Spread.Sheets.ConditionalFormatting.GeneralComparisonOperators | GC.Spread.Sheets.ConditionalFormatting.TextCompareType | GC.Spread.Sheets.ConditionalFormatting.ColorCompareType | GC.Spread.Sheets.ConditionalFormatting.DateCompareType | GC.Spread.Sheets.ConditionalFormatting.Condition} If no value is set, returns the rule compare type; otherwise, returns the condition. * @example * ```javascript * var data = ["testing", 'est', 'testtest', 'tesla', 'taste']; * activeSheet.setArray(0,0,data); * //this example will highlight show the cell which text not contain 'test' * var nCondition = new GC.Spread.Sheets.ConditionalFormatting.Condition(GC.Spread.Sheets.ConditionalFormatting.ConditionType.textCondition); * nCondition.compareType(GC.Spread.Sheets.ConditionalFormatting.TextCompareType.contains); * nCondition.expected("test"); * var validator = new GC.Spread.Sheets.DataValidation.DefaultDataValidator(nCondition); * validator.type(GC.Spread.Sheets.DataValidation.CriteriaType.custom); * activeSheet.getRange(0, 0, 5,1).validator(validator); * spread.options.highlightInvalidData = true; * ``` */ compareType(value?: GC.Spread.Sheets.ConditionalFormatting.LogicalOperators | GC.Spread.Sheets.ConditionalFormatting.GeneralComparisonOperators | GC.Spread.Sheets.ConditionalFormatting.TextCompareType | GC.Spread.Sheets.ConditionalFormatting.ColorCompareType | GC.Spread.Sheets.ConditionalFormatting.DateCompareType): any; /** * Evaluates the condition using the specified evaluator. * @param {Object} evaluator The evaluator that can evaluate an expression or a function. * @param {number} baseRow The base row index for evaluation. * @param {number} baseColumn The base column index for evaluation. * @param {Object} actualObj The actual value of object1 for evaluation. * @example * ```javascript * //this example will highlight show the cell which text not contain 'test' * var data = ["testing", 'est', 'testtest', 'tesla', 'taste']; * activeSheet.setArray(0, 0, data); * var nCondition = new GC.Spread.Sheets.ConditionalFormatting.Condition(GC.Spread.Sheets.ConditionalFormatting.ConditionType.textCondition); * nCondition.compareType(GC.Spread.Sheets.ConditionalFormatting.TextCompareType.contains); * nCondition.expected("test"); * var validator = new GC.Spread.Sheets.DataValidation.DefaultDataValidator(nCondition); * validator.type(GC.Spread.Sheets.DataValidation.CriteriaType.custom); * activeSheet.getRange(0, 0, 5, 1).validator(validator); * spread.options.highlightInvalidData = true; * for (var i = 0; i < 10; i++) { * var result = nCondition.evaluate(activeSheet, i, 0, data[i]); * console.log(result); * } * ``` * @returns {boolean} `true` if the result is successful; otherwise, `false`. */ evaluate(evaluator: Object, baseRow: number, baseColumn: number, actualObj: Object): boolean; /** * Gets or sets the expected value. * @param {Object} value The expected value. * @returns {object | GC.Spread.Sheets.ConditionalFormatting.Condition} If no value is set, returns the expected value; otherwise, returns the condition. * @example * ```javascript * var nCondition = new GC.Spread.Sheets.ConditionalFormatting.Condition(GC.Spread.Sheets.ConditionalFormatting.ConditionType.dateCondition); * nCondition.compareType(GC.Spread.Sheets.ConditionalFormatting.DateCompareType.before); * nCondition.expected(new Date(2012, 11, 31)); * var validator = new GC.Spread.Sheets.DataValidation.DefaultDataValidator(nCondition); * validator.type(GC.Spread.Sheets.DataValidation.CriteriaType.custom); * activeSheet.getCell(0, 0, GC.Spread.Sheets.SheetArea.viewport).validator(validator); * spread.options.highlightInvalidData = true; * activeSheet.setValue(0, 0, new Date(2012, 12, 12)); * ``` */ expected(value?: any): any; /** * Gets or sets the expected formula. * @param {string | number} formulaOrBaseRow The expected formula or base row. * @param {number} baseColumn The base column. * @returns {string | GC.Spread.Sheets.ConditionalFormatting.Condition} If no value is set or baseRow and baseColumn is set, returns the expected formula; otherwise, returns the condition. * @example * ```javascript * var textLengthCondition = new GC.Spread.Sheets.ConditionalFormatting.Condition(GC.Spread.Sheets.ConditionalFormatting.ConditionType.textLengthCondition); * textLengthCondition.compareType(GC.Spread.Sheets.ConditionalFormatting.GeneralComparisonOperators.greaterThan); * textLengthCondition.formula("$C$1"); // formula used to calculate a number. * var validator = new GC.Spread.Sheets.DataValidation.DefaultDataValidator(textLengthCondition); * validator.type(GC.Spread.Sheets.DataValidation.CriteriaType.custom); * activeSheet.getCell(0, 0, GC.Spread.Sheets.SheetArea.viewport).validator(validator); * spread.options.highlightInvalidData = true; * activeSheet.setValue(0, 0, "abcf"); * //Set value 3 to $C$1, after this code, the value in Cell(0,0) is valid. * activeSheet.setValue(0, 2, 3); * //Set value 5 to $C$1, after this code, the value in Cel(0,0) is invalid. * // activeSheet.setValue(0, 2, 5); * ``` */ formula(formulaOrBaseRow?: string | number, baseColumn ?: number): any; /** * Creates a date extend condition object from the specified day. * @static * @param {number} day The day. * @returns {GC.Spread.Sheets.ConditionalFormatting.Condition} A date extend condition object. */ static fromDay(day: number): GC.Spread.Sheets.ConditionalFormatting.Condition; /** * Creates the area condition from formula data. * @static * @param {string} formula The formula that specifies a range that contains data items. * @returns {GC.Spread.Sheets.ConditionalFormatting.Condition} The area condition. */ static fromFormula(formula: string): GC.Spread.Sheets.ConditionalFormatting.Condition; /** * Creates a date extend condition object from the specified month. * @static * @param {number} month The month. The first month is 0. * @returns {GC.Spread.Sheets.ConditionalFormatting.Condition} A date extend condition object. */ static fromMonth(month: number): GC.Spread.Sheets.ConditionalFormatting.Condition; /** * Creates a date extend condition object from the specified quarter. * @static * @param {GC.Spread.Sheets.ConditionalFormatting.QuarterType} quarter The quarter. * @returns {GC.Spread.Sheets.ConditionalFormatting.Condition} A date extend condition object. */ static fromQuarter(quarter: GC.Spread.Sheets.ConditionalFormatting.QuarterType): GC.Spread.Sheets.ConditionalFormatting.Condition; /** * Creates the area condition from source data. * @static * @param {string} expected The expected source that separates each data item with a comma (","). * @returns {GC.Spread.Sheets.ConditionalFormatting.Condition} The area condition. */ static fromSource(expected: string): GC.Spread.Sheets.ConditionalFormatting.Condition; /** * Creates a date extend condition object from the specified week. * @static * @param {number} week The week. * @returns {GC.Spread.Sheets.ConditionalFormatting.Condition} A date extend condition object. */ static fromWeek(week: number): GC.Spread.Sheets.ConditionalFormatting.Condition; /** * Creates a date extend condition object from the specified year. * @static * @param {number} year The year. * @returns {GC.Spread.Sheets.ConditionalFormatting.Condition} A date extend condition object. */ static fromYear(year: number): GC.Spread.Sheets.ConditionalFormatting.Condition; /** * Gets the expected value. * @constructor * @param {Object} evaluator The evaluator that can evaluate an expression or a function. * @param {number} baseRow The base row index for evaluation. * @param {number} baseColumn The base column index for evaluation. * @returns {Object} The expected value. */ getExpected(evaluator: Object, baseRow: number, baseColumn: number): Object; /** * Returns the list of valid data items. * @param {Object} evaluator The evaluator that can evaluate an expression or a function. * @param {number} baseRow The base row index for evaluation. * @param {number} baseColumn The base column index for evaluation. * @returns {Array} The list of valid data items. */ getValidList(evaluator: Object, baseRow: number, baseColumn: number): any[]; /** * Gets or sets whether to ignore the blank cell. * @param {boolean} value Whether to ignore the blank cell. * @returns {boolean | GC.Spread.Sheets.ConditionalFormatting.Condition} If no value is set, returns whether to ignore the blank cell; otherwise, returns the condition. * @example * ```javascript * var nCondition = new GC.Spread.Sheets.ConditionalFormatting.Condition(GC.Spread.Sheets.ConditionalFormatting.ConditionType.textCondition); * nCondition.compareType(GC.Spread.Sheets.ConditionalFormatting.TextCompareType.contains); * nCondition.expected("te?t"); * nCondition.ignoreBlank(true); * nCondition.ignoreCase(true); * nCondition.useWildCards(true); * var validator = new GC.Spread.Sheets.DataValidation.DefaultDataValidator(nCondition); * validator.type(GC.Spread.Sheets.DataValidation.CriteriaType.custom); * activeSheet.getCell(0, 0, GC.Spread.Sheets.SheetArea.viewport).validator(validator); * spread.options.highlightInvalidData = true; * activeSheet.setValue(0, 0, "testing"); * ``` */ ignoreBlank(value?: boolean): any; /** * Gets or sets whether to ignore case when performing the comparison. * @param {boolean} value Whether to ignore case when performing the comparison. * @returns {boolean | GC.Spread.Sheets.ConditionalFormatting.Condition} If no value is set, returns whether to ignore case when performing the comparison; otherwise, returns the condition. * @example * ```javascript * //This example creates a text condition. * var nCondition = new GC.Spread.Sheets.ConditionalFormatting.Condition(GC.Spread.Sheets.ConditionalFormatting.ConditionType.textCondition); * nCondition.compareType(GC.Spread.Sheets.ConditionalFormatting.TextCompareType.contains); * nCondition.expected("te?t"); * nCondition.ignoreBlank(true); * nCondition.ignoreCase(true); * nCondition.useWildCards(true); * var validator = new GC.Spread.Sheets.DataValidation.DefaultDataValidator(nCondition); * validator.type(GC.Spread.Sheets.DataValidation.CriteriaType.custom); * activeSheet.getCell(0, 0, GC.Spread.Sheets.SheetArea.viewport).validator(validator); * spread.options.highlightInvalidData = true; * activeSheet.setValue(0, 0, "testing"); * ``` */ ignoreCase(value?: boolean): any; /** * Gets or sets the first condition. * @param {GC.Spread.Sheets.ConditionalFormatting.Condition} value The first condition. * @returns {GC.Spread.Sheets.ConditionalFormatting.Condition} If no value is set, returns the first condition; otherwise, returns the relation condition. * @example * ```javascript * //This example validates a date. * var condition1 = new GC.Spread.Sheets.ConditionalFormatting.Condition(GC.Spread.Sheets.ConditionalFormatting.ConditionType.dateCondition, {compareType: GC.Spread.Sheets.ConditionalFormatting.DateCompareType.afterEqualsTo, expected: new Date(2012, 11, 31)}); * var condition2 = new GC.Spread.Sheets.ConditionalFormatting.Condition(GC.Spread.Sheets.ConditionalFormatting.ConditionType.dateCondition, {compareType: GC.Spread.Sheets.ConditionalFormatting.DateCompareType.beforeEqualsTo, expected: new Date(2013, 11, 31)}); * var nCondition = new GC.Spread.Sheets.ConditionalFormatting.Condition(GC.Spread.Sheets.ConditionalFormatting.ConditionType.relationCondition); * nCondition.compareType(GC.Spread.Sheets.ConditionalFormatting.LogicalOperators.and); * nCondition.item1(condition1); * nCondition.item2(condition2); * var validator = new GC.Spread.Sheets.DataValidation.DefaultDataValidator(nCondition); * validator.type(GC.Spread.Sheets.DataValidation.CriteriaType.custom); * activeSheet.getCell(0, 0, GC.Spread.Sheets.SheetArea.viewport).validator(validator); * spread.options.highlightInvalidData = true; * activeSheet.setValue(0, 0, new Date(2012, 11, 25)); * ``` */ item1(value?: GC.Spread.Sheets.ConditionalFormatting.Condition): GC.Spread.Sheets.ConditionalFormatting.Condition; /** * Gets or sets the second condition. * @param {GC.Spread.Sheets.ConditionalFormatting.Condition} value The second condition. * @returns {GC.Spread.Sheets.ConditionalFormatting.Condition} If no value is set, returns the second condition; otherwise, returns the relation condition. * @example * ```javascript * //This example validates a date. * var condition1 = new GC.Spread.Sheets.ConditionalFormatting.Condition(GC.Spread.Sheets.ConditionalFormatting.ConditionType.dateCondition, {compareType: GC.Spread.Sheets.ConditionalFormatting.DateCompareType.afterEqualsTo, expected: new Date(2012, 11, 31)}); * var condition2 = new GC.Spread.Sheets.ConditionalFormatting.Condition(GC.Spread.Sheets.ConditionalFormatting.ConditionType.dateCondition, {compareType: GC.Spread.Sheets.ConditionalFormatting.DateCompareType.beforeEqualsTo, expected: new Date(2013, 11, 31)}); * var nCondition = new GC.Spread.Sheets.ConditionalFormatting.Condition(GC.Spread.Sheets.ConditionalFormatting.ConditionType.relationCondition); * nCondition.compareType(GC.Spread.Sheets.ConditionalFormatting.LogicalOperators.and); * nCondition.item1(condition1); * nCondition.item2(condition2); * var validator = new GC.Spread.Sheets.DataValidation.DefaultDataValidator(nCondition); * validator.type(GC.Spread.Sheets.DataValidation.CriteriaType.custom); * activeSheet.getCell(0, 0, GC.Spread.Sheets.SheetArea.viewport).validator(validator); * spread.options.highlightInvalidData = true; * activeSheet.setValue(0, 0, new Date(2012, 11, 25)); * ``` */ item2(value?: GC.Spread.Sheets.ConditionalFormatting.Condition): GC.Spread.Sheets.ConditionalFormatting.Condition; /** * Gets or sets whether to compare whole day or precise date time. * @param {boolean} value Indicates compare whole day or precise date time. * @returns {boolean | GC.Spread.Sheets.DataValidation.DefaultDataValidator} If no value is set, returns compare whole day or precise date time; otherwise, returns the data validator. * @example * ```javascript * //This example uses the preciseCompareDate method. * var dateCondition = new GC.Spread.Sheets.ConditionalFormatting.Condition(GC.Spread.Sheets.ConditionalFormatting.ConditionType.dateCondition); * dateCondition.compareType(GC.Spread.Sheets.ConditionalFormatting.DateCompareType.after); * dateCondition.expected(new Date(2020, 4, 22, 6)); * //When the option is false, the validator compares the whole day, and they are the same, so validation fails and the red alert is displayed. * //When the option is true, the date time 7 o'clock is greater than 6 o'clock, so the result is successful. * var validator = new GC.Spread.Sheets.DataValidation.DefaultDataValidator(dateCondition); * validator.type(GC.Spread.Sheets.DataValidation.CriteriaType.date); * validator.preciseCompareDate(true); * activeSheet.getCell(0, 0, GC.Spread.Sheets.SheetArea.viewport).validator(validator); * spread.options.highlightInvalidData = true; * activeSheet.setValue(0, 0, new Date(2020, 4, 22, 7)); * ``` */ preciseCompareDate(value?: boolean): any; /** * Gets or sets the condition ranges. * @param {GC.Spread.Sheets.Range[]} value The condition ranges. * @returns {GC.Spread.Sheets.Range[] | GC.Spread.Sheets.ConditionalFormatting.Condition} If no value is set, returns the condition ranges; otherwise, returns the condition. * @example * ```javascript * //This example creates a unique condition. * var nCondition = new GC.Spread.Sheets.ConditionalFormatting.Condition(GC.Spread.Sheets.ConditionalFormatting.ConditionType.uniqueCondition); * nCondition.expected(true); * nCondition.ranges([new GC.Spread.Sheets.Range(0, 0, 5, 1)]); * var validator = new GC.Spread.Sheets.DataValidation.DefaultDataValidator(nCondition); * validator.type(GC.Spread.Sheets.DataValidation.CriteriaType.custom); * activeSheet.getCell(0, 0, GC.Spread.Sheets.SheetArea.viewport).validator(validator); * spread.options.highlightInvalidData = true; * activeSheet.setValue(0, 0, 5); * ``` */ ranges(value?: GC.Spread.Sheets.Range[]): any; /** * Resets this instance. * @example * ```javascript * var nCondition = new GC.Spread.Sheets.ConditionalFormatting.Condition(GC.Spread.Sheets.ConditionalFormatting.ConditionType.numberCondition); * nCondition.compareType(GC.Spread.Sheets.ConditionalFormatting.ComparisonOperators.greaterThan); * nCondition.expected(5); * var validator = new GC.Spread.Sheets.DataValidation.DefaultDataValidator(nCondition); * validator.type(GC.Spread.Sheets.DataValidation.CriteriaType.custom); * activeSheet.getCell(0, 0, GC.Spread.Sheets.SheetArea.viewport).validator(validator); * spread.options.highlightInvalidData = true; * activeSheet.setValue(0, 0, 5); * //Create a button * $("#button1").click(function () { * activeSheet.suspendPaint(); * nCondition.reset(); * activeSheet.resumePaint(); * }); * ``` */ reset(): void; /** * Gets or sets whether to treat the null value in a cell as zero. * @param {boolean} value Whether to treat the null value in a cell as zero. * @returns {boolean | GC.Spread.Sheets.ConditionalFormatting.Condition} If no value is set, returns whether to treat the null value in a cell as zero; otherwise, returns the condition. * @example * ```javascript * //This example sets the treatNullValueAsZero method. * var nCondition = new GC.Spread.Sheets.ConditionalFormatting.Condition(GC.Spread.Sheets.ConditionalFormatting.ConditionType.cellValueCondition); * nCondition.compareType(GC.Spread.Sheets.ConditionalFormatting.GeneralComparisonOperators.equalsTo); * nCondition.expected(0); * //When the option is false, the validation fails and the red alert is displayed. * //When the option is true, the blank cell is treated as zero and the validation is successful. * nCondition.treatNullValueAsZero(false); * var validator = new GC.Spread.Sheets.DataValidation.DefaultDataValidator(nCondition); * validator.type(GC.Spread.Sheets.DataValidation.CriteriaType.custom); * validator.ignoreBlank(false); * activeSheet.getCell(0, 0, GC.Spread.Sheets.SheetArea.viewport).validator(validator); * spread.options.highlightInvalidData = true; * activeSheet.setValue(0, 0, null); * ``` */ treatNullValueAsZero(value?: boolean): any; /** * Gets or sets whether to compare strings using wildcards. * @param {boolean} value Whether to compare strings using wildcards. * @returns {boolean | GC.Spread.Sheets.ConditionalFormatting.Condition} If no value is set, returns whether to compare strings using wildcards; otherwise, returns the condition. * @example * ```javascript * //This example allows wildcards. * var nCondition = new GC.Spread.Sheets.ConditionalFormatting.Condition(GC.Spread.Sheets.ConditionalFormatting.ConditionType.textCondition); * nCondition.compareType(GC.Spread.Sheets.ConditionalFormatting.TextCompareType.contains); * nCondition.expected("te?t"); * nCondition.ignoreBlank(true); * nCondition.ignoreCase(true); * nCondition.useWildCards(true); * var validator = new GC.Spread.Sheets.DataValidation.DefaultDataValidator(nCondition); * validator.type(GC.Spread.Sheets.DataValidation.CriteriaType.custom); * activeSheet.getCell(0, 0, GC.Spread.Sheets.SheetArea.viewport).validator(validator); * spread.options.highlightInvalidData = true; * activeSheet.setValue(0, 0, "testing"); * ``` */ useWildCards(value?: boolean): any; } export class ConditionalFormats{ /** * Represents a format condition class. * @class * @param {GC.Spread.Sheets.Worksheet} worksheet The sheet. */ constructor(worksheet: GC.Spread.Sheets.Worksheet); /** * Adds the two scale rule to the rule collection. * @param {GC.Spread.Sheets.ConditionalFormatting.ScaleValueType} minType The minimum scale type. * @param {number} minValue The minimum scale value. * @param {string} minColor The minimum scale color. * @param {GC.Spread.Sheets.ConditionalFormatting.ScaleValueType} maxType The maximum scale type. * @param {number} maxValue The maximum scale value. * @param {string} maxColor The maximum scale color. * @param {GC.Spread.Sheets.Range[]} ranges The cell ranges where the rule is applied whose item type is GC.Spread.Sheets.Range. * @returns {GC.Spread.Sheets.ConditionalFormatting.ConditionRuleBase} The two scale rule added to the rule collection. * @example * ```javascript * //This example uses the add2ScaleRule method. * activeSheet.conditionalFormats.add2ScaleRule(GC.Spread.Sheets.ConditionalFormatting.ScaleValueType.number,10,"Red",GC.Spread.Sheets.ConditionalFormatting.ScaleValueType.number,100,"Yellow", [new GC.Spread.Sheets.Range(0,0,10,3)]); * activeSheet.setValue(0,0, 1,3); * activeSheet.setValue(1,0, 50,3); * activeSheet.setValue(2,0, 100,3); * ``` */ add2ScaleRule(minType: GC.Spread.Sheets.ConditionalFormatting.ScaleValueType, minValue: number, minColor: string, maxType: GC.Spread.Sheets.ConditionalFormatting.ScaleValueType, maxValue: number, maxColor: string, ranges: GC.Spread.Sheets.Range[]): GC.Spread.Sheets.ConditionalFormatting.ConditionRuleBase; /** * Adds the three scale rule to the rule collection. * @param {GC.Spread.Sheets.ConditionalFormatting.ScaleValueType} minType The minimum scale type. * @param {number} minValue The minimum scale value. * @param {string} minColor The minimum scale color. * @param {GC.Spread.Sheets.ConditionalFormatting.ScaleValueType} midType The midpoint scale type. * @param {number} midValue The midpoint scale value. * @param {string} midColor The midpoint scale color. * @param {GC.Spread.Sheets.ConditionalFormatting.ScaleValueType} maxType The maximum scale type. * @param {number} maxValue The maximum scale value. * @param {string} maxColor The maximum scale color. * @param {GC.Spread.Sheets.Range[]} ranges The cell ranges where the rule is applied whose item type is GC.Spread.Sheets.Range. * @returns {GC.Spread.Sheets.ConditionalFormatting.ConditionRuleBase} The three scale rule added to the rule collection. * @example * ```javascript * //This example uses the add3ScaleRule method. * activeSheet.setValue(0,0, 1,3); * activeSheet.setValue(1,0, 50,3); * activeSheet.setValue(2,0, 100,3); * activeSheet.conditionalFormats.add3ScaleRule(1, 10, "red", 0, 50, "blue",2, 100, "yellow", [new GC.Spread.Sheets.Range(0, 0, 10, 3)]); * ``` */ add3ScaleRule(minType: GC.Spread.Sheets.ConditionalFormatting.ScaleValueType, minValue: number, minColor: string, midType: GC.Spread.Sheets.ConditionalFormatting.ScaleValueType, midValue: number, midColor: string, maxType: GC.Spread.Sheets.ConditionalFormatting.ScaleValueType, maxValue: number, maxColor: string, ranges: GC.Spread.Sheets.Range[]): GC.Spread.Sheets.ConditionalFormatting.ConditionRuleBase; /** * Adds an average rule to the rule collection. * @param {GC.Spread.Sheets.ConditionalFormatting.AverageConditionType} type The average condition type. * @param {GC.Spread.Sheets.Style} style The style that is applied to the cell when the condition is met. * @param {GC.Spread.Sheets.Range[]} ranges The cell ranges where the rule is applied whose item type is GC.Spread.Sheets.Range. * @returns {GC.Spread.Sheets.ConditionalFormatting.ConditionRuleBase} The average rule added to the rule collection. * @example * ```javascript * //This example uses the addAverageRule method. * activeSheet.setValue(0,0, 1,3); * activeSheet.setValue(1,0, 50,3); * activeSheet.setValue(2,0, 100,3); * activeSheet.setValue(3,0, 2,3); * activeSheet.setValue(4,0, 60,3); * activeSheet.setValue(5,0, 90,3); * activeSheet.setValue(6,0, 3,3); * activeSheet.setValue(7,0, 40,3); * activeSheet.setValue(8,0, 70,3); * activeSheet.setValue(9,0, 5,3); * activeSheet.setValue(10,0, 35,3); * var style = new GC.Spread.Sheets.Style(); * style.backColor = "red"; * style.borderLeft =new GC.Spread.Sheets.LineBorder("blue",GC.Spread.Sheets.LineStyle.medium); * style.borderTop = new GC.Spread.Sheets.LineBorder("blue",GC.Spread.Sheets.LineStyle.medium); * style.borderRight = new GC.Spread.Sheets.LineBorder("blue",GC.Spread.Sheets.LineStyle.medium); * style.borderBottom = new GC.Spread.Sheets.LineBorder("blue",GC.Spread.Sheets.LineStyle.medium); * activeSheet.conditionalFormats.addAverageRule(GC.Spread.Sheets.ConditionalFormatting.AverageConditionType.above,style,[new GC.Spread.Sheets.Range(0, 0, 10, 3)]); * ``` */ addAverageRule(type: GC.Spread.Sheets.ConditionalFormatting.AverageConditionType, style: GC.Spread.Sheets.Style, ranges: GC.Spread.Sheets.Range[]): GC.Spread.Sheets.ConditionalFormatting.ConditionRuleBase; /** * Adds the cell value rule to the rule collection. * @param {GC.Spread.Sheets.ConditionalFormatting.ComparisonOperators} comparisonOperator The comparison operator. * @param {Object} value1 The first value. * @param {Object} value2 The second value. * @param {GC.Spread.Sheets.Style} style The style that is applied to the cell when the condition is met. * @param {GC.Spread.Sheets.Range[]} ranges The cell ranges where the rule is applied whose item type is GC.Spread.Sheets.Range. * @returns {GC.Spread.Sheets.ConditionalFormatting.ConditionRuleBase} The cell value rule added to the rule collection. * @example * ```javascript * //This example uses the addCellValueRule method. * var style = new GC.Spread.Sheets.Style(); * style.backColor = "red"; * var ranges=[new GC.Spread.Sheets.Range(0,0,5,1)]; * activeSheet.conditionalFormats.addCellValueRule(GC.Spread.Sheets.ConditionalFormatting.ComparisonOperators.between, 2, 100, style, ranges); * activeSheet.setValue(0,0,1,3); * activeSheet.setValue(1,0,45,3); * ``` */ addCellValueRule(comparisonOperator: GC.Spread.Sheets.ConditionalFormatting.ComparisonOperators, value1: Object, value2: Object, style: GC.Spread.Sheets.Style, ranges: GC.Spread.Sheets.Range[]): GC.Spread.Sheets.ConditionalFormatting.ConditionRuleBase; /** * Adds a column state rule to the rule collection. * @param {GC.Spread.Sheets.RowColumnStates} state The state type. * @param {GC.Spread.Sheets.Style | GC.Spread.Sheets.Style[]} style The row style if the columns are matched the state. It could be an array of styles. * @param {GC.Spread.Sheets.Range[]} ranges The ranges where the rule is applied whose item type is GC.Spread.Sheets.Range. * @returns {GC.Spread.Sheets.ConditionalFormatting.ConditionRuleBase} The state rule added to the rule collection. * @example * ```javascript * // Add a hover state rule in column direction. * activeSheet.conditionalFormats.addColumnStateRule(GC.Spread.Sheets.RowColumnStates.hover, new GC.Spread.Sheets.Style("yellow"), [new GC.Spread.Sheets.Range(-1, -1, -1, -1)]); * activeSheet.conditionalFormats.addColumnStateRule( * GC.Spread.Sheets.RowColumnStates.hover, * [new GC.Spread.Sheets.Style("green"), new GC.Spread.Sheets.Style("red")], * [new GC.Spread.Sheets.Range(1, 1, 10, 5), new GC.Spread.Sheets.Range(13, 1, 10, 5)] * ); * ``` */ addColumnStateRule(state: GC.Spread.Sheets.RowColumnStates, style: GC.Spread.Sheets.Style | GC.Spread.Sheets.Style[], ranges: GC.Spread.Sheets.Range[]): GC.Spread.Sheets.ConditionalFormatting.ConditionRuleBase; /** * Adds a data bar rule to the rule collection. * @param {GC.Spread.Sheets.ConditionalFormatting.ScaleValueType} minType The minimum scale type. * @param {number} minValue The minimum scale value. * @param {GC.Spread.Sheets.ConditionalFormatting.ScaleValueType} maxType The maximum scale type. * @param {number} maxValue The maximum scale value. * @param {string} color The color data bar to show on the view. * @param {GC.Spread.Sheets.Range[]} ranges The cell ranges where the rule is applied whose item type is GC.Spread.Sheets.Range. * @returns {GC.Spread.Sheets.ConditionalFormatting.ConditionRuleBase} The data bar rule added to the rule collection. * @example * ```javascript * //This example uses the addDataBarRule method. * activeSheet.setValue(0,0,1,3); * activeSheet.setValue(1,0,15,3); * activeSheet.setValue(2,0,25,3); * activeSheet.setValue(3,0,-1,3); * activeSheet.conditionalFormats.addDataBarRule(GC.Spread.Sheets.ConditionalFormatting.ScaleValueType.number, -1, GC.Spread.Sheets.ConditionalFormatting.ScaleValueType.number, 40, "orange", [new GC.Spread.Sheets.Range(0,0,4,1)]); * ``` */ addDataBarRule(minType: GC.Spread.Sheets.ConditionalFormatting.ScaleValueType, minValue: number, maxType: GC.Spread.Sheets.ConditionalFormatting.ScaleValueType, maxValue: number, color: string, ranges: GC.Spread.Sheets.Range[]): GC.Spread.Sheets.ConditionalFormatting.ConditionRuleBase; /** * Adds the date occurring rule to the rule collection. * @param {GC.Spread.Sheets.ConditionalFormatting.DateOccurringType} type The data occurring type. * @param {GC.Spread.Sheets.Style} style The style that is applied to the cell when the condition is met. * @param {GC.Spread.Sheets.Range[]} ranges The cell ranges where the rule is applied whose item type is GC.Spread.Sheets.Range. * @returns {GC.Spread.Sheets.ConditionalFormatting.ConditionRuleBase} The date occurring rule added to the rule collection. * @example * ```javascript * //This example uses the addDateOccurringRule method. * var style = new GC.Spread.Sheets.Style(); * style.backColor = "red"; * var d = new Date(); * activeSheet.setValue(0, 0, d); * activeSheet.setValue(1, 0, new Date(d.setDate(d.getDate()+1))); * activeSheet.setValue(2, 0, new Date(d.setDate(d.getDate()+5))); * activeSheet.setValue(3, 0,new Date(d.setDate(d.getDate()+6))); * activeSheet.setValue(4, 0,new Date(d.setDate(d.getDate()+7))); * activeSheet.setValue(5, 0, new Date(d.setDate(d.getDate()+8))); * activeSheet.conditionalFormats.addDateOccurringRule(GC.Spread.Sheets.ConditionalFormatting.DateOccurringType.nextWeek, style, [new GC.Spread.Sheets.Range(0,0,10,1)]); * ``` */ addDateOccurringRule(type:GC.Spread.Sheets.ConditionalFormatting.DateOccurringType, style: GC.Spread.Sheets.Style, ranges: GC.Spread.Sheets.Range[]): GC.Spread.Sheets.ConditionalFormatting.ConditionRuleBase; /** * Adds a duplicate rule to the rule collection. * @param {GC.Spread.Sheets.Style} style The style that is applied to the cell when the condition is met. * @param {GC.Spread.Sheets.Range[]} ranges The cell ranges where the rule is applied whose item type is GC.Spread.Sheets.Range. * @returns {GC.Spread.Sheets.ConditionalFormatting.ConditionRuleBase} The duplicate rule added to the rule collection. * @example * ```javascript * //This example uses the addDuplicateRule method. * var style = new GC.Spread.Sheets.Style(); * style.backColor = "yellow"; * var ranges=[new GC.Spread.Sheets.Range(0,0,10,1)]; * activeSheet.conditionalFormats.addDuplicateRule(style, ranges); * activeSheet.setValue(0, 0, 50); * activeSheet.setValue(1, 0, 50); * activeSheet.setValue(2, 0, 11); * activeSheet.setValue(3, 0, 5); * ``` */ addDuplicateRule(style: GC.Spread.Sheets.Style, ranges: GC.Spread.Sheets.Range[]): GC.Spread.Sheets.ConditionalFormatting.ConditionRuleBase; /** * Adds the formula rule to the rule collection. * @param {string} formula The condition formula. * @param {GC.Spread.Sheets.Style} style The style that is applied to the cell when the condition is met. * @param {GC.Spread.Sheets.Range[]} ranges The cell ranges where the rule is applied whose item type is GC.Spread.Sheets.Range. * @returns {GC.Spread.Sheets.ConditionalFormatting.ConditionRuleBase} The formula rule added to the rule collection. * @example * ```javascript * //This example uses the addFormulaRule method. * var style = new GC.Spread.Sheets.Style(); * style.backColor = "red"; * var ranges = [new GC.Spread.Sheets.Range(0, 0, 2, 1)]; * activeSheet.conditionalFormats.addFormulaRule("=A1=B1+C1", style, ranges); * activeSheet.setValue(0, 0, 2,3); * activeSheet.setValue(0, 1, 1,3); * activeSheet.setValue(0, 2,1,3); * activeSheet.setValue(1, 0, 1,3); * ``` */ addFormulaRule(formula: string, style: GC.Spread.Sheets.Style, ranges: GC.Spread.Sheets.Range[]): GC.Spread.Sheets.ConditionalFormatting.ConditionRuleBase; /** * Adds an icon set rule to the rule collection. * @param {GC.Spread.Sheets.ConditionalFormatting.IconSetType} iconSetType The type of icon set. * @param {GC.Spread.Sheets.Range[]} ranges The cell ranges where the rule is applied whose item type is GC.Spread.Sheets.Range. * @returns {GC.Spread.Sheets.ConditionalFormatting.ConditionRuleBase} The icon set rule added to the rule collection. * @example * ```javascript * //This example uses the addIconSetRule method. * activeSheet.setValue(0,0,1,3); * activeSheet.setValue(1,0,15,3); * activeSheet.setValue(2,0,25,3); * activeSheet.setValue(3,0,-1,3); * activeSheet.conditionalFormats.addIconSetRule(GC.Spread.Sheets.ConditionalFormatting.IconSetType.fourTrafficLights, [new GC.Spread.Sheets.Range(0,0,4,1)]); * ``` */ addIconSetRule(iconSetTye: GC.Spread.Sheets.ConditionalFormatting.IconSetType, ranges: GC.Spread.Sheets.Range[]): GC.Spread.Sheets.ConditionalFormatting.ConditionRuleBase; /** * Adds a row state rule to the rule collection. * @param {GC.Spread.Sheets.RowColumnStates} state The state type. * @param {GC.Spread.Sheets.Style | GC.Spread.Sheets.Style[]} style The row style if the rows are matched the state. It could be an array of styles. * @param {GC.Spread.Sheets.Range[]} ranges The ranges where the rule is applied whose item type is GC.Spread.Sheets.Range. * @returns {GC.Spread.Sheets.ConditionalFormatting.ConditionRuleBase} The state rule added to the rule collection. * @example * ```javascript * // Add a hover state rule in row direction. * activeSheet.conditionalFormats.addRowStateRule(GC.Spread.Sheets.RowColumnStates.hover, new GC.Spread.Sheets.Style("yellow"), [new GC.Spread.Sheets.Range(-1, -1, -1, -1)]); * // Add a hover state rule with variable styles * activeSheet.conditionalFormats.addRowStateRule( * GC.Spread.Sheets.RowColumnStates.hover, * [new GC.Spread.Sheets.Style("green"), new GC.Spread.Sheets.Style("red")], * [new GC.Spread.Sheets.Range(1, 1, 10, 5), new GC.Spread.Sheets.Range(1, 7, 10, 5)] * ); * ``` */ addRowStateRule(state: GC.Spread.Sheets.RowColumnStates, style: GC.Spread.Sheets.Style | GC.Spread.Sheets.Style[], ranges: GC.Spread.Sheets.Range[]): GC.Spread.Sheets.ConditionalFormatting.ConditionRuleBase; /** * Adds the rule. * @param {GC.Spread.Sheets.ConditionalFormatting.ConditionRuleBase} rule The rule to add. * @returns {GC.Spread.Sheets.ConditionalFormatting.ConditionRuleBase} * @example * ```javascript * //This example uses the addRule method. * var scale = new GC.Spread.Sheets.ConditionalFormatting.ScaleRule(); * scale.ruleType(GC.Spread.Sheets.ConditionalFormatting.RuleType.threeScaleRule); * scale.midColor("red"); * scale.midType(GC.Spread.Sheets.ConditionalFormatting.ScaleValueType.number); * scale.midValue(50); * scale.maxColor("blue"); * scale.maxType(GC.Spread.Sheets.ConditionalFormatting.ScaleValueType.number); * scale.maxValue(100); * scale.minColor("yellow"); * scale.minType(GC.Spread.Sheets.ConditionalFormatting.ScaleValueType.number); * scale.minValue(10); * scale.ranges([new GC.Spread.Sheets.Range(0, 0, 10, 3)]); * activeSheet.conditionalFormats.addRule(scale); * activeSheet.setValue(0,0, 1,3); * activeSheet.setValue(1,0, 50,3); * activeSheet.setValue(2,0, 100,3); * ``` */ addRule(rule: GC.Spread.Sheets.ConditionalFormatting.ConditionRuleBase): GC.Spread.Sheets.ConditionalFormatting.ConditionRuleBase; /** * Adds the text rule to the rule collection. * @param {GC.Spread.Sheets.ConditionalFormatting.TextComparisonOperators} comparisonOperator The comparison operator. * @param {string} text The text for comparison. * @param {GC.Spread.Sheets.Style} style The style that is applied to the cell when the condition is met. * @param {GC.Spread.Sheets.Range[]} ranges The cell ranges where the rule is applied to items whose item type is GC.Spread.Sheets.Range. * @returns {GC.Spread.Sheets.ConditionalFormatting.ConditionRuleBase} The text rule added to the rule collection. * @example * ```javascript * //This example uses the addSpecificTextRule method. * var style = new GC.Spread.Sheets.Style(); * style.backColor = "red"; * var ranges=[new GC.Spread.Sheets.Range(0,0,10,1)]; * activeSheet.conditionalFormats.addSpecificTextRule(GC.Spread.Sheets.ConditionalFormatting.TextComparisonOperators.contains, "test", style, ranges); * activeSheet.setValue(0, 0, "testing"); * activeSheet.setValue(1, 0, "test"); * activeSheet.setValue(2, 0, "a"); * activeSheet.setValue(3, 0, "t"); * ``` */ addSpecificTextRule(comparisonOperator: GC.Spread.Sheets.ConditionalFormatting.TextComparisonOperators, text: string, style: GC.Spread.Sheets.Style, ranges: GC.Spread.Sheets.Range[]): GC.Spread.Sheets.ConditionalFormatting.ConditionRuleBase; /** * Adds the top 10 rule or bottom 10 rule to the collection based on the Top10ConditionType object. * @param {GC.Spread.Sheets.ConditionalFormatting.Top10ConditionType} type The top 10 condition. * @param {number} rank The number of top or bottom items to apply the style to. * @param {GC.Spread.Sheets.Style} style The style that is applied to the cell when the condition is met. * @param {GC.Spread.Sheets.Range[]} ranges The cell ranges where the rule is applied whose item type is GC.Spread.Sheets.Range. * @returns {GC.Spread.Sheets.ConditionalFormatting.ConditionRuleBase} The top 10 rule added to the rule collection. * @example * ```javascript * //This example uses the addTop10Rule method. * var style = new GC.Spread.Sheets.Style(); * style.backColor = "red"; * var ranges=[new GC.Spread.Sheets.Range(0,0,10,1)]; * activeSheet.conditionalFormats.addTop10Rule(GC.Spread.Sheets.ConditionalFormatting.Top10ConditionType.top, 2, style, ranges); * activeSheet.setValue(0, 0, 1); * activeSheet.setValue(1, 0, 50); * activeSheet.setValue(2, 0, 11); * activeSheet.setValue(3, 0, 5); * ``` */ addTop10Rule(type: GC.Spread.Sheets.ConditionalFormatting.Top10ConditionType, rank: number, style: GC.Spread.Sheets.Style, ranges: GC.Spread.Sheets.Range[]): GC.Spread.Sheets.ConditionalFormatting.ConditionRuleBase; /** * Adds a unique rule to the rule collection. * @param {GC.Spread.Sheets.Style} style The style that is applied to the cell when the condition is met. * @param {GC.Spread.Sheets.Range[]} ranges The cell ranges where the rule is applied whose item type is GC.Spread.Sheets.Range. * @returns {GC.Spread.Sheets.ConditionalFormatting.ConditionRuleBase} The unique rule added to the rule collection. * @example * ```javascript * //This example uses the addUniqueRule method. * var style = new GC.Spread.Sheets.Style(); * style.backColor = "green"; * activeSheet.setValue(0, 0, 50); * activeSheet.setValue(1, 0, 50); * activeSheet.setValue(2, 0, 11); * activeSheet.setValue(3, 0, 5); * activeSheet.conditionalFormats.addUniqueRule(style, [new GC.Spread.Sheets.Range(0,0,10,1)]); * ``` */ addUniqueRule(style: GC.Spread.Sheets.Style, ranges: GC.Spread.Sheets.Range[]): GC.Spread.Sheets.ConditionalFormatting.ConditionRuleBase; /** * Removes all rules. * @example * ```javascript * //This example uses the clearRule method. * activeSheet.setValue(0,0, 1,3); * activeSheet.setValue(1,0, 50,3); * activeSheet.setValue(2,0, 100,3); * activeSheet.conditionalFormats.add2ScaleRule(GC.Spread.Sheets.ConditionalFormatting.ScaleValueType.number, 10, "red", GC.Spread.Sheets.ConditionalFormatting.ScaleValueType.number, 100, "yellow", [new GC.Spread.Sheets.Range(0, 0, 10, 3)]); * // Remove comment in front of method to test * //activeSheet.conditionalFormats.clearRule(); * ``` */ clearRule(): void; /** * Determines whether the specified cell contains a specified rule. * @param {GC.Spread.Sheets.ConditionalFormatting.ConditionRuleBase} rule The rule for which to check. * @param {number} row The row index. * @param {number} column The column index. * @returns {boolean} `true` if the specified cell contains a specified rule; otherwise, `false`. * @example * ```javascript * //This example checks to see if a cell has a specified rule. * var style = new GC.Spread.Sheets.Style(); * style.backColor = "red"; * var rule = new GC.Spread.Sheets.ConditionalFormatting.NormalConditionRule(); * rule.ruleType(GC.Spread.Sheets.ConditionalFormatting.RuleType.cellValueRule); * rule.ranges([new GC.Spread.Sheets.Range(0,0,5,1)]); * rule.operator(GC.Spread.Sheets.ConditionalFormatting.ComparisonOperators.between); * rule.style(style); * rule.value1(2); * rule.value2(100); * activeSheet.conditionalFormats.addRule(rule); * activeSheet.setValue(0,0,1,3); * activeSheet.setValue(1,0,45,3); * var ruletest = activeSheet.conditionalFormats.containsRule(rule, 0, 0); * alert(ruletest); * ``` */ containsRule(rule: GC.Spread.Sheets.ConditionalFormatting.ConditionRuleBase, row: number, column: number): boolean; /** * Gets the number of rule objects in the collection. * @returns {number} The number of rule objects in the collection. * @example * ```javascript * //This example counts the rules. * var style = new GC.Spread.Sheets.Style(); * style.backColor = "red"; * var rule = new GC.Spread.Sheets.ConditionalFormatting.NormalConditionRule(); * rule.ruleType(GC.Spread.Sheets.ConditionalFormatting.RuleType.cellValueRule); * rule.ranges([new GC.Spread.Sheets.Range(0,0,5,1)]); * rule.operator(GC.Spread.Sheets.ConditionalFormatting.ComparisonOperators.between); * rule.style(style); * rule.value1(2); * rule.value2(100); * activeSheet.conditionalFormats.addRule(rule); * activeSheet.setValue(0,0,1,3); * activeSheet.setValue(1,0,45,3); * var ruletest = activeSheet.conditionalFormats.count(); * alert(ruletest); * ``` */ count(): number; /** * Gets the rule using the index. * @param {number} index The index from which to get the rule. * @returns {GC.Spread.Sheets.ConditionalFormatting.ConditionRuleBase} The rule from the index. * @example * ```javascript * //This example uses the getRule method. * var style = new GC.Spread.Sheets.Style(); * style.backColor = "red"; * var rule = new GC.Spread.Sheets.ConditionalFormatting.NormalConditionRule(); * rule.ruleType(GC.Spread.Sheets.ConditionalFormatting.RuleType.cellValueRule); * rule.ranges([new GC.Spread.Sheets.Range(0,0,5,1)]); * rule.operator(GC.Spread.Sheets.ConditionalFormatting.ComparisonOperators.between); * rule.style(style); * rule.value1(2); * rule.value2(100); * activeSheet.conditionalFormats.addRule(rule); * activeSheet.setValue(0,0,1,3); * activeSheet.setValue(1,0,45,3); * var ruletest = activeSheet.conditionalFormats.getRule(0); * alert(ruletest.value1()); * ``` */ getRule(index: number): GC.Spread.Sheets.ConditionalFormatting.ConditionRuleBase; /** * Gets the conditional rules from the cell at the specified row and column. * @param {number} row The row index. * @param {number} column The column index. * @returns {GC.Spread.Sheets.ConditionalFormatting.ConditionRuleBase[]} The conditional rules. * @example * ```javascript * //This example uses the getRules method. * var style = new GC.Spread.Sheets.Style(); * style.backColor = "red"; * var rule = new GC.Spread.Sheets.ConditionalFormatting.NormalConditionRule(); * rule.ruleType(GC.Spread.Sheets.ConditionalFormatting.RuleType.cellValueRule); * rule.ranges([new GC.Spread.Sheets.Range(0,0,5,1)]); * rule.operator(GC.Spread.Sheets.ConditionalFormatting.ComparisonOperators.between); * rule.style(style); * rule.value1(2); * rule.value2(100); * activeSheet.conditionalFormats.addRule(rule); * activeSheet.setValue(0,0,1,3); * activeSheet.setValue(1,0,45,3); * var ruletest = activeSheet.conditionalFormats.getRules(); * alert(ruletest[0].style().backColor); * ``` */ getRules(row: number, column: number): GC.Spread.Sheets.ConditionalFormatting.ConditionRuleBase[]; /** * Removes a rule object from the ConditionalFormats object. * @param {GC.Spread.Sheets.ConditionalFormatting.ConditionRuleBase} rule The rule object to remove from the ConditionalFormats object. * @example * ```javascript * //This example uses the removeRule method. * var style = new GC.Spread.Sheets.Style(); * style.backColor = "red"; * var rule = new GC.Spread.Sheets.ConditionalFormatting.NormalConditionRule(); * rule.ruleType(GC.Spread.Sheets.ConditionalFormatting.RuleType.cellValueRule); * rule.ranges([new GC.Spread.Sheets.Range(0,0,5,1)]); * rule.operator(GC.Spread.Sheets.ConditionalFormatting.ComparisonOperators.between); * rule.style(style); * rule.value1(2); * rule.value2(100); * activeSheet.conditionalFormats.addRule(rule); * activeSheet.setValue(0,0,1,3); * activeSheet.setValue(1,0,45,3); * activeSheet.conditionalFormats.removeRule(rule); * ``` */ removeRule(rule: GC.Spread.Sheets.ConditionalFormatting.ConditionRuleBase): void; /** * Removes the rules from a specified cell range. * @param {number} row The row index of the first cell in the range. * @param {number} column The column index of the first cell in the range. * @param {number} rowCount The number of rows in the range. * @param {number} columnCount The number of columns in the range. * @example * ```javascript * //This example uses the removeRuleByRange method. * var style = new GC.Spread.Sheets.Style(); * style.backColor = "red"; * var rule = new GC.Spread.Sheets.ConditionalFormatting.NormalConditionRule(); * rule.ruleType(GC.Spread.Sheets.ConditionalFormatting.RuleType.cellValueRule); * rule.ranges([new GC.Spread.Sheets.Range(0,0,5,1)]); * rule.operator(GC.Spread.Sheets.ConditionalFormatting.ComparisonOperators.between); * rule.style(style); * rule.value1(2); * rule.value2(100); * activeSheet.conditionalFormats.addRule(rule); * activeSheet.setValue(0,0,1,3); * activeSheet.setValue(1,0,45,3); * activeSheet.conditionalFormats.removeRuleByRange(0, 0, 5, 1); * ``` */ removeRuleByRange(row: number, column: number, rowCount: number, columnCount: number): void; } export class ConditionRuleBase{ /** * Represents a formatting base rule class as the specified style. * @param {GC.Spread.Sheets.ConditionalFormatting.RuleType} ruleType The type of condition formatting rule. * @param {GC.Spread.Sheets.Style} style The style for the rule. * @param {GC.Spread.Sheets.Range[]} ranges The range array. * @class */ constructor(ruleType: GC.Spread.Sheets.ConditionalFormatting.RuleType, style: GC.Spread.Sheets.Style, ranges: GC.Spread.Sheets.Range[]); /** * Gets or sets the base condition of the rule. * @param {GC.Spread.Sheets.ConditionalFormatting.Condition} value The base condition of the rule. * @returns {GC.Spread.Sheets.ConditionalFormatting.Condition | GC.Spread.Sheets.ConditionalFormatting.ConditionRuleBase} If no value is set, returns the base condition of the rule; otherwise, returns the condition rule. */ condition(value?: GC.Spread.Sheets.ConditionalFormatting.Condition): any; /** * Determines whether the range of cells contains the cell at the specified row and column. * @param {number} row The row index. * @param {number} column The column index. * @returns {boolean} `true` if the range of cells contains the cell at the specified row and column; otherwise, `false`. */ contains(row: number, column: number): boolean; /** * Creates condition for the rule. * @returns {GC.Spread.Sheets.ConditionalFormatting.Condition} The condition. */ createCondition(): GC.Spread.Sheets.ConditionalFormatting.Condition; /** * Returns the cell style of the rule if the cell satisfies the condition. * @param {Object} evaluator The object that can evaluate a condition. * @param {number} baseRow The row index. * @param {number} baseColumn The column index. * @param {Object} actual The actual value. * @returns {GC.Spread.Sheets.Style} The cell style of the rule. */ evaluate(evaluator: Object, baseRow: number, baseColumn: number, actual: Object): GC.Spread.Sheets.Style; /** * Gets the style of the base rule. * @returns {GC.Spread.Sheets.Style} * @example * ```javascript * //This example uses the getExpected method. * activeSheet.suspendPaint(); * var style = new GC.Spread.Sheets.Style(); * style.backColor = "green"; * var ranges = [new GC.Spread.Sheets.Range(0, 0, 10, 1)]; * activeSheet.conditionalFormats.addUniqueRule(style, ranges); * var data = [50, 50, 11, 5, 3, 6, 7, 8, 7, 11]; * var condition = activeSheet.conditionalFormats.getRules()[0]; * for (var i = 0; i < 10;i++){ * activeSheet.setValue(i, 0, data[i]); * } * activeSheet.resumePaint(); * console.log(condition.getExpected()); * ``` */ getExpected(): GC.Spread.Sheets.Style; /** * Specifies whether the range for this rule intersects another range. * @param {number} row The row index. * @param {number} column The column index. * @param {number} rowCount The number of rows. * @param {number} columnCount The number of columns. * @example * ```javascript * //This example uses the intersects method. * activeSheet.suspendPaint(); * var style = new GC.Spread.Sheets.Style(); * style.backColor = "green"; * var ranges = [new GC.Spread.Sheets.Range(0, 0, 10, 1)]; * activeSheet.conditionalFormats.addUniqueRule(style, ranges); * var data = [50, 50, 11, 5, 3, 6, 7, 8, 7, 11]; * var condition = activeSheet.conditionalFormats.getRules()[0]; * for (var i = 0; i < 10; i++) { * activeSheet.setValue(i, 0, data[i]); * } * activeSheet.resumePaint(); * activeSheet.bind(GC.Spread.Sheets.Events.SelectionChanged, function(e, info) { * var selection = info.newSelections[0]; * var result = condition.intersects(selection.row, selection.col, selection.rowCount, selection.colCount); * if (result) { * alert("current selection is intersects with condition formatting range"); * } else { * alert("current selection is not intersects with condition formatting range"); * } * }); * ``` * @returns {boolean} `true` if the range for this rule intersects another range; otherwise, `false`. */ intersects(row: number, column: number, rowCount: number, columnCount: number): boolean; /** * Specifies whether this rule is a scale rule. * @returns {boolean} `true` if this rule is a scale rule; otherwise, `false`. */ isScaleRule(): boolean; /** * Gets or sets the priority of the rule. * @param {number} value The priority of the rule. * @returns {number | GC.Spread.Sheets.ConditionalFormatting.ConditionRuleBase} If no value is set, returns the priority of the rule; otherwise, returns the condition rule. */ priority(value?: number): any; /** * Gets or sets the condition rule ranges. * @param {GC.Spread.Sheets.Range[]} value The condition rule ranges. * @returns {GC.Spread.Sheets.Range[] | GC.Spread.Sheets.ConditionalFormatting.ConditionRuleBase} If no value is set, returns the condition rule ranges; otherwise, returns the condition rule. * @example * ```javascript * var style = new GC.Spread.Sheets.Style(); * style.backColor = "green"; * var ranges = [new GC.Spread.Sheets.Range(0, 0, 10, 1)]; * activeSheet.conditionalFormats.addUniqueRule(style, ranges); * activeSheet.setValue(0, 0, 50); * activeSheet.setValue(1, 0, 50); * activeSheet.setValue(2, 0, 11); * activeSheet.setValue(3, 0, 5); * ``` */ ranges(value?: GC.Spread.Sheets.Range[]): any; /** * Resets the rule. * @example * ```javascript * activeSheet.setArray(0, 0, [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]); * var style = new GC.Spread.Sheets.Style(); * style.backColor = "red"; * style.foreColor = "black"; * var cell = new GC.Spread.Sheets.ConditionalFormatting.NormalConditionRule(); * cell.ruleType(GC.Spread.Sheets.ConditionalFormatting.RuleType.cellValueRule); * cell.operator(GC.Spread.Sheets.ConditionalFormatting.ComparisonOperators.greaterThan); * cell.value1(2); * cell.ranges([new GC.Spread.Sheets.Range(0, 0, 10, 1)]); * cell.style(style); * activeSheet.conditionalFormats.addRule(cell); * var style = new GC.Spread.Sheets.Style(); * style.cellButtons = [{ * caption: "Reset", * useButtonStyle: true, * width: 60, * command: function(sheet) { * cell.reset(); * sheet.resumePaint(); * } * }]; * activeSheet.setStyle(16, 4, style); * ``` */ reset(): void; /** * Gets or sets the condition rule type. * @param {GC.Spread.Sheets.ConditionalFormatting.RuleType} value The condition rule type. * @returns {GC.Spread.Sheets.ConditionalFormatting.RuleType | GC.Spread.Sheets.ConditionalFormatting.ConditionRuleBase} If no value is set, returns the condition rule type; otherwise, returns the condition rule. * @example * ```javascript * //This example uses the ruleType method. * activeSheet.setArray(0,0,[1,2,3,4,5,6,7,8,9,10]); * var style = new GC.Spread.Sheets.Style(); * style.backColor = "red"; * style.foreColor = "black"; * var cell = new GC.Spread.Sheets.ConditionalFormatting.NormalConditionRule(); * cell.ruleType(GC.Spread.Sheets.ConditionalFormatting.RuleType.cellValueRule); * cell.operator(GC.Spread.Sheets.ConditionalFormatting.ComparisonOperators.greaterThan); * cell.value1(5); * cell.ranges([new GC.Spread.Sheets.Range(0, 0, 10, 1)]); * cell.style(style); * activeSheet.conditionalFormats.addRule(cell); * var style1 = new GC.Spread.Sheets.Style(); * style1.foreColor = "red"; * var top = new GC.Spread.Sheets.ConditionalFormatting.NormalConditionRule(); * top.ruleType(GC.Spread.Sheets.ConditionalFormatting.RuleType.top10Rule); * top.type(GC.Spread.Sheets.ConditionalFormatting.Top10ConditionType.top); * top.rank(3); * top.style(style1); * top.ranges([new GC.Spread.Sheets.Range(0, 0, 10, 1)]); * top.stopIfTrue(true); * activeSheet.conditionalFormats.addRule(top); * ``` */ ruleType(value?: GC.Spread.Sheets.ConditionalFormatting.RuleType): any; /** * Gets or sets whether rules with lower priority are applied before this rule. * @param {boolean} value Whether rules with lower priority are applied before this rule. * @returns {boolean | GC.Spread.Sheets.ConditionalFormatting.ConditionRuleBase} If no value is set, returns whether the rules with lower priority are not applied before this rule; otherwise, returns the condition rule. * @example * ```javascript * //This example applies multiple rules. * activeSheet.setArray(0,0,[1,2,3,4,5,6,7,8,9,10]); * var style = new GC.Spread.Sheets.Style(); * style.backColor = "red"; * style.foreColor = "black"; * var cell = new GC.Spread.Sheets.ConditionalFormatting.NormalConditionRule(); * cell.ruleType(GC.Spread.Sheets.ConditionalFormatting.RuleType.cellValueRule); * cell.operator(GC.Spread.Sheets.ConditionalFormatting.ComparisonOperators.greaterThan); * cell.value1(5); * cell.ranges([new GC.Spread.Sheets.Range(0, 0, 10, 1)]); * cell.style(style); * activeSheet.conditionalFormats.addRule(cell); * var style1 = new GC.Spread.Sheets.Style(); * style1.foreColor = "red"; * var top = new GC.Spread.Sheets.ConditionalFormatting.NormalConditionRule(); * top.ruleType(GC.Spread.Sheets.ConditionalFormatting.RuleType.top10Rule); * top.type(GC.Spread.Sheets.ConditionalFormatting.Top10ConditionType.top); * top.rank(3); * top.style(style1); * top.ranges([new GC.Spread.Sheets.Range(0, 0, 10, 1)]); * top.stopIfTrue(true); * activeSheet.conditionalFormats.addRule(top); * ``` */ stopIfTrue(value?: boolean): any; /** * Gets or sets the style for the rule. * @param {GC.Spread.Sheets.Style} value The style for the rule. * @returns {GC.Spread.Sheets.Style | GC.Spread.Sheets.ConditionalFormatting.ConditionRuleBase} If no value is set, returns the style for the rule; otherwise, returns the condition rule. * @example * ```javascript * //This example applies multiple rules. * activeSheet.setArray(0,0,[1,2,3,4,5,6,7,8,9,10]); * var style = new GC.Spread.Sheets.Style(); * style.backColor = "red"; * style.foreColor = "black"; * var cell = new GC.Spread.Sheets.ConditionalFormatting.NormalConditionRule(); * cell.ruleType(GC.Spread.Sheets.ConditionalFormatting.RuleType.cellValueRule); * cell.operator(GC.Spread.Sheets.ConditionalFormatting.ComparisonOperators.greaterThan); * cell.value1(5); * cell.ranges([new GC.Spread.Sheets.Range(0, 0, 10, 1)]); * cell.style(style); * activeSheet.conditionalFormats.addRule(cell); * var style1 = new GC.Spread.Sheets.Style(); * style1.foreColor = "red"; * var top = new GC.Spread.Sheets.ConditionalFormatting.NormalConditionRule(); * top.ruleType(GC.Spread.Sheets.ConditionalFormatting.RuleType.top10Rule); * top.type(GC.Spread.Sheets.ConditionalFormatting.Top10ConditionType.top); * top.rank(3); * top.style(style1); * top.ranges([new GC.Spread.Sheets.Range(0, 0, 10, 1)]); * top.stopIfTrue(true); * activeSheet.conditionalFormats.addRule(top); * ``` */ style(value?: GC.Spread.Sheets.Style): any; } export class DataBarRule extends ScaleRule{ /** * Represents a data bar conditional rule with the specified parameters. * @extends GC.Spread.Sheets.ConditionalFormatting.ScaleRule * @param {GC.Spread.Sheets.ConditionalFormatting.ScaleValueType} minType The minimum scale type. * @param {number | string} minValue The minimum scale value. * @param {GC.Spread.Sheets.ConditionalFormatting.ScaleValueType} maxType The maximum scale type. * @param {number | string} maxValue The maximum scale value. * @param {string} color The fill color of the data bar. * @param {GC.Spread.Sheets.Range[]} ranges The data bar rule effected range. * @class * @example * ```javascript * //This example creates a data bar rule. * activeSheet.setValue(0,0,1,3); * activeSheet.setValue(1,0,15,3); * activeSheet.setValue(2,0,25,3); * activeSheet.setValue(3,0,-1,3); * var dataBarRule = new GC.Spread.Sheets.ConditionalFormatting.DataBarRule(GC.Spread.Sheets.ConditionalFormatting.ScaleValueType.number, -1, GC.Spread.Sheets.ConditionalFormatting.ScaleValueType.number, 40, "green", [new GC.Spread.Sheets.Range(0,0,4,1)]); * dataBarRule.color("green"); * dataBarRule.showBorder(true); * dataBarRule.borderColor("orange"); * dataBarRule.dataBarDirection(GC.Spread.Sheets.ConditionalFormatting.BarDirection.leftToRight); * dataBarRule.negativeFillColor("yellow"); * dataBarRule.useNegativeFillColor(true); * dataBarRule.negativeBorderColor("red"); * dataBarRule.useNegativeBorderColor(true); * dataBarRule.axisPosition(GC.Spread.Sheets.ConditionalFormatting.DataBarAxisPosition.automatic); * dataBarRule.axisColor("blue"); * dataBarRule.showBarOnly(false); * activeSheet.conditionalFormats.addRule(dataBarRule); * ``` */ constructor(minType: GC.Spread.Sheets.ConditionalFormatting.ScaleValueType, minValue: number | string, maxType: GC.Spread.Sheets.ConditionalFormatting.ScaleValueType, maxValue: number | string, color: string, ranges: GC.Spread.Sheets.Range[]); /** * Gets or sets the axis color of the data bar. * @param {string} value The axis color of the data bar. * @returns {string | GC.Spread.Sheets.ConditionalFormatting.DataBarRule} If no value is set, returns the axis color of the data bar; otherwise, returns the data bar rule. * @example * ```javascript * //This example uses the axisColor method. * activeSheet.setValue(0,0,1,3); * activeSheet.setValue(1,0,15,3); * activeSheet.setValue(2,0,25,3); * activeSheet.setValue(3,0,-1,3); * //rule * var dataBarRule = new GC.Spread.Sheets.ConditionalFormatting.DataBarRule(); * dataBarRule.ranges([new GC.Spread.Sheets.Range(0,0,4,1)]); * dataBarRule.minType(GC.Spread.Sheets.ConditionalFormatting.ScaleValueType.number); * dataBarRule.minValue(-1); * dataBarRule.maxType(GC.Spread.Sheets.ConditionalFormatting.ScaleValueType.number); * dataBarRule.maxValue(40); * dataBarRule.color("green"); * dataBarRule.showBorder(true); * dataBarRule.borderColor("orange"); * dataBarRule.dataBarDirection(GC.Spread.Sheets.ConditionalFormatting.BarDirection.leftToRight); * dataBarRule.negativeFillColor("yellow"); * dataBarRule.useNegativeFillColor(true); * dataBarRule.negativeBorderColor("red"); * dataBarRule.useNegativeBorderColor(true); * dataBarRule.axisPosition(GC.Spread.Sheets.ConditionalFormatting.DataBarAxisPosition.automatic); * dataBarRule.axisColor("blue"); * dataBarRule.showBarOnly(false); * activeSheet.conditionalFormats.addRule(dataBarRule); * ``` */ axisColor(value?: string): any; /** * Gets or sets the axis position of the data bar. * @param {GC.Spread.Sheets.ConditionalFormatting.DataBarAxisPosition} value The axis position of the data bar. * @returns {GC.Spread.Sheets.ConditionalFormatting.DataBarAxisPosition | GC.Spread.Sheets.ConditionalFormatting.DataBarRule} If no value is set, returns the axis position of the data bar; otherwise, returns the data bar rule. * @example * ```javascript * //This example uses the axisPosition method. * activeSheet.setValue(0,0,1,3); * activeSheet.setValue(1,0,15,3); * activeSheet.setValue(2,0,25,3); * activeSheet.setValue(3,0,-1,3); * //rule * var dataBarRule = new GC.Spread.Sheets.ConditionalFormatting.DataBarRule(); * dataBarRule.ranges([new GC.Spread.Sheets.Range(0,0,4,1)]); * dataBarRule.minType(GC.Spread.Sheets.ConditionalFormatting.ScaleValueType.number); * dataBarRule.minValue(-1); * dataBarRule.maxType(GC.Spread.Sheets.ConditionalFormatting.ScaleValueType.number); * dataBarRule.maxValue(40); * dataBarRule.color("green"); * dataBarRule.showBorder(true); * dataBarRule.borderColor("orange"); * dataBarRule.dataBarDirection(GC.Spread.Sheets.ConditionalFormatting.BarDirection.leftToRight); * dataBarRule.negativeFillColor("yellow"); * dataBarRule.useNegativeFillColor(true); * dataBarRule.negativeBorderColor("red"); * dataBarRule.useNegativeBorderColor(true); * dataBarRule.axisPosition(GC.Spread.Sheets.ConditionalFormatting.DataBarAxisPosition.automatic); * dataBarRule.axisColor("blue"); * dataBarRule.showBarOnly(false); * activeSheet.conditionalFormats.addRule(dataBarRule); * ``` */ axisPosition(value?: GC.Spread.Sheets.ConditionalFormatting.DataBarAxisPosition): any; /** * Gets or sets the color of the border. * @param {string} value The color of the border. * @returns {string | GC.Spread.Sheets.ConditionalFormatting.DataBarRule} If no value is set, returns the color of the border; otherwise, returns the data bar rule. * @example * ```javascript * //This example uses the borderColor method. * activeSheet.setValue(0,0,1,3); * activeSheet.setValue(1,0,15,3); * activeSheet.setValue(2,0,25,3); * activeSheet.setValue(3,0,-1,3); * //rule * var dataBarRule = new GC.Spread.Sheets.ConditionalFormatting.DataBarRule(); * dataBarRule.ranges([new GC.Spread.Sheets.Range(0,0,4,1)]); * dataBarRule.minType(GC.Spread.Sheets.ConditionalFormatting.ScaleValueType.number); * dataBarRule.minValue(-1); * dataBarRule.maxType(GC.Spread.Sheets.ConditionalFormatting.ScaleValueType.number); * dataBarRule.maxValue(40); * dataBarRule.color("green"); * dataBarRule.showBorder(true); * dataBarRule.borderColor("orange"); * dataBarRule.dataBarDirection(GC.Spread.Sheets.ConditionalFormatting.BarDirection.leftToRight); * dataBarRule.negativeFillColor("yellow"); * dataBarRule.useNegativeFillColor(true); * dataBarRule.negativeBorderColor("red"); * dataBarRule.useNegativeBorderColor(true); * dataBarRule.axisPosition(GC.Spread.Sheets.ConditionalFormatting.DataBarAxisPosition.automatic); * dataBarRule.axisColor("blue"); * dataBarRule.showBarOnly(false); * activeSheet.conditionalFormats.addRule(dataBarRule); * ``` */ borderColor(value?: string): any; /** * Gets or sets the positive fill color of the data bar. * @param {string} value The fill color. * @returns {string | GC.Spread.Sheets.ConditionalFormatting.DataBarRule} If no value is set, returns the positive fill color of the data bar; otherwise, returns the data bar rule. * @example * ```javascript * //This example uses the color method. * activeSheet.setValue(0,0,1,3); * activeSheet.setValue(1,0,15,3); * activeSheet.setValue(2,0,25,3); * activeSheet.setValue(3,0,-1,3); * //rule * var dataBarRule = new GC.Spread.Sheets.ConditionalFormatting.DataBarRule(); * dataBarRule.ranges([new GC.Spread.Sheets.Range(0,0,4,1)]); * dataBarRule.minType(GC.Spread.Sheets.ConditionalFormatting.ScaleValueType.number); * dataBarRule.minValue(-1); * dataBarRule.maxType(GC.Spread.Sheets.ConditionalFormatting.ScaleValueType.number); * dataBarRule.maxValue(40); * dataBarRule.color("green"); * dataBarRule.showBorder(true); * dataBarRule.borderColor("orange"); * dataBarRule.dataBarDirection(GC.Spread.Sheets.ConditionalFormatting.BarDirection.leftToRight); * dataBarRule.negativeFillColor("yellow"); * dataBarRule.useNegativeFillColor(true); * dataBarRule.negativeBorderColor("red"); * dataBarRule.useNegativeBorderColor(true); * dataBarRule.axisPosition(GC.Spread.Sheets.ConditionalFormatting.DataBarAxisPosition.automatic); * dataBarRule.axisColor("blue"); * dataBarRule.showBarOnly(false); * activeSheet.conditionalFormats.addRule(dataBarRule); * ``` */ color(value?: string): any; /** * Gets or sets the data bar direction. * @param {GC.Spread.Sheets.ConditionalFormatting.BarDirection} value The data bar direction. * @returns {GC.Spread.Sheets.ConditionalFormatting.BarDirection | GC.Spread.Sheets.ConditionalFormatting.DataBarRule} If no value is set, returns the data bar direction; otherwise, returns the data bar rule. * @example * ```javascript * //This example uses the dataBarDirection method. * activeSheet.setValue(0,0,1,3); * activeSheet.setValue(1,0,15,3); * activeSheet.setValue(2,0,25,3); * activeSheet.setValue(3,0,-1,3); * //rule * var dataBarRule = new GC.Spread.Sheets.ConditionalFormatting.DataBarRule(); * dataBarRule.ranges([new GC.Spread.Sheets.Range(0,0,4,1)]); * dataBarRule.minType(GC.Spread.Sheets.ConditionalFormatting.ScaleValueType.number); * dataBarRule.minValue(-1); * dataBarRule.maxType(GC.Spread.Sheets.ConditionalFormatting.ScaleValueType.number); * dataBarRule.maxValue(40); * dataBarRule.color("green"); * dataBarRule.showBorder(true); * dataBarRule.borderColor("orange"); * dataBarRule.dataBarDirection(GC.Spread.Sheets.ConditionalFormatting.BarDirection.leftToRight); * dataBarRule.negativeFillColor("yellow"); * dataBarRule.useNegativeFillColor(true); * dataBarRule.negativeBorderColor("red"); * dataBarRule.useNegativeBorderColor(true); * dataBarRule.axisPosition(GC.Spread.Sheets.ConditionalFormatting.DataBarAxisPosition.automatic); * dataBarRule.axisColor("blue"); * dataBarRule.showBarOnly(false); * activeSheet.conditionalFormats.addRule(dataBarRule); * ``` */ dataBarDirection(value?: GC.Spread.Sheets.ConditionalFormatting.BarDirection): any; /** * Returns the specified value of the rule if the cell meets the condition. * @param {Object} evaluator The evaluator. * @param {number} baseRow The row index. * @param {number} baseColumn The column index. * @param {Object} actual The current value. * @example * ```javascript * //This example uses the evaluate method. * var data = ["data", 1, 15, 25, -10]; * activeSheet.setArray(0, 0, data); * activeSheet.setValue(0, 1, "fillColor"); * activeSheet.setValue(0, 2, "borderColor"); * activeSheet.setColumnWidth(0, 200); * //rule * var dataBarRule = new GC.Spread.Sheets.ConditionalFormatting.DataBarRule(); * dataBarRule.ranges([new GC.Spread.Sheets.Range(0, 0, 5, 1)]); * dataBarRule.minType(GC.Spread.Sheets.ConditionalFormatting.ScaleValueType.number); * dataBarRule.minValue(-10); * dataBarRule.maxType(GC.Spread.Sheets.ConditionalFormatting.ScaleValueType.number); * dataBarRule.maxValue(40); * dataBarRule.color("green"); * dataBarRule.showBorder(true); * dataBarRule.borderColor("orange"); * dataBarRule.dataBarDirection(GC.Spread.Sheets.ConditionalFormatting.BarDirection.leftToRight); * dataBarRule.negativeFillColor("yellow"); * dataBarRule.useNegativeFillColor(true); * dataBarRule.negativeBorderColor("red"); * dataBarRule.useNegativeBorderColor(true); * dataBarRule.axisPosition(GC.Spread.Sheets.ConditionalFormatting.DataBarAxisPosition.automatic); * dataBarRule.axisColor("blue"); * dataBarRule.showBarOnly(false); * activeSheet.conditionalFormats.addRule(dataBarRule); * for (var i = 1; i < 5; i++) { * var evaluateResult = dataBarRule.evaluate(activeSheet, i, 0, activeSheet.getValue(i, 0)); * activeSheet.setValue(i, 1, evaluateResult.fillColor); * activeSheet.setValue(i, 2, evaluateResult.borderColor); * } * ``` * @returns {Object} The specified value of the rule if the cell meets the condition. */ evaluate(evaluator: Object, baseRow: number, baseColumn: number, actual: Object): any; /** * Gets or sets a value that indicates whether the data bar is a gradient. * @param {boolean} value Whether the data bar is a gradient. * @returns {boolean | GC.Spread.Sheets.ConditionalFormatting.DataBarRule} If no value is set, returns the value that indicates whether the data bar is a gradient; otherwise, returns the data bar rule. * @example * ```javascript * //This example uses the gradient method. * activeSheet.setValue(0,0,1,3); * activeSheet.setValue(1,0,15,3); * activeSheet.setValue(2,0,25,3); * activeSheet.setValue(3,0,-1,3); * var dataBarRule = new GC.Spread.Sheets.ConditionalFormatting.DataBarRule(); * dataBarRule.ranges([new GC.Spread.Sheets.Range(0,0,4,1)]); * dataBarRule.minType(GC.Spread.Sheets.ConditionalFormatting.ScaleValueType.number); * dataBarRule.minValue(-1); * dataBarRule.maxType(GC.Spread.Sheets.ConditionalFormatting.ScaleValueType.number); * dataBarRule.maxValue(40); * dataBarRule.color("green"); * dataBarRule.showBorder(true); * dataBarRule.borderColor("orange"); * dataBarRule.dataBarDirection(GC.Spread.Sheets.ConditionalFormatting.BarDirection.leftToRight); * dataBarRule.negativeFillColor("yellow"); * dataBarRule.useNegativeFillColor(true); * dataBarRule.negativeBorderColor("red"); * dataBarRule.useNegativeBorderColor(true); * dataBarRule.axisPosition(GC.Spread.Sheets.ConditionalFormatting.DataBarAxisPosition.automatic); * dataBarRule.axisColor("blue"); * dataBarRule.showBarOnly(false); * dataBarRule.gradient(false); * activeSheet.conditionalFormats.addRule(dataBarRule); * ``` */ gradient(value?: boolean): any; /** * Gets or sets the color of the negative border. * @param {string} value The color of the negative border. * @returns {string | GC.Spread.Sheets.ConditionalFormatting.DataBarRule} If no value is set, returns the color of the negative border; otherwise, returns the data bar rule. * @example * ```javascript * //This example uses the negativeBorderColor method. * activeSheet.setColumnWidth(0,400); * activeSheet.setValue(0,0,1,3); * activeSheet.setValue(1,0,15,3); * activeSheet.setValue(2,0,25,3); * activeSheet.setValue(3,0,-10,3); * var dataBarRule = new GC.Spread.Sheets.ConditionalFormatting.DataBarRule(); * dataBarRule.ranges([new GC.Spread.Sheets.Range(0,0,4,1)]); * dataBarRule.minType(GC.Spread.Sheets.ConditionalFormatting.ScaleValueType.number); * dataBarRule.minValue(-10); * dataBarRule.maxType(GC.Spread.Sheets.ConditionalFormatting.ScaleValueType.number); * dataBarRule.maxValue(40); * dataBarRule.color("green"); * dataBarRule.showBorder(true); * dataBarRule.borderColor("orange"); * dataBarRule.dataBarDirection(GC.Spread.Sheets.ConditionalFormatting.BarDirection.leftToRight); * dataBarRule.negativeFillColor("yellow"); * dataBarRule.useNegativeFillColor(true); * dataBarRule.negativeBorderColor("red"); * dataBarRule.useNegativeBorderColor(true); * dataBarRule.axisPosition(GC.Spread.Sheets.ConditionalFormatting.DataBarAxisPosition.automatic); * dataBarRule.axisColor("blue"); * dataBarRule.showBarOnly(false); * activeSheet.conditionalFormats.addRule(dataBarRule); * ``` */ negativeBorderColor(value?: string): any; /** * Gets or sets the color of the negative fill. * @param {string} value The color of the negative fill. * @returns {string | GC.Spread.Sheets.ConditionalFormatting.DataBarRule} If no value is set, returns the color of the negative fill; otherwise, returns the data bar rule. * @example * ```javascript * //This example uses the negativeFillColor method. * activeSheet.setColumnWidth(0,400); * activeSheet.setValue(0,0,1,3); * activeSheet.setValue(1,0,15,3); * activeSheet.setValue(2,0,25,3); * activeSheet.setValue(3,0,-10,3); * var dataBarRule = new GC.Spread.Sheets.ConditionalFormatting.DataBarRule(); * dataBarRule.ranges([new GC.Spread.Sheets.Range(0,0,4,1)]); * dataBarRule.minType(GC.Spread.Sheets.ConditionalFormatting.ScaleValueType.number); * dataBarRule.minValue(-10); * dataBarRule.maxType(GC.Spread.Sheets.ConditionalFormatting.ScaleValueType.number); * dataBarRule.maxValue(40); * dataBarRule.color("green"); * dataBarRule.showBorder(true); * dataBarRule.borderColor("orange"); * dataBarRule.dataBarDirection(GC.Spread.Sheets.ConditionalFormatting.BarDirection.leftToRight); * dataBarRule.negativeFillColor("yellow"); * dataBarRule.useNegativeFillColor(true); * dataBarRule.negativeBorderColor("red"); * dataBarRule.useNegativeBorderColor(true); * dataBarRule.axisPosition(GC.Spread.Sheets.ConditionalFormatting.DataBarAxisPosition.automatic); * dataBarRule.axisColor("blue"); * dataBarRule.showBarOnly(false); * activeSheet.conditionalFormats.addRule(dataBarRule); * ``` */ negativeFillColor(value?: string): any; /** * Gets or sets whether to display the data bar without text. * @param {boolean} value Whether to display the data bar without text. * @returns {boolean | GC.Spread.Sheets.ConditionalFormatting.DataBarRule} If no value is set, returns whether the widget displays the data bar without text; otherwise, returns the data bar rule. * @example * ```javascript * //This example uses the showBarOnly method. * activeSheet.setValue(0,0,1,3); * activeSheet.setValue(1,0,15,3); * activeSheet.setValue(2,0,25,3); * activeSheet.setValue(3,0,-1,3); * var dataBarRule = new GC.Spread.Sheets.ConditionalFormatting.DataBarRule(); * dataBarRule.ranges([new GC.Spread.Sheets.Range(0,0,4,1)]); * dataBarRule.minType(GC.Spread.Sheets.ConditionalFormatting.ScaleValueType.number); * dataBarRule.minValue(-1); * dataBarRule.maxType(GC.Spread.Sheets.ConditionalFormatting.ScaleValueType.number); * dataBarRule.maxValue(40); * dataBarRule.color("green"); * dataBarRule.showBorder(true); * dataBarRule.borderColor("orange"); * dataBarRule.dataBarDirection(GC.Spread.Sheets.ConditionalFormatting.BarDirection.leftToRight); * dataBarRule.negativeFillColor("yellow"); * dataBarRule.useNegativeFillColor(true); * dataBarRule.negativeBorderColor("red"); * dataBarRule.useNegativeBorderColor(true); * dataBarRule.axisPosition(GC.Spread.Sheets.ConditionalFormatting.DataBarAxisPosition.automatic); * dataBarRule.axisColor("blue"); * dataBarRule.showBarOnly(false); * activeSheet.conditionalFormats.addRule(dataBarRule); * ``` */ showBarOnly(value?: boolean): any; /** * Gets or sets a value that indicates whether to paint the border. * @param {boolean} value Whether to paint the border. * @returns {boolean | GC.Spread.Sheets.ConditionalFormatting.DataBarRule} If no value is set, returns the value that indicates whether to paint the border; otherwise, returns the data bar rule. * @example * ```javascript * //This example uses the showBorder method. * activeSheet.setValue(0,0,1,3); * activeSheet.setValue(1,0,15,3); * activeSheet.setValue(2,0,25,3); * activeSheet.setValue(3,0,-1,3); * var dataBarRule = new GC.Spread.Sheets.ConditionalFormatting.DataBarRule(); * dataBarRule.ranges([new GC.Spread.Sheets.Range(0,0,4,1)]); * dataBarRule.minType(GC.Spread.Sheets.ConditionalFormatting.ScaleValueType.number); * dataBarRule.minValue(-1); * dataBarRule.maxType(GC.Spread.Sheets.ConditionalFormatting.ScaleValueType.number); * dataBarRule.maxValue(40); * dataBarRule.color("green"); * dataBarRule.showBorder(true); * dataBarRule.borderColor("orange"); * dataBarRule.dataBarDirection(GC.Spread.Sheets.ConditionalFormatting.BarDirection.leftToRight); * dataBarRule.negativeFillColor("yellow"); * dataBarRule.useNegativeFillColor(true); * dataBarRule.negativeBorderColor("red"); * dataBarRule.useNegativeBorderColor(true); * dataBarRule.axisPosition(GC.Spread.Sheets.ConditionalFormatting.DataBarAxisPosition.automatic); * dataBarRule.axisColor("blue"); * dataBarRule.showBarOnly(false); * activeSheet.conditionalFormats.addRule(dataBarRule); * ``` */ showBorder(value?: boolean): any; /** * Gets or sets a value that indicates whether the negative border color is used to paint the border for the negative value. * @param {boolean} value Whether the negative border color is used to paint the border for the negative value. * @returns {boolean | GC.Spread.Sheets.ConditionalFormatting.DataBarRule} If no value is set, returns the value that indicates whether the negative border color is used to paint the border for the negative value; otherwise, returns the data bar rule. * @example * ```javascript * //This example uses the useNegativeBorderColor method. * activeSheet.setValue(0,0,1,3); * activeSheet.setValue(1,0,15,3); * activeSheet.setValue(2,0,25,3); * activeSheet.setValue(3,0,-1,3); * var dataBarRule = new GC.Spread.Sheets.ConditionalFormatting.DataBarRule(); * dataBarRule.ranges([new GC.Spread.Sheets.Range(0,0,4,1)]); * dataBarRule.minType(GC.Spread.Sheets.ConditionalFormatting.ScaleValueType.number); * dataBarRule.minValue(-1); * dataBarRule.maxType(GC.Spread.Sheets.ConditionalFormatting.ScaleValueType.number); * dataBarRule.maxValue(40); * dataBarRule.color("green"); * dataBarRule.showBorder(true); * dataBarRule.borderColor("orange"); * dataBarRule.dataBarDirection(GC.Spread.Sheets.ConditionalFormatting.BarDirection.leftToRight); * dataBarRule.negativeFillColor("yellow"); * dataBarRule.useNegativeFillColor(true); * dataBarRule.negativeBorderColor("red"); * dataBarRule.useNegativeBorderColor(true); * dataBarRule.axisPosition(GC.Spread.Sheets.ConditionalFormatting.DataBarAxisPosition.automatic); * dataBarRule.axisColor("blue"); * dataBarRule.showBarOnly(false); * activeSheet.conditionalFormats.addRule(dataBarRule); * ``` */ useNegativeBorderColor(value?: boolean): any; /** * Gets or sets a value that indicates whether the negative fill color is used to paint the negative value. * @param {boolean} value Whether the negative fill color is used to paint the negative value. * @returns {boolean | GC.Spread.Sheets.ConditionalFormatting.DataBarRule} If no value is set, returns the value that indicates whether the negative fill color is used to paint the negative value; otherwise, returns the data bar rule. * @example * ```javascript * //This example uses the useNegativeFillColor method. * activeSheet.setValue(0,0,1,3); * activeSheet.setValue(1,0,15,3); * activeSheet.setValue(2,0,25,3); * activeSheet.setValue(3,0,-1,3); * var dataBarRule = new GC.Spread.Sheets.ConditionalFormatting.DataBarRule(); * dataBarRule.ranges([new GC.Spread.Sheets.Range(0,0,4,1)]); * dataBarRule.minType(GC.Spread.Sheets.ConditionalFormatting.ScaleValueType.number); * dataBarRule.minValue(-1); * dataBarRule.maxType(GC.Spread.Sheets.ConditionalFormatting.ScaleValueType.number); * dataBarRule.maxValue(40); * dataBarRule.color("green"); * dataBarRule.showBorder(true); * dataBarRule.borderColor("orange"); * dataBarRule.dataBarDirection(GC.Spread.Sheets.ConditionalFormatting.BarDirection.leftToRight); * dataBarRule.negativeFillColor("yellow"); * dataBarRule.useNegativeFillColor(true); * dataBarRule.negativeBorderColor("red"); * dataBarRule.useNegativeBorderColor(true); * dataBarRule.axisPosition(GC.Spread.Sheets.ConditionalFormatting.DataBarAxisPosition.automatic); * dataBarRule.axisColor("blue"); * dataBarRule.showBarOnly(false); * activeSheet.conditionalFormats.addRule(dataBarRule); * ``` */ useNegativeFillColor(value?: boolean): any; } export class IconCriterion{ /** * Represents an icon criteria with the specified parameters. * @class * @param {boolean} isGreaterThanOrEqualTo If set to true, use the greater than or equal to operator to calculate the value. * @param {GC.Spread.Sheets.ConditionalFormatting.IconValueType} iconValueType The type of scale value. * @param {Object} iconValue The scale value. * @example * ```javascript * //This example creates an icon rule. * activeSheet.setValue(0,0,1,3); * activeSheet.setValue(1,0,15,3); * activeSheet.setValue(2,0,25,3); * activeSheet.setValue(3,0,-1,3); * //rule * var iconSetRule = new GC.Spread.Sheets.ConditionalFormatting.IconSetRule(); * iconSetRule.ranges([new GC.Spread.Sheets.Range(0,0,4,1)]); * iconSetRule.iconSetType(GC.Spread.Sheets.ConditionalFormatting.IconSetType.fourTrafficLights); * var iconCriteria = iconSetRule.iconCriteria(); * iconCriteria[0] = new GC.Spread.Sheets.ConditionalFormatting.IconCriterion(true, GC.Spread.Sheets.ConditionalFormatting.IconValueType.number, 1); * iconCriteria[1] = new GC.Spread.Sheets.ConditionalFormatting.IconCriterion(true, GC.Spread.Sheets.ConditionalFormatting.IconValueType.number, 10); * iconCriteria[2] = new GC.Spread.Sheets.ConditionalFormatting.IconCriterion(true, GC.Spread.Sheets.ConditionalFormatting.IconValueType.number, 20); * iconSetRule.reverseIconOrder(false); * iconSetRule.showIconOnly(false); * activeSheet.conditionalFormats.addRule(iconSetRule); * ``` */ constructor(isGreaterThanOrEqualTo: boolean, iconValueType: IconValueType, iconValue: Object); } export class IconSetRule extends ScaleRule{ /** * Represents an icon set rule with the specified parameters. * @class * @extends GC.Spread.Sheets.ConditionalFormatting.ScaleRule * @param {GC.Spread.Sheets.ConditionalFormatting.IconSetType} iconSetType The type of icon set. * @param {GC.Spread.Sheets.Range[]} ranges * @example * ```javascript * //This example creates a new icon set rule and sets the range and icon for it. * activeSheet.setValue(0,0,1,3); * activeSheet.setValue(1,0,15,3); * activeSheet.setValue(2,0,25,3); * activeSheet.setValue(3,0,-1,3); * var iconSetRule = new GC.Spread.Sheets.ConditionalFormatting.IconSetRule(); * iconSetRule.ranges([new GC.Spread.Sheets.Range(0,0,4,1)]); * iconSetRule.iconSetType(GC.Spread.Sheets.ConditionalFormatting.IconSetType.fourTrafficLights); * var icons = iconSetRule.icons(); * icons[0] = {iconSetType: GC.Spread.Sheets.ConditionalFormatting.IconSetType.fiveArrowsColored, iconIndex: 1}; * icons[1] = {iconSetType: GC.Spread.Sheets.ConditionalFormatting.IconSetType.fiveArrowsColored, iconIndex: 2}; * icons[2] = {iconSetType: GC.Spread.Sheets.ConditionalFormatting.IconSetType.noIcons, iconIndex: 0}; * * var iconCriteria = iconSetRule.iconCriteria(); * iconCriteria[0] = new GC.Spread.Sheets.ConditionalFormatting.IconCriterion(true, GC.Spread.Sheets.ConditionalFormatting.IconValueType.number, 1); * iconCriteria[1] = new GC.Spread.Sheets.ConditionalFormatting.IconCriterion(true, GC.Spread.Sheets.ConditionalFormatting.IconValueType.number, 10); * iconCriteria[2] = new GC.Spread.Sheets.ConditionalFormatting.IconCriterion(true, GC.Spread.Sheets.ConditionalFormatting.IconValueType.number, 20); * iconSetRule.reverseIconOrder(false); * iconSetRule.showIconOnly(false); * activeSheet.conditionalFormats.addRule(iconSetRule); * ``` */ constructor(iconSetType: IconSetType, ranges: GC.Spread.Sheets.Range[]); /** * Returns the specified value of the rule if the cell meets the condition. * @param {Object} evaluator The evaluator. * @param {number} baseRow The row index. * @param {number} baseColumn The column index. * @param {Object} actual The current value. * @example * ```javascript * activeSheet.setValue(0, 0, 1, 3); * activeSheet.setValue(1, 0, 15, 3); * activeSheet.setValue(2, 0, 25, 3); * activeSheet.setValue(3, 0, -1, 3); * var iconSetRule = new GC.Spread.Sheets.ConditionalFormatting.IconSetRule(); * iconSetRule.ranges([new GC.Spread.Sheets.Range(0, 0, 4, 1)]); * iconSetRule.iconSetType(GC.Spread.Sheets.ConditionalFormatting.IconSetType.fourTrafficLights); * activeSheet.conditionalFormats.addRule(iconSetRule); * for (var i = 1; i < 5; i++) { * var evaluateResult = iconSetRule.evaluate(activeSheet, i, 0, activeSheet.getValue(i, 0)); * console.log(evaluateResult); * } * ``` * @returns {Object} The specified value of the rule if the cell meets the condition. */ evaluate(evaluator: Object, baseRow: number, baseColumn: number, actual: Object): any; /** * Gets the icon based on the specific iconSetType and iconIndex objects. * @static * @param {GC.Spread.Sheets.ConditionalFormatting.IconSetType} iconSetType The icon set type. * @param {number} iconIndex The icon index. * @returns {object} An object that contains the image's URL string, the offset, and width and height. * If the user wants to customize the icon for IconSet, it returns the image URL string. * @example * ```javascript * //This example returns the icons for an icon set rule. * activeSheet.setValue(0,0,1,3); * activeSheet.setValue(1,0,15,3); * activeSheet.setValue(2,0,25,3); * activeSheet.setValue(3,0,-1,3); * //get the icon * var base = GC.Spread.Sheets.ConditionalFormatting.IconSetRule.getIcon; * GC.Spread.Sheets.ConditionalFormatting.IconSetRule.getIcon = function (iconSetType, iconIndex) { * var icon = base.apply(this, arguments); * if (iconSetType === GC.Spread.Sheets.ConditionalFormatting.IconSetType.threeArrowsColored) { * if (iconIndex === 0) { * return "images/Star2.png"; * } else if (iconIndex === 1){ * return "images/Rating4.png"; * } else if (iconIndex === 2) { * return "images/Box4.png"; * } * } * return icon; * }; * var iconSetRule = new GC.Spread.Sheets.ConditionalFormatting.IconSetRule(); * iconSetRule.ranges([new GC.Spread.Sheets.Range(0,0,4,1)]); * iconSetRule.iconSetType(GC.Spread.Sheets.ConditionalFormatting.IconSetType.threeArrowsColored); * var iconCriteria = iconSetRule.iconCriteria(); * iconCriteria[0] = new GC.Spread.Sheets.ConditionalFormatting.IconCriterion(true, GC.Spread.Sheets.ConditionalFormatting.IconValueType.number, 1); * iconCriteria[1] = new GC.Spread.Sheets.ConditionalFormatting.IconCriterion(true, GC.Spread.Sheets.ConditionalFormatting.IconValueType.number, 10); * iconCriteria[2] = new GC.Spread.Sheets.ConditionalFormatting.IconCriterion(true, GC.Spread.Sheets.ConditionalFormatting.IconValueType.number, 20); * iconSetRule.reverseIconOrder(false); * iconSetRule.showIconOnly(false); * activeSheet.conditionalFormats.addRule(iconSetRule); * ``` */ static getIcon(iconSetType: IconSetType, iconIndex: number): Object; /** * Gets the icon criteria. * @returns {GC.Spread.Sheets.ConditionalFormatting.IconCriterion[]} Returns the icon criterions whose item type is GC.Spread.Sheets.ConditionalFormatting.IconCriterion. * @example * ```javascript * //This example creates a rule. * activeSheet.setValue(0,0,1,3); * activeSheet.setValue(1,0,15,3); * activeSheet.setValue(2,0,25,3); * activeSheet.setValue(3,0,-1,3); * //rule * var iconSetRule = new GC.Spread.Sheets.ConditionalFormatting.IconSetRule(); * iconSetRule.ranges([new GC.Spread.Sheets.Range(0,0,4,1)]); * iconSetRule.iconSetType(GC.Spread.Sheets.ConditionalFormatting.IconSetType.fourTrafficLights); * var iconCriteria = iconSetRule.iconCriteria(); * iconCriteria[0] = new GC.Spread.Sheets.ConditionalFormatting.IconCriterion(true, GC.Spread.Sheets.ConditionalFormatting.IconValueType.number, 1); * iconCriteria[1] = new GC.Spread.Sheets.ConditionalFormatting.IconCriterion(true, GC.Spread.Sheets.ConditionalFormatting.IconValueType.number, 10); * iconCriteria[2] = new GC.Spread.Sheets.ConditionalFormatting.IconCriterion(true, GC.Spread.Sheets.ConditionalFormatting.IconValueType.number, 20); * iconSetRule.reverseIconOrder(false); * iconSetRule.showIconOnly(false); * activeSheet.conditionalFormats.addRule(iconSetRule); * ``` */ iconCriteria(): GC.Spread.Sheets.ConditionalFormatting.IconCriterion[]; /** * Gets or sets the icons. * @param {object[]} [iconInfos] - Sets the iconInfos array. * @param {GC.Spread.Sheets.ConditionalFormatting.IconSetType} iconInfos.iconSetType - The custom iconSetType * @param {number} iconInfos.iconIndex - The custom iconIndex * @returns {object[]} Returns the iconInfos array. * @example * ```javascript * //This example creates a rule. * activeSheet.setValue(0,0,1,3); * activeSheet.setValue(1,0,15,3); * activeSheet.setValue(2,0,25,3); * activeSheet.setValue(3,0,-1,3); * * //rule * var iconSetRule = new GC.Spread.Sheets.ConditionalFormatting.IconSetRule(); * iconSetRule.ranges([new GC.Spread.Sheets.Range(0,0,4,1)]); * iconSetRule.iconSetType(GC.Spread.Sheets.ConditionalFormatting.IconSetType.fourTrafficLights); * var icons = iconSetRule.icons(); * icons[0] = {iconSetType: GC.Spread.Sheets.ConditionalFormatting.IconSetType.fiveArrowsColored, iconIndex: 1}; * icons[1] = {iconSetType: GC.Spread.Sheets.ConditionalFormatting.IconSetType.fiveArrowsColored, iconIndex: 2}; * icons[2] = {iconSetType: GC.Spread.Sheets.ConditionalFormatting.IconSetType.noIcons, iconIndex: 0}; * iconSetRule.reverseIconOrder(false); * iconSetRule.showIconOnly(false); * activeSheet.conditionalFormats.addRule(iconSetRule); * ``` */ icons(value?: GC.Spread.Sheets.ConditionalFormatting.IIconInfo[]): GC.Spread.Sheets.ConditionalFormatting.IIconInfo[]; /** * Gets or sets the type of icon set. * @param {GC.Spread.Sheets.ConditionalFormatting.IconSetType} value The type of icon set. * @returns {GC.Spread.Sheets.ConditionalFormatting.IconSetType | GC.Spread.Sheets.ConditionalFormatting.IconSetRule} If no value is set, returns the type of icon set; otherwise, returns the icon set rule. * @example * ```javascript * //This example creates a rule. * activeSheet.setValue(0,0,1,3); * activeSheet.setValue(1,0,15,3); * activeSheet.setValue(2,0,25,3); * activeSheet.setValue(3,0,-1,3); * //rule * var iconSetRule = new GC.Spread.Sheets.ConditionalFormatting.IconSetRule(); * iconSetRule.ranges([new GC.Spread.Sheets.Range(0,0,4,1)]); * iconSetRule.iconSetType(GC.Spread.Sheets.ConditionalFormatting.IconSetType.fourTrafficLights); * var iconCriteria = iconSetRule.iconCriteria(); * iconCriteria[0] = new GC.Spread.Sheets.ConditionalFormatting.IconCriterion(true, GC.Spread.Sheets.ConditionalFormatting.IconValueType.number, 1); * iconCriteria[1] = new GC.Spread.Sheets.ConditionalFormatting.IconCriterion(true, GC.Spread.Sheets.ConditionalFormatting.IconValueType.number, 10); * iconCriteria[2] = new GC.Spread.Sheets.ConditionalFormatting.IconCriterion(true, GC.Spread.Sheets.ConditionalFormatting.IconValueType.number, 20); * iconSetRule.reverseIconOrder(false); * iconSetRule.showIconOnly(false); * activeSheet.conditionalFormats.addRule(iconSetRule); * ``` */ iconSetType(value?: GC.Spread.Sheets.ConditionalFormatting.IconSetType): any; /** * Resets the rule. * @example * ```javascript * //This example uses the reset method. * activeSheet.setValue(0,0,1,3); * activeSheet.setValue(1,0,15,3); * activeSheet.setValue(2,0,25,3); * activeSheet.setValue(3,0,-1,3); * //rule * var iconSetRule = new GC.Spread.Sheets.ConditionalFormatting.IconSetRule(); * iconSetRule.ranges([new GC.Spread.Sheets.Range(0,0,4,1)]); * iconSetRule.iconSetType(GC.Spread.Sheets.ConditionalFormatting.IconSetType.fourTrafficLights); * var iconCriteria = iconSetRule.iconCriteria(); * iconCriteria[0] = new GC.Spread.Sheets.ConditionalFormatting.IconCriterion(true, GC.Spread.Sheets.ConditionalFormatting.IconValueType.number, 1); * iconCriteria[1] = new GC.Spread.Sheets.ConditionalFormatting.IconCriterion(true, GC.Spread.Sheets.ConditionalFormatting.IconValueType.number, 10); * iconCriteria[2] = new GC.Spread.Sheets.ConditionalFormatting.IconCriterion(true, GC.Spread.Sheets.ConditionalFormatting.IconValueType.number, 20); * iconSetRule.reverseIconOrder(false); * iconSetRule.showIconOnly(false); * activeSheet.conditionalFormats.addRule(iconSetRule); * iconSetRule.reset(); * ``` */ reset(): void; /** * Gets or sets whether to reverse icon order. * @param {boolean} value Whether to reverse icon order. * @returns {boolean | GC.Spread.Sheets.ConditionalFormatting.IconSetRule} If no value is set, returns the value that indicates whether to reverse icon order; otherwise, returns the icon set rule. * @example * ```javascript * //This example creates a rule. * activeSheet.setValue(0,0,1,3); * activeSheet.setValue(1,0,15,3); * activeSheet.setValue(2,0,25,3); * activeSheet.setValue(3,0,-1,3); * //rule * var iconSetRule = new GC.Spread.Sheets.ConditionalFormatting.IconSetRule(); * iconSetRule.ranges([new GC.Spread.Sheets.Range(0,0,4,1)]); * iconSetRule.iconSetType(GC.Spread.Sheets.ConditionalFormatting.IconSetType.fourTrafficLights); * var iconCriteria = iconSetRule.iconCriteria(); * iconCriteria[0] = new GC.Spread.Sheets.ConditionalFormatting.IconCriterion(true, GC.Spread.Sheets.ConditionalFormatting.IconValueType.number, 1); * iconCriteria[1] = new GC.Spread.Sheets.ConditionalFormatting.IconCriterion(true, GC.Spread.Sheets.ConditionalFormatting.IconValueType.number, 10); * iconCriteria[2] = new GC.Spread.Sheets.ConditionalFormatting.IconCriterion(true, GC.Spread.Sheets.ConditionalFormatting.IconValueType.number, 20); * iconSetRule.reverseIconOrder(false); * iconSetRule.showIconOnly(false); * activeSheet.conditionalFormats.addRule(iconSetRule); * ``` */ reverseIconOrder(value?: boolean): any; /** * Gets or sets whether to display the icon only. * @param {boolean} value Whether to display the icon only. * @returns {boolean | GC.Spread.Sheets.ConditionalFormatting.IconSetRule} If no value is set, returns the value that indicates whether to display the icon only; otherwise, returns the icon set rule. * @example * ```javascript * //This example creates a rule. * activeSheet.setValue(0,0,1,3); * activeSheet.setValue(1,0,15,3); * activeSheet.setValue(2,0,25,3); * activeSheet.setValue(3,0,-1,3); * //rule * var iconSetRule = new GC.Spread.Sheets.ConditionalFormatting.IconSetRule(); * iconSetRule.ranges([new GC.Spread.Sheets.Range(0,0,4,1)]); * iconSetRule.iconSetType(GC.Spread.Sheets.ConditionalFormatting.IconSetType.fourTrafficLights); * var iconCriteria = iconSetRule.iconCriteria(); * iconCriteria[0] = new GC.Spread.Sheets.ConditionalFormatting.IconCriterion(true, GC.Spread.Sheets.ConditionalFormatting.IconValueType.number, 1); * iconCriteria[1] = new GC.Spread.Sheets.ConditionalFormatting.IconCriterion(true, GC.Spread.Sheets.ConditionalFormatting.IconValueType.number, 10); * iconCriteria[2] = new GC.Spread.Sheets.ConditionalFormatting.IconCriterion(true, GC.Spread.Sheets.ConditionalFormatting.IconValueType.number, 20); * iconSetRule.reverseIconOrder(false); * iconSetRule.showIconOnly(false); * activeSheet.conditionalFormats.addRule(iconSetRule); * ``` */ showIconOnly(value?: boolean): any; } export class NormalConditionRule extends ConditionRuleBase{ /** * Represents a normal conditional rule. * @class * @extends GC.Spread.Sheets.ConditionalFormatting.ConditionRuleBase * @param {GC.Spread.Sheets.ConditionalFormatting.RuleType} ruleType The type of condition formatting rule. * @param {GC.Spread.Sheets.Range[]} ranges The cell ranges where the rule is applied whose item type is GC.Spread.Sheets.Range. * @param {GC.Spread.Sheets.Style} style The style that is applied to the cell when the condition is met. * @param {GC.Spread.Sheets.ConditionalFormatting.LogicalOperators | GC.Spread.Sheets.ConditionalFormatting.ComparisonOperators | GC.Spread.Sheets.ConditionalFormatting.TextComparisonOperators} operator The comparison operator. * @param {Object} value1 The first value. * @param {Object} value2 The second value. * @param {string} text The text for comparison. * @param {string} formula The condition formula. * @param {GC.Spread.Sheets.ConditionalFormatting.Top10ConditionType | GC.Spread.Sheets.ConditionalFormatting.AverageConditionType | GC.Spread.Sheets.ConditionalFormatting.DateOccurringType} type The average condition type. * @param {number} rank The number of top or bottom items to apply the style to. * @constructor * @example * ```javascript * activeSheet.setArray(0,0,[1,2,3,4,5,6,7,8,9,10]); * var cell = new GC.Spread.Sheets.ConditionalFormatting.NormalConditionRule(); * cell.ruleType(GC.Spread.Sheets.ConditionalFormatting.RuleType.cellValueRule); * cell.operator(GC.Spread.Sheets.ConditionalFormatting.ComparisonOperators.greaterThan); * cell.value1(5); * cell.ranges([new GC.Spread.Sheets.Range(0, 0, 10, 1)]); * var style = new GC.Spread.Sheets.Style(); * style.backColor = "red"; * cell.style(style); * activeSheet.conditionalFormats.addRule(cell); * //button * $("#button1").click(function () { * cell.reset(); * activeSheet.suspendPaint(); * activeSheet.resumePaint(); * }); * ``` */ constructor(ruleType: GC.Spread.Sheets.ConditionalFormatting.RuleType, ranges: GC.Spread.Sheets.Range[], style: GC.Spread.Sheets.Style, operator: GC.Spread.Sheets.ConditionalFormatting.LogicalOperators | GC.Spread.Sheets.ConditionalFormatting.ComparisonOperators | GC.Spread.Sheets.ConditionalFormatting.TextComparisonOperators, value1: Object, value2: Object, text: string, formula: string, type: GC.Spread.Sheets.ConditionalFormatting.Top10ConditionType | GC.Spread.Sheets.ConditionalFormatting.AverageConditionType | GC.Spread.Sheets.ConditionalFormatting.DateOccurringType, rank: number); /** * Creates a condition for the rule. * @returns {GC.Spread.Sheets.ConditionalFormatting.Condition} The condition. */ createCondition(): GC.Spread.Sheets.ConditionalFormatting.Condition; /** * Gets or sets the condition formula. * @param {string | number} formulaOrBaseRow The condition formula or the base row. * @param {number} baseColumn The base column. * @returns {string | GC.Spread.Sheets.ConditionalFormatting.NormalConditionRule} If no value is set or baseRow and baseColumn is set, returns the condition formula; otherwise, returns the number condition rule. * @example * ```javascript * //This example uses the formula method. * var style = new GC.Spread.Sheets.Style(); * style.backColor = "red"; * var rule = new GC.Spread.Sheets.ConditionalFormatting.NormalConditionRule(); * rule.ruleType(GC.Spread.Sheets.ConditionalFormatting.RuleType.formulaRule); * rule.formula("=A1=B1+C1"); * rule.ranges([new GC.Spread.Sheets.Range(0, 0, 2, 1)]); * rule.style(style); * activeSheet.conditionalFormats.addRule(rule); * activeSheet.setValue(0, 0, 2,3); * activeSheet.setValue(0, 1, 1,3); * activeSheet.setValue(0, 2,1,3); * activeSheet.setValue(1, 0, 1,3); * var formulaOfTheTopLeftCell = rule.formula(); * var formulaOfA1 = rule.formula(0, 0); * var formulaOfA2 = rule.formula(1, 0); * ``` */ formula(formulaOrBaseRow?: string | number, baseColumn ?: number): any; /** * Gets or sets the comparison operator. * @param {GC.Spread.Sheets.ConditionalFormatting.ComparisonOperators} value The comparison operator. * @returns {GC.Spread.Sheets.ConditionalFormatting.ComparisonOperators | GC.Spread.Sheets.ConditionalFormatting.NormalConditionRule} If no value is set, returns the comparison operator; otherwise, returns the number condition rule. * @example * ```javascript * //This example creates multiple rules. * activeSheet.setArray(0,0,[1,2,3,4,5,6,7,8,9,10]); * var style = new GC.Spread.Sheets.Style(); * style.backColor = "red"; * style.foreColor = "black"; * var cell = new GC.Spread.Sheets.ConditionalFormatting.NormalConditionRule(); * cell.ruleType(GC.Spread.Sheets.ConditionalFormatting.RuleType.cellValueRule); * cell.operator(GC.Spread.Sheets.ConditionalFormatting.ComparisonOperators.greaterThan); * cell.value1(5); * cell.ranges([new GC.Spread.Sheets.Range(0, 0, 10, 1)]); * cell.style(style); * activeSheet.conditionalFormats.addRule(cell); * var style1 = new GC.Spread.Sheets.Style(); * style1.foreColor = "red"; * var top = new GC.Spread.Sheets.ConditionalFormatting.NormalConditionRule(); * top.ruleType(GC.Spread.Sheets.ConditionalFormatting.RuleType.top10Rule); * top.type(GC.Spread.Sheets.ConditionalFormatting.Top10ConditionType.top); * top.rank(3); * top.style(style1); * top.ranges([new GC.Spread.Sheets.Range(0, 0, 10, 1)]); * top.stopIfTrue(true); * activeSheet.conditionalFormats.addRule(top); * ``` */ operator(value?: GC.Spread.Sheets.ConditionalFormatting.ComparisonOperators): any; /** * Gets or sets the number of top or bottom items to apply the style to. * @param {number} value The number of top or bottom items to apply the style to. * @returns {number | GC.Spread.Sheets.ConditionalFormatting.NormalConditionRule} If no value is set, returns the number of top or bottom items to apply the style to; otherwise, returns the number condition rule. * @example * ```javascript * //This example creates multiple rules. * activeSheet.setArray(0,0,[1,2,3,4,5,6,7,8,9,10]); * var style = new GC.Spread.Sheets.Style(); * style.backColor = "red"; * style.foreColor = "black"; * var cell = new GC.Spread.Sheets.ConditionalFormatting.NormalConditionRule(); * cell.ruleType(GC.Spread.Sheets.ConditionalFormatting.RuleType.cellValueRule); * cell.operator(GC.Spread.Sheets.ConditionalFormatting.ComparisonOperators.greaterThan); * cell.value1(5); * cell.ranges([new GC.Spread.Sheets.Range(0, 0, 10, 1)]); * cell.style(style); * activeSheet.conditionalFormats.addRule(cell); * var style1 = new GC.Spread.Sheets.Style(); * style1.foreColor = "red"; * var top = new GC.Spread.Sheets.ConditionalFormatting.NormalConditionRule(); * top.ruleType(GC.Spread.Sheets.ConditionalFormatting.RuleType.top10Rule); * top.type(GC.Spread.Sheets.ConditionalFormatting.Top10ConditionType.top); * top.rank(3); * top.style(style1); * top.ranges([new GC.Spread.Sheets.Range(0, 0, 10, 1)]); * top.stopIfTrue(true); * activeSheet.conditionalFormats.addRule(top); * ``` */ rank(value?: number): any; /** * Resets the rule. * @example * ```javascript * activeSheet.setValue(0,0, 1,3); * activeSheet.setValue(1,0, 50,3); * activeSheet.setValue(2,0, 100,3); * activeSheet.setValue(3,0, 2,3); * activeSheet.setValue(4,0, 60,3); * activeSheet.setValue(5,0, 90,3); * activeSheet.setValue(6,0, 3,3); * activeSheet.setValue(7,0, 40,3); * activeSheet.setValue(8,0, 70,3); * activeSheet.setValue(9,0, 5,3); * activeSheet.setValue(10,0, 35,3); * var style = new GC.Spread.Sheets.Style(); * style.backColor = "red"; * style.borderLeft =new GC.Spread.Sheets.LineBorder("blue",GC.Spread.Sheets.LineStyle.medium); * style.borderTop = new GC.Spread.Sheets.LineBorder("blue",GC.Spread.Sheets.LineStyle.medium); * style.borderRight = new GC.Spread.Sheets.LineBorder("blue",GC.Spread.Sheets.LineStyle.medium); * style.borderBottom = new GC.Spread.Sheets.LineBorder("blue",GC.Spread.Sheets.LineStyle.medium); * var rule = new GC.Spread.Sheets.ConditionalFormatting.NormalConditionRule(); * rule.ruleType(GC.Spread.Sheets.ConditionalFormatting.RuleType.averageRule); * rule.ranges([new GC.Spread.Sheets.Range(0, 0, 10, 3)]); * rule.style(style); * rule.type(GC.Spread.Sheets.ConditionalFormatting.AverageConditionType.above); * activeSheet.conditionalFormats.addRule(rule); * rule.reset(); * ``` */ reset(): void; /** * Gets or sets the text for comparison. * @param {string} value The text for comparison. * @returns {string | GC.Spread.Sheets.ConditionalFormatting.NormalConditionRule} If no value is set, returns the text for comparison; otherwise, returns the number condition rule. * @example * ```javascript * //This example creates a rule. * var style = new GC.Spread.Sheets.Style(); * style.backColor = "red"; * var rule = new GC.Spread.Sheets.ConditionalFormatting.NormalConditionRule(); * rule.ruleType(GC.Spread.Sheets.ConditionalFormatting.RuleType.specificTextRule); * rule.style(style); * rule.text("test"); * rule.operator(GC.Spread.Sheets.ConditionalFormatting.TextComparisonOperators.contains); * rule.ranges([new GC.Spread.Sheets.Range(0, 0, 10, 1)]); * activeSheet.conditionalFormats.addRule(rule); * activeSheet.setValue(0, 0, "testing"); * activeSheet.setValue(1, 0, "test"); * activeSheet.setValue(2, 0, "a"); * activeSheet.setValue(3, 0, "t"); * ``` */ text(value?: string): any; /** * Gets or sets the average condition type. * @param {GC.Spread.Sheets.ConditionalFormatting.AverageConditionType} value The average condition type. * @returns {GC.Spread.Sheets.ConditionalFormatting.AverageConditionType | GC.Spread.Sheets.ConditionalFormatting.NormalConditionRule} If no value is set, returns the average condition type; otherwise, returns the number condition rule. * @example * ```javascript * activeSheet.setArray(0,0,[1,2,3,4,5,6,7,8,9,10]); * var style = new GC.Spread.Sheets.Style(); * style.backColor = "red"; * style.foreColor = "black"; * var cell = new GC.Spread.Sheets.ConditionalFormatting.NormalConditionRule(); * cell.ruleType(GC.Spread.Sheets.ConditionalFormatting.RuleType.cellValueRule); * cell.operator(GC.Spread.Sheets.ConditionalFormatting.ComparisonOperators.greaterThan); * cell.value1(5); * cell.ranges([new GC.Spread.Sheets.Range(0, 0, 10, 1)]); * cell.style(style); * activeSheet.conditionalFormats.addRule(cell); * var style1 = new GC.Spread.Sheets.Style(); * style1.foreColor = "red"; * var top = new GC.Spread.Sheets.ConditionalFormatting.NormalConditionRule(); * top.ruleType(GC.Spread.Sheets.ConditionalFormatting.RuleType.top10Rule); * top.type(GC.Spread.Sheets.ConditionalFormatting.Top10ConditionType.top); * top.rank(3); * top.style(style1); * top.ranges([new GC.Spread.Sheets.Range(0, 0, 10, 1)]); * top.stopIfTrue(true); * activeSheet.conditionalFormats.addRule(top); * ``` */ type(value?: GC.Spread.Sheets.ConditionalFormatting.AverageConditionType): any; /** * Gets or sets the first value. * @param {Object | number} valueOrBaseRow The first value or the base row. * @param {number} baseColumn The base column. * @returns {Object | GC.Spread.Sheets.ConditionalFormatting.NormalConditionRule} If no value is set or baseRow and baseColumn is set, returns the first value; otherwise, returns the number condition rule. * @example * ```javascript * //This example creates multiple rules. * activeSheet.setArray(0,0,[[1,10],[2,9], [3,8],[4,7],[5,6],[6,5],[7,4],[8,3],[9,2],[10,1]]); * var style = new GC.Spread.Sheets.Style(); * style.backColor = "red"; * style.foreColor = "black"; * var cell = new GC.Spread.Sheets.ConditionalFormatting.NormalConditionRule(); * cell.ruleType(GC.Spread.Sheets.ConditionalFormatting.RuleType.cellValueRule); * cell.operator(GC.Spread.Sheets.ConditionalFormatting.ComparisonOperators.greaterThan); * cell.value1("=B1"); * cell.ranges([new GC.Spread.Sheets.Range(0, 0, 10, 1)]); * cell.style(style); * activeSheet.conditionalFormats.addRule(cell); * var style1 = new GC.Spread.Sheets.Style(); * style1.foreColor = "red"; * var top = new GC.Spread.Sheets.ConditionalFormatting.NormalConditionRule(); * top.ruleType(GC.Spread.Sheets.ConditionalFormatting.RuleType.top10Rule); * top.type(GC.Spread.Sheets.ConditionalFormatting.Top10ConditionType.top); * top.rank(3); * top.style(style1); * top.ranges([new GC.Spread.Sheets.Range(0, 0, 10, 1)]); * top.stopIfTrue(true); * activeSheet.conditionalFormats.addRule(top); * var formulaOfTheTopLeftCell = cell.value1(); * var formulaOfA5 = cell.value1(4, 0); * var formulaOfA10 = cell.value1(9, 0); * ``` */ value1(valueOrBaseRow?: any, baseColumn?: number): any; /** * Gets or sets the first value. * @param {Object | number} valueOrBaseRow The first value or the base row. * @param {number} baseColumn The base column. * @returns {Object | GC.Spread.Sheets.ConditionalFormatting.NormalConditionRule} If no value is set or baseRow and baseColumn is set, returns the first value; otherwise, returns the number condition rule. * @example * ```javascript * //This example uses the value2 method. * activeSheet.setArray(0,0,[1,2,3,4,5,6,7,8,9,10]); * var cell = new GC.Spread.Sheets.ConditionalFormatting.NormalConditionRule(); * cell.ruleType(GC.Spread.Sheets.ConditionalFormatting.RuleType.cellValueRule); * cell.operator(GC.Spread.Sheets.ConditionalFormatting.ComparisonOperators.between); * cell.value1(5); * cell.value2(7); * cell.ranges([new GC.Spread.Sheets.Range(0, 0, 10, 1)]); * var style = new GC.Spread.Sheets.Style(); * style.backColor = "red"; * style.foreColor = "black"; * cell.style(style); * activeSheet.conditionalFormats.addRule(cell); * ``` */ value2(valueOrBaseRow?: any, baseColumn?: number): any; } export class ScaleRule extends ConditionRuleBase{ /** * Represents a scale conditional rule. * @@extends GC.Spread.Sheets.ConditionalFormatting.ConditionRuleBase * @param {GC.Spread.Sheets.ConditionalFormatting.RuleType} ruleType The rule type. * @param {GC.Spread.Sheets.ConditionalFormatting.ScaleValueType} minType The minimum scale type. * @param {number} minValue The minimum scale value. * @param {string} minColor The minimum scale color. * @param {GC.Spread.Sheets.ConditionalFormatting.ScaleValueType} midType The midpoint scale type. * @param {number} midValue The midpoint scale value. * @param {string} midColor The midpoint scale color. * @param {GC.Spread.Sheets.ConditionalFormatting.ScaleValueType} maxType The maximum scale type. * @param {number} maxValue The maximum scale value. * @param {string} maxColor The maximum scale color. * @param {GC.Spread.Sheets.Range[]} ranges The ranges. * @constructor * @example * ```javascript * var scale = new GC.Spread.Sheets.ConditionalFormatting.ScaleRule(); * scale.ruleType(GC.Spread.Sheets.ConditionalFormatting.RuleType.threeScaleRule); * scale.midColor("red"); * scale.midType(GC.Spread.Sheets.ConditionalFormatting.ScaleValueType.number); * scale.midValue(50); * scale.maxColor("blue"); * scale.maxType(GC.Spread.Sheets.ConditionalFormatting.ScaleValueType.number); * scale.maxValue(100); * scale.minColor("yellow"); * scale.minType(GC.Spread.Sheets.ConditionalFormatting.ScaleValueType.number); * scale.minValue(10); * scale.ranges([new GC.Spread.Sheets.Range(0, 0, 10, 3)]); * activeSheet.conditionalFormats.addRule(scale); * activeSheet.setValue(0,0, 1,3); * activeSheet.setValue(1,0, 50,3); * activeSheet.setValue(2,0, 100,3); * ``` */ constructor(ruleType: GC.Spread.Sheets.ConditionalFormatting.RuleType, minType?: GC.Spread.Sheets.ConditionalFormatting.ScaleValueType, minValue?: number, minColor?: string, midType?: GC.Spread.Sheets.ConditionalFormatting.ScaleValueType, midValue?: number, midColor?: string, maxType?: GC.Spread.Sheets.ConditionalFormatting.ScaleValueType, maxValue?: number, maxColor?: string, ranges?: GC.Spread.Sheets.Range[]); /** * Creates a condition for the rule. * @returns {GC.Spread.Sheets.ConditionalFormatting.Condition} The condition. */ createCondition(): GC.Spread.Sheets.ConditionalFormatting.Condition; /** * Returns a specified value of the rule if the cell satisfies the condition. * @param {Object} evaluator The evaluator. * @param {number} baseRow The row index. * @param {number} baseColumn The column index. * @param {Object} actual The actual value object for evaluation. * @returns {string} A specified value of the rule if the cell satisfies the condition. */ evaluate(evaluator: Object, baseRow: number, baseColumn: number, actual: Object): any; /** * Gets or sets the maximum color scale. * @param {string} value The maximum color scale. * @returns {string | GC.Spread.Sheets.ConditionalFormatting.ScaleRule} If no value is set, returns the maximum color scale; otherwise, returns the scale rule. * @example * ```javascript * var rule = new GC.Spread.Sheets.ConditionalFormatting.ScaleRule(); * rule.ranges([new GC.Spread.Sheets.Range(0,0,10,3)]); * rule.ruleType(GC.Spread.Sheets.ConditionalFormatting.RuleType.twoScaleRule); * rule.minType(GC.Spread.Sheets.ConditionalFormatting.ScaleValueType.number); * rule.minValue(10); * rule.minColor("Yellow"); * rule.maxType(GC.Spread.Sheets.ConditionalFormatting.ScaleValueType.number); * rule.maxValue(100); * rule.maxColor("Blue"); * activeSheet.conditionalFormats.addRule(rule); * activeSheet.setValue(0,0, 1,3); * activeSheet.setValue(1,0, 50,3); * activeSheet.setValue(2,0, 100,3); * ``` */ maxColor(value?: string): any; /** * Gets or sets the maximum scale type. * @param {GC.Spread.Sheets.ConditionalFormatting.ScaleValueType} value The maximum scale type. * @returns {GC.Spread.Sheets.ConditionalFormatting.ScaleValueType | GC.Spread.Sheets.ConditionalFormatting.ScaleRule} If no value is set, returns the maximum scale type; otherwise, returns the scale rule. * @example * ```javascript * var scale = new GC.Spread.Sheets.ConditionalFormatting.ScaleRule(); * scale.ruleType(GC.Spread.Sheets.ConditionalFormatting.RuleType.threeScaleRule); * scale.midColor("red"); * scale.midType(GC.Spread.Sheets.ConditionalFormatting.ScaleValueType.number); * scale.midValue(50); * scale.maxColor("blue"); * scale.maxType(GC.Spread.Sheets.ConditionalFormatting.ScaleValueType.number); * scale.maxValue(100); * scale.minColor("yellow"); * scale.minType(GC.Spread.Sheets.ConditionalFormatting.ScaleValueType.number); * scale.minValue(10); * scale.ranges([new GC.Spread.Sheets.Range(0, 0, 10, 3)]); * activeSheet.conditionalFormats.addRule(scale); * activeSheet.setValue(0,0, 1,3); * activeSheet.setValue(1,0, 50,3); * activeSheet.setValue(2,0, 100,3); * ``` */ maxType(value?: GC.Spread.Sheets.ConditionalFormatting.ScaleValueType): any; /** * Gets or sets the maximum scale value. * @param {number} value The maximum scale value. * @returns {number | GC.Spread.Sheets.ConditionalFormatting.ScaleRule} If no value is set, returns the maximum scale value; otherwise, returns the scale rule. * @example * ```javascript * var scale = new GC.Spread.Sheets.ConditionalFormatting.ScaleRule(); * scale.ruleType(GC.Spread.Sheets.ConditionalFormatting.RuleType.twoScaleRule); * scale.maxColor("blue"); * scale.maxType(GC.Spread.Sheets.ConditionalFormatting.ScaleValueType.number); * scale.maxValue(100); * scale.minColor("yellow"); * scale.minType(GC.Spread.Sheets.ConditionalFormatting.ScaleValueType.number); * scale.minValue(10); * scale.ranges([new GC.Spread.Sheets.Range(0, 0, 10, 3)]); * activeSheet.conditionalFormats.addRule(scale); * activeSheet.setValue(0,0, 1,3); * activeSheet.setValue(1,0, 50,3); * activeSheet.setValue(2,0, 100,3); * alert("Color: " + scale.maxColor() + " Type: " + scale.maxType() + " Value: " + scale.maxValue()); * ``` */ maxValue(value?: number): any; /** * Gets or sets the midpoint scale color. * @param {string} value The midpoint scale color. * @returns {string | GC.Spread.Sheets.ConditionalFormatting.ScaleRule} If no value is set, returns the midpoint scale color; otherwise, returns the scale rule. * @example * ```javascript * var scale = new GC.Spread.Sheets.ConditionalFormatting.ScaleRule(); * scale.ruleType(GC.Spread.Sheets.ConditionalFormatting.RuleType.threeScaleRule); * scale.midColor("red"); * scale.midType(GC.Spread.Sheets.ConditionalFormatting.ScaleValueType.number); * scale.midValue(50); * scale.maxColor("blue"); * scale.maxType(GC.Spread.Sheets.ConditionalFormatting.ScaleValueType.number); * scale.maxValue(100); * scale.minColor("yellow"); * scale.minType(GC.Spread.Sheets.ConditionalFormatting.ScaleValueType.number); * scale.minValue(10); * scale.ranges([new GC.Spread.Sheets.Range(0, 0, 10, 3)]); * activeSheet.conditionalFormats.addRule(scale); * activeSheet.setValue(0,0, 1,3); * activeSheet.setValue(1,0, 50,3); * activeSheet.setValue(2,0, 100,3); * ``` */ midColor(value?: string): any; /** * Gets or sets the midpoint scale type. * @param {GC.Spread.Sheets.ConditionalFormatting.ScaleValueType} value The midpoint scale type. * @returns {GC.Spread.Sheets.ConditionalFormatting.ScaleValueType | GC.Spread.Sheets.ConditionalFormatting.ScaleRule} If no value is set, returns the midpoint scale type; otherwise, returns the scale rule. * @example * ```javascript * var scale = new GC.Spread.Sheets.ConditionalFormatting.ScaleRule(); * scale.ruleType(GC.Spread.Sheets.ConditionalFormatting.RuleType.threeScaleRule); * scale.midColor("red"); * scale.midType(GC.Spread.Sheets.ConditionalFormatting.ScaleValueType.number); * scale.midValue(50); * scale.maxColor("blue"); * scale.maxType(GC.Spread.Sheets.ConditionalFormatting.ScaleValueType.number); * scale.maxValue(100); * scale.minColor("yellow"); * scale.minType(GC.Spread.Sheets.ConditionalFormatting.ScaleValueType.number); * scale.minValue(10); * scale.ranges([new GC.Spread.Sheets.Range(0, 0, 10, 3)]); * activeSheet.conditionalFormats.addRule(scale); * activeSheet.setValue(0,0, 1,3); * activeSheet.setValue(1,0, 50,3); * activeSheet.setValue(2,0, 100,3); * ``` */ midType(value?: GC.Spread.Sheets.ConditionalFormatting.ScaleValueType): any; /** * Gets or sets the midpoint scale value. * @param {number} value The midpoint scale value. * @returns {number | GC.Spread.Sheets.ConditionalFormatting.ScaleRule} If no value is set, returns the midpoint scale value; otherwise, returns the scale rule. * @example * ```javascript * var scale = new GC.Spread.Sheets.ConditionalFormatting.ScaleRule(); * scale.ruleType(GC.Spread.Sheets.ConditionalFormatting.RuleType.threeScaleRule); * scale.midColor("red"); * scale.midType(GC.Spread.Sheets.ConditionalFormatting.ScaleValueType.number); * scale.midValue(50); * scale.maxColor("blue"); * scale.maxType(GC.Spread.Sheets.ConditionalFormatting.ScaleValueType.number); * scale.maxValue(100); * scale.minColor("yellow"); * scale.minType(GC.Spread.Sheets.ConditionalFormatting.ScaleValueType.number); * scale.minValue(10); * scale.ranges([new GC.Spread.Sheets.Range(0, 0, 10, 3)]); * activeSheet.conditionalFormats.addRule(scale); * activeSheet.setValue(0,0, 1,3); * activeSheet.setValue(1,0, 50,3); * activeSheet.setValue(2,0, 100,3); * ``` */ midValue(value?: number): any; /** * Gets or sets the minimum scale color. * @param {string} value The minimum scale color. * @returns {string | GC.Spread.Sheets.ConditionalFormatting.ScaleRule} If no value is set, returns the minimum scale color; otherwise, returns the scale rule. * @example * ```javascript * var rule = new GC.Spread.Sheets.ConditionalFormatting.ScaleRule(); * rule.ranges([new GC.Spread.Sheets.Range(0,0,10,3)]); * rule.ruleType(GC.Spread.Sheets.ConditionalFormatting.RuleType.twoScaleRule); * rule.minType(GC.Spread.Sheets.ConditionalFormatting.ScaleValueType.number); * rule.minValue(10); * rule.minColor("Yellow"); * rule.maxType(GC.Spread.Sheets.ConditionalFormatting.ScaleValueType.number); * rule.maxValue(100); * rule.maxColor("Blue"); * activeSheet.conditionalFormats.addRule(rule); * activeSheet.setValue(0,0, 1,3); * activeSheet.setValue(1,0, 50,3); * activeSheet.setValue(2,0, 100,3); * ``` */ minColor(value?: string): any; /** * Gets or sets the type of minimum scale. * @param {GC.Spread.Sheets.ConditionalFormatting.ScaleValueType} value The type of minimum scale. * @returns {GC.Spread.Sheets.ConditionalFormatting.ScaleValueType | GC.Spread.Sheets.ConditionalFormatting.ScaleRule} If no value is set, returns the type of minimum scale; otherwise, returns the scale rule. * @example * ```javascript * activeSheet.setValue(0,0,1,3); * activeSheet.setValue(1,0,15,3); * activeSheet.setValue(2,0,25,3); * activeSheet.setValue(3,0,-1,3); * var dataBarRule = new GC.Spread.Sheets.ConditionalFormatting.DataBarRule(); * dataBarRule.ranges([new GC.Spread.Sheets.Range(0,0,4,1)]); * dataBarRule.minType(GC.Spread.Sheets.ConditionalFormatting.ScaleValueType.number); * dataBarRule.minValue(-1); * dataBarRule.maxType(GC.Spread.Sheets.ConditionalFormatting.ScaleValueType.number); * dataBarRule.maxValue(40); * dataBarRule.color("green"); * dataBarRule.showBorder(true); * dataBarRule.borderColor("orange"); * dataBarRule.dataBarDirection(GC.Spread.Sheets.ConditionalFormatting.BarDirection.leftToRight); * dataBarRule.negativeFillColor("yellow"); * dataBarRule.useNegativeFillColor(true); * dataBarRule.negativeBorderColor("red"); * dataBarRule.useNegativeBorderColor(true); * dataBarRule.axisPosition(GC.Spread.Sheets.ConditionalFormatting.DataBarAxisPosition.automatic); * dataBarRule.axisColor("blue"); * dataBarRule.showBarOnly(false); * activeSheet.conditionalFormats.addRule(dataBarRule); * ``` */ minType(value?: GC.Spread.Sheets.ConditionalFormatting.ScaleValueType): any; /** * Gets or sets the minimum scale value. * @param {number} value The minimum scale value. * @returns {number | GC.Spread.Sheets.ConditionalFormatting.ScaleRule} If no value is set, returns the minimum scale value; otherwise, returns the scale rule. * @example * ```javascript * activeSheet.setValue(0,0,1,3); * activeSheet.setValue(1,0,15,3); * activeSheet.setValue(2,0,25,3); * activeSheet.setValue(3,0,-1,3); * var dataBarRule = new GC.Spread.Sheets.ConditionalFormatting.DataBarRule(); * dataBarRule.ranges([new GC.Spread.Sheets.Range(0,0,4,1)]); * dataBarRule.minType(GC.Spread.Sheets.ConditionalFormatting.ScaleValueType.number); * dataBarRule.minValue(-1); * dataBarRule.maxType(GC.Spread.Sheets.ConditionalFormatting.ScaleValueType.number); * dataBarRule.maxValue(40); * dataBarRule.color("green"); * dataBarRule.showBorder(true); * dataBarRule.borderColor("orange"); * dataBarRule.dataBarDirection(GC.Spread.Sheets.ConditionalFormatting.BarDirection.leftToRight); * dataBarRule.negativeFillColor("yellow"); * dataBarRule.useNegativeFillColor(true); * dataBarRule.negativeBorderColor("red"); * dataBarRule.useNegativeBorderColor(true); * dataBarRule.axisPosition(GC.Spread.Sheets.ConditionalFormatting.DataBarAxisPosition.automatic); * dataBarRule.axisColor("blue"); * dataBarRule.showBarOnly(false); * activeSheet.conditionalFormats.addRule(dataBarRule); * ``` */ minValue(value?: number): any; /** * Gets whether evaluation should stop if the condition evaluates to `true`. */ stopIfTrue(value?: boolean): boolean; } export class ScaleValue{ /** * Represents a scale value with the specified type and value. * @class * @param {GC.Spread.Sheets.ConditionalFormatting.ScaleValueType} type The scale value type. * @param {Object} value The scale value. */ constructor(type: GC.Spread.Sheets.ConditionalFormatting.ScaleValueType, value: Object); /** Gets the scale value type. * @type {GC.Spread.Sheets.ConditionalFormatting.ScaleValueType} */ type: GC.Spread.Sheets.ConditionalFormatting.ScaleValueType; /** Gets the scale value. * @type {Object} */ value: Object; } export class StateRule extends GC.Spread.Sheets.ConditionalFormatting.ConditionRuleBase{ /** * Represents a state rule. * @class * @extends GC.Spread.Sheets.ConditionalFormatting.ConditionRuleBase * @param {GC.Spread.Sheets.ConditionalFormatting.RuleType.rowStateRule | GC.Spread.Sheets.ConditionalFormatting.RuleType.columnStateRule} ruleType The state rule type, it would be GC.Spread.Sheets.ConditionalFormatting.RuleType.rowStateRule or GC.Spread.Sheets.ConditionalFormatting.RuleType.columnStateRule. * @param {GC.Spread.Sheets.RowColumnStates} state The state. * @param {GC.Spread.Sheets.Style | GC.Spread.Sheets.Style[]} style The style that is applied to the cell when the state is met. It could an array of styles. * @param {GC.Spread.Sheets.Range[]} ranges The cell ranges where the rule is applied whose item type is GC.Spread.Sheets.Range. * @returns {GC.Spread.Sheets.ConditionalFormatting.StateRule} The state rule. * @example * ```javascript * // add a row state rule with red back color in whole sheet * var style = new GC.Spread.Sheets.Style(); * style.backColor = "red"; * var stateRule = new GC.Spread.Sheets.ConditionalFormatting.StateRule( * GC.Spread.Sheets.ConditionalFormatting.RuleType.rowStateRule, * GC.Spread.Sheets.RowColumnStates.active, * style, [new GC.Spread.Sheets.Range(-1, -1, -1, -1)] * ); * activeSheet.conditionalFormats.addRule(stateRule); * // add a row state rule with two styles to different corresponding ranges * var stateRule2 = new GC.Spread.Sheets.ConditionalFormatting.StateRule( * GC.Spread.Sheets.ConditionalFormatting.RuleType.rowStateRule, * GC.Spread.Sheets.RowColumnStates.dirty, * [new GC.Spread.Sheets.Style("green"), new GC.Spread.Sheets.Style("red")], * [new GC.Spread.Sheets.Range(1, 1, 10, 5), new GC.Spread.Sheets.Range(1, 7, 10, 5)] * ); * activeSheet.conditionalFormats.addRule(stateRule2); * ``` */ constructor(ruleType: GC.Spread.Sheets.ConditionalFormatting.RuleType, state: GC.Spread.Sheets.RowColumnStates, style?: GC.Spread.Sheets.Style | GC.Spread.Sheets.Style[], ranges?: GC.Spread.Sheets.Range[]); /** * Get whether this state rule will applied to row direction. * @returns {boolean} Whether this state rule will be applied to row direction, otherwise, it will be applied to column direction. */ isRow(): boolean; /** * Gets or sets the rule state. * @param {GC.Spread.Sheets.RowColumnStates} value The state. * @returns {GC.Spread.Sheets.RowColumnStates} The rule state. */ state(value?: GC.Spread.Sheets.RowColumnStates): GC.Spread.Sheets.RowColumnStates; } } module ContextMenu{ export interface IMenuItemData{ name?:string; text?:string; command?:string|Function; disable?:boolean; iconClass?:string; group?:string; subMenu?:IMenuItemData[]; type?:string; workArea?:string; visible?: boolean; menuContent?: string; status?: string | any placeholder?: string; commandOptions?: any; itemClass?: string; title?: string; needKeepFocus?: boolean; metaData?: GC.Spread.Sheets.ICommandMetaData; } export class ContextMenu{ /** * Represents ContextMenu * @class */ constructor(); /** * Represents the build-in menuData * @type {Object[]} * @property {string} [name] - Represent context menu item's identify. * @property {string} [text] - Represent the text to be shown,if this context menu item is a group,text will be shown as DOM element's title. * @property {string|Function} [command] - Represent a command name,commandManager will use this as index to find this command,if this command exist,then execute it. * @property {boolean} [disable] - Represent this context menu item is disabled under current condition, default value is false. * @property {string} [iconClass] - Represent this context menu item's icon,it is a class name. * @property {string} [group] - Represent this context menu item is a group menu item and this property's value should be it's group header's name. * @property {Object[]} [subMenu] - Represent this context menu item has sub menu. * @property {string} [type] - Represent a context menu's type. * @property {string} [workArea] - Represent this context menu item's should be shown on what area,value can be a collection of conditions,separate by whitespace. include: "outline","rowHeader","colHeader","corner","slicer","chart","shape","table","vpWithoutTb","pivotPageFilter","pivotTopLeft","pivotEmptyLabel","pivotHeader","pivotGrandTotal","pivotContent","pivotTable". */ menuData: GC.Spread.Sheets.ContextMenu.IMenuItemData[]; /** * Represents the build-in menuView, could be replaced for customize * @type {GC.Spread.Sheets.ContextMenu.MenuView} * @example * ```javascript * var spread = new GC.Spread.Sheets.Workbook(document.getElementById('ss')); * var colors = ['rgb(255,255,255)', 'rgb(0,255,255)', 'rgb(255,0,255)', 'rgb(255,255,0)', 'rgb(255,0,0)', 'rgb(0,255,0)', 'rgb(0,0,255)', 'rgb(0,0,0)']; * function createColorpicker() { * var colorPicker = document.createElement('div'); * colorPicker.style.width = '100%'; * colorPicker.style.backgroundColor = 'white'; * for (var j = 0; j < 8; j++) { * var colorDom = document.createElement("div"); * colorDom.style.width = "14px"; * colorDom.style.height = "14px"; * colorDom.style.margin = "0 0 0 6px"; * colorDom.style.display = "inline-block"; * colorDom.style.border = "solid 1px #333333"; * colorDom.style.verticalAlign = "top"; * colorDom.style.backgroundColor = colors[j]; * colorPicker.appendChild(colorDom); * } * return colorPicker; * } * // let spread = new GC.Spread.Sheets.Workbook(document.getElementById('ss')); * let selectWithABackgroundColor = { * text: "Select Color", * name: "selectColorWithBg", * workArea: "viewport", * subMenu: [{ * name: "selectColorPicker", * command: "selectWithBg" * }] * }; * spread.contextMenu.menuData.push(selectWithABackgroundColor); * let selectWithABackgroundColorCommand = { * canUndo: false, * execute: function(spread, options) { * if (options.commandOptions) { * var style = new GC.Spread.Sheets.Style(); * style.name = 'style1'; * style.backColor = options.commandOptions; * var sheet = spread.getActiveSheet(); * sheet.suspendPaint(); * var selections = sheet.getSelections(); * var selectionIndex = 0 * , selectionCount = selections.length; * for (; selectionIndex < selectionCount; selectionIndex++) { * var selection = selections[selectionIndex]; * for (var i = selection.row; i < (selection.row + selection.rowCount); i++) { * for (var j = selection.col; j < (selection.col + selection.colCount); j++) { * sheet.setStyle(i, j, style, GC.Spread.Sheets.SheetArea.viewport); * } * } * } * sheet.resumePaint(); * } * } * }; * spread.commandManager().register("selectWithBg", selectWithABackgroundColorCommand, null, false, false, false, false); * class CustomMenuView extends GC.Spread.Sheets.ContextMenu.MenuView { * createMenuItemElement(menuItemData) { * // create menu item view by your self * // should return menu item view back * // you can call super's createMenuItemElement here and only customize a few of menu item * if (menuItemData.name === "selectColorPicker") { * var containers = super.createMenuItemElement(menuItemData); * var supMenuItemContainer = containers[0]; * while (supMenuItemContainer.firstChild) { * supMenuItemContainer.removeChild(supMenuItemContainer.firstChild); * } * var colorPicker = createColorpicker(); * supMenuItemContainer.appendChild(colorPicker); * * return supMenuItemContainer; * } * return super.createMenuItemElement(menuItemData); * } * getCommandOptions(menuItemData, host, event) { * if (menuItemData && menuItemData.name === "selectColorPicker") { * var ele = event.target || event.srcElement; * return ele.style.backgroundColor; * } * return super.getCommandOptions(menuItemData, host, event); * } * } * spread.contextMenu.menuView = new CustomMenuView(); * ``` */ menuView: GC.Spread.Sheets.ContextMenu.MenuView; /** * open context menu * @param {Object[]} menuData * @param {string} [menuData.name] - Represent context menu item's identify. * @param {string} [menuData.text] - Represent the text to be shown,if this context menu item is a group,text will be shown as DOM element's title. * @param {string|Function} [menuData.command] - Represent a command name,commandManager will use this as index to find this command,if this command exist,then execute it. * @param {boolean} [menuData.disable] - Represent this context menu item is disabled under current condition, default value is false. * @param {string} [menuData.iconClass] - Represent this context menu item's icon,it is a class name. * @param {string} [menuData.group] - Represent this context menu item is a group menu item and this param's value should be it's group header's name. * @param {Object[]} [menuData.subMenu] - Represent this context menu item has sub menu. * @param {string} [menuData.type] - Represent a context menu's type. * @param {string} [menuData.workArea] - Represent this context menu item's should be shown on what area,value can be a collection of conditions,separate by whitespace. include: "outline","rowHeader","colHeader","corner","slicer","chart","shape","table","vpWithoutTb","pivotPageFilter","pivotTopLeft","pivotEmptyLabel","pivotHeader","pivotGrandTotal","pivotContent","pivotTable". * @param {Object[]} itemsDataForShown * @param {string} [itemsDataForShown.name] - Represent context menu item's identify. * @param {string} [itemsDataForShown.text] - Represent the text to be shown,if this context menu item is a group,text will be shown as DOM element's title. * @param {string|Function} [itemsDataForShown.command] - Represent a command name,commandManager will use this as index to find this command,if this command exist,then execute it. * @param {boolean} [itemsDataForShown.disable] - Represent this context menu item is disabled under current condition, default value is false. * @param {string} [itemsDataForShown.iconClass] - Represent this context menu item's icon,it is a class name. * @param {string} [itemsDataForShown.group] - Represent this context menu item is a group menu item and this param's value should be it's group header's name. * @param {Object[]} [itemsDataForShown.subMenu] - Represent this context menu item has sub menu. * @param {string} [itemsDataForShown.type] - Represent a context menu's type. * @param {string} [itemsDataForShown.workArea] - Represent this context menu item's should be shown on what area,value can be a collection of conditions,separate by whitespace. include: "outline","rowHeader","colHeader","corner","slicer","chart","shape","table","vpWithoutTb","pivotPageFilter","pivotTopLeft","pivotEmptyLabel","pivotHeader","pivotGrandTotal","pivotContent","pivotTable". * @param {Object} hitInfo * @param {Object} spread * @return {boolean} indicate whether or not the contextmenu event has been processed done * @example * ```javascript * var spread = new GC.Spread.Sheets.Workbook(document.getElementById("ss")); * spread.contextMenu.onOpenMenu = function (menuData, itemsDataForShown, hitInfo, spread) { * console.log(menuData); * console.log(itemsDataForShown); * console.log(hitInfo); * console.log(spread); * alert("menu is opening"); * //you can change itemsDataForShown to change filter result * //if you only want to change filter result,return false or don't return anything * //you also can open your own context menu,if you want to do this,return true * //return true; * }; * ``` */ onOpenMenu(menuData: GC.Spread.Sheets.ContextMenu.IMenuItemData[], itemsDataForShown: GC.Spread.Sheets.ContextMenu.IMenuItemData[], hitInfo: Object, spread: Object): boolean; } export class MenuView{ /** * Represents MenuView * @class */ constructor(); /** * create menuitem view * @param {GC.Spread.Sheets.ContextMenu.IMenuItemData} menuItemData the data of the menu item which needs to be shown * @return {HTMLElement} menuitem view * @example * ```javascript * window.addEventListener('load', function() { * var spread = new GC.Spread.Sheets.Workbook(document.getElementById("ss")); * var activeSheet = spread.getActiveSheet(); * activeSheet.setValue(0,0,'please right click'); * activeSheet.setValue(1,0,'you will find there is a new context menu item "Change BackColor"'); * activeSheet.setValue(2,0,'click it'); * var selectWithABackgroundColor = { * text: "Change BackColor", * name: "changeColorWithBg", * workArea: "viewport", * subMenu: [ * { * name: "selectColorPicker", * command: "changeBackColor" * } * ] * }; * spread.contextMenu.menuData.push(selectWithABackgroundColor); * var changeBackgroundColorCommand = { * canUndo: false, * execute: function(spread, options) { * spread.suspendPaint(); * spread.options.backColor = options.commandOptions; * spread.resumePaint(); * } * }; * var commandManager = spread.commandManager(); * commandManager.register("changeBackColor", changeBackgroundColorCommand, null, false, false, false, false); * function CustomMenuView() { * } * CustomMenuView.prototype = new GC.Spread.Sheets.ContextMenu.MenuView(); * CustomMenuView.prototype.createMenuItemElement = function(menuItemData) { * var self = this; * if (menuItemData.name === "selectColorPicker") { * var containers = GC.Spread.Sheets.ContextMenu.MenuView.prototype.createMenuItemElement.call(self, menuItemData); * var supMenuItemContainer = containers[0]; * while (supMenuItemContainer.firstChild) { * supMenuItemContainer.removeChild(supMenuItemContainer.firstChild); * } * var colorPicker = createColorpicker(); * supMenuItemContainer.appendChild(colorPicker); * return supMenuItemContainer; * } else { * var menuItemView = GC.Spread.Sheets.ContextMenu.MenuView.prototype.createMenuItemElement.call(self, menuItemData); * return menuItemView; * } * }; * CustomMenuView.prototype.getCommandOptions = function(menuItemData, host, event) { * if (menuItemData && menuItemData.name === "selectColorPicker") { * var ele = event.target || event.srcElement; * return ele.style.backgroundColor; * } * }; * CustomMenuView.prototype.getCommandOptions = function(menuItemData, host, event) { * if (menuItemData && menuItemData.name === "selectColorPicker") { * var ele = event.target || event.srcElement; * return ele.style.backgroundColor; * } * }; * var colors = ['rgb(255,255,255)', 'rgb(0,255,255)', 'rgb(255,0,255)', 'rgb(255,255,0)', 'rgb(255,0,0)', * 'rgb(0,255,0)', 'rgb(0,0,255)', 'rgb(0,0,0)']; * function createColorpicker() { * var colorPicker = document.createElement('div'); * colorPicker.className = 'colorPickerContent'; * for (var j = 0; j < 8; j++) { * var colorDom = document.createElement("div"); * colorDom.className = 'colorDom'; * colorDom.style.width = 14 + 'px'; * colorDom.style.height = 14 + 'px'; * colorDom.style.margin = "0 0 0 6px"; * colorDom.style.display = 'inline-block'; * colorDom.style['backgroundColor'] = colors[j]; * colorPicker.appendChild(colorDom); * } * return colorPicker; * } * spread.contextMenu.menuView = new CustomMenuView(); * }); * ``` */ createMenuItemElement(menuItemData: GC.Spread.Sheets.ContextMenu.IMenuItemData):HTMLElement; /** * get command options of specified menu item * @param {Object} menuItemData the data of the menu item which be clicked * @param {HTMLElement} host the container of the menu item which be clicked * @param {Object} event the mouse click event * @return {Object} command options of specified menu item * @example * ```javascript * var spread = new GC.Spread.Sheets.Workbook(document.getElementById("ss")); * function CustomMenuView() { * } * CustomMenuView.prototype = new GC.Spread.Sheets.ContextMenu.MenuView(); * CustomMenuView.prototype.getCommandOptions = function (menuItemData, host, event) { * if (menuItemData && menuItemData.name === "markWithABg") { * var ele = event.target || event.srcElement; * if (ele.className.indexOf("colorpicker-div-inner-colorcell") !== -1) { * ele = ele.parentElement; * } * return ele.style.background; * } * }; * ``` */ getCommandOptions(menuItemData: GC.Spread.Sheets.ContextMenu.IMenuItemData, host: Object, event: Object): any; /** * @description get or set context menu's max height * @param {number} [value] context menu's max height * @returns {number | void} represent the number of context menu's max height * @example * ```javascript * var spread = new GC.Spread.Sheets.Workbook(document.getElementById("ss")); * spread.contextMenu.menuView.maxHeight(400); * ``` */ maxHeight(value?: number): number | void; /** * @description get or set context menu scrollable * @param {boolean} [value] whether context menu could scrollable * @returns {boolean | void} represent whether the context menu can scroll * @example * ```javascript * var spread = new GC.Spread.Sheets.Workbook(document.getElementById("ss")); * spread.contextMenu.menuView.scrollable(false); * ``` */ scrollable(value?: boolean): boolean | void; } } module DataCharts{ export interface IAnimationOption{ duration?: number; easing?: GC.Spread.Sheets.DataCharts.AnimationEasing; scale?: number; startDelay?: number; } export interface IAxisOption{ type?: GC.Spread.Sheets.DataCharts.AxisType; labels?: boolean; axisLine?: boolean; reversed?: boolean; title?: string; max?: GC.Spread.Sheets.DataCharts.IValueOption; min?: GC.Spread.Sheets.DataCharts.IValueOption; position?: GC.Spread.Sheets.DataCharts.AxisPosition; origin?: number; format?: GC.Spread.Sheets.DataCharts.IFormatOption; majorUnit?: GC.Spread.Sheets.DataCharts.IAxisUnitOption; overlappingLabels?: GC.Spread.Sheets.DataCharts.OverlappingLabels; dateMode?: GC.Spread.Sheets.DataCharts.DateMode; hoverStyle?: GC.Spread.Sheets.DataCharts.ITextStyleOption; labelAngle?: number[]; labelStyle?: GC.Spread.Sheets.DataCharts.ILabelStyleOption; logBase?: number; majorGrid?: boolean; majorTickSize?: number; majorTicks?: GC.Spread.Sheets.DataCharts.TickMark; minorGrid?: boolean; minorTickSize?: number; minorTicks?: GC.Spread.Sheets.DataCharts.TickMark; minorUnit?: GC.Spread.Sheets.DataCharts.IAxisUnitOption; scale?: GC.Spread.Sheets.DataCharts.IValueScaleOption; style?: GC.Spread.Sheets.DataCharts.IStyleOption; titleStyle?: GC.Spread.Sheets.DataCharts.ITitleStyleOption; lineStyle?: GC.Spread.Sheets.DataCharts.ILineStyle; majorGridStyle?: GC.Spread.Sheets.DataCharts.ILineStyle; majorTickStyle?: GC.Spread.Sheets.DataCharts.ILineStyle; minorGridStyle?: GC.Spread.Sheets.DataCharts.ILineStyle; minorTickStyle?: GC.Spread.Sheets.DataCharts.ILineStyle; } export interface IAxisUnitOption{ dateMode?: GC.Spread.Sheets.DataCharts.DateMode; value?: number; } export interface IBarStyleOption{ overlap?: number; width?: number; borderRadius?: GC.Spread.Sheets.DataCharts.IBorderRadius; } export interface IBorderRadius{ bottomLeft?: number; bottomRight?: number; topLeft?: number; topRight?: number; } export interface ICategoryEncodingOption extends GC.Spread.Sheets.DataCharts.IFieldBasicOption{ sort?: GC.Spread.Sheets.DataCharts.ISortEncodingOption; } export interface IConfigLegendOption{ wrapping?: boolean; } export interface IConfigOption{ dvStyle?: GC.Spread.Sheets.DataCharts.IStyleOption; palette?: GC.Spread.Sheets.DataCharts.IPaletteItemOption[]; plotAreaLayout?: GC.Spread.Sheets.DataCharts.IPlotAreaLayoutOption; plotAreas?: GC.Spread.Sheets.DataCharts.IPlotAreaOption[]; style?: GC.Spread.Sheets.DataCharts.IStyleOption; textStyle?: GC.Spread.Sheets.DataCharts.ITextStyleOption; header?: GC.Spread.Sheets.DataCharts.IHeaderOption; } export interface IConnectingLineStyle{ stroke?: string; strokeWidth?: number; strokeDasharray?: string; firstLineLength?: number; secondLineLength?: number; } export interface IContentEncodingOption extends GC.Spread.Sheets.DataCharts.IFieldBasicOption{ aggregate?: GC.Spread.Sheets.DataCharts.Aggregate; } export interface ICssColorOptions{ type: "CssColor"; color?: GC.Spread.Sheets.DataCharts.ColorString; } export interface IDataChartConfig{ plots: GC.Spread.Sheets.DataCharts.IPlotOption[]; config?: GC.Spread.Sheets.DataCharts.IConfigOption; tableName?: string; } export interface IDataPointStyleOption extends GC.Spread.Sheets.DataCharts.IStyleOption{ symbol?: GC.Spread.Sheets.DataCharts.ISymbolStyleOption; bar?: GC.Spread.Sheets.DataCharts.IBarStyleOption; } export interface IFieldBasicOption{ field: string; displayName?: string; } export interface IFormatOption{ type?: GC.Spread.Sheets.DataCharts.FormatType; value: string; } export interface IFunnelOption{ funnelType?: GC.Spread.Sheets.DataCharts.FunnelType; topWidth?: number; bottomWidth?: number; neckHeight?: number; orientation?: GC.Spread.Sheets.DataCharts.Orientation; reversed?: boolean; } export interface IHeaderOption{ title?: string; textStyle?: GC.Spread.Sheets.DataCharts.ITextStyleOption; padding?: GC.Spread.Sheets.DataCharts.IPaddingOption; style?: GC.Spread.Sheets.DataCharts.IStyleOption; } export interface ILabelStyleOption{ color?: string; fontFamily?: string; fontSize?: number; fontStyle?: GC.Spread.Sheets.DataCharts.FontStyle; fontWeight?: string; opacity?: number; overflow?: GC.Spread.Sheets.DataCharts.TextOverflow; padding?: GC.Spread.Sheets.DataCharts.IPaddingOption; } export interface ILegendOptions{ title?: string; type?: GC.Spread.Sheets.DataCharts.LegendType; height?: number; width?: number; position?: GC.Spread.Sheets.DataCharts.LegendPosition; textStyle?: GC.Spread.Sheets.DataCharts.ITextStyleOption; hAlign?: GC.Spread.Sheets.DataCharts.HAlign; vAlign?: GC.Spread.Sheets.DataCharts.VAlign; padding?: GC.Spread.Sheets.DataCharts.IPaddingOption; } export interface ILineStyle{ stroke?: GC.Spread.Sheets.DataCharts.ColorOptions; strokeWidth?: number; strokeDasharray?: string; strokeOpacity?: number; } export interface IPaddingOption{ top?: number; bottom?: number; left?: number; right?: number; } export interface IPaletteItemOption{ color: GC.Spread.Sheets.DataCharts.ColorOptions; } export interface IPlotAreaLayoutOption{ columnWidths?: GC.Spread.Sheets.DataCharts.IValueOption[]; rowHeights?: GC.Spread.Sheets.DataCharts.IValueOption[]; } export interface IPlotAreaOption{ axes?: GC.Spread.Sheets.DataCharts.IAxisOption[]; column?: number; padding?: GC.Spread.Sheets.DataCharts.IPaddingOption; row?: number; textStyle?: GC.Spread.Sheets.DataCharts.ITextStyleOption; legends?: GC.Spread.Sheets.DataCharts.ILegendOptions[]; legend?: GC.Spread.Sheets.DataCharts.IConfigLegendOption; } export interface IPlotConfigOption{ hoverStyle?: GC.Spread.Sheets.DataCharts.IDataPointStyleOption; innerRadius?: number; outerRadius?: number; lineAspect?: GC.Spread.Sheets.DataCharts.LineAspect; palette?: string[]; startAngle?: number; style?: GC.Spread.Sheets.DataCharts.IDataPointStyleOption; swapAxes?: boolean; sweep?: number; symbols?: boolean; text?: GC.Spread.Sheets.DataCharts.IPlotConfigTextOption[]; tooltip?: GC.Spread.Sheets.DataCharts.IPlotConfigTooltipOption[]; hoverAnimation?: GC.Spread.Sheets.DataCharts.IAnimationOption; updateAnimation?: GC.Spread.Sheets.DataCharts.IAnimationOption; funnel?: GC.Spread.Sheets.DataCharts.IFunnelOption; } export interface IPlotConfigTextOption{ template?: string; format?: GC.Spread.Sheets.DataCharts.IFormatOption; style?: GC.Spread.Sheets.DataCharts.IStyleOption; textStyle?: GC.Spread.Sheets.DataCharts.ITextStyleOption; connectingLineStyle?: GC.Spread.Sheets.DataCharts.IConnectingLineStyle; maxWidth?: number; offset?: number; overlappingLabels?: GC.Spread.Sheets.DataCharts.OverlappingLabels; position?: GC.Spread.Sheets.DataCharts.TextPosition; } export interface IPlotConfigTooltipOption{ style?: GC.Spread.Sheets.DataCharts.IToolTipStyleOption; textStyle?: GC.Spread.Sheets.DataCharts.IToolTipTextStyleOption; } export interface IPlotEncodingsOption{ values?: GC.Spread.Sheets.DataCharts.IValueEncodingOption[]; category?: GC.Spread.Sheets.DataCharts.ICategoryEncodingOption; details?: GC.Spread.Sheets.DataCharts.IFieldBasicOption[]; color?: GC.Spread.Sheets.DataCharts.IFieldBasicOption; size?: GC.Spread.Sheets.DataCharts.IFieldBasicOption; tooltip?: GC.Spread.Sheets.DataCharts.IContentEncodingOption[]; filter?: GC.Spread.Sheets.DataCharts.IFilterOption; } export interface IPlotOption{ type: GC.Spread.Sheets.DataCharts.DataChartType; encodings?: GC.Spread.Sheets.DataCharts.IPlotEncodingsOption; config?: GC.Spread.Sheets.DataCharts.IPlotConfigOption; } export interface IQuadrangleStyleOption{ leftBorder?: GC.Spread.Sheets.DataCharts.ILineStyle; rightBorder?: GC.Spread.Sheets.DataCharts.ILineStyle; topBorder?: GC.Spread.Sheets.DataCharts.ILineStyle; bottomBorder?: GC.Spread.Sheets.DataCharts.ILineStyle; } export interface ISortEncodingOption{ field: string; aggregate?: GC.Spread.Sheets.DataCharts.Aggregate; order?: GC.Spread.Sheets.DataCharts.OrderType; } export interface IStyleOption{ fill?: GC.Spread.Sheets.DataCharts.ColorOptions; fillOpacity?: number; stroke?: GC.Spread.Sheets.DataCharts.ColorOptions; strokeDasharray?: string; strokeOpacity?: number; strokeWidth?: number; } export interface ISymbolStyleOption{ symbolShape?: GC.Spread.Sheets.DataCharts.SymbolShape; symbolSize?: number; } export interface ITextDecorationOption{ lineThrough?: boolean; overline?: boolean; underline?: boolean; } export interface ITextStyleOption{ alignment?: GC.Spread.Sheets.DataCharts.HAlign; color?: string; fontFamily?: string; fontSize?: number; fontStyle?: GC.Spread.Sheets.DataCharts.FontStyle; fontWeight?: string; opacity?: number; overflow?: GC.Spread.Sheets.DataCharts.TextOverflow; } export interface ITitleStyleOption{ color?: string; fontFamily?: string; fontSize?: number; fontStyle?: GC.Spread.Sheets.DataCharts.FontStyle; fontWeight?: string; opacity?: number; padding?: GC.Spread.Sheets.DataCharts.IPaddingOption; } export interface IToolTipStyleOption{ fill?: GC.Spread.Sheets.DataCharts.ColorOptions; stroke?: GC.Spread.Sheets.DataCharts.ColorOptions; strokeWidth?: number; fillOpacity?: number; strokeOpacity?: number; } export interface IToolTipTextStyleOption{ color?: string; fontFamily?: string; fontSize?: number; fontStyle?: GC.Spread.Sheets.DataCharts.FontStyle; fontWeight?: string; opacity?: number; textDecoration?: GC.Spread.Sheets.DataCharts.ITextDecorationOption; } export interface IValueEncodingOption extends GC.Spread.Sheets.DataCharts.IFieldBasicOption{ aggregate?: GC.Spread.Sheets.DataCharts.Aggregate; } export interface IValueFilter{ field: string; operate: GC.Spread.Sheets.DataCharts.ComparisonOperator | GC.Spread.Sheets.DataCharts.StringOperator; value: GC.Spread.Sheets.DataCharts.DataValueType | GC.Spread.Sheets.DataCharts.DataValueType[]; excludeMatched?: boolean; ignoreCase?: boolean; } export interface IValueFilterGroup{ conditions: GC.Spread.Sheets.DataCharts.IFilterOption[]; operate: GC.Spread.Sheets.DataCharts.LogicalOperation; } export interface IValueOption{ type?: GC.Spread.Sheets.DataCharts.ValueOptionType; value?: number; } export interface IValueScaleOption{ type?: GC.Spread.Sheets.DataCharts.ValueScaleType; } /** * @typedef GC.Spread.Sheets.DataCharts.ColorOptions * @type {GC.Spread.Sheets.DataCharts.ICssColorOptions} */ export type ColorOptions = GC.Spread.Sheets.DataCharts.ICssColorOptions /** * @typedef GC.Spread.Sheets.DataCharts.ColorString * @type {string} */ export type ColorString = string /** * @typedef GC.Spread.Sheets.DataCharts.DataValueType * @type {number | boolean | Date | string | null} */ export type DataValueType = number | boolean | Date | string | null /** * @typedef GC.Spread.Sheets.DataCharts.IFilterOption * @type {GC.Spread.Sheets.DataCharts.IValueFilter | GC.Spread.Sheets.DataCharts.IValueFilterGroup} */ export type IFilterOption = GC.Spread.Sheets.DataCharts.IValueFilter | GC.Spread.Sheets.DataCharts.IValueFilterGroup /** * Specifies the datachart plot value Aggregate. * @enum {number} */ export enum Aggregate{ /** * firstValue */ firstValue= 0, /** * sum */ sum= 1, /** * count */ count= 2, /** * average */ average= 3, /** * max */ max= 4, /** * min */ min= 5, /** * countDistinct */ countDistinct= 12 } /** * Specifies the datachart plot AnimationEasing. * @enum {number} */ export enum AnimationEasing{ /** * linear */ linear= 0, /** * swing */ swing= 1, /** * easeInQuad */ easeInQuad= 2, /** * easeOutQuad */ easeOutQuad= 3, /** * easeInOutQuad */ easeInOutQuad= 4, /** * easeInCubic */ easeInCubic= 5, /** * easeOutCubic */ easeOutCubic= 6, /** * easeInOutCubic */ easeInOutCubic= 7, /** * easeInQuart */ easeInQuart= 8, /** * easeOutQuart */ easeOutQuart= 9, /** * easeInOutQuart */ easeInOutQuart= 10, /** * easeInQuint */ easeInQuint= 11, /** * easeOutQuint */ easeOutQuint= 12, /** * easeInOutQuint */ easeInOutQuint= 13, /** * easeInSine */ easeInSine= 14, /** * easeOutSine */ easeOutSine= 15, /** * easeInOutSine */ easeInOutSine= 16, /** * easeInExpo */ easeInExpo= 17, /** * easeOutExpo */ easeOutExpo= 18, /** * easeInOutExpo */ easeInOutExpo= 19, /** * easeInCirc */ easeInCirc= 20, /** * easeOutCirc */ easeOutCirc= 21, /** * easeInOutCirc */ easeInOutCirc= 22, /** * easeInBack */ easeInBack= 23, /** * easeOutBack */ easeOutBack= 24, /** * easeInOutBack */ easeInOutBack= 25, /** * easeInBounce */ easeInBounce= 26, /** * easeOutBounce */ easeOutBounce= 27, /** * easeInOutBounce */ easeInOutBounce= 28, /** * easeInElastic */ easeInElastic= 29, /** * easeOutElastic */ easeOutElastic= 30, /** * easeInOutElastic */ easeInOutElastic= 31 } /** * Specifies the datachart plot AxisPosition. * @enum {number} */ export enum AxisPosition{ /** none */ none= 0, /** near */ near= 1, /** far */ far= 2 } /** * Specifies the datachart plot AxisType. * @enum {string} */ export enum AxisType{ /** x */ x= 0, /** y */ y= 1 } /** * Specifies the datachart filter operator. * @enum {string} */ export enum ComparisonOperator{ /** The field value must match any one of the given filter array. */ in= "In", /** The field value must be exactly equal to the target value. */ equalsTo= "EqualsTo", /** The field value is greater than target value. */ greaterThan= "GreaterThan", /** The field value is greater than or equal to the target value. */ greaterThanOrEqualsTo= "GreaterThanOrEqualsTo", /** The field value is less than target value. */ lessThan= "LessThan", /** The field value is less than or equal to the target value. */ lessThanOrEqualsTo= "LessThanOrEqualsTo", /** The field value is not equal to the target value. */ notEqualsTo= "NotEqualsTo" } /** * Specifies the datachart type. * @enum {string} */ export enum DataChartType{ /** * Identifies the current DataChart type as column */ column= "Column", /** * Identifies the current DataChart type as rangeColumn */ rangeColumn= "RangeColumn", /** * Identifies the current DataChart type as stackedColumn */ stackedColumn= "StackedColumn", /** * Identifies the current DataChart type as percentStackedColumn */ percentStackedColumn= "PercentStackedColumn", /** * Identifies the current DataChart type as bar */ bar= "Bar", /** * Identifies the current DataChart type as rangeBar */ rangeBar= "RangeBar", /** * Identifies the current DataChart type as stackedBar */ stackedBar= "StackedBar", /** * Identifies the current DataChart type as percentStackedBar */ percentStackedBar= "PercentStackedBar", /** * Identifies the current DataChart type as area */ area= "Area", /** * Identifies the current DataChart type as rangeArea */ rangeArea= "RangeArea", /** * Identifies the current DataChart type as stackedArea */ stackedArea= "StackedArea", /** * Identifies the current DataChart type as percentStackedArea */ percentStackedArea= "PercentStackedArea", /** * Identifies the current DataChart type as line */ line= "Line", /** * Identifies the current DataChart type as pie */ pie= "Pie", /** * Identifies the current DataChart type as donut */ donut= "Donut", /** * Identifies the current DataChart type as rose */ rose= "Rose", /** * Identifies the current DataChart type as radialStackedBar */ radialStackedBar= "RadialStackedBar", /** * Identifies the current DataChart type as sunburst */ sunburst= "Sunburst", /** * Identifies the current DataChart type as polarCoordinatesBar */ polarCoordinatesBar= "PolarCoordinatesBar", /** * Identifies the current DataChart type as polarCoordinatesStackedBar */ polarCoordinatesStackedBar= "PolarCoordinatesStackedBar", /** * Identifies the current DataChart type as radar */ radar= "Radar", /** * Identifies the current DataChart type as filledRadar */ filledRadar= "FilledRadar", /** * Identifies the current DataChart type as scatter */ scatter= "Scatter", /** * Identifies the current DataChart type as bubble */ bubble= "Bubble", /** * Identifies the current DataChart type as treemap */ treemap= "Treemap", /** * Identifies the current DataChart type as funnel */ funnel= "Funnel" } /** * Specifies the datachart plot DateMode. * @enum {string} */ export enum DateMode{ /** milliSecond */ milliSecond= 0, /** second */ second= 1, /** minute */ minute= 2, /** hour */ hour= 3, /** day */ day= 4, /** week */ week= 5, /** month */ month= 6, /** year */ year= 7 } /** * Specifies the datachart plot FontStyle. * @enum {string} */ export enum FontStyle{ /** normal */ normal= "Normal", /** italic */ italic= "Italic" } /** * Specifies the datachart data level. * @enum {string} */ export enum FormatType{ /** hundreds */ hundreds= "Hundreds", /** thousands */ thousands= "Thousands", /** tenThousand */ tenThousand= "10000", /** hundredThousand */ hundredThousand= "100000", /** millions */ millions= "Millions", /** tenMillion */ tenMillion= "10000000", /** hundredMillion */ hundredMillion= "100000000", /** billions */ billions= "Billions", /** trillions */ trillions= "Trillions" } /** * Specifies the datachart funnel type. * @enum {string} */ export enum FunnelType{ /** * default */ default= "Default", /** * bar */ bar= "Bar", /** * pyramid */ pyramid= "Pyramid" } /** * Specifies the datachart plot HAlign. * @enum {string} */ export enum HAlign{ /** center */ center= "Center", /** left */ left= "Left", /** right */ right= "Right" } /** * Specifies the datachart plot LegendPosition. * @enum {string} */ export enum LegendPosition{ /** none */ none= "None", /** bottom */ bottom= "Bottom", /** left */ left= "Left", /** right */ right= "Right", /** top */ top= "Top" } /** * Specifies the datachart plot LegendType. * @enum {string} */ export enum LegendType{ /** color */ color= "Color", /** size */ size= "Size" } /** * Describes the type of lines in the Area chart. * @enum {string} */ export enum LineAspect{ /** * default */ default= "Default", /** * spline */ spline= "Spline", /** * stepCenter */ stepCenter= "StepCenter" } /** * Specifies the datachart string filter logical operator. * @enum {string} */ export enum LogicalOperation{ /** and */ and= "AND", /** or */ or= "OR" } /** * Specifies the datachart order type. * @enum {string} */ export enum OrderType{ /** * ascending */ ascending= "Ascending", /** * descending */ descending= "Descending", /** * none */ none= "None" } /** * Specifies the datachart orientation. * @enum {string} */ export enum Orientation{ /** * horizontal */ horizontal= "Horizontal", /** * vertical */ vertical= "Vertical" } /** * Specifies the datachart plot OverlappingLabels. * @enum {string} */ export enum OverlappingLabels{ /** * show */ show= "Show", /** * hide */ hide= "Hide" } /** * Specifies the datachart string filter operator. * @enum {string} */ export enum StringOperator{ /** * The field value must match any one of the given string array. */ in= "In", /** * The field value must be exactly equal to the target value. */ equalsTo= "EqualsTo", /** * The field value contains the target substring. */ contains= "Contains", /** * The field value starts with the target string. */ startsWith= "StartsWith", /** * The field value ends with the target string. */ endsWith= "EndsWith", /** * The field value is not equal to the target value. */ notEqualsTo= "NotEqualsTo" } /** * Specifies the datachart SymbolShape. * @enum {number} */ export enum SymbolShape{ /** * dot */ dot= "Dot", /** * box */ box= "Box", /** * diamond */ diamond= "Diamond", /** * triangle */ triangle= "Triangle", /** * x */ x= "X", /** * plus */ plus= "Plus" } /** * Specifies the datachart plot TextOverflow. * @enum {string} */ export enum TextOverflow{ /** * clip */ clip= "Clip", /** * ellipsis */ ellipsis= "Ellipsis", /** * wrap */ wrap= "Wrap" } /** * Specifies the datachart plot TextPosition. * @enum {string} */ export enum TextPosition{ /** * center */ center= "Center", /** * inside */ inside= "Inside", /** * outside */ outside= "Outside" } /** * Specifies the datachart plot TickMark. * @enum {string} */ export enum TickMark{ /** cross */ cross= "Cross", /** inside */ inside= "Inside", /** none */ none= "None", /** outside */ outside= "Outside" } /** * Specifies the datachart plot VAlign. * @enum {string} */ export enum VAlign{ /** top */ top= "Top", /** bottom */ bottom= "Bottom", /** middle */ middle= "Middle" } /** * Specifies the datachart plot ValueOptionType. * @enum {string} */ export enum ValueOptionType{ /** number */ number= 0, /** date */ date= 1 } /** * Specifies the datachart plot ValueScaleType. * @enum {string} */ export enum ValueScaleType{ /** date */ date= "Date", /** linear */ linear= "Linear" } export class DataChart{ /** * Represents a datachart. * @class * @param {GC.Spread.Sheets.Worksheet} sheet The host sheet of the datachart. * @param {string} name The name of the datachart. * @param {number} x The x location of the datachart. * @param {number} y The y location of the datachart. * @param {number} width The width of the datachart. * @param {number} height The height of the datachart. * @param {GC.Spread.Sheets.DataCharts.DataChartType} type The type of the datachart. */ constructor(sheet: GC.Spread.Sheets.Worksheet, name: string, x: number, y: number, width: number, height: number, type: GC.Spread.Sheets.DataCharts.DataChartType); /** * Gets or sets whether to disable moving the data chart. * @param {boolean} value The setting for whether to disable moving the data chart. * @returns {boolean | GC.Spread.Sheets.DataCharts.DataChart} If no value is set, returns the setting for whether to disable moving the data chart; otherwise, returns the data chart. */ allowMove(value?: boolean): any; /** * Gets or sets whether to disable resizing the data chart. * @param {boolean} value The setting for whether to disable resizing the data chart. * @returns {boolean | GC.Spread.Sheets.DataCharts.DataChart} If no value is set, returns the setting for whether to disable resizing the data chart; otherwise, returns the data chart. */ allowResize(value?: boolean): any; /** * Gets or sets the alternative text of the data chart for screen readers. * @param {string} value The alternative text of the data chart. * @returns {string} The alternative text of the data chart. */ alt(value?: string): any; /** * Gets or sets whether this data chart is printable. * @param {boolean} value The value that indicates whether this data chart is printable. * @returns {boolean | void} If no value is set, returns whether this data chart is printable. */ canPrint(value?: boolean): any; /** * Gets or sets whether the object moves when hiding or showing, resizing, or moving rows or columns. * @param {boolean} value The value indicates whether the object moves when hiding or showing, resizing, or moving rows or columns. * @returns {boolean | GC.Spread.Sheets.DataCharts.DataChart} If no value is set, returns whether this data chart dynamically moves; otherwise, returns the data chart. */ dynamicMove(value?: boolean): any; /** * Gets or sets whether the position of the data chart is fixed. When fixedPosition is true, dynamicMove and dynamicSize are disabled. * @param {boolean} value The value indicates whether the position of the data chart is fixed. * @returns {boolean | GC.Spread.Sheets.DataCharts.DataChart} If no value is set, returns whether the position of the data chart is fixed; otherwise, returns the data chart. */ dynamicSize(value?: boolean): any; /** * Gets or sets the end column index of the data chart position. * @param {number} value The end column index of the data chart position. * @returns {number | GC.Spread.Sheets.DataCharts.DataChart} If no value is set, returns the end column index of the data chart position; otherwise, returns the data chart. */ endColumn(value?: number): any; /** * Gets or sets the offset relative to the end column of the data chart. * @param {number} value The offset relative to the end column of the data chart. * @returns {number | GC.Spread.Sheets.DataCharts.DataChart} If no value is set, returns the offset relative to the end column of the data chart; otherwise, returns the data chart. */ endColumnOffset(value?: number): any; /** * Gets or sets the end row index of the data chart position. * @param {number} value The end row index of the data chart position. * @returns {number | GC.Spread.Sheets.DataCharts.DataChart} If no value is set, returns the end row index of the data chart position; otherwise, returns the data chart. */ endRow(value?: number): any; /** * Gets or sets the offset relative to the end row of the data chart. * @param {number} value The offset relative to the end row of the data chart. * @returns {number | GC.Spread.Sheets.DataCharts.DataChart} If no value is set, returns the offset relative to the end row of the data chart; otherwise, returns the data chart. */ endRowOffset(value?: number): any; /** * get datachart config. * @return {object} The config of the datachart. * @example * ```javascript * var datachart = activeSheet.datacharts.add('datachart1', 250, 20, 480, 300, GC.Spread.Sheets.DataCharts.DataChartType.column); * console.log(datachart.getChartConfig()); * ``` */ getChartConfig(): GC.Spread.Sheets.DataCharts.IDataChartConfig; /** * Gets or sets the height of a data chart. * @param {number} value The height of a data chart. * @returns {number | GC.Spread.Sheets.DataCharts.DataChart} If no value is set, returns the height of a data chart; otherwise, returns the data chart. */ height(value?: number): any; /** * Gets or sets whether this data chart is locked. * @param {boolean} value The value that indicates whether this data chart is locked. * @returns {boolean | GC.Spread.Sheets.DataCharts.DataChart} If no value is set, returns whether this data chart is locked; otherwise, returns the data chart. */ isLocked(value?: boolean): any; /** * Gets or sets whether this data chart is selected. * @param {boolean} value The value that indicates whether this data chart is selected. * @returns {boolean | GC.Spread.Sheets.DataCharts.DataChart} If no value is set, returns whether this data chart is selected; otherwise, returns the data chart. */ isSelected(value?: boolean): any; /** * Gets or sets whether this data chart is visible. * @param {boolean} value The value that indicates whether this data chart is visible. * @returns {boolean | GC.Spread.Sheets.DataCharts.DataChart} If no value is set, returns whether this data chart is visible; otherwise, returns the data chart. */ isVisible(value?: boolean): any; /** * Gets the name of the data chart. * @param {string} value The name of the data chart. * @returns {string | GC.Spread.Sheets.DataCharts.DataChart} If no value is set, returns the name of the data chart; otherwise, returns the data chart. */ name(value?: string): any; /** * set datachart config. * @param {object} config The config of the datachart. * @example * ```javascript * var datachart = activeSheet.datacharts.add('datachart1', 250, 20, 480, 300, GC.Spread.Sheets.DataCharts.DataChartType.column); * var config = datachart.getChartConfig(); * config.plots[0].type = GC.Spread.Sheets.DataCharts.DataChartType.line; * datachart.setChartConfig(config); * ``` */ setChartConfig(config: GC.Spread.Sheets.DataCharts.IDataChartConfig): void; /** * Gets or sets the starting column index of the data chart position. * @param {number} value The starting column index of the data chart position. * @returns {number | GC.Spread.Sheets.DataCharts.DataChart} If no value is set, returns the starting column index of the data chart position; otherwise, returns the data chart. */ startColumn(value?: number): any; /** * Gets or sets the offset relative to the start column of the data chart. * @param {number} value The offset relative to the start column of the data chart. * @returns {number | GC.Spread.Sheets.DataCharts.DataChart} If no value is set, returns the offset relative to the start column of the data chart; otherwise, returns the data chart. */ startColumnOffset(value?: number): any; /** * Gets or sets the starting row index of the data chart position. * @param {number} value The starting row index of the data chart position. * @returns {number | GC.Spread.Sheets.DataCharts.DataChart} If no value is set, returns the starting row index of the data chart position; otherwise, returns the data chart. */ startRow(value?: number): any; /** * Gets or sets the offset relative to the start row of the data chart. * @param {number} value The offset relative to the start row of the data chart. * @returns {number | GC.Spread.Sheets.DataCharts.DataChart} If no value is set, returns the offset relative to the start row of the data chart; otherwise, returns the data chart. */ startRowOffset(value?: number): any; /** * Gets or sets the width of a data chart. * @param {number} value The width of a data chart. * @returns {number | GC.Spread.Sheets.DataCharts.DataChart} If no value is set, returns the width of a data chart; otherwise, returns the data chart. */ width(value?: number): any; /** * Gets or sets the horizontal location of the data chart. * @param {number} value The horizontal location of the data chart. * @return {number | GC.Spread.Sheets.DataCharts.DataChart} If no value is set, returns the horizontal location of the data chart; otherwise, returns the data chart. */ x(value?: number): any; /** * Gets or sets the vertical location of the data chart. * @param {number} value The vertical location of the data chart. * @return {number | GC.Spread.Sheets.DataCharts.DataChart} If no value is set, returns the vertical location of the data chart; otherwise, returns the data chart. */ y(value?: number): any; } export class DataChartConfigPanel{ /** * Represents a data chart config panel. * @class * @param {HTMLElement | string} host The host element or the host element id or the host element selector. * @param {object} spread The spread that the panel attach to. */ constructor(host: HTMLElement | string, spread: GC.Spread.Sheets.Workbook); /** * attach the spread to the config panel. * @example * ```javascript * configPanel.attach(spread); * ``` */ attach(spread: GC.Spread.Sheets.Workbook): void; /** * destroy the config panel. * @example * ```javascript * configPanel.destroy(); * ``` */ destroy(): void; /** * detach the spread from the config panel. * @example * ```javascript * configPanel.detach(); * ``` */ detach(): void; /** * Gets the DataChartConfigPanel instance by the host element. * @param {HTMLElement|string} host The host element or the host element id or the host element selector. * @returns {GC.Spread.Sheets.DataCharts.DataChartConfigPanel} The DataChartConfigPanel instance. * @example * ```javascript * const configPanel = GC.Spread.Sheets.DataCharts.DataChartConfigPanel.findControl('host'); * ``` */ static findControl(host: HTMLElement|string): GC.Spread.Sheets.DataCharts.DataChartConfigPanel; } export class DataChartManager{ /** * Represents a datachart manager that managers all datacharts in a sheet. * @class * @param {GC.Spread.Sheets.Worksheet} sheet The worksheet. */ constructor(); /** * Adds a datachart to the sheet. * @param {string} name The name of the datachart that will be added to the sheet. * @param {number} x The x location of the datachart. * @param {number} y The y location of the datachart. * @param {number} width The width of the datachart. * @param {number} height The height of the datachart. * @param {GC.Spread.Sheets.DataCharts.DataChartType} type The type of the datachart. * @return {GC.Spread.Sheets.DataCharts.DataChart} The datachart that has been added to the sheet. * @example * ```javascript * //This example shows how to add a datachart. * var datachart = activeSheet.datacharts.add('datachart1', 250, 20, 480, 300, GC.Spread.Sheets.DataCharts.DataChartType.column); * ``` */ add(name: string, x: number, y: number, width: number, height: number, type: GC.Spread.Sheets.DataCharts.DataChartType): GC.Spread.Sheets.DataCharts.DataChart; /** * get all data charts. * @return {GC.Spread.Sheets.DataCharts.DataChart[]} get all data charts. * @example * ```javascript * activeSheet.datacharts.add('DataChart1', 0, 20, 480, 300, GC.Spread.Sheets.DataCharts.DataChartType.column); * activeSheet.datacharts.add('DataChart2', 500, 20, 480, 300, GC.Spread.Sheets.DataCharts.DataChartType.pie); * var dataCharts = activeSheet.datacharts.all(); * for (var i = 0; i < dataCharts.length; i++) { * alert("Name of dataChart " + i + " is: " + dataCharts[i].name()) * } * ``` */ all(): GC.Spread.Sheets.DataCharts.DataChart[]; /** * remove all data charts. */ clear(): void; /** * get a data charts by name. * @param {string} name data chart name. * @return {GC.Spread.Sheets.DataCharts.DataChart} get a data charts by name. * @example * ```javascript * activeSheet.datacharts.add('DataChart1', 0, 20, 480, 300, GC.Spread.Sheets.DataCharts.DataChartType.column); * //button * $("#button1").click(function () { * var dataChart = activeSheet.datacharts.get("DataChart1"); * }); * ``` */ get(name: string): GC.Spread.Sheets.DataCharts.DataChart; /** * remove a data charts by name. * @param {string} name data chart name. * @example * ```javascript * activeSheet.datacharts.add('DataChart1', 0, 20, 480, 300, GC.Spread.Sheets.DataCharts.DataChartType.column); * //button * $("#button1").click(function () { * activeSheet.resumePaint(); * activeSheet.datacharts.remove("DataChart1"); * activeSheet.repaint(); * }); * ``` */ remove(name: string): void; /** * Gets or sets the z-index of chart. * @param {string} name The name of the chart. * @param {number} zIndex The z-index of the chart. * @return {number | *} If the parameter 'zIndex' is null or undefined,it will return the z-index of the chart with the indicate name. * @example * ```javascript * activeSheet.datacharts.add('DataChart1', 200, 20, 480, 300, GC.Spread.Sheets.DataCharts.DataChartType.column); * activeSheet.datacharts.add('DataChart2', 0, 20, 480, 300, GC.Spread.Sheets.DataCharts.DataChartType.pie); * activeSheet.datacharts.zIndex('DataChart1', 897); * activeSheet.datacharts.zIndex('DataChart2', 890); * ``` */ zIndex(name: string, zIndex?: number): any; } } module DataRange{ export interface IDataProvider{ /** * The data provider host. */ host: GC.Spread.Sheets.DataRange.DataRange; /** * Implement this hook to provide values to data range cells. The `row` and `col` parameters are based on the data range axis. If returns `undefined`, it means fail to get value from data provider, so it will continue to get the value from sheet model. */ getValue?: (row: number, col: number) => unknown; /** * Implement this hook to receive the changed values from data range. The `row` and `col` parameters are based on the data range axis. Post your change into `changes` parameter if you want undo/redo. If returns `true`, it means set value successfully to data provider, so it will prevent to set the value to sheet model. */ setValue?: (row: number, col: number, value: unknown, changes: any[]) => boolean; /** * Implement this hook to provide styles to data range cells. The `row` and `col` parameters are based on the data range axis. It should return the style as `GC.Spread.Sheets.Style`, otherwise, means fail to get style from data provider, so it will continue to get the style from sheet model. */ getStyle?: (row: number, col: number) => GC.Spread.Sheets.Style; /** * Implement this hook to provide spans to data range cells. The `row`, `col`, `rowCount` and `colCount` parameters are based on the data range axis. */ getSpans?: (row: number, col: number, rowCount: number, colCount: number) => GC.Spread.Sheets.Range[]; /** * Implement this hook to receive changed rows information. The `row` and `rowCount` parameters are based on the data range axis. Post your change into `changes` parameter if you want undo/redo. */ onRowChange?: (row: number, rowCount: number, changeType: "add" | "delete", changes: any[]) => void; /** * Implement this hook to receive changed columns information. The `col` and `colCount` parameters are based on the data range axis. Post your change into `changes` parameter if you want undo/redo. */ onColumnChange?: (col: number, colCount: number, changeType: "add" | "delete", changes: any[]) => void; /** * Implement this hook to handle the copy action. Input parameter `name` is copied data range name, need to return a different new data range `name` and a data provider instance. Return `true` means prevent the copy actions from the sheet. Return `false` means prevent to copy data range. Default is `false`. */ onCopy?: (name: string) => {name: string, dataProvider: GC.Spread.Sheets.DataRange.IDataProvider} | boolean; /** * Implement this hook to handle the clear contents action. Return `true` means prevent the clear actions from the sheet. Return `false` means prevent to clear data range contents. Default is `false`. */ onClear?: (row: number, col: number, rowCount: number, colCount: number, changes: any[]) => boolean; /** * Implement this hook to handle the destroy action. */ onDestroy?: () => void; /** * Implement this hook to handle the mouse down action. The `row` and `col` parameters are based on the data range axis. Return `true` means prevent the next sheet actions. Default is false. */ onMouseDown?: (row: number, col: number, e: MouseEvent) => boolean; /** * Implement this hook to handle the mouse move action. The `row` and `col` parameters are based on the data range axis. Return `true` means prevent the next sheet actions. Default is false. */ onMouseMove?: (row: number, col: number, e: MouseEvent) => boolean; /** * Implement this hook to handle the mouse up action. The `row` and `col` parameters are based on the data range axis. Return `true` means prevent the next sheet actions. Default is false. */ onMouseUp?: (row: number, col: number, e: MouseEvent) => boolean; /** * Implement this hook to handle the mouse context menu action. The `row` and `col` parameters are based on the data range axis. Return `true` means prevent the next sheet actions. Default is false. */ onContextMenu?: (row: number, col: number, e: MouseEvent) => boolean; /** * Implement this hook to handle the mouse double click action. The `row` and `col` parameters are based on the data range axis. Return `true` means prevent the next sheet actions. Default is false. */ onDoubleClick?: (row: number, col: number, e: MouseEvent) => boolean; /** * Implement this hook to handle the mouse wheel action. Return `true` means prevent the next sheet actions. Default is false. */ onMouseWheel?: (deltaX: number, deltaY: number, e: MouseEvent) => boolean; /** * Implement this hook to handle the key down action. The `row` and `col` parameters are based on the data range axis. Return `true` means prevent the next sheet actions. Default is false. */ onKeyDown?: (row: number, col: number, e: KeyboardEvent) => boolean; /** * Implement this hook to handle the key down action. The `row` and `col` parameters are based on the data range axis. Return `true` means prevent the next sheet actions. Default is false. */ onKeyUp?: (row: number, col: number, e: KeyboardEvent) => boolean; /** * Implement this hook to handle the undo action. Input parameter `change` is the user created in the corresponding hooks. */ undo?: (change: any) => void; /** * Implement this hook to handle the serialization. */ toJSON?: () => { typeName: string, [prop: string]: any }; /** * Implement this hook to handle the deserialization. */ fromJSON?: (options: { typeName: string, [prop: string]: any }) => void; } export interface IDataRangeOptions{ /** * Indicates the top rows count to be sticked. */ sticky: { top: number }; } export class DataRange{ /** * Represents a data range. * @class * @param {string} name The name of the data range. * @param {GC.Spread.Sheets.DataRange.IDataProvider} dataProvider The data provider of the data range. * @param {GC.Spread.Sheets.Range} range The range of the data range. * @param {GC.Spread.Sheets.DataRange.IDataRangeOptions} [options] The options of the data range. */ constructor(name: string, dataProvider: GC.Spread.Sheets.DataRange.IDataProvider, range: GC.Spread.Sheets.Range, options?: GC.Spread.Sheets.DataRange.IDataRangeOptions); /** * @description Get or set the name of the data range. * @param {string} [name] this name of the data range * @returns {string} If no value is set, returns the name of the data range. */ name(name?: string): string; /** * @description Get or set the range of the data range. * @param {GC.Spread.Sheets.Range} [range] this range of the data range * @returns {GC.Spread.Sheets.Range} If no value is set, returns the range of the data range. */ range(range?: GC.Spread.Sheets.Range): GC.Spread.Sheets.Range; /** * @description repaint the data range */ repaint(): void; } export class DataRangeManager{ /** * @description Represents a data range manager. * @class * @param {GC.Spread.Sheets.Worksheet} sheet The worksheet. */ constructor(sheet: GC.Spread.Sheets.Worksheet); /** * @description Adds a data range. * @param {string} name The data range name. * @param {GC.Spread.Sheets.DataRange.IDataProvider | string} dataProvider The data provider. String type means the tableSheet name, it will create a TableSheetDataProvider. * @param {GC.Spread.Sheets.Range} range The range of data range. * @param {GC.Spread.Sheets.DataRange.IDataRangeOptions} [options] The data range options. * @returns {GC.Spread.Sheets.DataRange.DataRange} The added data range. */ add(name: string, dataProvider: GC.Spread.Sheets.DataRange.IDataProvider | string, range: GC.Spread.Sheets.Range, options?: GC.Spread.Sheets.DataRange.IDataRangeOptions): GC.Spread.Sheets.DataRange.DataRange; /** * @description Get all data ranges. * @returns {GC.Spread.Sheets.DataRange.DataRange[]} The array of data range instances. Default is empty array. */ all(): GC.Spread.Sheets.DataRange.DataRange[]; /** * @description Remove all data ranges. */ clear(): void; /** * @description Gets a data range. * @param {string} name The data range name. * @returns {GC.Spread.Sheets.DataRange.DataRange} The target data range. */ get(name: string): GC.Spread.Sheets.DataRange.DataRange; /** * @description Remove a data range. * @param {string} name The data range name. */ remove(name: string): void; } } module DataValidation{ /** * Creates a validator based on the data. * @static * @param {GC.Spread.Sheets.ConditionalFormatting.ComparisonOperators} typeOperator The compare operator type. The possible values for this attribute are defined by the GC.Spread.Sheets.ConditionalFormatting.ComparisonOperators. * @param {object} v1 The first object. * @param {object} [v2] The second object. * @returns {GC.Spread.Sheets.DataValidation.DefaultDataValidator} The validator. * @example * ```javascript * spread.options.highlightInvalidData = true; * var dv = GC.Spread.Sheets.DataValidation.createDateValidator(GC.Spread.Sheets.ConditionalFormatting.ComparisonOperators.between, new Date(2012, 11, 31), new Date(2013, 11, 31)); * dv.showInputMessage(true); * dv.inputMessage("Enter a date between 12/31/2012 and 12/31/2013."); * dv.inputTitle("Tip"); * activeSheet.getCell(1, -1).validator(dv); * ``` */ function createDateValidator(typeOperator: GC.Spread.Sheets.ConditionalFormatting.ComparisonOperators, v1: Object, v2?: Object): GC.Spread.Sheets.DataValidation.DefaultDataValidator; /** * Creates a validator based on a formula list. * @static * @param {string} formula The formula list. * @returns {GC.Spread.Sheets.DataValidation.DefaultDataValidator} The validator. * @example * ```javascript * activeSheet.setValue(0, 2, 5); * activeSheet.setValue(1, 2, 4); * activeSheet.setValue(2, 2, 5); * spread.options.highlightInvalidData = true; * var dv = GC.Spread.Sheets.DataValidation.createFormulaListValidator("$C$1:$C$3"); * dv.showInputMessage(true); * dv.inputMessage("Pick a value from the list."); * dv.inputTitle("tip"); * activeSheet.setDataValidator(1, 1, 1,1,dv,GC.Spread.Sheets.SheetArea.viewport); * var validList = activeSheet.getDataValidator(1, 1).getValidList(activeSheet, 1, 1); * alert(validList); * ``` */ function createFormulaListValidator(formula: string): GC.Spread.Sheets.DataValidation.DefaultDataValidator; /** * Creates a validator based on a formula. * @static * @param {string} formula The formula condition. * @returns {GC.Spread.Sheets.DataValidation.DefaultDataValidator} The validator. * @example * ```javascript * spread.options.highlightInvalidData = true; * //The formula validator is valid if the formula condition returns true. * var dv = GC.Spread.Sheets.DataValidation.createFormulaValidator("A1>0"); * dv.showInputMessage(true); * dv.inputMessage("Enter a value greater than 0 in A1."); * dv.inputTitle("Tip"); * activeSheet.setDataValidator(0, 0, 1,1,dv,GC.Spread.Sheets.SheetArea.viewport); * ``` */ function createFormulaValidator(formula: string): GC.Spread.Sheets.DataValidation.DefaultDataValidator; /** * Creates a validator based on a list. * @static * @param {string} source The list value. * @returns {GC.Spread.Sheets.DataValidation.DefaultDataValidator} The validator. * @example * ```javascript * spread.options.highlightInvalidData = true; * var dv = GC.Spread.Sheets.DataValidation.createListValidator("1,2,3"); * dv.showInputMessage(true); * dv.inputMessage("Value must be 1,2 or 3"); * dv.inputTitle("tip"); * activeSheet.setDataValidator(1,1,1,1,dv, GC.Spread.Sheets.SheetArea.viewport); * alert(activeSheet.getDataValidator(1,1).getValidList(activeSheet,1,1)); * ``` */ function createListValidator(source: string): GC.Spread.Sheets.DataValidation.DefaultDataValidator; /** * Creates a validator based on numbers. * @static * @param {GC.Spread.Sheets.ConditionalFormatting.ComparisonOperators} typeOperator The compare operator type. The possible values for this attribute are defined by the GC.Spread.Sheets.ConditionalFormatting.ComparisonOperators. * @param {object} v1 The first object. * @param {object} [v2] The second object. * @param {boolean} [isIntegerValue] Set to `true` if the validator is set to a number. * @returns {GC.Spread.Sheets.DataValidation.DefaultDataValidator} The validator. * @example * ```javascript * spread.options.highlightInvalidData = true; * var dv = GC.Spread.Sheets.DataValidation.createNumberValidator(GC.Spread.Sheets.ConditionalFormatting.ComparisonOperators.between, 5, 20, true); * dv.showInputMessage(true); * dv.inputMessage("Value must be between 5 and 20."); * dv.inputTitle("tip"); * activeSheet.setDataValidator(1, 1, 1,1,dv,GC.Spread.Sheets.SheetArea.viewport); * ``` */ function createNumberValidator(typeOperator: GC.Spread.Sheets.ConditionalFormatting.ComparisonOperators, v1: Object, v2?: Object, isIntegerValue?: boolean): GC.Spread.Sheets.DataValidation.DefaultDataValidator; /** * Creates a validator based on text length. * @static * @param {GC.Spread.Sheets.ConditionalFormatting.ComparisonOperators} typeOperator The compare operator type. The possible values for this attribute are defined by the GC.Spread.Sheets.ConditionalFormatting.ComparisonOperators. * @param {object} v1 The first object. * @param {object} [v2] The second object. * @returns {GC.Spread.Sheets.DataValidation.DefaultDataValidator} The validator. * @example * ```javascript * spread.options.highlightInvalidData = true; * var dv = GC.Spread.Sheets.DataValidation.createTextLengthValidator(GC.Spread.Sheets.ConditionalFormatting.ComparisonOperators.greaterThan, 4); * dv.showInputMessage(true); * dv.inputMessage("Number of characters must be greater than 4."); * dv.inputTitle("tip"); * activeSheet.setDataValidator(1, 1, 1, 1, dv, GC.Spread.Sheets.SheetArea.viewport); * ``` */ function createTextLengthValidator(typeOperator: GC.Spread.Sheets.ConditionalFormatting.ComparisonOperators, v1: Object, v2?: Object): GC.Spread.Sheets.DataValidation.DefaultDataValidator; /** * Creates a validator based on the time. * @static * @param {GC.Spread.Sheets.ConditionalFormatting.ComparisonOperators} typeOperator The compare operator type. The possible values for this attribute are defined by the GC.Spread.Sheets.ConditionalFormatting.ComparisonOperators. * @param {object} v1 The first object. * @param {object} [v2] The second object. * @returns {GC.Spread.Sheets.DataValidation.DefaultDataValidator} The validator. * @example * ```javascript * spread.options.highlightInvalidData = true; * var dv = GC.Spread.Sheets.DataValidation.createTimeValidator(GC.Spread.Sheets.ConditionalFormatting.ComparisonOperators.between, '9:08:09', '19:08:09'); * dv.showInputMessage(true); * dv.inputMessage("Enter a time between 9:08:09 and 19:08:09."); * dv.inputTitle("Tip"); * sheet.setDataValidator(1, 1, dv); * ``` */ function createTimeValidator(typeOperator: GC.Spread.Sheets.ConditionalFormatting.ComparisonOperators, v1: Object, v2?: Object): GC.Spread.Sheets.DataValidation.DefaultDataValidator; export interface IHighLightStyle{ /** * Indicates the data validation highlightType. */ type?: GC.Spread.Sheets.DataValidation.HighlightType; /** * Indicates the data validation highlight color. */ color?: string; /** * Indicates the data validation highlight position. */ position?: GC.Spread.Sheets.DataValidation.HighlightPosition; /** * Indicates the data validation highlight image url or data. */ image?: string; } /** * Indicates the data validator criteria type. * @enum {number} * @example * ```javascript * //This example uses the CriteriaType enumeration. * var textLengthCondition = new GC.Spread.Sheets.ConditionalFormatting.Condition(GC.Spread.Sheets.ConditionalFormatting.ConditionType.textLengthCondition); * textLengthCondition.compareType(GC.Spread.Sheets.ConditionalFormatting.GeneralComparisonOperators.greaterThan); * textLengthCondition.formula("$C$1"); // formula used to calculate a number. * var validator = new GC.Spread.Sheets.DataValidation.DefaultDataValidator(textLengthCondition); * validator.type(GC.Spread.Sheets.DataValidation.CriteriaType.custom); * activeSheet.getCell(0, 0, GC.Spread.Sheets.SheetArea.viewport).validator(validator); * spread.options.highlightInvalidData = true; * activeSheet.setValue(0, 0, "abcf"); * //Set value 3 to $C$1, after this code, the value in Cell(0,0) is valid. * activeSheet.setValue(0, 2, 3); * //Set value 5 to $C$1, after this code, the value in Cel(0,0) is invalid. * // activeSheet.setValue(0, 2, 5); * ``` */ export enum CriteriaType{ /** * Specifies that the data validation allows any type of value and does not check for a type or range of values. */ anyValue= 0, /** * Specifies that the data validation checks for and allows whole number values satisfying the given condition. */ wholeNumber= 1, /** * Specifies that the data validation checks for and allows decimal values satisfying the given condition. */ decimalValues= 2, /** * Specifies that the data validation checks for and allows a value that matches one in a list of values. */ list= 3, /** * Specifies that the data validation checks for and allows date values satisfying the given condition. */ date= 4, /** * Specifies that the data validation checks for and allows time values satisfying the given condition. */ time= 5, /** * Specifies that the data validation checks for and allows text values whose length satisfies the given condition. */ textLength= 6, /** * Specifies that the data validation uses a custom formula to check the cell value. */ custom= 7 } /** * Indicates the data validation result. * @enum {number} */ export enum DataValidationResult{ /** * Indicates to apply the value to a cell for a validation error. */ forceApply= 0, /** * Indicates to discard the value and not apply it to the cell for a validation error. */ discard= 1, /** * Indicates to retry multiple times to apply the value to the cell for a validation error. */ retry= 2 } /** * Indicates the data validation error style. * @enum {number} */ export enum ErrorStyle{ /** * Specifies to use a stop icon in the error alert. */ stop= 0, /** * Specifies to use a warning icon in the error alert. */ warning= 1, /** * Specifies to use an information icon in the error alert. */ information= 2 } /** * Indicates the data validation highlightposition. * @enum {number} * @example * ```javascript * //This example uses the highlightStyle method. * sheet.setValue(1, 1, "sss"); * var dv = GC.Spread.Sheets.DataValidation.createListValidator('Fruit,Vegetable,Food'); * dv.highlightStyle({ * type:GC.Spread.Sheets.DataValidation.HighlightType.dogEar, * color:'blue', * position:GC.Spread.Sheets.DataValidation.HighlightPosition.topLeft * }); * sheet.setDataValidator(1,1, dv); * spread.options.highlightInvalidData = true; * ``` */ export enum HighlightPosition{ /** * Specifies highlight flag on the topleft of the invalid data cell. */ topLeft= 0, /** * Specifies highlight flag on the topright of the invalid data cell. */ topRight= 1, /** * Specifies highlight flag on the bottomright of the invalid data cell. */ bottomRight= 2, /** * Specifies highlight flag on the bottomleft of the invalid data cell. */ bottomLeft= 3, /** * Specifies image which type is icon on the left of the invalid data cell. */ outsideLeft= 4, /** * Specifies image which type is icon on the Right of the invalid data cell. */ outsideRight= 5 } /** * Indicates the data validation highlightType. * @enum {number} * @example * ```javascript * //This example uses the highlightStyle method. * sheet.setValue(1, 1, "sss"); * var dv = GC.Spread.Sheets.DataValidation.createListValidator('Fruit,Vegetable,Food'); * dv.highlightStyle({ * type:GC.Spread.Sheets.DataValidation.HighlightType.dogEar, * color:'blue', * position:GC.Spread.Sheets.DataValidation.HighlightPosition.topLeft * }); * sheet.setDataValidator(1,1, dv); * spread.options.highlightInvalidData = true; * ``` */ export enum HighlightType{ /** * Specifies to use a circle in the invalid data cell. */ circle= 0, /** * Specifies to use a dogEar in the invalid data cell. */ dogEar= 1, /** * Specifies to use a icon in the invalid data cell. */ icon= 2 } export class DefaultDataValidator{ /** * Represents a data validator. * @class * @param {GC.Spread.Sheets.ConditionalFormatting.Condition} [condition] The condition. * @example * ```javascript * //This example validates the cell data. * spread.options.highlightInvalidData = true; * var dv = GC.Spread.Sheets.DataValidation.createTextLengthValidator(GC.Spread.Sheets.ConditionalFormatting.ComparisonOperators.greaterThan, 5); * activeSheet.setDataValidator(0, 0, 1, 1, dv, GC.Spread.Sheets.SheetArea.viewport); * activeSheet.setValue(0, 0, "abcf"); * ``` */ constructor(condition?: GC.Spread.Sheets.ConditionalFormatting.Condition); /** * Gets or sets the comparison operator. * @param {GC.Spread.Sheets.ConditionalFormatting.ComparisonOperators} [value] The comparison operator. * @returns {GC.Spread.Sheets.ConditionalFormatting.ComparisonOperators | GC.Spread.Sheets.DataValidation.DefaultDataValidator} If no value is set, returns the comparison operator; otherwise, returns the data validator. */ comparisonOperator(value?: GC.Spread.Sheets.ConditionalFormatting.ComparisonOperators): any; /** * Gets or sets the condition to validate. * @param {GC.Spread.Sheets.ConditionalFormatting.Condition} [value] The condition to validate. * @returns {GC.Spread.Sheets.ConditionalFormatting.Condition | GC.Spread.Sheets.DataValidation.DefaultDataValidator} If no value is set, returns the condition to validate; otherwise, returns the data validator. * @example * ```javascript * var nCondition = new GC.Spread.Sheets.ConditionalFormatting.Condition(GC.Spread.Sheets.ConditionalFormatting.ConditionType.averageCondition, {compareType: GC.Spread.Sheets.ConditionalFormatting.AverageConditionType.above}); * nCondition.ranges([new GC.Spread.Sheets.Range(0, 0, 10, 3)]); * var validator = new GC.Spread.Sheets.DataValidation.DefaultDataValidator(); * validator.type(GC.Spread.Sheets.DataValidation.CriteriaType.custom); * validator.condition(nCondition); * activeSheet.getCell(0, 0, GC.Spread.Sheets.SheetArea.viewport).validator(validator); * spread.options.highlightInvalidData = true; * activeSheet.setValue(0, 0, 5); * activeSheet.setValue(1, 0, 15); * ``` */ condition(value?: GC.Spread.Sheets.ConditionalFormatting.Condition): any; /** * Gets or sets the error message. * @param {string} [value] The error message. * @returns {string | GC.Spread.Sheets.DataValidation.DefaultDataValidator} If no value is set, returns the error message; otherwise, returns the data validator. * @example * ```javascript * var nCondition = new GC.Spread.Sheets.ConditionalFormatting.Condition(GC.Spread.Sheets.ConditionalFormatting.ConditionType.cellValueCondition); * nCondition.compareType(GC.Spread.Sheets.ConditionalFormatting.GeneralComparisonOperators.equalsTo); * nCondition.expected(0); * var validator = new GC.Spread.Sheets.DataValidation.DefaultDataValidator(nCondition); * validator.type(GC.Spread.Sheets.DataValidation.CriteriaType.custom); * validator.errorMessage('Incorrect input, please input a positive number'); * activeSheet.getCell(0, 0, GC.Spread.Sheets.SheetArea.viewport).validator(validator); * ``` */ errorMessage(value?: string): any; /** * Gets or sets the error style to display. * @param {GC.Spread.Sheets.DataValidation.ErrorStyle} [value] The error style to display. * @returns {GC.Spread.Sheets.DataValidation.ErrorStyle | GC.Spread.Sheets.DataValidation.DefaultDataValidator} If no value is set, returns the error style to display; otherwise, returns the data validator. * @example * ```javascript * var nCondition = new GC.Spread.Sheets.ConditionalFormatting.Condition(GC.Spread.Sheets.ConditionalFormatting.ConditionType.averageCondition, {compareType: GC.Spread.Sheets.ConditionalFormatting.AverageConditionType.above}); * nCondition.ranges([new GC.Spread.Sheets.Range(0, 0, 10, 3)]); * var validator = new GC.Spread.Sheets.DataValidation.DefaultDataValidator(nCondition); * validator.type(GC.Spread.Sheets.DataValidation.CriteriaType.custom); * validator.errorStyle(GC.Spread.Sheets.DataValidation.ErrorStyle.warning); * activeSheet.getCell(0, 0, GC.Spread.Sheets.SheetArea.viewport).validator(validator); * spread.options.highlightInvalidData = true; * activeSheet.setValue(0, 0, 5); * activeSheet.setValue(1, 0, 15); * ``` */ errorStyle(value?: GC.Spread.Sheets.DataValidation.ErrorStyle): any; /** * Gets or sets the error title. * @param {string} [value] The error title. * @returns {string | GC.Spread.Sheets.DataValidation.DefaultDataValidator} If no value is set, returns the error title; otherwise, returns the data validator. */ errorTitle(value?: string): any; /** * Returns the valid data lists if the Data validation type is list; otherwise, returns null. * @param {object} evaluator The object that can evaluate a condition. * @param {number} baseRow The base row. * @param {number} baseColumn The base column. * @returns {Object[]} The valid data lists or null. * @example * ```javascript * spread.options.highlightInvalidData = true; * var dv = GC.Spread.Sheets.DataValidation.createListValidator("1,2,3"); * dv.showInputMessage(true); * dv.inputMessage("Value must be 1,2 or 3"); * dv.inputTitle("tip"); * activeSheet.setDataValidator(1,1,1,1,dv, GC.Spread.Sheets.SheetArea.viewport); * alert(activeSheet.getDataValidator(1,1).getValidList(activeSheet,1,1)); * ``` */ getValidList(evaluator: Object, baseRow: number, baseColumn: number): any[]; /** * Get or Sets the invalid data cell highlight style. * @param {GC.Spread.Sheets.DataValidation.IHighLightStyle} [style] - The style of invalid data cell. * @returns {GC.Spread.Sheets.DataValidation.IHighLightStyle | GC.Spread.Sheets.DataValidation.DefaultDataValidator} If no value is set, returns the hignlight style object; otherwise, returns the data validator. * @example * ```javascript * //This example uses the highlightStyle method. * sheet.setValue(1, 1, "sss"); * var dv = GC.Spread.Sheets.DataValidation.createListValidator('Fruit,Vegetable,Food'); * dv.highlightStyle({ * type:GC.Spread.Sheets.DataValidation.HighlightType.dogEar, * color:'blue', * position:GC.Spread.Sheets.DataValidation.HighlightPosition.topLeft * }); * sheet.setDataValidator(1,1, dv); * spread.options.highlightInvalidData = true; * ``` */ highlightStyle(style?: GC.Spread.Sheets.DataValidation.IHighLightStyle): any; /** * Gets or sets whether to ignore an empty value. * @param {boolean} [value] Indicates whether to ignore the empty value. * @returns {boolean | GC.Spread.Sheets.DataValidation.DefaultDataValidator} If no value is set, returns whether to ignore the empty value; otherwise, returns the data validator. * @example * ```javascript * //This example uses the IgnoreBlank method. * var nCondition = new GC.Spread.Sheets.ConditionalFormatting.Condition(GC.Spread.Sheets.ConditionalFormatting.ConditionType.cellValueCondition); * nCondition.compareType(GC.Spread.Sheets.ConditionalFormatting.GeneralComparisonOperators.equalsTo); * nCondition.expected(0); * //When the option is false, the validation fails and the red alert is displayed. * //When the option is true, the blank cell is treated as zero and the validation is successful. * nCondition.treatNullValueAsZero(false); * var validator = new GC.Spread.Sheets.DataValidation.DefaultDataValidator(nCondition); * validator.type(GC.Spread.Sheets.DataValidation.CriteriaType.custom); * validator.ignoreBlank(false); * activeSheet.getCell(0, 0, GC.Spread.Sheets.SheetArea.viewport).validator(validator); * spread.options.highlightInvalidData = true; * activeSheet.setValue(0, 0, null); * ``` */ ignoreBlank(value?: boolean): any; /** * Gets or sets whether to display a drop-down button. * @param {boolean} [value] Indicates whether to display a drop-down button. * @returns {boolean | GC.Spread.Sheets.DataValidation.DefaultDataValidator} If no value is set, returns whether to display a drop-down button; otherwise, returns the data validator. * @example * ```javascript * //This example uses the inCellDropdown method. * spread.options.highlightInvalidData = true; * var dv = GC.Spread.Sheets.DataValidation.createListValidator("1,2,3"); * dv.showInputMessage(true); * dv.inputMessage("Value must be 1,2 or 3"); * dv.inputTitle("tip"); * dv.inCellDropdown(true); * activeSheet.setDataValidator(1,1,1,1,dv,GC.Spread.Sheets.SheetArea.viewport); * var validList = activeSheet.getDataValidator(1, 1).getValidList(activeSheet, 1, 1); * alert(validList); * ``` */ inCellDropdown(value?: boolean): any; /** * Gets or sets the input message. * @param {string} [value] The input message. * @returns {string | GC.Spread.Sheets.DataValidation.DefaultDataValidator} If no value is set, returns the input message; otherwise, returns the data validator. * @example * ```javascript * spread.options.highlightInvalidData = true; * var dv = GC.Spread.Sheets.DataValidation.createListValidator("1,2,3"); * dv.showInputMessage(true); * dv.inputMessage("Value must be 1,2 or 3"); * dv.inputTitle("tip"); * activeSheet.setDataValidator(1,1,1,1,dv,GC.Spread.Sheets.SheetArea.viewport); * alert(activeSheet.getDataValidator(1,1).getValidList(activeSheet,1,1)); * ``` */ inputMessage(value?: string): any; /** * Gets or sets the input title. * @param {string} [value] The input title. * @returns {string | GC.Spread.Sheets.DataValidation.DefaultDataValidator} If no value is set, returns the input title; otherwise, returns the data validator. * @example * ```javascript * spread.options.highlightInvalidData = true; * var dv = GC.Spread.Sheets.DataValidation.createListValidator("1,2,3"); * dv.showInputMessage(true); * dv.inputMessage("Value must be 1,2 or 3"); * dv.inputTitle("tip"); * activeSheet.setDataValidator(1,1,1,1,dv,GC.Spread.Sheets.SheetArea.viewport); * alert(activeSheet.getDataValidator(1,1).getValidList(activeSheet,1,1)); * ``` */ inputTitle(value?: string): any; /** * Determines whether the current value is valid. * @param {object} evaluator The evaluator. * @param {number} baseRow The base row. * @param {number} baseColumn The base column. * @param {object} actual The current value. * @returns {boolean} `true` if the value is valid; otherwise, `false`. * @example * ```javascript * sheet.setArray(0, 0, * [ * [ 3.4 ], * [ 102.8 ] * ]); * var expression1 = 1.1; * var expression2 = 101.2; * var dv = GC.Spread.Sheets.DataValidation.createNumberValidator(GC.Spread.Sheets.ConditionalFormatting.ComparisonOperators.between, expression1, expression2, false); * sheet.getCell(0, 0, GC.Spread.Sheets.SheetArea.viewport).validator(dv); * dv = sheet.getCell(0, 0, GC.Spread.Sheets.SheetArea.viewport).validator(); // Limitation of SDM, the dv is copied when set to style. * console.log(dv.isValid(sheet, 0, 0, 3)); // true * console.log(dv.isValid(sheet, 0, 0, 1)); // false * console.log(dv.isValid(sheet, 0, 0, 101)); // true * console.log(dv.isValid(sheet, 0, 0, 0)); // false * console.log(dv.isValid(sheet, 0, 0, 120.0)); // false * ``` */ isValid(evaluator: Object, baseRow: number, baseColumn: number, actual: Object): boolean; /** * Gets or sets whether to compare whole day or precise date time. * @param {boolean} [value] Indicates compare whole day or precise date time. * @returns {boolean | GC.Spread.Sheets.DataValidation.DefaultDataValidator} If no value is set, returns compare whole day or precise date time; otherwise, returns the data validator. * @example * ```javascript * //This example uses the preciseCompareDate method. * var dateCondition = new GC.Spread.Sheets.ConditionalFormatting.Condition(GC.Spread.Sheets.ConditionalFormatting.ConditionType.dateCondition); * dateCondition.compareType(GC.Spread.Sheets.ConditionalFormatting.DateCompareType.after); * dateCondition.expected(new Date(2020, 4, 22, 6)); * //When the option is false, the validator compares the whole day, and they are the same, so validation fails and the red alert is displayed. * //When the option is true, the date time 7 o'clock is greater than 6 o'clock, so the result is successful. * var validator = new GC.Spread.Sheets.DataValidation.DefaultDataValidator(dateCondition); * validator.type(GC.Spread.Sheets.DataValidation.CriteriaType.date); * validator.preciseCompareDate(true); * activeSheet.getCell(0, 0, GC.Spread.Sheets.SheetArea.viewport).validator(validator); * spread.options.highlightInvalidData = true; * activeSheet.setValue(0, 0, new Date(2020, 4, 22, 7)); * ``` */ preciseCompareDate(value?: boolean): any; /** * Resets the data validator. * @example * ```javascript * //This example uses the reset method. * var nCondition = new GC.Spread.Sheets.ConditionalFormatting.Condition(GC.Spread.Sheets.ConditionalFormatting.ConditionType.cellValueCondition); * nCondition.compareType(GC.Spread.Sheets.ConditionalFormatting.GeneralComparisonOperators.equalsTo); * nCondition.expected(0); * //When the option is false, the validation fails and the red alert is displayed. * //When the option is true, the blank cell is treated as zero and the validation is successful. * nCondition.treatNullValueAsZero(false); * var validator = new GC.Spread.Sheets.DataValidation.DefaultDataValidator(nCondition); * validator.type(GC.Spread.Sheets.DataValidation.CriteriaType.custom); * validator.ignoreBlank(false); * activeSheet.getCell(0, 0, GC.Spread.Sheets.SheetArea.viewport).validator(validator); * spread.options.highlightInvalidData = true; * activeSheet.setValue(0, 0, null); * validator.reset(); * ``` */ reset(): void; /** * Gets or sets whether to display an error message. * @param {boolean} [value] Indicates whether to display an error message. * @returns {boolean | GC.Spread.Sheets.DataValidation.DefaultDataValidator} If no value is set, returns whether to display an error message; otherwise, returns the data validator. * @example * ```javascript * spread.options.highlightInvalidData = true; * //The formula validator is valid if the formula condition returns true. * var dv = GC.Spread.Sheets.DataValidation.createFormulaValidator("A1>0"); * dv.showInputMessage(true); * dv.inputMessage("Enter a value greater than 0 in A1."); * dv.inputTitle("Tip"); * dv.showErrorMessage(true); * dv.errorMessage("Incorrect Value"); * activeSheet.setDataValidator(0, 0, 1, 1, dv, GC.Spread.Sheets.SheetArea.viewport); * //bind * activeSheet.bind(GC.Spread.Sheets.Events.ValidationError, function (sender, args) { * if (args.validator.showErrorMessage()) { * if (confirm(args.validator.errorMessage())) { * args.validationResult = GC.Spread.Sheets.DataValidation.DataValidationResult.retry; * } else { * args.validationResult = GC.Spread.Sheets.DataValidation.DataValidationResult.forceApply; * } * } * }); * ``` */ showErrorMessage(value?: boolean): any; /** * Gets or sets whether to display the input title and input message. * @param {boolean} [value] Indicates whether to display the input title and input message. * @returns {boolean | GC.Spread.Sheets.DataValidation.DefaultDataValidator} If no value is set, returns whether to display the input title and input message; otherwise, returns the data validator. * @example * ```javascript * spread.options.highlightInvalidData = true; * var dv = GC.Spread.Sheets.DataValidation.createListValidator("1,2,3"); * dv.showInputMessage(true); * dv.inputMessage("Value must be 1,2 or 3"); * dv.inputTitle("tip"); * activeSheet.setDataValidator(1,1,1,1,dv,GC.Spread.Sheets.SheetArea.viewport); * alert(activeSheet.getDataValidator(1,1).getValidList(activeSheet,1,1)); * ``` */ showInputMessage(value?: boolean): any; /** * Gets or sets the criteria type of this data validator. * @param {GC.Spread.Sheets.DataValidation.CriteriaType} [value] The criteria type of this data validator. * @returns {GC.Spread.Sheets.DataValidation.CriteriaType | GC.Spread.Sheets.DataValidation.DefaultDataValidator} If no value is set, returns the criteria type of this data validator; otherwise, returns the data validator. * @example * ```javascript * //This example uses the preciseCompareDate method. * var dateCondition = new GC.Spread.Sheets.ConditionalFormatting.Condition(GC.Spread.Sheets.ConditionalFormatting.ConditionType.dateCondition); * dateCondition.compareType(GC.Spread.Sheets.ConditionalFormatting.DateCompareType.after); * dateCondition.expected(new Date(2020, 4, 22, 6)); * //When the option is false, the validator compares the whole day, and they are the same, so validation fails and the red alert is displayed. * //When the option is true, the date time 7 o'clock is greater than 6 o'clock, so the result is successful. * var validator = new GC.Spread.Sheets.DataValidation.DefaultDataValidator(dateCondition); * validator.type(GC.Spread.Sheets.DataValidation.CriteriaType.date); * validator.preciseCompareDate(true); * activeSheet.getCell(0, 0, GC.Spread.Sheets.SheetArea.viewport).validator(validator); * spread.options.highlightInvalidData = true; * activeSheet.setValue(0, 0, new Date(2020, 4, 22, 7)); * ``` */ type(value?: GC.Spread.Sheets.DataValidation.CriteriaType): any; /** * Gets the first value of the data validation. * @param {number} [baseRow] The base row. * @param {number} [baseColumn] The base column. * @returns {object} The first value. * @example * ```javascript * //This example validates a cell value. * var nCondition = new GC.Spread.Sheets.ConditionalFormatting.Condition(GC.Spread.Sheets.ConditionalFormatting.ConditionType.cellValueCondition); * nCondition.compareType(GC.Spread.Sheets.ConditionalFormatting.GeneralComparisonOperators.equalsTo); * nCondition.expected(0); * //When the option is false, the validation fails and the red alert is displayed. * //When the option is true, the blank cell is treated as zero and the validation is successful. * nCondition.treatNullValueAsZero(false); * var validator = new GC.Spread.Sheets.DataValidation.DefaultDataValidator(nCondition); * validator.type(GC.Spread.Sheets.DataValidation.CriteriaType.custom); * validator.ignoreBlank(false); * activeSheet.getCell(0, 0, GC.Spread.Sheets.SheetArea.viewport).validator(validator); * spread.options.highlightInvalidData = true; * activeSheet.setValue(0, 0, null); * alert(validator.value1()); * ``` */ value1(baseRow?: number, baseColumn?: number): any; /** * Gets the second value of the data validation. * @param {number} [baseRow] The base row. * @param {number} [baseColumn] The base column. * @returns {object} The second value. * @example * ```javascript * //This example validates a cell value. * var nCondition = new GC.Spread.Sheets.ConditionalFormatting.Condition(GC.Spread.Sheets.ConditionalFormatting.ConditionType.cellValueCondition); * nCondition.compareType(GC.Spread.Sheets.ConditionalFormatting.GeneralComparisonOperators.equalsTo); * nCondition.expected(0); * //When the option is false, the validation fails and the red alert is displayed. * //When the option is true, the blank cell is treated as zero and the validation is successful. * nCondition.treatNullValueAsZero(false); * var validator = new GC.Spread.Sheets.DataValidation.DefaultDataValidator(nCondition); * validator.type(GC.Spread.Sheets.DataValidation.CriteriaType.custom); * validator.ignoreBlank(false); * activeSheet.getCell(0, 0, GC.Spread.Sheets.SheetArea.viewport).validator(validator); * spread.options.highlightInvalidData = true; * activeSheet.setValue(0, 0, null); * alert(validator.value2()); * ``` */ value2(baseRow?: number, baseColumn?: number): any; } } module Fill{ export interface IFillOptions{ fillType: GC.Spread.Sheets.Fill.FillType; series: GC.Spread.Sheets.Fill.FillSeries; direction?: GC.Spread.Sheets.Fill.FillDirection; step?: number; stop?: number; unit?: GC.Spread.Sheets.Fill.FillDateUnit; } // /** * Represents the type of drag fill. * @enum {number} * @example * ```javascript * //This example uses the AutoFillType enumeration. * console.log(spread.options.defaultDragFillType); // equals to GC.Spread.Sheets.Fill.AutoFillType.auto * spread.options.defaultDragFillType = GC.Spread.Sheets.Fill.AutoFillType.copyCells; * ``` */ export enum AutoFillType{ /** * Fills cells with all data objects, including values, formatting, and formulas. */ copyCells= 0, /** * Fills cells with series. */ fillSeries= 1, /** * Fills cells only with formatting. */ fillFormattingOnly= 2, /** * Fills cells with values and not formatting. */ fillWithoutFormatting= 3, /** * Clears cell values. */ clearValues= 4, /** * Automatically fills cells. */ auto= 5 } // /** * Represents the date fill unit. * @enum {number} * @example * ```javascript * //This example uses the FillDateUnit enumeration. * spread.options.allowUserDragFill = true; * activeSheet.setValue(0, 0, new Date(2011, 1, 1)); * activeSheet.setValue(0, 1, new Date(2011, 2, 9)); * activeSheet.setValue(0, 2, 5); * activeSheet.setValue(0, 3, 10); * activeSheet.setValue(0, 4, 1); * * var start = new GC.Spread.Sheets.Range(0, 0, 1, 1); * var r = new GC.Spread.Sheets.Range(0, 0, 4, 1); * activeSheet.fillAuto(start, r, { * fillType: GC.Spread.Sheets.Fill.FillType.date, * series: GC.Spread.Sheets.Fill.FillSeries.column, * fillDirection: GC.Spread.Sheets.Fill.FillDirection.down, * unit: GC.Spread.Sheets.Fill.FillDateUnit.day, * step: 1, * stop: new Date(2011, 2, 11) * }); * * start = new GC.Spread.Sheets.Range(0, 1, 1, 1); * var r2 = new GC.Spread.Sheets.Range(0, 1, 4, 1); * activeSheet.fillAuto(start, r2, { * fillType: GC.Spread.Sheets.Fill.FillType.date, * series: GC.Spread.Sheets.Fill.FillSeries.column, * fillDirection:GC.Spread.Sheets.Fill.FillDirection.down, * unit: GC.Spread.Sheets.Fill.FillDateUnit.day, * step: 1, * stop: new Date(2011, 2, 11) * }); * ``` */ export enum FillDateUnit{ /** Sets the date fill unit to day. * @type {number} */ day= 0, /** Sets the date fill unit to weekday. * @type {number} */ weekday= 1, /** Sets the date fill unit to month. * @type {number} */ month= 2, /** Sets the date fill unit to year. * @type {number} */ year= 3 } // /** * Represents the type of drag fill direction. * @enum {number} * @example * ```javascript * var start = new GC.Spread.Sheets.Range(0, 2, 1, 1); * activeSheet.setValue(0, 2, 5); * var r3 = new GC.Spread.Sheets.Range(0, 2, 4, 1); * activeSheet.fillAuto(start, r3, {fillType: GC.Spread.Sheets.Fill.FillType.auto, fillDirection:GC.Spread.Sheets.Fill.FillDirection.down, series: GC.Spread.Sheets.Fill.FillSeries.column}); * ``` */ export enum FillDirection{ /** * Fills from the right to the left. */ left= 0, /** * Fills from the left to the right. */ right= 1, /** * Fills from the bottom to the top. */ up= 2, /** * Fills from the top to the bottom. */ down= 3 } // /** * Represents the fill series for drag fill. * @enum {number} * @example * ```javascript * //This example automatically fills the data in an area of the sheet. * activeSheet.setValue(0, 0, 5); * var start = new GC.Spread.Sheets.Range(0, 0, 1, 1); * var r3 = new GC.Spread.Sheets.Range(0, 0, 4, 1); * activeSheet.fillAuto(start,r3, {fillType:GC.Spread.Sheets.Fill.FillType.auto, series:GC.Spread.Sheets.Fill.FillSeries.column, fillDirection:GC.Spread.Sheets.Fill.FillDirection.down}); * ``` */ export enum FillSeries{ /** * Fills the column data. */ column= 0, /** * Fills the row data. */ row= 1 } // /** * Represents the type of fill data. * @enum {number} * @example * ```javascript * start = new GC.Spread.Sheets.Range(0, 2, 1, 1); * var r3 = new GC.Spread.Sheets.Range(0, 2, 4, 1); * activeSheet.fillAuto(start, r3, { * fillType: GC.Spread.Sheets.Fill.FillType.auto, * series: GC.Spread.Sheets.Fill.FillSeries.column, * }); * ``` */ export enum FillType{ /** Represents the direction fill type. * @type {number} */ direction= 0, /** Represents the linear fill type. * @type {number} */ linear= 1, /** Represents the growth fill type. * @type {number} */ growth= 2, /** Represents the date fill type. * @type {number} */ date= 3, /** Represents the auto fill type. * @type {number} */ auto= 4 } } module Filter{ export interface IFilterDialogVisibleInfo{ /** * Whether to show the sort by value area in filter dialog. */ sortByValue? : boolean; /** * Whether to show the sort by color area in filter dialog. */ sortByColor? : boolean; /** * Whether to show the filter by color area in filter dialog. */ filterByColor? : boolean; /** * Whether to show the filter by value area in filter dialog. */ filterByValue? : boolean; /** * Whether to show the list filter in filter dialog. */ listFilterArea? : boolean; } export interface IFilteredArgs{ action: GC.Spread.Sheets.Filter.FilterActionType; sheet: GC.Spread.Sheets.Worksheet; range: GC.Spread.Sheets.Range; filteredRows: number[]; filteredOutRows: number[]; columns: number[]; } /** * Defines the type of filter action. * @enum {number} */ export enum FilterActionType{ /** Specifies the filter action. */ filter= 0, /** Specifies the unfilter action. */ unfilter= 1 } export class HideRowFilter extends RowFilterBase{ /** * Represents a default row filter. * @class GC.Spread.Sheets.Filter.HideRowFilter * @extends GC.Spread.Sheets.Filter.RowFilterBase * @param {GC.Spread.Sheets.Range} [range] The filter range. * @example * ```javascript * //The following example creates a new filter. * sheet.rowFilter(new GC.Spread.Sheets.Filter.HideRowFilter(new GC.Spread.Sheets.Range(0,0,4,4))); * sheet.repaint(); * ``` */ constructor(range?: GC.Spread.Sheets.Range); /** * Gets or sets the visible info for the row filter. * @param {GC.Spread.Sheets.Filter.IFilterDialogVisibleInfo} [visibleInfo] The visible info for row filter. * @returns {GC.Spread.Sheets.Filter.IFilterDialogVisibleInfo | GC.Spread.Sheets.Filter.HideRowFilter} If no value is set filter dialog visible info; otherwise, returns the HideRowFilter. * @example * ```javascript * //This example creates a row filter. * sheet.rowFilter(new GC.Spread.Sheets.Filter.HideRowFilter(new GC.Spread.Sheets.Range(1, 1, 10, 3))); * var filter = sheet.rowFilter(); * filter.filterDialogVisibleInfo({ * sortByValue : false, * sortByColor : true, * filterByColor : true, * filterByValue : true, * listFilterArea : false * }); * ``` */ filterDialogVisibleInfo(visibleInfo?: GC.Spread.Sheets.Filter.IFilterDialogVisibleInfo): any; } export class RowFilterBase{ /** * Represents a row filter base that supports row filters for filtering rows in a sheet. * @class GC.Spread.Sheets.Filter.RowFilterBase * @param {GC.Spread.Sheets.Range} range The filter range. */ constructor(range: GC.Spread.Sheets.Range); /** * Represents the extendedRange for the row filter. * @type {GC.Spread.Sheets.Range} */ extendedRange: GC.Spread.Sheets.Range; /** * Represents the range for the row filter. * @type {GC.Spread.Sheets.Range} */ range: GC.Spread.Sheets.Range; /** * Represents the type name string used for supporting serialization. * @type {string} */ typeName: string; /** * Adds a specified filter to the row filter. * @param {number} col The column index. * @param {GC.Spread.Sheets.ConditionalFormatting.Condition|GC.Spread.Sheets.ConditionalFormatting.Condition[]} condition The condition to filter. * @example * ```javascript * sheet.setRowCount(3); * sheet.setColumnCount(1); * sheet.setArray(0, 0, * [ * [ 1 ], * [ 2 ], * [ 3 ] * ]); * sheet.rowFilter(new GC.Spread.Sheets.Filter.HideRowFilter(new GC.Spread.Sheets.Range(-1, -1, -1, -1))); * var condition = new GC.Spread.Sheets.ConditionalFormatting.Condition(GC.Spread.Sheets.ConditionalFormatting.ConditionType.textCondition, {compareType: GC.Spread.Sheets.ConditionalFormatting.TextCompareType.equalsTo,expected: '3'}); * sheet.rowFilter().addFilterItem(0, condition); * sheet.rowFilter().filter(0); * ``` */ addFilterItem(col: number, condition: GC.Spread.Sheets.ConditionalFormatting.Condition | GC.Spread.Sheets.ConditionalFormatting.Condition[]): void; /** * Filters the specified column. * @param {number} col The index of the column to be filtered; if it is omitted, all the columns in the range will be filtered. * @example * ```javascript * sheet.setRowCount(2); * sheet.setColumnCount(1); * sheet.setArray(0, 0, * [ * [ "a" ], * [ "b" ] * ]); * sheet.rowFilter(new GC.Spread.Sheets.Filter.HideRowFilter(new GC.Spread.Sheets.Range(-1, -1, -1, -1))); * var condition = new GC.Spread.Sheets.ConditionalFormatting.Condition(GC.Spread.Sheets.ConditionalFormatting.ConditionType.textCondition, {compareType: GC.Spread.Sheets.ConditionalFormatting.TextCompareType.equalsTo,expected: 'a'}); * var rowFilter = sheet.rowFilter(); * rowFilter.addFilterItem(0, condition); * rowFilter.filter(0); * ``` */ filter(col?: number): void; /** * Gets or sets whether the sheet column's filter button is displayed. * @param {number|boolean} [col] The column index of the filter button. * @param {boolean} [value] Whether the filter button is displayed. * @returns {boolean | GC.Spread.Sheets.Filter.RowFilterBase} * No parameter `false` if all filter buttons are invisible; otherwise, `true`. * One parameter col `false` if the specified column filter button is invisible; otherwise, `true`. * One parameter value GC.Spread.Sheets.Filter.RowFilterBase sets all filter buttons to be visible(true)/invisible(false). * Two parameters col,value GC.Spread.Sheets.Filter.RowFilterBase sets the specified column filter button to be visible(true)/invisible(false). * @example * ```javascript * sheet.setArray(2, 2, * [ * [ 1, 4 ], * [ 2, 5 ], * [ 3, 6 ] * ] ); * sheet.rowFilter(new GC.Spread.Sheets.Filter.HideRowFilter(new GC.Spread.Sheets.Range(2, 2, 3, 2))); * console.log(sheet.rowFilter().filterButtonVisible()); // true * sheet.rowFilter().filterButtonVisible(2, false); * console.log(sheet.rowFilter().filterButtonVisible(2)); // false * console.log(sheet.rowFilter().filterButtonVisible(3)); // true * ``` */ filterButtonVisible(col?: number | boolean, value?: boolean): any; /** * Loads the object state from the specified JSON string. * @param {object} settings The row filter data from deserialization. */ fromJSON(settings: Object): void; /** * Gets all the filtered conditions. * @returns {GC.Spread.Sheets.ConditionalFormatting.Condition[]} Returns a collection that contains all the filtered conditions. * @example * ```javascript * sheet.setRowCount(3); * sheet.setColumnCount(2); * sheet.setArray(0, 0, * [ * [ 1, 2 ], * [ 3, 4 ], * [ 5, 6 ] * ]); * sheet.rowFilter(new GC.Spread.Sheets.Filter.HideRowFilter(new GC.Spread.Sheets.Range(-1, -1, -1, -1))); * var condition = new GC.Spread.Sheets.ConditionalFormatting.Condition(GC.Spread.Sheets.ConditionalFormatting.ConditionType.numberCondition, { compareType: GC.Spread.Sheets.ConditionalFormatting.GeneralComparisonOperators.greaterThan, expected: 1 }); * var condition1 = new GC.Spread.Sheets.ConditionalFormatting.Condition(GC.Spread.Sheets.ConditionalFormatting.ConditionType.numberCondition, { compareType: GC.Spread.Sheets.ConditionalFormatting.GeneralComparisonOperators.greaterThan, expected: 4 }); * sheet.rowFilter().addFilterItem(0, condition); * sheet.rowFilter().addFilterItem(1, condition1); * console.log(sheet.rowFilter().getFilteredItems().length); // 0 * sheet.rowFilter().filter(); * console.log(sheet.rowFilter().getFilteredItems().length); // 2 * sheet.rowFilter().removeFilterItems(0); * console.log(sheet.rowFilter().getFilteredItems().length); // 1 * sheet.rowFilter().removeFilterItems(1); * console.log(sheet.rowFilter().getFilteredItems().length); // 0 * ``` */ getFilteredItems(): GC.Spread.Sheets.ConditionalFormatting.Condition[]; /** * Gets the filters for the specified column. * @param {number} col The column index. * @returns {GC.Spread.Sheets.ConditionalFormatting.Condition[]} Returns a collection that contains conditions that belong to a specified column. * @example * ```javascript * sheet.getCell(0, 0).value("a"); * sheet.getCell(0, 1).value("b"); * sheet.getCell(1, 0).value("ac"); * sheet.getCell(1, 1).value("bd"); * sheet.rowFilter( new GC.Spread.Sheets.Filter.HideRowFilter(new GC.Spread.Sheets.Range( -1, -1, -1, -1))); * var condition1 = new GC.Spread.Sheets.ConditionalFormatting.Condition(GC.Spread.Sheets.ConditionalFormatting.ConditionType.textCondition, { compareType: GC.Spread.Sheets.ConditionalFormatting.TextCompareType.equalsTo,expected: 'a' }); * var condition2 = new GC.Spread.Sheets.ConditionalFormatting.Condition(GC.Spread.Sheets.ConditionalFormatting.ConditionType.textCondition, { compareType: GC.Spread.Sheets.ConditionalFormatting.TextCompareType.equalsTo,beginsWith: '' }); * sheet.rowFilter().addFilterItem(0, condition1); * sheet.rowFilter().addFilterItem(1, condition2); * console.log(sheet.rowFilter().getFilterItems(0)); // result is array, length is 1, and the item equals to condition1. * ``` */ getFilterItems(col: number): GC.Spread.Sheets.ConditionalFormatting.Condition[]; /** * Gets the current sort state. * @param {number} col The column index. * @returns {GC.Spread.Sheets.SortState} The sort state of the current filter. * @example * ```javascript * sheet.setArray(0, 0, [ * [ 4 ], * [ 3 ], * [ 2 ], * [ 1 ], * [ 0 ] * ]); * sheet.rowFilter( new GC.Spread.Sheets.Filter.HideRowFilter( new GC.Spread.Sheets.Range( 0, 0, 5, 1 ) ) ); * sheet.rowFilter().addFilterItem( 0, new GC.Spread.Sheets.ConditionalFormatting.Condition(GC.Spread.Sheets.ConditionalFormatting.ConditionType.numberCondition, { compareType: GC.Spread.Sheets.ConditionalFormatting.GeneralComparisonOperators.greaterThan, expected: 2 })); * sheet.rowFilter().filter(0); * sheet.rowFilter().sortColumn(0, false); * console.log(sheet.rowFilter().getSortState(0)); // 2 * ``` */ getSortState(col: number): GC.Spread.Sheets.SortState; /** * Gets a value that indicates whether any row or specified column is filtered. * @param {number} [col] The column index. * @returns {boolean} No parameter `true` if some rows are filtered; otherwise, `false`. * One parameter col `true` if the specified column is filtered; otherwise, `false`. * @example * ```javascript * //This example uses the isFiltered method. * activeSheet.setValue(0, 0, "North"); * activeSheet.setValue(1, 0, "South"); * activeSheet.setValue(2, 0, "East"); * activeSheet.setValue(3, 0, "South"); * activeSheet.setValue(4, 0, "North"); * activeSheet.setValue(5, 0, "North"); * activeSheet.setValue(6, 0, "West"); * activeSheet.setColumnWidth(0, 80); * //Set a row filter. * activeSheet.rowFilter(new GC.Spread.Sheets.Filter.HideRowFilter(new GC.Spread.Sheets.Range(0, 0, 7, 1))); * //button * $("#button1").click(function () { * var rowFilter = spread.getActiveSheet().rowFilter(); * if (rowFilter.isFiltered(0)) { * alert("Row-filtering executed for Column1"); * } else { * alert("Row-filtering not executed for Column1"); * } * }); * //Add button control to page * * ``` */ isFiltered(col?: number): boolean; /** * Determines whether the specified row is filtered out. * @param {number} row The row index. * @returns {boolean} `true` if the row is filtered out; otherwise, `false`. * @example * ```javascript * sheet.setRowCount(2); * sheet.setColumnCount(1); * sheet.setArray(0, 0, * [ * [ 1 ], * [ 2 ] * ] ); * sheet.rowFilter(new GC.Spread.Sheets.Filter.HideRowFilter(new GC.Spread.Sheets.Range(-1, -1, -1, -1))); * var condition = new GC.Spread.Sheets.ConditionalFormatting.Condition(GC.Spread.Sheets.ConditionalFormatting.ConditionType.textCondition, {compareType: GC.Spread.Sheets.ConditionalFormatting.TextCompareType.equalsTo,expected: '2'}); * sheet.rowFilter().addFilterItem(0, condition); * sheet.rowFilter().filter(0); * sheet.addRows(1, 1); * console.log(sheet.rowFilter().isFiltered()); // true * console.log(sheet.rowFilter().isRowFilteredOut(0)); // true * console.log(sheet.rowFilter().isRowFilteredOut(1)); // false * ``` */ isRowFilteredOut(row: number): boolean; /** * Performs the action when some columns have just been filtered or unfiltered. * @param {GC.Spread.Sheets.Filter.IFilteredArgs} args An object that contains the action, sheet, range, filteredRows, filteredOutRows, and columns. * @example * ```javascript * sheet.setRowCount(3); * sheet.setColumnCount(2); * sheet.setArray(0, 0, * [ * [ 1, 2 ], * [ 3, 4 ], * [ 5, 6 ] * ]); * function HighLightFilter(range) { * GC.Spread.Sheets.Filter.RowFilterBase.call(this, range); * } * HighLightFilter.prototype = new GC.Spread.Sheets.Filter.RowFilterBase(new GC.Spread.Sheets.Range(-1, -1, -1, -1)); * var doFilterCalled = false; * HighLightFilter.prototype.onFilter = function(args) { * if ( args.action === GC.Spread.Sheets.Filter.FilterActionType.filter ) { * doFilterCalled = true; * } * }; * sheet.rowFilter(new HighLightFilter(new GC.Spread.Sheets.Range(-1, -1, -1, -1))); * var condition = new GC.Spread.Sheets.ConditionalFormatting.Condition(GC.Spread.Sheets.ConditionalFormatting.ConditionType.numberCondition, { compareType: GC.Spread.Sheets.ConditionalFormatting.GeneralComparisonOperators.greaterThan, expected: 1 }); * sheet.rowFilter().addFilterItem(0, condition); * sheet.rowFilter().filter(); * console.log(doFilterCalled); // true * ``` */ onFilter(args: GC.Spread.Sheets.Filter.IFilteredArgs): void; /** * Opens the filter dialog when the user clicks the filter button. * @param {GC.Spread.Sheets.IFilterButtonHitInfo} filterButtonHitInfo The hit test information about the filter button. * @example * ```javascript * sheet.setRowCount(3); * sheet.setColumnCount(2); * sheet.setArray(0, 0, * [ * [ 1, 2 ], * [ 3, 4 ], * [ 5, 6 ] * ]); * function HighLightFilter(range) { * GC.Spread.Sheets.Filter.RowFilterBase.call(this, range); * } * HighLightFilter.prototype = new GC.Spread.Sheets.Filter.RowFilterBase(new GC.Spread.Sheets.Range(-1, -1, -1, -1)); * HighLightFilter.prototype.openFilterDialog = function(args) { * console.log(args.row, args.col); * }; * sheet.rowFilter(new HighLightFilter(new GC.Spread.Sheets.Range(-1, -1, -1, -1))); * ``` */ openFilterDialog(filterButtonHitInfo: GC.Spread.Sheets.IFilterButtonHitInfo): void; /** * Removes the specified filter. * @param {number} col The column index. * @example * ```javascript * sheet.setRowCount(3); * sheet.setColumnCount(1); * sheet.setArray(0, 0, * [ * [ 1 ], * [ 2 ], * [ 3 ] * ]); * sheet.rowFilter(new GC.Spread.Sheets.Filter.HideRowFilter(new GC.Spread.Sheets.Range( -1, -1, -1, -1))); * var condition = new GC.Spread.Sheets.ConditionalFormatting.Condition(GC.Spread.Sheets.ConditionalFormatting.ConditionType.textCondition, {compareType: GC.Spread.Sheets.ConditionalFormatting.TextCompareType.equalsTo, expected: '3'}); * var rowFilter = sheet.rowFilter(); * rowFilter.addFilterItem(0, condition); * rowFilter.removeFilterItems(0); * ``` */ removeFilterItems(col: number): void; /** * Clears all filters. * @example * ```javascript * sheet.rowFilter(new GC.Spread.Sheets.Filter.HideRowFilter(new GC.Spread.Sheets.Range(-1, -1, -1, -1))); * sheet.rowFilter().reset(); * console.log(sheet.rowFilter().isFiltered()); // false * ``` */ reset(): void; /** * Sorts the specified column in the specified order. * @param {number} col The column index. * @param {boolean} ascending Set to `true` to sort as ascending. * @example * ```javascript * sheet.setArray(0, 0, [ * [ 4 ], * [ 3 ], * [ 2 ], * [ 1 ], * [ 0 ] * ]); * sheet.rowFilter(new GC.Spread.Sheets.Filter.HideRowFilter(new GC.Spread.Sheets.Range(0, 0, 5, 1))); * sheet.rowFilter().addFilterItem(0, new GC.Spread.Sheets.ConditionalFormatting.Condition(GC.Spread.Sheets.ConditionalFormatting.ConditionType.numberCondition, { compareType: GC.Spread.Sheets.ConditionalFormatting.GeneralComparisonOperators.greaterThan, expected: 2 })); * sheet.rowFilter().filter(0); * sheet.rowFilter().sortColumn(0, true); * ``` */ sortColumn(col: number, ascending: boolean): void; /** * Saves the object state to a JSON string. * @returns {object} The row filter data. */ toJSON(): Object; /** * Removes the filter from the specified column. * @param {number} [col] The index of the column for which to remove the filter; if it is omitted, removes the filter for all columns in the range. * @example * ```javascript * sheet.setRowCount(2); * sheet.setColumnCount(1); * sheet.setArray(0, 0, * [ * [ "a" ], * [ "b" ] * ]); * sheet.rowFilter(new GC.Spread.Sheets.Filter.HideRowFilter(new GC.Spread.Sheets.Range(-1, -1, -1, -1))); * var condition = new GC.Spread.Sheets.ConditionalFormatting.Condition(GC.Spread.Sheets.ConditionalFormatting.ConditionType.textCondition, {compareType: GC.Spread.Sheets.ConditionalFormatting.TextCompareType.equalsTo,expected: 'a'}); * var rowFilter = sheet.rowFilter(); * rowFilter.addFilterItem(0, condition); * rowFilter.unfilter(); * ``` */ unfilter(col?: number): void; } } module FloatingObjects{ export class FloatingObject{ /** * Represents a floating object. * @class * @param {string} name The name of the floating object. * @param {number} x The x location of the floating object. * @param {number} y The y location of the floating object. * @param {number} width The width of the floating object. * @param {number} height The height of the floating object. * @remarks * This is a base class that is intended for internal use. * @example * ```javascript * //This example creates a floating object. * var customFloatingObject = new GC.Spread.Sheets.FloatingObjects.FloatingObject("f1", 10, 10, 60, 64); * var btn = document.createElement('button'); * btn.style.width = "60px"; * btn.style.height = "30px"; * btn.innerText = "button"; * customFloatingObject.content(btn); * activeSheet.floatingObjects.add(customFloatingObject); * ``` */ constructor(name: string, x: number, y: number, width: number, height: number); /** Represents the type name string used for supporting serialization. * @type {string} */ typeName: string; /** * Gets or sets whether to disable moving the floating object. * @param {boolean} [value] The setting for whether to disable moving the floating object. * @returns {boolean | GC.Spread.Sheets.FloatingObjects.FloatingObject} If no value is set, returns the setting for whether to disable moving the floating object; otherwise, returns the floating object. * @example * ```javascript * //This example prevents you from moving or resizing the floating object. * var customFloatingObject = new GC.Spread.Sheets.FloatingObjects.FloatingObject("f1", 10, 10, 60, 64); * var btn = document.createElement('button'); * btn.style.width = "60px"; * btn.style.height = "30px"; * btn.innerText = "button"; * customFloatingObject.allowResize(false); * customFloatingObject.allowMove(false); * customFloatingObject.content(btn); * activeSheet.floatingObjects.add(customFloatingObject); * ``` */ allowMove(value?: boolean): any; /** * Gets or sets whether to disable resizing the floating object. * @param {boolean} [value] The setting for whether to disable resizing the floating object. * @returns {boolean | GC.Spread.Sheets.FloatingObjects.FloatingObject} If no value is set, returns the setting for whether to disable resizing the floating object; otherwise, returns the floating object. * @example * ```javascript * //This example prevents you from moving or resizing the floating object. * var customFloatingObject = new GC.Spread.Sheets.FloatingObjects.FloatingObject("f1", 10, 10, 60, 64); * var btn = document.createElement('button'); * btn.style.width = "60px"; * btn.style.height = "30px"; * btn.innerText = "button"; * customFloatingObject.allowResize(false); * customFloatingObject.allowMove(false); * customFloatingObject.content(btn); * activeSheet.floatingObjects.add(customFloatingObject); * ``` */ allowResize(value?: boolean): any; /** * Gets or sets the alternative text of the floating object for screen readers. * @param {string} [value] The alternative text of the floating object. * @returns {string} The alternative text of the floating object. * @example * ```javascript * var customFloatingObject = new GC.Spread.Sheets.FloatingObjects.FloatingObject('f1', 10, 10, 60, 64); * var btn = document.createElement('button'); * btn.style.width = "60px"; * btn.style.height = "30px"; * btn.innerText = "button"; * customFloatingObject.content(btn); * customFloatingObject.alt("A button"); * activeSheet.floatingObjects.add(customFloatingObject); * ``` */ alt(value?: string): any; /** * Gets a copy of the current content of the instance. * @returns {HTMLElement} A copy of the current content of the instance. * @example * ```javascript * var customFloatingObject = new GC.Spread.Sheets.FloatingObjects.FloatingObject('f1', 10, 10, 64, 30); * customFloatingObject.content(createButton('button 1', '64px', '30px')); * activeSheet.floatingObjects.add(customFloatingObject); * * var btn = customFloatingObject.cloneContent(); * btn.innerText = 'button 2'; * customFloatingObject.content(btn); * * function createButton (text, width, height) { * var btn = document.createElement('button'); * btn.style.width = width; * btn.style.height = height; * btn.innerText = text; * return btn; * } * ``` */ cloneContent(): HTMLElement; /** * Gets or sets the content of the custom floating object. * @param {HTMLElement} [value] The content of the custom floating object. * @returns {HTMLElement | GC.Spread.Sheets.FloatingObjects.FloatingObject} If no value is set, returns the content of the custom floating object; otherwise, returns the floating object. * @example * ```javascript * var customFloatingObject = new GC.Spread.Sheets.FloatingObjects.FloatingObject('f1', 10, 10, 64, 30); * customFloatingObject.content(createButton('button 1', '64px', '30px')); * activeSheet.floatingObjects.add(customFloatingObject); * * console.log(customFloatingObject.content()); // get current content, the result is button element with the text "button 1". * customFloatingObject.content(createButton('button 2', '64px', '30px')); // set new content. * * function createButton (text, width, height) { * var btn = document.createElement('button'); * btn.style.width = width; * btn.style.height = height; * btn.innerText = text; * return btn; * } * ``` */ content(value?: HTMLElement): any; /** * Gets or sets whether the object moves when hiding or showing, resizing, or moving rows or columns. * @param {boolean} [value] The value indicates whether the object moves when hiding or showing, resizing, or moving rows or columns. * @returns {boolean | GC.Spread.Sheets.FloatingObjects.FloatingObject} If no value is set, returns whether this floating object dynamically moves; otherwise, returns the floating object. * @example * ```javascript * //This example creates a floating object. * var customFloatingObject = new GC.Spread.Sheets.FloatingObjects.FloatingObject("f1", 10, 10, 60, 64); * customFloatingObject.isVisible(true); * customFloatingObject.dynamicSize(true); * customFloatingObject.dynamicMove(true); * var btn = document.createElement('button'); * btn.style.width = "60px"; * btn.style.height = "30px"; * btn.innerText = "button"; * customFloatingObject.content(btn); * activeSheet.floatingObjects.add(customFloatingObject); * ``` */ dynamicMove(value?: boolean): any; /** * Gets or sets whether the size of the object changes when hiding or showing, resizing, or moving rows or columns. * @param {boolean} [value] The value indicates whether the size of the object changes when hiding or showing, resizing, or moving rows or columns. * @returns {boolean | GC.Spread.Sheets.FloatingObjects.FloatingObject} If no value is set, returns whether this floating object dynamically changes size; otherwise, returns the floating object. * @example * ```javascript * //This example creates a floating object. * var customFloatingObject = new GC.Spread.Sheets.FloatingObjects.FloatingObject("f1", 10, 10, 60, 64); * customFloatingObject.isVisible(true); * customFloatingObject.dynamicSize(true); * customFloatingObject.dynamicMove(true); * var btn = document.createElement('button'); * btn.style.width = "60px"; * btn.style.height = "30px"; * btn.innerText = "button"; * customFloatingObject.content(btn); * activeSheet.floatingObjects.add(customFloatingObject); * ``` */ dynamicSize(value?: boolean): any; /** * Gets or sets the end column index of the floating object position. * @param {number} [value] The end column index of the floating object position. * @returns {number | GC.Spread.Sheets.FloatingObjects.FloatingObject} If no value is set, returns the end column index of the floating object position; otherwise, returns the floating object. * @example * ```javascript * //Creates a floating object. * var customFloatingObject = new GC.Spread.Sheets.FloatingObjects.FloatingObject("f1", 10, 10, 60, 64); * var btn = document.createElement('button'); * btn.style.width = "60px"; * btn.style.height = "30px"; * btn.innerText = "button"; * customFloatingObject.content(btn); * activeSheet.floatingObjects.add(customFloatingObject); * //Position the upper left corner of the floating object by cell anchors. * customFloatingObject.startRow(2); * customFloatingObject.startColumn(2); * customFloatingObject.startRowOffset(10); * customFloatingObject.startColumnOffset(10); * //Position the lower right corner of the floating object by cell anchors. * customFloatingObject.endRow(7); * customFloatingObject.endColumn(5); * customFloatingObject.endRowOffset(10); * customFloatingObject.endColumnOffset(10); * ``` */ endColumn(value?: number): any; /** * Gets or sets the offset relative to the end column of the floating object. * @param {number} [value] The offset relative to the end column of the floating object. * @returns {number | GC.Spread.Sheets.FloatingObjects.FloatingObject} If no value is set, returns the offset relative to the end column of the floating object; otherwise, returns the floating object. * @example * ```javascript * //Creates a floating object. * var customFloatingObject = new GC.Spread.Sheets.FloatingObjects.FloatingObject("f1", 10, 10, 60, 64); * var btn = document.createElement('button'); * btn.style.width = "60px"; * btn.style.height = "30px"; * btn.innerText = "button"; * customFloatingObject.content(btn); * activeSheet.floatingObjects.add(customFloatingObject); * //Position the upper left corner of the floating object by cell anchors. * customFloatingObject.startRow(2); * customFloatingObject.startColumn(2); * customFloatingObject.startRowOffset(10); * customFloatingObject.startColumnOffset(10); * //Position the lower right corner of the floating object by cell anchors. * customFloatingObject.endRow(7); * customFloatingObject.endColumn(5); * customFloatingObject.endRowOffset(10); * customFloatingObject.endColumnOffset(10); * ``` */ endColumnOffset(value?: number): any; /** * Gets or sets the end row index of the floating object position. * @param {number} [value] The end row index of the floating object position. * @returns {number | GC.Spread.Sheets.FloatingObjects.FloatingObject} If no value is set, returns the end row index of the floating object position; otherwise, returns the floating object. * @example * ```javascript * //Creates a floating object. * var customFloatingObject = new GC.Spread.Sheets.FloatingObjects.FloatingObject("f1", 10, 10, 60, 64); * var btn = document.createElement('button'); * btn.style.width = "60px"; * btn.style.height = "30px"; * btn.innerText = "button"; * customFloatingObject.content(btn); * activeSheet.floatingObjects.add(customFloatingObject); * //Position the upper left corner of the floating object by cell anchors. * customFloatingObject.startRow(2); * customFloatingObject.startColumn(2); * customFloatingObject.startRowOffset(10); * customFloatingObject.startColumnOffset(10); * //Position the lower right corner of the floating object by cell anchors. * customFloatingObject.endRow(7); * customFloatingObject.endColumn(5); * customFloatingObject.endRowOffset(10); * customFloatingObject.endColumnOffset(10); * ``` */ endRow(value?: number): any; /** * Gets or sets the offset relative to the end row of the floating object. * @param {number} [value] The offset relative to the end row of the floating object. * @returns {number | GC.Spread.Sheets.FloatingObjects.FloatingObject} If no value is set, returns the offset relative to the end row of the floating object; otherwise, returns the floating object. * @example * ```javascript * //Creates a floating object. * var customFloatingObject = new GC.Spread.Sheets.FloatingObjects.FloatingObject("f1", 10, 10, 60, 64); * var btn = document.createElement('button'); * btn.style.width = "60px"; * btn.style.height = "30px"; * btn.innerText = "button"; * customFloatingObject.content(btn); * activeSheet.floatingObjects.add(customFloatingObject); * //Position the upper left corner of the floating object by cell anchors. * customFloatingObject.startRow(2); * customFloatingObject.startColumn(2); * customFloatingObject.startRowOffset(10); * customFloatingObject.startColumnOffset(10); * //Position the lower right corner of the floating object by cell anchors. * customFloatingObject.endRow(7); * customFloatingObject.endColumn(5); * customFloatingObject.endRowOffset(10); * customFloatingObject.endColumnOffset(10); * ``` */ endRowOffset(value?: number): any; /** * Gets or sets whether the position of the floating object is fixed. When fixedPosition is true, dynamicMove and dynamicSize are disabled. * @param {boolean} [value] The value indicates whether the position of the floating object is fixed. * @returns {boolean | GC.Spread.Sheets.FloatingObjects.FloatingObject} If no value is set, returns whether the position of the floating object is fixed; otherwise, returns the floating object. * @example * ```javascript * //This example sets the position of the object to fixed. * var customFloatingObject = new GC.Spread.Sheets.FloatingObjects.FloatingObject("f1", 10, 10, 60, 64); * customFloatingObject.fixedPosition(true); * var btn = document.createElement('button'); * btn.style.width = "60px"; * btn.style.height = "30px"; * btn.innerText = "button"; * customFloatingObject.content(btn); * activeSheet.floatingObjects.add(customFloatingObject); * ``` */ fixedPosition(value: boolean): any; /** * Gets the dom host of the custom content. * @returns {HTMLElement[]} */ getHost(): HTMLElement[]; /** * Gets or sets the height of a floating object. * @param {number} [value] The height of a floating object. * @returns {number | GC.Spread.Sheets.FloatingObjects.FloatingObject} If no value is set, returns the height of a floating object; otherwise, returns the floating object. * @example * ```javascript * //This example creates a floating object. * var customFloatingObject = new GC.Spread.Sheets.FloatingObjects.FloatingObject("f1"); * customFloatingObject.x(10); * customFloatingObject.y(10); * customFloatingObject.width(60); * customFloatingObject.height(64); * var btn = document.createElement('button'); * btn.style.width = "60px"; * btn.style.height = "30px"; * btn.innerText = "button"; * customFloatingObject.content(btn); * activeSheet.floatingObjects.add(customFloatingObject); * ``` */ height(value?: number): any; /** * Gets or sets whether this floating object is locked. * @param {boolean} [value] The value that indicates whether this floating object is locked. * @returns {boolean | GC.Spread.Sheets.FloatingObjects.FloatingObject} If no value is set, returns whether this floating object is locked; otherwise, returns the floating object. * @example * ```javascript * var customFloatingObject = new GC.Spread.Sheets.FloatingObjects.FloatingObject("f1"); * customFloatingObject.x(10); * customFloatingObject.y(10); * customFloatingObject.width(60); * customFloatingObject.height(64); * customFloatingObject.isLocked(true); * var btn = document.createElement('button'); * btn.style.width = "60px"; * btn.style.height = "30px"; * btn.innerText = "button"; * customFloatingObject.content(btn); * activeSheet.floatingObjects.add(customFloatingObject); * activeSheet.options.isProtected = true; * ``` */ isLocked(value?: boolean): any; /** * Gets or sets whether this floating object is selected. * @param {boolean} [value] The value that indicates whether this floating object is selected. * @returns {boolean | GC.Spread.Sheets.FloatingObjects.FloatingObject} If no value is set, returns whether this floating object is selected; otherwise, returns the floating object. * @example * ```javascript * //This example creates a floating object. * var customFloatingObject = new GC.Spread.Sheets.FloatingObjects.FloatingObject("f1", 10, 10, 60, 64); * customFloatingObject.isSelected(true); * var btn = document.createElement('button'); * btn.style.width = "60px"; * btn.style.height = "30px"; * btn.innerText = "button"; * customFloatingObject.content(btn); * activeSheet.floatingObjects.add(customFloatingObject); * ``` */ isSelected(value?: boolean): any; /** * Gets or sets whether this floating object is visible. * @param {boolean} [value] The value that indicates whether this floating object is visible. * @returns {boolean | GC.Spread.Sheets.FloatingObjects.FloatingObject} If no value is set, returns whether this floating object is visible; otherwise, returns the floating object. * @example * ```javascript * //This example creates a floating object. * var customFloatingObject = new GC.Spread.Sheets.FloatingObjects.FloatingObject("f1", 10, 10, 60, 64); * customFloatingObject.isVisible(true); * customFloatingObject.dynamicSize(true); * customFloatingObject.dynamicMove(true); * var btn = document.createElement('button'); * btn.style.width = "60px"; * btn.style.height = "30px"; * btn.innerText = "button"; * customFloatingObject.content(btn); * activeSheet.floatingObjects.add(customFloatingObject); * ``` */ isVisible(value?: boolean): any; /** * Gets the name of the floating object. * @param {string} [value] The name of the floating object. * @returns {string | GC.Spread.Sheets.FloatingObjects.FloatingObject} If no value is set, returns the name of the floating object; otherwise, returns the floating object. * @example * ```javascript * //This example uses the name method. * var customFloatingObject = new GC.Spread.Sheets.FloatingObjects.FloatingObject(); * customFloatingObject.name("f1"); * customFloatingObject.x(10); * customFloatingObject.y(10); * customFloatingObject.width(60); * customFloatingObject.height(64); * var btn = document.createElement('button'); * btn.style.width = "60px"; * btn.style.height = "30px"; * btn.innerText = "button"; * customFloatingObject.content(btn); * activeSheet.floatingObjects.add(customFloatingObject); * ``` */ name(value?: string): any; /** * Refresh the content in floatingObject.The user should override this method to make their content synchronize with the floatingObject. */ refreshContent(): void; /** * Gets or sets the starting column index of the floating object position. * @param {number} [value] The starting column index of the floating object position. * @returns {number | GC.Spread.Sheets.FloatingObjects.FloatingObject} If no value is set, returns the starting column index of the floating object position; otherwise, returns the floating object. * @example * ```javascript * //Creates a floating object. * var customFloatingObject = new GC.Spread.Sheets.FloatingObjects.FloatingObject("f1", 10, 10, 60, 64); * var btn = document.createElement('button'); * btn.style.width = "60px"; * btn.style.height = "30px"; * btn.innerText = "button"; * customFloatingObject.content(btn); * activeSheet.floatingObjects.add(customFloatingObject); * //Position the upper left corner of the floating object by cell anchors. * customFloatingObject.startRow(2); * customFloatingObject.startColumn(2); * customFloatingObject.startRowOffset(10); * customFloatingObject.startColumnOffset(10); * ``` */ startColumn(value?: number): any; /** * Gets or sets the offset relative to the start column of the floating object. * @param {number} [value] The offset relative to the start column of the floating object. * @returns {number | GC.Spread.Sheets.FloatingObjects.FloatingObject} If no value is set, returns the offset relative to the start column of the floating object; otherwise, returns the floating object. * @example * ```javascript * //Creates a floating object. * var customFloatingObject = new GC.Spread.Sheets.FloatingObjects.FloatingObject("f1", 10, 10, 60, 64); * var btn = document.createElement('button'); * btn.style.width = "60px"; * btn.style.height = "30px"; * btn.innerText = "button"; * customFloatingObject.content(btn); * activeSheet.floatingObjects.add(customFloatingObject); * //Position the upper left corner of the floating object by cell anchors. * customFloatingObject.startRow(2); * customFloatingObject.startColumn(2); * customFloatingObject.startRowOffset(10); * customFloatingObject.startColumnOffset(10); * ``` */ startColumnOffset(value?: number): any; /** * Gets or sets the starting row index of the floating object position. * @param {number} [value] The starting row index of the floating object position. * @returns {number | GC.Spread.Sheets.FloatingObjects.FloatingObject} If no value is set, returns the starting row index of the floating object position; otherwise, returns the floating object. * @example * ```javascript * //Creates a floating object. * var customFloatingObject = new GC.Spread.Sheets.FloatingObjects.FloatingObject("f1", 10, 10, 60, 64); * var btn = document.createElement('button'); * btn.style.width = "60px"; * btn.style.height = "30px"; * btn.innerText = "button"; * customFloatingObject.content(btn); * activeSheet.floatingObjects.add(customFloatingObject); * //Position the upper left corner of the floating object by cell anchors. * customFloatingObject.startRow(2); * customFloatingObject.startColumn(2); * customFloatingObject.startRowOffset(10); * customFloatingObject.startColumnOffset(10); * ``` */ startRow(value?: number): any; /** * Gets or sets the offset relative to the start row of the floating object. * @param {number} [value] The offset relative to the start row of the floating object. * @returns {number | GC.Spread.Sheets.FloatingObjects.FloatingObject} If no value is set, returns the offset relative to the start row of the floating object; otherwise, returns the floating object. * @example * ```javascript * //This example creates a floating object. * var customFloatingObject = new GC.Spread.Sheets.FloatingObjects.FloatingObject("f1", 10, 10, 60, 64); * var btn = document.createElement('button'); * btn.style.width = "60px"; * btn.style.height = "30px"; * btn.innerText = "button"; * customFloatingObject.content(btn); * activeSheet.floatingObjects.add(customFloatingObject); * //Position the upper left corner of the floating object by cell anchors. * customFloatingObject.startRow(2); * customFloatingObject.startColumn(2); * customFloatingObject.startRowOffset(10); * customFloatingObject.startColumnOffset(10); * ``` */ startRowOffset(value?: number): any; /** * Gets or sets the width of a floating object. * @param {number} [value] The width of a floating object. * @returns {number | GC.Spread.Sheets.FloatingObjects.FloatingObject} If no value is set, returns the width of a floating object; otherwise, returns the floating object. * @example * ```javascript * //This example creates a floating object. * var customFloatingObject = new GC.Spread.Sheets.FloatingObjects.FloatingObject("f1"); * customFloatingObject.x(10); * customFloatingObject.y(10); * customFloatingObject.width(60); * customFloatingObject.height(64); * var btn = document.createElement('button'); * btn.style.width = "60px"; * btn.style.height = "30px"; * btn.innerText = "button"; * customFloatingObject.content(btn); * activeSheet.floatingObjects.add(customFloatingObject); * ``` */ width(value?: number): any; /** * Gets or sets the horizontal location of the floating object. * @param {number} [value] The horizontal location of the floating object. * @return {number | GC.Spread.Sheets.FloatingObjects.FloatingObject} If no value is set, returns the horizontal location of the floating object; otherwise, returns the floating object. * @example * ```javascript * //This example creates a floating object. * var customFloatingObject = new GC.Spread.Sheets.FloatingObjects.FloatingObject("f1"); * customFloatingObject.x(10); * customFloatingObject.y(10); * customFloatingObject.width(60); * customFloatingObject.height(64); * var btn = document.createElement('button'); * btn.style.width = "60px"; * btn.style.height = "30px"; * btn.innerText = "button"; * customFloatingObject.content(btn); * activeSheet.floatingObjects.add(customFloatingObject); * ``` */ x(value?: number): any; /** * Gets or sets the vertical location of the floating object. * @param {number} [value] The vertical location of the floating object. * @return {number | GC.Spread.Sheets.FloatingObjects.FloatingObject} If no value is set, returns the vertical location of the floating object; otherwise, returns the floating object. * @example * ```javascript * //This example creates a floating object. * var customFloatingObject = new GC.Spread.Sheets.FloatingObjects.FloatingObject("f1"); * customFloatingObject.x(10); * customFloatingObject.y(10); * customFloatingObject.width(60); * customFloatingObject.height(64); * var btn = document.createElement('button'); * btn.style.width = "60px"; * btn.style.height = "30px"; * btn.innerText = "button"; * customFloatingObject.content(btn); * activeSheet.floatingObjects.add(customFloatingObject); * ``` */ y(value?: number): any; } export class FloatingObjectCollection{ /** * Represents a floating object manager that managers all floating objects in a sheet. * @class * @param {GC.Spread.Sheets.Worksheet} sheet The worksheet. * @param {string} typeName The type name. */ constructor(sheet?: GC.Spread.Sheets.Worksheet, typeName?: string); /** * Adds a floating object to the sheet. * The arguments has 2 modes. * If there is 1 parameter, the parameter is floatingObject which is a GC.Spread.Sheets.FloatingObjects.FloatingObject type. * If there are 6 parameters, the parameters are name, src, x, y, width, and height. * @param {GC.Spread.Sheets.FloatingObjects.FloatingObject|string} floatingObjectOrName The floating object that will be added to the sheet, or the name of the picture that will be added to the sheet. * @param {string} src The image source of the picture. * @param {number} x The x location of the picture. * @param {number} y The y location of the picture. * @param {number} width The width of the picture. * @param {number} height The height of the picture. * @return {GC.Spread.Sheets.FloatingObjects.FloatingObject} The floating object that has been added to the sheet. * @example * ```javascript * var customFloatingObject = new GC.Spread.Sheets.FloatingObjects.FloatingObject("f1", 10, 10, 60, 64); * var btn = document.createElement('button'); * btn.style.width = "60px"; * btn.style.height = "30px"; * btn.innerText = "button"; * customFloatingObject.content(btn); * activeSheet.floatingObjects.add(customFloatingObject); * ``` */ add(floatingObjectOrName: GC.Spread.Sheets.FloatingObjects.FloatingObject | string, src?: string, x?: number, y?: number, width?: number, height?: number): GC.Spread.Sheets.FloatingObjects.FloatingObject; /** * Gets all of the floating objects in the sheet. * @return {GC.Spread.Sheets.FloatingObjects.FloatingObject[]} The collection of all the floating objects in the sheet. * @example * ```javascript * activeSheet.pictures.add("p1", "pics/download.jpg", 1, 6, 400, 400); * activeSheet.pictures.add("p2", "pics/download.jpg", 500, 150, 200, 300); * var pictures = activeSheet.pictures.all(); * for (var i = 0; i < pictures.length; i++) { * alert("Path of picture " + i + " is: " + pictures[i].src()) * } * ``` */ all(): GC.Spread.Sheets.FloatingObjects.FloatingObject[]; /** * Removes all floating objects in the sheet. * @example * ```javascript * var f1 = new GC.Spread.Sheets.FloatingObjects.FloatingObject('f1', 10, 10, 64, 30); * f1.content(createButton('button 1', '64px', '30px')); * activeSheet.floatingObjects.add(f1); * * var f2 = new GC.Spread.Sheets.FloatingObjects.FloatingObject('f2', 100, 10, 64, 30); * f2.content(createButton('button 2', '64px', '30px')); * activeSheet.floatingObjects.add(f2); * * console.log(activeSheet.floatingObjects.all().length); // result is 2 * activeSheet.floatingObjects.clear(); // removes all floating objects. * console.log(activeSheet.floatingObjects.all().length); // result is 0 * * function createButton (text, width, height) { * var btn = document.createElement('button'); * btn.style.width = width; * btn.style.height = height; * btn.innerText = text; * return btn; * } * ``` */ clear(): void; /** * Gets a floating object from the sheet by the indicate name. * @param {string} name The name of the floating object. * @return {GC.Spread.Sheets.FloatingObjects.FloatingObject} The floating object in the sheet with the indicate name. * @example * ```javascript * activeSheet.pictures.add("f2","tsoutline.png",100,60,200,100); * //button * $("#button1").click(function () { * var pic = activeSheet.pictures.get("f2"); * }); * ``` */ get(name: string): GC.Spread.Sheets.FloatingObjects.FloatingObject; /** * Removes a floating object from the sheet by the indicate name. * @param {string} name The name of the floating object. * @example * ```javascript * activeSheet.pictures.add("f2","tsoutline.png",100,60,200,100); * //button * $("#button1").click(function () { * activeSheet.resumePaint(); * activeSheet.pictures.remove("f2"); * activeSheet.repaint(); * }); * ``` */ remove(name: string): void; /** * Gets or sets the z-index of floating object. * @param {string} name The name of the floatingObject. * @param {number} zIndex The z-index of the floating object. * @return {number | *} If the parameter 'zIndex' is null or undefined,it will return the z-index of the floating object with the indicate name. * @example * ```javascript * var customFloatingObject = new GC.Spread.Sheets.FloatingObjects.FloatingObject("f1", 20, 20, 60, 64); * var btn = document.createElement('button'); * btn.style.width = "60px"; * btn.style.height = "30px"; * btn.innerText = "button1"; * customFloatingObject.content(btn); * activeSheet.floatingObjects.add(customFloatingObject); * var customFloatingObject1 = new GC.Spread.Sheets.FloatingObjects.FloatingObject("f2", 5, 5, 30, 64); * var btn1 = document.createElement('button'); * btn1.style.width = "60px"; * btn1.style.height = "30px"; * btn1.innerText = "button2"; * customFloatingObject1.content(btn1); * activeSheet.floatingObjects.add(customFloatingObject1); * activeSheet.floatingObjects.zIndex("f2", 897); * activeSheet.floatingObjects.zIndex("f1", 898); * ``` */ zIndex(name: string, zIndex?: number): any; } export class Picture extends FloatingObject{ /** * Represents a picture. * @extends GC.Spread.Sheets.FloatingObjects.FloatingObject * @class * @param {string} name The name of the picture. * @param {string} src The image source of the picture. * @param {number} x The x location of the picture. * @param {number} y The y location of the picture. * @param {number} width The width of the picture. * @param {number} height The height of the picture. */ constructor(name: string, src: string, x: number, y: number, width: number, height: number); /** * Gets or sets the background color of the picture. * @param {string} [value] The backcolor of the picture. * @returns {string | GC.Spread.Sheets.FloatingObjects.Picture} If no value is set, returns the backcolor of the picture; otherwise, returns the picture. * @example * ```javascript * //This example sets the backcolor of the picture. * var picture = activeSheet.pictures.add("f2","Event.png",50,50,100,100); * picture.borderStyle("solid"); * picture.borderWidth(2); * picture.borderColor("red"); * ``` */ backColor(value?: string): any; /** * Gets or sets the border color of the picture. * @param {string} [value] The border color of the picture. * @returns {string | GC.Spread.Sheets.FloatingObjects.Picture} If no value is set, returns the border color of the picture; otherwise, returns the picture. * @example * ```javascript * //This example sets the border color of the picture. * var picture = activeSheet.pictures.add("f2","Event.png",50,50,100,100); * picture.borderStyle("solid"); * picture.borderWidth(2); * picture.borderColor("red"); * ``` */ borderColor(value?: string): any; /** * Gets or sets the border radius of the picture. * @param {number} [value] The border radius of the picture. * @returns {number | GC.Spread.Sheets.FloatingObjects.Picture} If no value is set, returns the border radius of the picture; otherwise, returns the picture. * @example * ```javascript * //This example uses the borderRadius method. * var picture = activeSheet.pictures.add("f2","Event.png",50,50,100,100); * picture.backColor("blue"); * picture.borderWidth(2); * picture.borderColor("red"); * picture.borderStyle("dotted"); * picture.borderRadius(5); * ``` */ borderRadius(value?: number): any; /** * Gets or sets the border style of the picture. * @param {string} [value] The css border style of the picture, such as dotted, dashed, solid, and so on. * @returns {string | GC.Spread.Sheets.FloatingObjects.Picture} If no value is set, returns the border style of the picture; otherwise, returns the picture. * @example * ```javascript * //This example uses the borderStyle method. * var picture = activeSheet.pictures.add("f2","Event.png",50,50,100,100); * picture.borderStyle("dotted"); * picture.borderWidth(2); * picture.borderColor("red"); * ``` */ borderStyle(value?: string): any; /** * Gets or sets the border width of the picture. * @param {number} [value] The border width of the picture. * @returns {number | GC.Spread.Sheets.FloatingObjects.Picture} If no value is set, returns the border width of the picture; otherwise, returns the picture. * @example * ```javascript * //This example uses the borderWidth method. * var picture = activeSheet.pictures.add("f2","Event.png",50,50,100,100); * picture.borderStyle("solid"); * picture.borderWidth(2); * picture.borderColor("red"); * ``` */ borderWidth(value?: number): any; /** * Gets the original height of the picture. * @returns {number} The original height of the picture. * @example * ```javascript * activeSheet.pictures.add("f2","Event.png",2,2,6,6); * activeSheet.pictures.add("f1","tsoutline.png",3,0,6,6); * var picture = activeSheet.pictures.get("f2"); * picture.pictureStretch(GC.Spread.Sheets.ImageLayout.center); * //button * $("#button1").click(function () { * alert(picture.getOriginalHeight()); * }); * ``` */ getOriginalHeight(): number; /** * Gets the original width of the picture. * @returns {number} The original width of the picture. * @example * ```javascript * activeSheet.pictures.add("f2","Event.png",2,2,6,6); * activeSheet.pictures.add("f1","tsoutline.png",3,0,6,6); * var picture = activeSheet.pictures.get("f2"); * picture.pictureStretch(GC.Spread.Sheets.ImageLayout.center); * //button * $("#button1").click(function () { * alert(picture.getOriginalWidth()); * }); * ``` */ getOriginalWidth(): number; /** * Gets or sets the stretch of the picture. * @param {GC.Spread.Sheets.ImageLayout} [value] The stretch of the picture. * @returns {GC.Spread.Sheets.ImageLayout | GC.Spread.Sheets.FloatingObjects.Picture} If no value is set, returns the stretch of the picture; otherwise, returns the picture. * @example * ```javascript * //This example uses the pictureStretch method. * var picture = activeSheet.pictures.add("f2","Event.png",50,50,100,100); * picture.pictureStretch(GC.Spread.Sheets.ImageLayout.stretch); * picture.backColor("blue"); * ``` */ pictureStretch(value?: GC.Spread.Sheets.ImageLayout): any; /** * Gets or sets the src of the picture. * @param {string} [value] The src of the picture. * @returns {string | GC.Spread.Sheets.FloatingObjects.Picture} If no value is set, returns the src of the picture; otherwise, returns the picture. * @example * ```javascript * var pic = sheet.pictures.add("Picture 1", "Event.png", 100, 50, 200, 200); * var src = pic.src(); // get current image source, the result is "Event.png". * pic.src("tsoutline.png"); // set new image source. * ``` */ src(value?: string): any; } } module FormulaPanel{ /** * Gets the FormulaEditor instance by the host element. * @param {HTMLElement|string} host The host element or the host element id. * @returns {GC.Spread.Sheets.FormulaPanel.FormulaEditor} The FormulaEditor instance. * @example * ```javascript * window.onload = function(){ * var spread = new GC.Spread.Sheets.Workbook(document.getElementById("ss")); * var formulaEditor = new GC.Spread.Sheets.FormulaPanel.FormulaEditor(document.getElementById("fe")); * formulaEditor.workbook(spread); * var formulaEditorInstance = GC.Spread.Sheets.FormulaPanel.findControl("fe"); * } * ``` */ function findControl(host: HTMLElement|string): GC.Spread.Sheets.FormulaPanel.FormulaEditor; export interface IFormulaEditorOptions{ tabSize?: number; formatWidthLimit?: number | 'auto'; } export class FormulaEditor{ /** * Represents a formula editor. * @class * @param {HTMLElement} host The DOM element. * @param {Object} [options] The options. Default is { tabSize: 4, formatWidthLimit: 'auto' } * @example * ```javascript * window.onload = function(){ * var spread = new GC.Spread.Sheets.Workbook(document.getElementById("ss")); * formulaEditor = new GC.Spread.Sheets.FormulaPanel.FormulaEditor(document.getElementById("fe")); * formulaEditor.attach(spread); * } * ``` */ constructor(host: HTMLElement, options?: GC.Spread.Sheets.FormulaPanel.IFormulaEditorOptions); /** * Indicates the options of the formula editor. * @type {Object} * @property {number} tabSize - Indicate the number of spaces inserted when the "Tab" key is pressed. Default is 4. * @property {number} formatWidthLimit - Indicates the width limit when formatting, Default is 'auto'. 'auto' means that this follows the width of the dom and will try to avoid the width of a line exceeding the width of the dom. * @example * ```javascript * formulaEditor.options.tabSize = 2; * formulaEditor.options.formatWidthLimit = -1; * ``` */ options: GC.Spread.Sheets.FormulaPanel.IFormulaEditorOptions; /** * @description attach to a workbook for formula editor. * @param {GC.Spread.Sheets.Workbook} workbook Indicates the workbook which is attached. * @returns void */ attach(workbook: GC.Spread.Sheets.Workbook): any; /** * Gets the command manager. * @returns {GC.Spread.Commands.CommandManager} The command manager. * @example * ```javascript * //This example executes a command that performs a specified action. * formulaEditor.commandManager().execute({ cmd: "formatDocument" }); * ``` */ commandManager(): GC.Spread.Commands.CommandManager; /** * Destroys current formula editor. */ destroy(): void; /** * @description detach the workbook for formula editor. * @returns void */ detach(): void; /** * format the document(formula string). */ format(): void; /** * refresh the formula editor. */ refresh(): void; /** * Gets or sets the text. * @param {string} value The text. * @returns {string} If no value is set, returns the text; otherwise, there is no return value. */ text(value?: string): string; } module Commands{ /** * Represents the command used to close hints. * @property {function} execute - performs an execute operation. * @example * ```javascript * //This example showing binding the closeHints command to the esc shortcut. * spread.commandManager().setShortcutKey("closeHints", 27); * ``` */ var closeHints: { execute(context: GC.Spread.Sheets.FormulaPanel.FormulaEditor): any }; /** * Represents the command used to commit content to active cell. * @property {function} execute - performs an execute operation. * @example * ```javascript * //This example showing binding the commitContentToActiveCell command to the ctrl-s shortcut. * spread.commandManager().setShortcutKey("commitContentToActiveCell", 83, true); * ``` */ var commitContentToActiveCell: { execute(context: GC.Spread.Sheets.FormulaPanel.FormulaEditor): any }; /** * Represents the command used to exit edit. * @property {function} execute - performs an execute operation. * @example * ```javascript * //This example showing binding the exitEdit command to the esc shortcut. * spread.commandManager().setShortcutKey("exitEdit", 27); * ``` */ var exitEdit: { execute(context: GC.Spread.Sheets.FormulaPanel.FormulaEditor): any }; /** * Represents the command used to format document. * @property {function} execute - performs an execute operation. * @example * ```javascript * //This example showing binding the formatDocument command to the alt-shift-f shortcut. * spread.commandManager().setShortcutKey("formatDocument", 70, false, true, true); * ``` */ var formatDocument: { execute(context: GC.Spread.Sheets.FormulaPanel.FormulaEditor): any }; /** * Represents the command used to show hints. * @property {function} execute - performs an execute operation. * @example * ```javascript * //This example showing binding the showHints command to the ctrl-shift-whitespace shortcut. * spread.commandManager().setShortcutKey("showHints", 32, true, true); * ``` */ var showHints: { execute(context: GC.Spread.Sheets.FormulaPanel.FormulaEditor): any }; /** * Represents the command used to toggle absolute/relative references. * @property {function} execute - performs an execute operation. * @example * ```javascript * //This example showing binding the toggleAbsoluteRelativeReferences command to the f4 shortcut. * spread.commandManager().setShortcutKey("toggleAbsoluteRelativeReferences", 115); * ``` */ var toggleAbsoluteRelativeReferences: { execute(context: GC.Spread.Sheets.FormulaPanel.FormulaEditor): any }; } } module FormulaTextBox{ /** * Gets the FormulaTextBox instance by the host element. * @param {HTMLElement|string} host The host element or the host element id. * @returns {GC.Spread.Sheets.FormulaTextBox.FormulaTextBox} The FormulaTextBox instance. * @example * ```javascript * window.onload = function(){ * var spread = new GC.Spread.Sheets.Workbook(document.getElementById("ss"), { sheetCount: 1 }); * var rangeSelector = new GC.Spread.Sheets.FormulaTextBox.FormulaTextBox(document.getElementById("ftb"), {rangeSelectMode: true}); * rangeSelector.workbook(spread); * var rangeSelectorInstance = GC.Spread.Sheets.FormulaTextBox.findControl("ftb"); * } * ``` */ function findControl(host: HTMLElement|string): GC.Spread.Sheets.FormulaTextBox.FormulaTextBox; export interface IFormulaTextBoxOptions{ /** * Whether support range select mode. */ rangeSelectMode: boolean; /** * Whether use the absolute reference. */ absoluteReference: boolean; /** * whether display the sheet name in reference. */ needSheetName?: boolean; } export class FormulaTextBox{ /** * Represents a formula text box. * @class * @param {HTMLElement} host The DOM element. It can be INPUT, TEXTAREA, or editable DIV. * @param {GC.Spread.Sheets.FormulaTextBox.IFormulaTextBoxOptions} [options] The options. Default is {rangeSelectMode: false, absoluteReference: false} * @example * ```javascript * window.onload = function(){ * var spread = new GC.Spread.Sheets.Workbook(document.getElementById("ss"), { sheetCount: 1 }); * rangeSelector = new GC.Spread.Sheets.FormulaTextBox.FormulaTextBox(document.getElementById("ftb"), {rangeSelectMode: true}); * rangeSelector.workbook(spread); * } * function buttonClick(){ * alert(rangeSelector.text()); * } * ``` */ constructor(host: HTMLElement, options?: GC.Spread.Sheets.FormulaTextBox.IFormulaTextBoxOptions); /** * Adds a custom function description. * @param {GC.Spread.CalcEngine.Functions.IFunctionDescription | GC.Spread.CalcEngine.Functions.IFunctionDescription[]} functionDescription The function description to add. This can be an array. See the Remarks for more information. */ add(functionDescription: GC.Spread.CalcEngine.Functions.IFunctionDescription | GC.Spread.CalcEngine.Functions.IFunctionDescription[]): void; /** * Gets or sets whether the text box uses automatic complete. * @param {boolean} [value] Whether to use automatic complete when editing. * @returns {boolean} If no value is set, returns whether the text box uses auto complete; otherwise, there is no return value. * @example * ```javascript * var spread = new GC.Spread.Sheets.Workbook(_getElementById('ss'), { sheetCount: 2 }); * var div = document.createElement('div'); * div.id = 'fbx'; * div.style.width = '300px'; * div.style.height = '50px'; * div.setAttribute('contentEditable', 'true'); * document.getElementById('panel').appendChild(div); * var formulaTextBox = new GC.Spread.Sheets.FormulaTextBox.FormulaTextBox(div); * formulaTextBox.workbook(spread); * formulaTextBox.autoComplete(false); * * // input "=SUM" formula prefix in the formula text box input element, the func hint box will not show * ``` */ autoComplete(value?: boolean): boolean; /** * Removes host from formula text box and removes all binding events. */ destroy(): void; /** * refresh the formula text box with the active cell. * @param {boolean} [ignoreEditing] set to true to avoid the formula text box enter editing mode. */ refresh(ignoreEditing?: boolean): void; /** * Removes a custom function description. * @param {string} name The custom function description name. */ remove(name: string): void; /** * Gets or sets whether to display the function's help tip. * @param {boolean} [value] Whether to display the function's help tip when editing. * @returns {boolean} If no value is set, returns whether the text box displays the function's help tip when editing; otherwise, there is no return value. * @example * ```javascript * var spread = new GC.Spread.Sheets.Workbook(_getElementById('ss'), { sheetCount: 2 }); * var div = document.createElement('div'); * div.id = 'fbx'; * div.style.width = '300px'; * div.style.height = '50px'; * div.setAttribute('contentEditable', 'true'); * document.getElementById('panel').appendChild(div); * var formulaTextBox = new GC.Spread.Sheets.FormulaTextBox.FormulaTextBox(div); * formulaTextBox.workbook(spread); * formulaTextBox.showHelp(false); * * // input "=SUM" formula prefix in the formula text box input element, the func hint (auto complete) box iwll show, but the help func will not show * ``` */ showHelp(value?: boolean): any; /** * Gets or sets the text. * @param {string} [value] The text. * @returns {string} If no value is set, returns the text; otherwise, there is no return value. * @example * ```javascript * var spread = new GC.Spread.Sheets.Workbook(_getElementById('ss'), { sheetCount: 2 }); * var div = document.createElement('div'); * div.id = 'fbx'; * div.style.width = '300px'; * div.style.height = '50px'; * div.setAttribute('contentEditable', 'true'); * document.getElementById('panel').appendChild(div); * var formulaTextBox = new GC.Spread.Sheets.FormulaTextBox.FormulaTextBox(div); * formulaTextBox.workbook(spread); * formulaTextBox.text('this is text'); * // worksheet will be in edit status with the text value and formula text box input box will also show the text value. * console.log(formulaTextBox.text()); // 'this is text' * ``` */ text(value?: string): string; /** * Gets or sets the Workbook component to work with the formula text box. * @param {GC.Spread.Sheets.Workbook} value The Workbook component. * @returns {GC.Spread.Sheets.Workbook} If no value is set, returns the workbook component; otherwise, there is no return value. * @example * ```javascript * window.onload = function(){ * var spread = new GC.Spread.Sheets.Workbook(document.getElementById("ss"),{sheetCount:3}); * var activeSheet = spread.getActiveSheet(); * activeSheet.setArray(0, 0, [1, 2, 3, 4, 5]); * var fbx = new GC.Spread.Sheets.FormulaTextBox.FormulaTextBox(document.getElementById("formulaTextBox")); * fbx.workbook(spread); * }; * ``` */ workbook(value?: GC.Spread.Sheets.Workbook): GC.Spread.Sheets.Workbook; } } module GanttSheet{ /** * Represents a duration in scheduling. To create a valid duration, please call project.parseDuration method. * @typedef {Object} GC.Spread.Sheets.GanttSheet.Duration * @property {number} [value] Indicates the value in unit of the duration. * @property {GC.Spread.Sheets.GanttSheet.DurationUnit} [unit] Indicates the unit of the value. If not specified, the default unit in {@link GC.Spread.Sheets.GanttSheet.CalendarSettings} will be used. * @property {number} [time] Indicates the real duration time in milliseconds. */ export type Duration = { value?: number, unit?: DurationUnit, time?: number } /** * @typedef GC.Spread.Sheets.GanttSheet.DurationUnit * @type {"Month" | "Week" | "Day" | "Hour" | "Minute"} * @description Represents the unit of a duration. */ export type DurationUnit = "Month" | "Week" | "Day" | "Hour" | "Minute" /** * Represents how to draw a gridline on GanttChart. * @typedef GC.Spread.Sheets.GanttSheet.GanttGridline * @property {GC.Spread.Sheets.GanttSheet.GanttGridlineType} lineType The type of the line. * @property {GC.Data.ColorString} lineColor The color of the line. */ export type GanttGridline = { lineType: GC.Spread.Sheets.GanttSheet.GanttGridlineType; lineColor: GC.Data.ColorString; } /** * Represents how to draw a gridline with intervals on GanttChart. * @typedef GC.Spread.Sheets.GanttSheet.GanttGridlineInterval * @property {GC.Spread.Sheets.GanttSheet.GanttGridlineType} lineType The type of the normal line. * @property {GC.Data.ColorString} lineColor The color of the normal line. * @property {number} [interval] The interval count. Lines at multiples of the interval value will use the intervalType and intervalColor. * @property {GC.Spread.Sheets.GanttSheet.GanttGridlineType} [intervalLineType] The type of the interval lines. * @property {GC.Data.ColorString} [intervalLineColor] The color of the interval lines. */ export type GanttGridlineInterval = { lineType: GC.Spread.Sheets.GanttSheet.GanttGridlineType; lineColor: GC.Data.ColorString; interval?: number; intervalLineType?: GC.Spread.Sheets.GanttSheet.GanttGridlineType; intervalLineColor?: GC.Data.ColorString; } /** * Represents the style of a task grid. * @property {string} [font] Indicates the font of text. * @property {GC.Data.ColorString} [color] Indicates the color of text. * @property {GC.Data.ColorString} [backColor] Indicates the back color of text. * @property {GC.Spread.Sheets.TextDecorationType} [textDecoration] Indicates the decoration of text. */ export type GridStyle = { font?: string; color?: string; backColor?: string; textDecoration?: TextDecorationType; } /** * Represents the gantt sheet options * @typedef {Object} GC.Spread.Sheets.GanttSheet.IGanttSheetOptions * @property {boolean} [enableGanttColumn] Whether to show the gantt column. Default is true. * @property {boolean} [allowAddNew] - Whether to allow to add new empty row. * @property {boolean} [sheetTabColor] - A color string used to represent the sheet tab color, such as "red", "#FFFF00", "rgb(255,0,0)", "Accent 5", and so on. */ export type IGanttSheetOptions = { /** * Whether to show the gantt column. Default is true. */ enableGanttColumn?: boolean; /** * Whether to allow to add new empty row. */ allowAddNew?: boolean; /** * A color string used to represent the sheet tab color, such as "red", "#FFFF00", "rgb(255,0,0)", "Accent 5", and so on. */ sheetTabColor?: string; } /** * Represents the data to create tasks. It is used in add, insert, and renew tasks methods of project. * @typedef {Object} GC.Spread.Sheets.GanttSheet.ITaskData * @property {string} [name] Indicates the name of the task. * @property {Date} [start] Indicates the start date of the task. * @property {Date} [finish] Indicates the finish date of the task. * @property {GC.Spread.Sheets.GanttSheet.Duration} [duration] Indicates the duration of the task. * @property {GC.Spread.Sheets.GanttSheet.TaskScheduleMode} [mode] Indicates the scheduling mode of the task. * @property {Object.} [barStyles] Indicates the bar styles of the task. */ export type ITaskData = { name?: string; start?: Date; finish?: Date; duration?: Duration; mode?: TaskScheduleMode; barStyles?: { [key: string]: TaskbarStyle }; } /** * Represents a couple of parameters for adding task dependencies. * @typedef {Object} GC.Spread.Sheets.GanttSheet.ITaskDependency * @property {number} fromTaskNumber Indicates the number of the task which the dependency is from. * @property {number} toTaskNumber Indicates the number of the task which the dependency is to. * @property {GC.Spread.Sheets.GanttSheet.TaskDependencyType} [type] Optional. Indicates the dependency type. The default is 'FS' (Finish to Start). */ export type ITaskDependency = { fromTaskNumber: number; toTaskNumber: number; type?: GC.Spread.Sheets.GanttSheet.TaskDependencyType; } /** * @typedef GC.Spread.Sheets.GanttSheet.NonWorkingTimeDrawMode * @type {"Behind" | "None"} * @description Represents how to draw the non-working time area in GanttChart. */ export type NonWorkingTimeDrawMode = "Behind" | "None" /** * @typedef GC.Spread.Sheets.GanttSheet.TaskbarEndShape * @type {"arrowDown" | "arrowUp" | "caretDownTop" | "caretUpBottom" | "circle" | "circleArrowDown" | "circleArrowUp" | "circleDiamond" | "circleTriangleDown" | "circleTriangleUp" | "diamond" | "houseDown" | "houseUp" | "leftBracket" | "leftFade" | "lineShape" | "rightBracket" | "rightFade" | "square" | "star" | "triangleDown" | "triangleLeft" | "triangleRight" | "triangleUp"} * @description Represents the shapes for taskbar start part and end part. */ export type TaskbarEndShape = "arrowDown" | "arrowUp" | "caretDownTop" | "caretUpBottom" | "circle" | "circleArrowDown" | "circleArrowUp" | "circleDiamond" | "circleTriangleDown" | "circleTriangleUp" | "diamond" | "houseDown" | "houseUp" | "leftBracket" | "leftFade" | "lineShape" | "rightBracket" | "rightFade" | "square" | "star" | "triangleDown" | "triangleLeft" | "triangleRight" | "triangleUp" /** * @typedef GC.Spread.Sheets.GanttSheet.TaskbarEndType * @type {"solid" | "dashed" | "framed"} * @description Represents the drawing type for taskbar end shapes. */ export type TaskbarEndType = "solid" | "dashed" | "framed" /** * @typedef GC.Spread.Sheets.GanttSheet.TaskbarFillPattern * @type {"hollow" | "solidFill" | "lightFill" | "mediumFill" | "darkFill" | "diagonalRight" | "diagonalLeft" | "diagonalCross" | "lineVertical" | "lineHorizontal" | "lineCross" | "dashedBorder"} * @description Represents the fill pattern for taskbar middle part or non working time area in GanttChart. */ export type TaskbarFillPattern = "hollow" | "solidFill" | "lightFill" | "mediumFill" | "darkFill" | "diagonalRight" | "diagonalLeft" | "diagonalCross" | "lineVertical" | "lineHorizontal" | "lineCross" | "dashedBorder" /** * @typedef GC.Spread.Sheets.GanttSheet.TaskbarLinkMode * @type {"noLinks" | "toEnd" | "toTop"} * @description Represents how to draw the link lines between task bars. */ export type TaskbarLinkMode = "noLinks" | "toEnd" | "toTop" /** * @typedef GC.Spread.Sheets.GanttSheet.TaskbarMiddleShape * @type {"rectangleBar" | "lineTop" | "lineMiddle" | "lineBottom" | "rectangleTop" | "rectangleMiddle" | "rectangleBottom"} * @description Represents the shapes for task bar middle part. */ export type TaskbarMiddleShape = "rectangleBar" | "lineTop" | "lineMiddle" | "lineBottom" | "rectangleTop" | "rectangleMiddle" | "rectangleBottom" /** * Represents the style of a task bar. * @typedef {Object} GC.Spread.Sheets.GanttSheet.TaskbarStyle * @property {GC.Spread.Sheets.GanttSheet.TaskbarEndShape} [startShape] Indicates the shape of the start part. * @property {GC.Spread.Sheets.GanttSheet.TaskbarEndType} [startType] Indicates the type of the start part. * @property {GC.Data.ColorString} [startColor] Indicates the color of the start part. * @property {GC.Spread.Sheets.GanttSheet.TaskbarEndShape} [endShape] Indicates the shape of the end part. * @property {GC.Spread.Sheets.GanttSheet.TaskbarEndType} [endType] Indicates the type of the end part. * @property {GC.Data.ColorString} [endColor] Indicates the color of the end part. * @property {GC.Spread.Sheets.GanttSheet.TaskbarMiddleShape} [middleShape] Indicates the shape of the middle part. * @property {GC.Spread.Sheets.GanttSheet.TaskbarFillPattern} [middlePattern] Indicates the fill pattern of the middle part. * @property {GC.Data.ColorString} [middleColor] Indicates the color of the middle part. * @property {string} [leftText] Indicates the name of a task field or formula, which value will be displayed as text at left side of the bar. * @property {GC.Spread.Sheets.GanttSheet.TextStyle} [leftTextStyle] Indicates the the style of the taskbar's left task field. * @property {string} [rightText] Indicates the name of a task field or formula, which value will be displayed as text at right side of the bar. * @property {GC.Spread.Sheets.GanttSheet.TextStyle} [rightTextStyle] Indicates the the style of the taskbar's left task field. * @property {string} [topText] Indicates the name of a task field or formula, which value will be displayed as text above the bar. * @property {GC.Spread.Sheets.GanttSheet.TextStyle} [topTextStyle] Indicates the the style of the taskbar's left task field. * @property {string} [bottomText] Indicates the name of a task field or formula, which value will be displayed as text below the bar. * @property {GC.Spread.Sheets.GanttSheet.TextStyle} [bottomTextStyle] Indicates the the style of the taskbar's left task field. * @property {string} [insideText] Indicates the name of a task field or formula, which value will be displayed as text inside the bar. * @property {GC.Spread.Sheets.GanttSheet.TextStyle} [insideTextStyle] Indicates the the style of the taskbar's left task field. */ export type TaskbarStyle = { startShape?: GC.Spread.Sheets.GanttSheet.TaskbarEndShape; startType?: GC.Spread.Sheets.GanttSheet.TaskbarEndType; startColor?: GC.Data.ColorString; endShape?: GC.Spread.Sheets.GanttSheet.TaskbarEndShape; endType?: GC.Spread.Sheets.GanttSheet.TaskbarEndType; endColor?: GC.Data.ColorString; middleShape?: GC.Spread.Sheets.GanttSheet.TaskbarMiddleShape; middlePattern?: GC.Spread.Sheets.GanttSheet.TaskbarFillPattern; middleColor?: GC.Data.ColorString; leftText?: string; leftTextStyle?: GC.Spread.Sheets.GanttSheet.TextStyle; rightText?: string; rightTextStyle?: GC.Spread.Sheets.GanttSheet.TextStyle; topText?: string; topTextStyle?: GC.Spread.Sheets.GanttSheet.TextStyle; bottomText?: string; bottomTextStyle?: GC.Spread.Sheets.GanttSheet.TextStyle; insideText?: string; insideTextStyle?: GC.Spread.Sheets.GanttSheet.TextStyle; } /** * @typedef GC.Spread.Sheets.GanttSheet.TaskbarStyleRuleName * @type {"projectSummary" | "summary" | "manualSummary" | "task" | "manualTask" | "milestone" | "manualMilestone" | "progress" | "manualProgress" | "startOnly" | "finishOnly" | "durationOnly" | "startOnlyMilestone" | "finishOnlyMilestone" | "durationOnlyMilestone"} * @description Represents the names for built-in taskbar style rules. Used for project.taskStyleRules.getRule method. */ export type TaskbarStyleRuleName = "projectSummary" | "summary" | "manualSummary" | "task" | "manualTask" | "milestone" | "manualMilestone" | "progress" | "manualProgress" | "startOnly" | "finishOnly" | "durationOnly" | "startOnlyMilestone" | "finishOnlyMilestone" | "durationOnlyMilestone" /** * @typedef GC.Spread.Sheets.GanttSheet.TaskDependencyType * @type {"FS" | "SS" | "FF" | "SF"} * @description Represents the type for task dependency. */ export type TaskDependencyType = "FS" | "SS" | "FF" | "SF" /** * @typedef GC.Spread.Sheets.GanttSheet.TaskScheduleMode * @type {"Auto" | "Manual"} * @description Represents the scheduling mode for tasks. */ export type TaskScheduleMode = "Auto" | "Manual" /** * the task style * @property {string} [name] The task style name. * @property {GC.Spread.Sheets.GanttSheet.TaskbarStyle} [taskbarStyle] The task bar part style. * @property {GC.Spread.Sheets.GanttSheet.GridStyle} [gridStyle] The task grid part style. */ export type TaskStyle = { name?: string; taskbarStyle?: GC.Spread.Sheets.GanttSheet.TaskbarStyle; gridStyle?: GC.Spread.Sheets.GanttSheet.GridStyle; } /** * Represents the text style for timescale and task bars on GanttChart. * @typedef {Object} GC.Spread.Sheets.GanttSheet.TextStyle * @property {string} [font] Indicates the font of text. * @property {GC.Data.ColorString} [color] Indicates the color of text. * @property {GC.Spread.Sheets.TextDecorationType} [textDecoration] Indicates the decoration of text. */ export type TextStyle = { font?: string; color?: GC.Data.ColorString; textDecoration?: GC.Spread.Sheets.TextDecorationType; } /** * Represents a time value that contains hours and minutes. * @typedef {Object} GC.Spread.Sheets.GanttSheet.Time * @property {number} hour Indicates the hours for this time. Could be 0 to 24. * @property {number} minute Indicates the minutes for this time. Could be 0 to 59. */ export type Time = { hour: number, minute: number }; /** * This callback is used to format timescale labels. * @callback GC.Spread.Sheets.GanttSheet.TimescaleLabelFormatter * @param {Date} date Specifies the date to be formatted. * @param {GC.Spread.Sheets.GanttSheet.Project} project The project of this timescale. Could use the start date, calendar settings, or other data in the formatting. */ export type TimescaleLabelFormatter = (date: Date, project: Project)=> string; /** * Represents the work periods in one day. * @typedef {GC.Spread.Sheets.GanttSheet.WorkTime[]} GC.Spread.Sheets.GanttSheet.WorkDay */ export type WorkDay = WorkTime[] /** * Represents a work period in one day defined by a start time and end time. * @typedef {Object} GC.Spread.Sheets.GanttSheet.WorkTime * @property {GC.Spread.Sheets.GanttSheet.Time} start Indicates the start time. Could be 0:00 to 23:59. * @property {GC.Spread.Sheets.GanttSheet.Time} end Indicates the end time. Could be 0:01 t0 24:00. */ export type WorkTime = { start: GC.Spread.Sheets.GanttSheet.Time, end: GC.Spread.Sheets.GanttSheet.Time } /** * Represents the day of week in calendar. * @enum {number} */ export enum DayOfWeek{ /** * Sunday. */ Sunday= 0, /** * Monday. */ Monday= 1, /** * Tuesday. */ Tuesday= 2, /** * Wednesday. */ Wednesday= 3, /** * Thursday. */ Thursday= 4, /** * Friday. */ Friday= 5, /** * Saturday. */ Saturday= 6 } /** * Represents the type of gridlines on GanttChart. * @enum {number} */ export enum GanttGridlineType{ /** * The empty style. */ empty= 0, /** * The thin style. */ thin= 1, /** * The dashed style. */ dashed= 3, /** * The dotted style. */ dotted= 4, /** * The dashDot style. */ dashDot= 9 } /** * Represents how to show the tiers for timescale. * @enum {number} */ export enum TimescaleTierMode{ /** * Shows the middle tier. */ middle= 1, /** * Shows the middle tier and bottom tier. */ middleBottom= 2, /** * Shows all the tiers at top, middle, and bottom. */ topMiddleBottom= 3 } /** * Represents the units for timescale. * @enum {number} */ export enum TimescaleUnit{ /** * The Year unit. */ years= 1, /** * The HalfYear unit. */ halfYears= 2, /** * The Quarter unit. */ quarters= 3, /** * The Month unit. */ months= 4, /** * The ThirdsOfMonth unit. */ thirdsOfMonth= 5, /** * The Week unit. */ weeks= 6, /** * The Day unit. */ days= 7, /** * The Hour unit. */ hours= 8, /** * The Minute unit. */ minutes= 9 } export class Calendar{ /** * Creates a calendar with the provided work weeks. * @class * @param {string} name - A string value specifies the name of this calendar. * @param {GC.Spread.Sheets.GanttSheet.WorkWeek} [defaultWorkWeek] - Specifies the default work times of each day of week. If not specified, the work times will be same as the standard calendar. * @param {GC.Spread.Sheets.GanttSheet.CustomWorkWeek[]} [customWorkWeeks] - Specifies the customized work times of each day of week for the specified date range. * @classdesc Represents a calender for scheduling, which defines the work times of each day. */ constructor(name: string, defaultWorkWeek?: GC.Spread.Sheets.GanttSheet.WorkWeek, customWorkWeeks?: GC.Spread.Sheets.GanttSheet.CustomWorkWeek[]); /** * Gets or sets the custom work weeks for this calendar. * Note do not modify a calendar in use. Instead, you could copy a calendar and make changes, then replace the original one. * @type {GC.Spread.Sheets.GanttSheet.CustomWorkWeek[]} */ customWorkWeeks: GC.Spread.Sheets.GanttSheet.CustomWorkWeek[]; /** * Gets or sets the default work week for this calendar. * Note do not modify a calendar in use. Instead, you could copy a calendar and make changes, then replace the original one. * @type {GC.Spread.Sheets.GanttSheet.WorkWeek} */ defaultWorkWeek: GC.Spread.Sheets.GanttSheet.WorkWeek; /** * The 24 hours calendar, which defines the work time as 24 hours by 7 days in a week. * @type {GC.Spread.Sheets.GanttSheet.Calendar} * @readonly */ static hours24: GC.Spread.Sheets.GanttSheet.Calendar; /** * Gets or sets the calendar name. * @type {string} */ name: string; /** * The night-shift calendar, which defines the work time as 23:00 to 3:00 and 4:00 to 8:00 from Monday evening to Saturday morning. * @type {GC.Spread.Sheets.GanttSheet.Calendar} * @readonly */ static nightShift: GC.Spread.Sheets.GanttSheet.Calendar; /** * The standard calendar, which defines the work time as 8:00 to 12:00 and 13:00 to 17:00 for Monday to Friday. * @type {GC.Spread.Sheets.GanttSheet.Calendar} * @readonly */ static standard: GC.Spread.Sheets.GanttSheet.Calendar; /** * Copies the work weeks of this calendar to a new calendar. * @param {string} newName A string indicates the name of the new calendar. * @returns {GC.Spread.Sheets.GanttSheet.Calendar} The copy result. */ copyTo(newName: string): GC.Spread.Sheets.GanttSheet.Calendar; } export class CalendarSettings{ /** * Creates a calendar settings object. Internal used only. * @class * @classdesc Represents a calendar settings object to configure the parameters used by calendars and durations. */ constructor(); /** * Gets or sets a value that indicates how many work days have in a month. It is used in duration conversions and calculating. The default value is 20; * @type {number} * @default 20 */ daysPerMonth: number; /** * Gets or sets the decimal digits for formatting a duration value. This duration value will be rounded to the nearest decimal places. The default value is 3. * @type {number} * @default 3 */ defaultDurationDecimalDigits: number; /** * Gets or sets the default unit of duration. It is used in parsing or editing durations. The default value is 'Day'. * @type {GC.Spread.Sheets.GanttSheet.DurationUnit} * @default "Day" */ defaultDurationUnit: GC.Spread.Sheets.GanttSheet.DurationUnit; /** * Gets or sets the default time for task finish. If the date for task finish has no time specified, then this time will be used. The default value is 17:00. * @type {GC.Spread.Sheets.GanttSheet.Time} */ defaultFinishTime: GC.Spread.Sheets.GanttSheet.Time; /** * Gets or sets the default time for task start. If the date for task start has no time specified, then this time will be used. The default value is 8:00. * @type {GC.Spread.Sheets.GanttSheet.Time} */ defaultStartTime: GC.Spread.Sheets.GanttSheet.Time; /** * Gets or sets a value that indicates how many hours have in a workday. It is used in duration conversions and calculating. The default value is 8; * @type {number} * @default 8 */ hoursPerDay: number; /** * Gets or sets a value that indicates how many hours have in a work week. It is used in duration conversions and calculating. The default value is 40; * @type {number} * @default 40 */ hoursPerWeek: number; /** * Gets or sets the labels for duration parsing and formatting. The value should have 6 strings, in the order as Minute, Hour, Day, Week, Month, and Year. * @type {string[]} */ unitLabels: string[]; /** * Gets or sets the plurals labels for duration parsing and formatting. The value should have 6 strings, in the order as Minute, Hour, Day, Week, Month, and Year. * @type {string[]} */ unitLabelsPlurals: string[]; /** * Gets or sets a value that indicates the first day of the week. It will affect how to display and calculate weeks. The default value is Sunday. * @type {GC.Spread.Sheets.GanttSheet.DayOfWeek} * @default GC.Spread.Sheets.GanttSheet.DayOfWeek.Sunday */ weekStartOn: GC.Spread.Sheets.GanttSheet.DayOfWeek; } export class Collection{ /** * Creates an instance of Collection. * @class * @param {T[]} [items] The items of collection. * @classdesc A collection of objects. */ constructor(); /** * Adds the item into list. * @param {T} item The item to add. */ add(item: T): void; /** * Get all item form collection. * @return {T[]} A collection item list. */ all(): T[]; /** * Removes all items from list. */ clear(): void; /** * Get the item index from collection list. * @param {T} item The item of the collection. * @return {number} The index of item in the collection list. */ getIndexByItem(item: T): number; /** * Get the item with the corresponding index * @param {number} index The collection list index. * @returns {T} The rule with the specified name. */ getItemAt(index: number): T; /** * Gets the item with the specified name. * @param {string} name A string value indicates the name of the rule. * @returns {T | null} The rule with the specified name. */ getRule(name: string): T | null; /** * Insert the item into list. * @param {number} index The insert index. * @param {T} item The item to insert. */ insert(item: T): void; /** * Get the collection list length. * @return {number} The collection list length. */ length(): number; /** * Removes the item from list. * @param {T} item The item to remove. */ remove(item: T): void; /** * Delete the corresponding item from an index * @param {number} index The collection list index. */ removeAt(index: number): void; /** * Set the item to index. * @param {number} index The index to insert. * @param {T} item The item. */ setItemAt(index: number, item: T): void; } export class CustomWorkWeek extends GC.Spread.Sheets.GanttSheet.WorkWeek{ /** * Creates a new week with the specified work times of each day for a custom date range. * @class * @extends {GC.Spread.Sheets.GanttSheet.WorkWeek} * @param {GC.Spread.Sheets.GanttSheet.WorkDay[]} workDays - A workday array with 7 items from Sunday to Saturday, specifies the work times of each day in a week. * @param {Date} start - A date specifies the start of the date range to apply this week definition in calendar. * @param {Date} finish - A date specifies the finish of the date range to apply this week definition in calendar. * @classdesc Represents the a week in calender, which defines the work times of each day. */ constructor(workDays: GC.Spread.Sheets.GanttSheet.WorkDay[], start: Date, finish: Date); /** * Gets or sets the finish date for this custom work week. * @type {Date} */ finish:Date; /** * Gets or sets the start date for this custom work week. * @type {Date} */ start:Date; } export class GanttGridlines{ /** * Represents the gridlines for GanttSheet and GanttChart. */ constructor(); /** * Gets or sets the gridline which aligns to the ticks on timescale bottom tier on GanttChart. * @type {GC.Spread.Sheets.GanttSheet.GanttGridline} */ bottomTierColumn: GC.Spread.Sheets.GanttSheet.GanttGridline; /** * Gets or sets the gridline to indicate current date on GanttChart. * @type {GC.Spread.Sheets.GanttSheet.GanttGridline} */ currentDate: GC.Spread.Sheets.GanttSheet.GanttGridline; /** * Gets or sets the gridline for rows of GanttChart. * @type {GC.Spread.Sheets.GanttSheet.GanttGridlineInterval} */ ganttRows: GC.Spread.Sheets.GanttSheet.GanttGridlineInterval; /** * Gets or sets the gridline which aligns to the ticks on timescale middle tier on GanttChart. * @type {GC.Spread.Sheets.GanttSheet.GanttGridline} */ middleTierColumn: GC.Spread.Sheets.GanttSheet.GanttGridline; /** * Gets or sets the gridline to indicate project finish date on GanttChart. * @type {GC.Spread.Sheets.GanttSheet.GanttGridline} */ projectFinish: GC.Spread.Sheets.GanttSheet.GanttGridline; /** * Gets or sets the gridline to indicate project start date on GanttChart. * @type {GC.Spread.Sheets.GanttSheet.GanttGridline} */ projectStart: GC.Spread.Sheets.GanttSheet.GanttGridline; /** * Gets or sets the gridline which aligns to the ticks on timescale top tier on GanttChart. * @type {GC.Spread.Sheets.GanttSheet.GanttGridline} */ topTierColumn: GC.Spread.Sheets.GanttSheet.GanttGridline; } export class GanttMapping{ /** * Creates the mapping for the GanttSheet * @class * @classdesc Represents the mapping of GanttSheet to convert and convert back the task value. */ constructor(); /** * A helper function that will format a boolean value to string. * @param {boolean} value The boolean value to format. * @returns {string} */ formatBoolean(value: boolean): string; /** * A helper function that will format a Date value to string. * @param {Date} value The Date value to format. * @param {string} [format] Optional. A string value indicates the format string for Date value. * @param {string} [culture] Optional. A string value indicates the culture used to format Date. * @returns {string} */ formatDate(value: Date, format?: string, culture?: string): string; /** * A helper function that will format a {@link GC.Spread.Sheets.GanttSheet.Duration} value to string. * @param {GC.Spread.Sheets.GanttSheet.Duration} value The Duration value to format. * @returns {string} */ formatDuration(value: GC.Spread.Sheets.GanttSheet.Duration): string; /** * A helper function that will format a number value to string. * @param {number} value The number value to format. * @returns {string} */ formatInt(value: number): string; /** * A helper function that will format a {@link GC.Spread.Sheets.GanttSheet.TaskScheduleMode} value to string. * @param {GC.Spread.Sheets.GanttSheet.TaskScheduleMode} value The value to format. * @returns {string} */ formatMode(value: GC.Spread.Sheets.GanttSheet.TaskScheduleMode): string; /** * A helper function that will parse an original value in string or other types to a boolean value. * @param {any} value The original value to parse. * @returns {boolean} */ parseBoolean(value: any): boolean; /** * A helper function that will parse an original value in string or other types to a Date value. * @param {any} value The original value to parse. * @param {string} [format] Optional. A string value indicates the format string for Date value. * @param {string} [culture] Optional. A string value indicates the culture used to parse Date. * @returns {Date} */ parseDate(value: any, format?: string, culture?: string): Date; /** * A helper function that will parse an original value in string or other types to a {@link GC.Spread.Sheets.GanttSheet.Duration} value. * @param {any} value The original value to parse. * @returns {GC.Spread.Sheets.GanttSheet.Duration} */ parseDuration(value: any): GC.Spread.Sheets.GanttSheet.Duration; /** * A helper function that will parse an original value in string or other types to an integer value. * @param {any} value The original value to parse. * @returns {number} */ parseInt(value: any): number; /** * A helper function that will parse an original value in string or other types to a {@link GC.Spread.Sheets.GanttSheet.TaskScheduleMode} value. * @param {any} value The original value to parse. * @returns {GC.Spread.Sheets.GanttSheet.TaskScheduleMode} */ parseMode(value: any): TaskScheduleMode; } export class GanttSheet extends GC.Spread.Sheets.TableSheet.TableSheet{ /** * Creates a GanttSheet with specified data view and options. * @class * @param {string} [name] The gantt sheet name. You could use this name to get gantt sheet instance. * @param {GC.Data.View} [dataView] The gantt sheet data view for initialization. */ constructor(name?: string, dataView?: GC.Data.View); /** * Gets the gridline for gantt chart, and configure the line types and colors. * @readonly * @type {GC.Spread.Sheets.GanttSheet.GanttGridlines} */ gridlines: GC.Spread.Sheets.GanttSheet.GanttGridlines; /** * Gets the mapping of this GanttSheet used to convert or convert back the data in view. * @readonly * @type {GC.Spread.Sheets.GanttSheet.GanttMapping} */ mapping: GC.Spread.Sheets.GanttSheet.GanttMapping; /** * Gets the project to display and edit of this GanttSheet. * @readonly * @type {GC.Spread.Sheets.GanttSheet.Project} */ project: GC.Spread.Sheets.GanttSheet.Project; /** * Sets the data view of table sheet. * @param {GC.Data.View} dataView - The data view to bind. * @param {GC.Spread.Sheets.GanttSheet.IGanttSheetOptions} [options] - The the gantt sheet options. */ bindGanttView(dataView: GC.Data.View, options?: GC.Spread.Sheets.GanttSheet.IGanttSheetOptions): void; /** * Gets the task at the active row. * @returns {GC.Spread.Sheets.GanttSheet.Task} The task at the active row. */ getActiveTask(): GC.Spread.Sheets.GanttSheet.Task; /** * Gets the selection ranges. * @returns {GC.Spread.Sheets.Range[]} The selected ranges. */ getSelections(): GC.Spread.Sheets.Range[]; /** * Gets the task at the specified row. * @param {number} rowIndex A number indicates the row index. * @returns {GC.Spread.Sheets.GanttSheet.Task} The task at the specified row. */ getTaskByRow(rowIndex: number): GC.Spread.Sheets.GanttSheet.Task; /** * Resumes the paint of gantt sheet. */ resumePaint(): void; /** * Suspends the paint of gantt sheet. */ suspendPaint(): void; } export class NonWorkingTimeStyle{ /** * Creates the instance to configure non working time area on GanttChart. Internal used only. * @class * @classdesc Represents the non working time area on GanttChart. */ constructor(); /** * Gets or sets the color used to draw the non working time area on GanttChart. The default value is "#F7F7F7". * @type {GC.Data.ColorString} * @default "#F7F7F7" */ color: GC.Data.ColorString; /** * Gets or sets a value that indicates how to draw the non working time area on GanttChart. * @type {GC.Spread.Sheets.GanttSheet.NonWorkingTimeDrawMode} */ drawMode: GC.Spread.Sheets.GanttSheet.NonWorkingTimeDrawMode; /** * Gets or sets the fill pattern used to draw the non working time area on GanttChart. The default value is 'solidFill'. * @type {GC.Spread.Sheets.GanttSheet.TaskbarFillPattern} */ pattern: GC.Spread.Sheets.GanttSheet.TaskbarFillPattern; } export class Project{ /** * Represents a project for scheduling. * @param {string} name - Indicates the name of this project. The name will apply to the root task also. */ constructor(name: string); /** * Gets or sets the calendar for this project. It is the default calendar for all tasks in this project. * Note do not modify the members of calendar, instead, please replace the calendar instance to modify. * @type {GC.Spread.Sheets.GanttSheet.Calendar} */ calendar: GC.Spread.Sheets.GanttSheet.Calendar; /** * Gets the calendar settings for this project, and configure the parameters used for calculating dates and durations. * @type {GC.Spread.Sheets.GanttSheet.CalendarSettings} * @readonly */ calendarSettings: GC.Spread.Sheets.GanttSheet.CalendarSettings; /** * Gets the count of tasks and blank rows in this project. * @type {number} * @readonly */ count: number; /** * Gets or sets the current date of this project. Gantt chart will show a grid line to indicate current date. * @type {Date} */ currentDate: Date; /** * Gets the tasks dependencies in this project. * This is a cloned array of the internal tasks dependencies. Call addDependency or removeDependency to modify it. * @type {GC.Spread.Sheets.GanttSheet.TaskDependency[]} * @readonly */ dependencies: GC.Spread.Sheets.GanttSheet.TaskDependency[]; /** * Gets the finish date of this project. By default, the finish date is scheduled by the start date. * @type {Date} */ finishDate: Date; /** * Gets the layout for gantt chart, and configure the layout appearance of task bars and links. * @readonly * @type {GC.Spread.Sheets.GanttSheet.TaskbarLayout} */ layout: GC.Spread.Sheets.GanttSheet.TaskbarLayout; /** * Gets the root task of this project. * @type {GC.Spread.Sheets.GanttSheet.Task} * @readonly */ root: Task; /** * Indicates the tasks are sorted. * @type {boolean} * @readonly */ sorted: boolean; /** * Gets or sets the start date of this project. The scheduling will start from this date. * @type {Date} */ startDate: Date; /** * Gets the tasks in this project. * This is a cloned array of the internal tasks. Please use getTask if you want to get one task with the specified task number. * @type {GC.Spread.Sheets.GanttSheet.Task[]} * @readonly */ tasks: GC.Spread.Sheets.GanttSheet.Task[]; /** * Gets the tasks in this project in the sorted order. * Specially, null indicates a blank row in the array. * This is a cloned array of the internal tasks. Please use getTaskByRow if you want to get one task with the specified row index after sort. * @type {GC.Spread.Sheets.GanttSheet.Task[]} * @readonly */ tasksSorted: GC.Spread.Sheets.GanttSheet.Task[]; /** * Gets the list of task style rules for gantt chart, and configure the appearance for task with the specified rules. * @readonly * @type {GC.Spread.Sheets.GanttSheet.Collection} */ taskStyleRules: GC.Spread.Sheets.GanttSheet.Collection; /** * Gets the timescale for gantt chart, and configure the timescale appearances and locations. * @readonly * @type {GC.Spread.Sheets.GanttSheet.Timescale} */ timescale: GC.Spread.Sheets.GanttSheet.Timescale; /** * Adds one or more task dependency for the project. * @param {GC.Spread.Sheets.GanttSheet.TaskDependency|GC.Spread.Sheets.GanttSheet.ITaskDependency|Array|Array} dependencies Indicates the tasks dependencies to be added. */ addDependency(dependencies: GC.Spread.Sheets.GanttSheet.TaskDependency|GC.Spread.Sheets.GanttSheet.ITaskDependency|Array|Array): void; /** * Adds tasks with the specified count or data for this project. * @param {number|GC.Spread.Sheets.GanttSheet.ITaskData|GC.Spread.Sheets.GanttSheet.ITaskData[]} [data=1] Optional. A number indicates the count of the tasks to add, or a provided data or a data array for the tasks to add. The default is 1 for adding one task. * @param {number} [level] Optional. A number indicates the level of the tasks to add. With the specified level, the tasks could be added as children, sibling, or elders of the last task. If not provided, will set level automatically. * @returns {GC.Spread.Sheets.GanttSheet.Task[]} Array of the added tasks. */ addTasks(data?: number | GC.Spread.Sheets.GanttSheet.ITaskData | GC.Spread.Sheets.GanttSheet.ITaskData[], level?: number): Task[]; /** * Gets a task with the specified task number. * Typically, the task number is the index of the task in project. * If the tasks has been sorted, please uses getTaskByRow to get task with the specified row index. * @param {number} taskNumber Specifies the task number of the target task. * @returns {GC.Spread.Sheets.GanttSheet.Task} The task with the specified task number. */ getTask(taskNumber: number): GC.Spread.Sheets.GanttSheet.Task; /** * Increases the levels of the specified tasks for this project. * @param {number|number[]} taskNumbers A number or number array indicates the number of the tasks to increase levels. */ indentTasks(taskNumbers: number | number[]): void; /** * Increases the levels of a range of tasks with the continues numbers for this project. * @param {number} taskNumber A number indicates the first number of the tasks to increase levels. * @param {number} [count=1] Optional. A number indicates the count of tasks to increase levels. The default is 1. */ indentTasksByRange(taskNumber: number, count?: number): void; /** * Inserts tasks at the specified position with provided data. * @param {number} taskNumber Specifies the target task number to insert. * @param {number|GC.Spread.Sheets.GanttSheet.ITaskData|GC.Spread.Sheets.GanttSheet.ITaskData[]} [data=1] Optional. A number indicates the count of the tasks to insert, or a provided data or a data array for the tasks to insert. The default is 1 for inserting one task. * @param {number} [level] Optional. A number indicates the level of the tasks to add. With the specified level, the tasks could be added as children, sibling, or elders of the last task. If not provided, will set level automatically. * @returns {GC.Spread.Sheets.GanttSheet.Task[]} Array of the inserted tasks. */ insertTasks(taskNumber: number, data?: number | GC.Spread.Sheets.GanttSheet.ITaskData | GC.Spread.Sheets.GanttSheet.ITaskData[], level?: number): Task[]; /** * Decreases the levels of the specified tasks for this project. * @param {number|number[]} taskNumbers A number or number array indicates the number of the tasks to decrease levels. */ outdentTasks(taskNumbers: number | number[]): void; /** * Decreases the levels of a range of tasks with the continues numbers for this project. * @param {number} taskNumber A number indicates the first number of the tasks to decrease levels. * @param {number} [count=1] Optional. A number indicates the count of tasks to decrease levels. The default is 1. */ outdentTasksByRange(taskNumber: number, count?: number): void; /** * Removes one or more task dependency for the project. * @param {GC.Spread.Sheets.GanttSheet.TaskDependency|Array} dependencies Indicates the tasks dependencies to be removed. Note the dependency instance should be members of project.dependencies. */ removeDependency(dependencies: GC.Spread.Sheets.GanttSheet.TaskDependency|Array): void; /** * Removes tasks with the specified task numbers for this project. * @param {number|number[]} taskNumbers A number or number array indicates the number of the tasks to be removed. */ removeTasks(taskNumbers: number | number[]): void; /** * Removes a range of tasks with the continues task numbers for this project. * @param {number} taskNumber A number indicates the first number of the tasks to be removed. * @param {number} [count=1] Optional. A number indicates the count of tasks to be removed. The default is 1. */ removeTasksByRange(taskNumber: number, count?:number): void; /** * Resume the scheduling process after made modifications for multiple tasks or dependencies. */ resumeSchedule(): void; /** * Sorts the tasks with the specified task fields. * @param {string[]} fields Specifies the fields to sort by. * @param {boolean[]} [ascendingStates] Specifies the ascending states for related fields. * @param {boolean[]} [keepStructure=true] Specifies sort result should keep the task parent-children relationship structure. The default is true. * @param {boolean[]} [renumber=false] If true, the number of tasks will be renumbered by the sort result. The default is false. */ sort(fields: string[], ascendingStates?: boolean[], keepStructure?: boolean, renumber?: boolean): void; /** * Suspends the scheduling process before making modifications for multiple tasks or dependencies. */ suspendSchedule(): void; } export class Task{ /** * Creates a task instance. Internal used only. * @class * @classdesc Represents a task in project. */ constructor(); /** * Gets the children of this task. * This is a cloned array of the internal tasks. To modify the children, please call project.insertTasks and project.removeTasks. * @readonly * @type {GC.Spread.Sheets.GanttSheet.Task[]} */ children: GC.Spread.Sheets.GanttSheet.Task[]; /** * Gets or sets a float number that indicates the complete percentage of this task. The value should be equal or grater than 0. * @type {number} */ complete: number; /** * Gets or sets a Date value that indicates the progress of a task. It is the point up to which actual have been reported for the task. * @type {Date} */ completeThrough: Date; /** * Gets or sets the duration of this task. * It is allowed to set a number or string value to represent the duration, and the get result will always be a valid {@link GC.Spread.Sheets.GanttSheet.Duration} object. * Note that duration could be null for a start-only or finish-only task with manually scheduling mode. * @type {number | string | GC.Spread.Sheets.GanttSheet.Duration} */ duration: number | string | GC.Spread.Sheets.GanttSheet.Duration; /** * Gets or sets the finish date of this task. * Note that finish could be null for a start-only or duration-only task with manually scheduling mode. In these cases, use finishDisplayed to get the actual value in GanttChart. * @type {Date} */ finish: Date; /** * Gets the finish date for this task to display in GanttChart. * @type {Date} * @readonly */ finishDisplayed: Date; /** * Gets or sets a boolean value that indicates this task is a milestone or not. * If not specified, a task will show as milestone if the duration time is 0. * @type {boolean} */ isMilestone: boolean; /** * Gets a boolean value that indicates this task is a normal task or not. A normal task is neither a summary task nor milestone. * @type {boolean} * @readonly */ isNormal: boolean; /** * Gets a boolean value that indicates this task is a summary task or not. A summary task is a parent of other tasks. * @readonly * @type {boolean} */ isSummary: boolean; /** * Gets the level of this task. For root task, the value is 0. * @readonly * @type {number} */ level: number; /** * Gets or sets the scheduling mode of this task. * @type {GC.Spread.Sheets.GanttSheet.TaskScheduleMode} */ mode: GC.Spread.Sheets.GanttSheet.TaskScheduleMode; /** * Gets or sets the name of this task. * @type {string} */ name: string; /** * Gets the parent of this task. Note the root task has no parent. * @readonly * @type {GC.Spread.Sheets.GanttSheet.Task} */ parent: GC.Spread.Sheets.GanttSheet.Task; /** * Gets a {@link GC.Spread.Sheets.GanttSheet.TaskDependency} array that contains all predecessor of this task. * To modify the predecessor, please set predecessor field of task, or call addDependency or removeDependency of project. * @type {GC.Spread.Sheets.GanttSheet.TaskDependency[]} * @readonly */ predecessorDependencies: GC.Spread.Sheets.GanttSheet.TaskDependency[]; /** * Gets or sets a string value that represents the predecessors of this task. * The predecessors string contains one or more task number and dependency type. * @type {string} */ predecessors: string; /** * Gets the row index of this task. The row index is same as the id of the task if tasks are not sorted. * @readonly * @type {number} */ rowIndex: number; /** * Gets or sets the start date of this task. * Note that start could be null for a finish-only or duration-only task with manually scheduling mode. In these cases, use startDisplayed to get the actual value in GanttChart. * @type {Date} */ start: Date; /** * Gets the start date for this task to display in GanttChart. * @type {Date} * @readonly */ startDisplayed: Date; /** * Gets or sets the bar styles of this task. A task could have several task bars in the GanttChart, you could set style for each bar by the specified rule name. * Note do not modify the members of this value, instead, please set a new object instance for this field. * @type {Object.} */ style: { [key: string]: GC.Spread.Sheets.GanttSheet.TaskStyle }; /** * Gets a {@link GC.Spread.Sheets.GanttSheet.TaskDependency} array that contains all successors of this task. * To modify the successors, please set successors field of task, or call addDependency or removeDependency of project. * @type {GC.Spread.Sheets.GanttSheet.TaskDependency[]} * @readonly */ successorDependencies: GC.Spread.Sheets.GanttSheet.TaskDependency[]; /** * Gets or sets a string value that represents the successors of this task. * The successors string contains one or more task number and dependency type. * @type {string} */ successors: string; /** * Gets the number of this task. For root task, the value is 0. * @readonly * @type {number} */ taskNumber: number; /** * Gets the task value by the specified property. * @param {string} property the specified property. * @returns {*} the task value. */ getValue(property: string): void; /** * Sets the task value by the specified property. * @param {string} property the specified property. * @param {*} value the specified value. */ setValue(property: string, value: any): void; } export class TaskbarLayout{ /** * * Creates a task bar layout instance. Internal used only. * @class * @classdesc Represents the layout of task bars on GanttChart. */ constructor(); /** * Gets or sets the height of task bars in pixels. The default value is 12. * @type {number} * @default 12 */ barHeight: number; /** * Gets or sets the format string for date values which displays for task bar on GanttChart. The default value is "yyyy/mm/dd hh:mm". * @type {string} * @default "yyyy/mm/dd hh:mm" */ barTextDateFormat: string; /** * Gets or sets the link line mode. The default value is 'toTop'. * @type {GC.Spread.Sheets.GanttSheet.TaskbarLinkMode} * @default "toTop" */ linkLineMode: GC.Spread.Sheets.GanttSheet.TaskbarLinkMode; /** * Gets or sets a boolean value that indicates the task bar should be rounded to whole days or not. * If true, a time before the project.calendarSettings.defaultStartTime will be displayed as the beginning of the day, * and a time after the project.calendarSettings.defaultFinishTime will be displayed as the ending of the day. * The default value is true. * @type {boolean} * @default true */ roundBarsToWholeDays: boolean; /** * Gets or sets the format string for date values which displays in task bar tips or link line tips on GanttChart. The default value is "yyyy/mm/dd hh:mm". * @type {string} * @default "yyyy/mm/dd hh:mm" */ tipDateFormat: string; } export class TaskbarStyleRule{ /** * Creates a task bar style rule with the specified name. * @class * @param {string} name Indicates the name of the rule. The name should be a unique value. * @classdesc Represents a task bar style rule for project. Could extend from this class and implement a customized rule. * @example * ```javascript * class MyProgressRule extends TaskbarStyleRule { * constructor() { * super("My Progress"); * this.style = { * taskbarStyle: { * middleColor: "#3B87D4", * middleShape: "RectangleMiddle", * middlePattern: "solidFill", * } * }; * } * match(task: Task): boolean { * return task.complete > 0; * } * getFromDate(task: Task) { * return task.startDisplayed; * } * getToDate(task: Task) { * return task.completeThrough; * } * } * ``` */ constructor(); /** * Gets the name of this rule. * @type {string} */ name: string; /** * Gets or sets the style for all task bars this rule matched. * @type {GC.Spread.Sheets.GanttSheet.TaskStyle} */ style: GC.Spread.Sheets.GanttSheet.TaskStyle; /** * Gets the date that indicates the start of the task bar for the specified task. * By default it returns task.startDisplayed. Override this method in your customized rule and returns the result. * @param {GC.Spread.Sheets.GanttSheet.Task} task A matched task for this rule. * @returns {Date} A date value indicates the start of the task bar for the specified task. */ getFromDate(task: GC.Spread.Sheets.GanttSheet.Task): Date; /** * Gets the date that indicates the end of the task bar for the specified task. * By default it returns task.finishDisplayed. Override this method in your customized rule and returns the result. * @param {GC.Spread.Sheets.GanttSheet.Task} task A matched task for this rule. * @returns {Date} A date value indicates the end of the task bar for the specified task. */ getToDate(task: GC.Spread.Sheets.GanttSheet.Task): Date; /** * Determines the task bar defined by this rule matches the specified task or not. * Override this method in your customized rule and returns the result. * @param {GC.Spread.Sheets.GanttSheet.Task} task The task to check. * @returns {boolean} true if the task is matched and will show the task bar of this rule; otherwise false. * @abstract */ match(task: GC.Spread.Sheets.GanttSheet.Task): boolean; } export class TaskDependency{ /** * Creates a task dependency. * @class * @param {GC.Spread.Sheets.GanttSheet.Task} from Indicates the task which the dependency is from. * @param {GC.Spread.Sheets.GanttSheet.Task} to Indicates the task which the dependency is to. * @param {GC.Spread.Sheets.GanttSheet.TaskDependencyType} [type="FS"] Optional. Indicates the dependency type. The default is 'FS' (Finish to Start). * @classdesc Represents a task dependency. */ constructor(from: GC.Spread.Sheets.GanttSheet.Task, to: GC.Spread.Sheets.GanttSheet.Task, type?: GC.Spread.Sheets.GanttSheet.TaskDependencyType); /** * Gets the task which this dependency is from. * @type {GC.Spread.Sheets.GanttSheet.Task} * @readonly */ from: GC.Spread.Sheets.GanttSheet.Task; /** * Gets the task which this dependency is to. * @type {GC.Spread.Sheets.GanttSheet.Task} * @readonly */ to: GC.Spread.Sheets.GanttSheet.Task; /** * Gets the type of this dependency. * @type {GC.Spread.Sheets.GanttSheet.TaskDependencyType} * @readonly */ type: GC.Spread.Sheets.GanttSheet.TaskDependencyType; } export class Timescale{ /** * Creates a timescale for project. Internal used only. * @class * @classdesc Represents the timescale of GanttChart. */ constructor(); /** * Gets the bottom tier of the timescale. * @type {GC.Spread.Sheets.GanttSheet.TimescaleTier} * @readonly */ bottomTier: GC.Spread.Sheets.GanttSheet.TimescaleTier; /** * Gets the current date for the timescale. To change it, call scroll functions of timescale. * @type {Date} * @readonly */ currentDate: Date; /** * Gets or sets the maximum date of the scrollable area of the timescale. The default value is 2030-1-1. * @type {Date} */ maxDate: Date; /** * Gets the middle tier of the timescale. * @type {GC.Spread.Sheets.GanttSheet.TimescaleTier} * @readonly */ middleTier: GC.Spread.Sheets.GanttSheet.TimescaleTier; /** * Gets or sets the minimum date of the scrollable area of the timescale. The default value is 2020-1-1. * @type {Date} */ minDate: Date; /** * Gets the non working time area of the timescale. * @type {GC.Spread.Sheets.GanttSheet.NonWorkingTimeStyle} * @readonly */ nonWorkingTime: GC.Spread.Sheets.GanttSheet.NonWorkingTimeStyle; /** * Gets or sets a boolean value that indicates whether show the scale separator line between top tier and middle tier. * @type {boolean} */ showScaleSeparator: boolean; /** * Gets or sets the tier mode for the timescale. * @type {GC.Spread.Sheets.GanttSheet.TimescaleTierMode} */ tierMode: GC.Spread.Sheets.GanttSheet.TimescaleTierMode; /** * Gets or sets the text style for bottom tier labels of timescales. * @type {GC.Spread.Sheets.GanttSheet.TextStyle} */ timescaleBottomTierTextStyle: GC.Spread.Sheets.GanttSheet.TextStyle; /** * Gets or sets the text style for middle tier labels of timescales. * @type {GC.Spread.Sheets.GanttSheet.TextStyle} */ timescaleMiddleTierTextStyle: GC.Spread.Sheets.GanttSheet.TextStyle; /** * Gets or sets the text style for top tier labels of timescales. * @type {GC.Spread.Sheets.GanttSheet.TextStyle} */ timescaleTopTierTextStyle: GC.Spread.Sheets.GanttSheet.TextStyle; /** * Gets the top tier of the timescale. * @type {GC.Spread.Sheets.GanttSheet.TimescaleTier} * @readonly */ topTier: GC.Spread.Sheets.GanttSheet.TimescaleTier; /** * Gets a number value that indicates the zoom factor for timescale. To change it, call zoom functions of timescale. * @type {number} * @readonly */ zoomFactor: number; /** * Scrolls the timescale in pixels. Note timescale will scroll to the nearest tick. * @param {number} pixels Indicates the pixels to scroll. Positive number indicates scroll forward, and negative number indicates scroll backward. */ scroll(pixels: number): void; /** * Scrolls the timescale by the specified count of units. Note timescale will scroll to the nearest tick. * @param {number} count Indicates the time in specified units to scroll. Positive number indicates scroll forward, and negative number indicates scroll backward. * @param {GC.Spread.Sheets.GanttSheet.TimescaleUnit} unit Indicates the unit for count value. */ scrollBy(count: number, unit: GC.Spread.Sheets.GanttSheet.TimescaleUnit): void; /** * Scrolls the timescale by one tick. * @param {boolean} forward A boolean value that indicates to scroll forward or backward. */ scrollOneTick(forward: boolean): void; /** * Scrolls the timescale to the specified date. Note timescale will scroll to the nearest tick. * @param {Date} date A Date value indicates the scroll target. * @param {number} [percentOfViewport] A number value from 0 to 1 indicates the location in percent of viewport where the target date want to scroll to. 0 indicates the left side of viewport, and 1 indicates the right side of viewport. The default is 0. */ scrollTo(date: Date, percentOfViewport?: number): void; /** * Zooms the timescale to suitable factor according to the labels of ticks on each tiers automatically. */ zoomAuto(): void; /** * Zooms in the timescale to the next level. * @param {boolean} [adjustTierUnit] A boolean value indicates whether to adjust the units of tiers to a suitable value according to the zoom factor or not. The default is true. */ zoomIn(adjustTierUnit?: boolean): void; /** * Zooms out the timescale to the next level. * @param {boolean} [adjustTierUnit] A boolean value indicates whether to adjust the units of tiers to a suitable value according to the zoom factor or not. The default is true. */ zoomOut(adjustTierUnit?: boolean): void; /** * Zooms the timescale to the specified factor. * @param {number} zoomFactor A number value indicates the target zoom factor. * @param {boolean} [adjustTierUnit] A boolean value indicates whether to adjust the units of tiers to a suitable value according to the zoom factor or not. The default is true. */ zoomTo(zoomFactor: number, adjustTierUnit?: boolean): void; /** * Zooms the timescale to display the target date range in viewport. Note timescale will adjust to the nearest ticks. * @param {Date} start A date value indicates the start of data range to display. * @param {Date} end A date value indicates the end of data range to display. * @param {boolean} [adjustTierUnit] A boolean value indicates whether to adjust the units of tiers to a suitable value according to the zoom factor or not. The default is true. */ zoomToRange(start: Date, end: Date, adjustTierUnit?: boolean): void; } export class TimescaleTier{ /** * Creates a tier for timescale. Internal used only. * @class * @classdesc Represents a tier of timescale. */ constructor(); /** * Gets or sets a number that indicates one tick are representing a time in how many units. The default value is 1. * @type {number} * @default 1 */ count: number; /** * Gets or sets the formatter for this tier, which is used to format the tick labels. * The formatter could be a Spread Number Format string for Date value like "yyyy-mm-dd", with GanttSheet special keywords supports, * or could be a callback function which will be executed in formatting. * @type {string | GC.Spread.Sheets.GanttSheet.TimescaleLabelFormatter} * @example * ```javascript * // Following keywords could be used within the formatter string. They could be used standalone, or combined with literal text or Spread Number Formatting text. * '{!YEAR_FROM_START}' // Replace with the number of years from project start date. * '{!YEAR_FROM_END}' // Replace with the number of years from project finish date. * '{!HALF_YEAR("H1", "H2")}' // Replace with the parameter text for the corresponding half year, * '{!HALF_YEAR_FROM_START}' // Replace with the number of half years from project start date. * '{!HALF_YEAR_FROM_END}' // Replace with the number of half years from project finish date. * '{!QUARTER("Q1", "Q2", "Q3", "Q4")}' // Replace with the parameter text for the corresponding quarter in year. * '{!QUARTER_FROM_START}' // Replace with the number of quarters from project start date. * '{!QUARTER_FROM_END}' // Replace with the number of quarters from project finish date. * '{!MONTH_FROM_START}' // Replace with the number of months from project start date. * '{!MONTH_FROM_END}' // Replace with the number of months from project finish date. * '{!THIRDS_OF_MONTH("B", "M", "E")}' // Replace with the parameter text for the corresponding thirds of month. * '{!WEEK_OF_YEAR}' //Replace with the number that indicates the week index in year. * '{!DAY_OF_WEEK("SUN", "MON", "TUE", "WED", "THR", "FRI", "STA")}' // Replace with the parameter text for the corresponding day of week. * '{!WEEK_FROM_START}' // Replace with the number of weeks from project start date. * '{!WEEK_FROM_END}' // Replace with the number of weeks from project finish date. * '{!DAY_OF_YEAR}' // Replace with the number 1 to 366 indicates the day index of year. * '{!DAY_FROM_START}' // Replace with the number of days from project start date. * '{!DAY_FROM_END}' // Replace with the number of days from project finish date. * '{!HOUR_FROM_START}' // Replace with the number of hours from project start date. * '{!HOUR_FROM_END}' // Replace with the number of hours from project finish date. * '{!MINUTE}' // Replace with minute value, because "mm" will be treated as month in Number Formatting. * '{!MINUTE_FROM_START}' // Replace with the number of minutes from project start date. * '{!MINUTE_FROM_END}' // Replace with the number of minutes from project finish date. * ``` */ formatter: string | GC.Spread.Sheets.GanttSheet.TimescaleLabelFormatter; /** * Gets or sets a string value that indicates the alignment of tick label. The default is "Left". * @type {"Left" | "Center" | "Right"} * @default "Left" */ labelAlign: "Left" | "Center" | "Right"; /** * Gets or sets a boolean value that indicates show tick lines for this tier or not. The default value is true. * @type {boolean} * @default true */ showTickLines: boolean; /** * Gets or sets the unit for this tier. * @type {GC.Spread.Sheets.GanttSheet.TimescaleUnit} */ unit: GC.Spread.Sheets.GanttSheet.TimescaleUnit; } export class WorkWeek{ /** * Creates a new week with the specified work times of each day. * @class * @param {GC.Spread.Sheets.GanttSheet.WorkDay[]} workDays - A workday array with 7 items from Sunday to Saturday, specifies the work times of each day in a week. * @classdesc Represents the a week in calender, which defines the work times of each day. */ constructor(workDays: GC.Spread.Sheets.GanttSheet.WorkDay[]); /** * Gets the work times for the specified day in the week. * @param {number|GC.Spread.Sheets.GanttSheet.DayOfWeek} index A number from 0 to 6, or a DayOfWeek value indicates the day. * @returns {GC.Spread.Sheets.GanttSheet.WorkDay} The work times for the specified day. */ getWorkDay(index: number|GC.Spread.Sheets.GanttSheet.DayOfWeek):GC.Spread.Sheets.GanttSheet.WorkDay; } } module Hyperlink{ /** * Present the way that user open the hyperlinked document. Default is blank. * @enum {number} * @example * ```javascript * //This example uses the HyperlinkTargetType. * sheet.setHyperlink(1, 1, { * url: 'https://www.spreadjs.com', * tooltip: 'baidu', * target: GC.Spread.Sheets.Hyperlink.HyperlinkTargetType.top, * }, GC.Spread.Sheets.SheetArea.viewport); * ``` */ export enum HyperlinkTargetType{ /** * Opens the hyperlinked document in a new window or tab. */ blank= 0, /** * Opens the hyperlinked document in the same frame where the user clicked. */ self= 1, /** * Opens the hyperlinked document in the parent frame. */ parent= 2, /** * Opens the hyperlinked document in the full body of the window. */ top= 3 } } module InputMask{ /** * Get all named patterns. * @static * @returns {INamedPattern[]} returns all the named patterns. */ function getNamedPatterns(): INamedPattern[]; /** * Set or get named pattern. * @static * @param {string} name - The name of pattern string. * @param {string | null} [pattern] - The pattern string. * @returns {string | void} if no pattern is set, returns the pattern string of the name, otherwise returns void. */ function namedPattern(name: string, pattern?: string | null): string | void; /** * Verify whether the pattern is valid. * @static * @param {string} pattern - The pattern string. * @returns {GC.Spread.Sheets.InputMask.IValidatePatternResult} returns the verified result. * @example * ```javascript * let verifyResult = GC.Spread.Sheets.InputMask.validatePattern('[a0_]{8}'); * ``` */ function validatePattern(pattern: string): GC.Spread.Sheets.InputMask.IValidatePatternResult; export interface INamedPattern{ name: string; pattern: string; } export interface IValidatePatternResult{ success: boolean; message?: string; } } module IO{ /** * Gets the the values of specific reference path list from file directly. * @static * @param {GC.Spread.Sheets.IExternalReference[]} refList - The array of external reference. * @param {GC.Spread.Sheets.IO.GetFileFunctionType} getFile - The function which return file or blob by the specified file path. * @param {GC.Spread.Sheets.IO.GetPartialValuesSuccessCallbackType} getPartialValuesSuccessCallback - The success callback function which called when get values successfully. * @param {GC.Spread.Sheets.IO.GetPartialValuesErrorCallbackType} getPartialValuesErrorCallback - The error callback function which called when get values failed. * @example * ```javascript * function getFile (path) { * // return file by path * } * let refList = spread.getExternalReferences(true); * GC.Spread.Sheets.IO.getPartialValues(refList, getFile, (externalValues) => { * // successCallback * spread.updateExternalReference(externalValues); * }, (errorMsg) => { * // errorCallback * console.log(errorMsg); * }); * ``` */ function getPartialValues(refList: GC.Spread.Sheets.IExternalReference[], getFile: GC.Spread.Sheets.IO.GetFileFunctionType, getPartialValuesSuccessCallback: GC.Spread.Sheets.IO.GetPartialValuesSuccessCallbackType, getPartialValuesErrorCallback: GC.Spread.Sheets.IO.GetPartialValuesErrorCallbackType): void; /** * Register a unknown max digit width info to IO. * @param {string} fontFamily The font family of default style's font. * @param {number} fontSize The font size of default style's font(in point). * @param {number} maxDigitWidth The max digit width of default style's font. * @returns {void} */ function registerMaxDigitWidth(fontFamily: string, fontSize: number, maxDigitWidth: number): void; /** * @typedef GC.Spread.Sheets.IO.GetFileFunctionType * @param {string} filePath - the file path. * @returns {File | Blob} - Returns the file or file blob. * @description get file by file path. */ export type GetFileFunctionType = (filePath: string) => (File | Blob) /** * @typedef GC.Spread.Sheets.IO.GetPartialValuesErrorCallbackType * @param {string} errorMsg - the error message. * @description the error callback of get partial values. */ export type GetPartialValuesErrorCallbackType = (errorMsg: string) => void /** * @typedef GC.Spread.Sheets.IO.GetPartialValuesSuccessCallbackType * @param {GC.Spread.Sheets.ExternalPartialValues} externalValues - the external value list. * @description the success callback of get partial values. */ export type GetPartialValuesSuccessCallbackType = (externalValues: GC.Spread.Sheets.ExternalPartialValues) => void /** * Specifies the io error code. * @enum {number} */ export enum ErrorCode{ /** * File read and write exception. */ fileIOError= 0, /** * Incorrect file format. */ fileFormatError= 1, /** * Need a password. */ noPassword= 2, /** * invalid Password. */ invalidPassword= 3 } } module NameBox{ /** * Gets the NameBox instance by the host element. * @param {HTMLElement|string} host The host element or the host element id. * @returns {GC.Spread.Sheets.NameBox.NameBox} The NameBox instance. * @example * ```javascript * var spread = new GC.Spread.Sheets.Workbook("ss"); * var nameBox = new GC.Spread.Sheets.NameBox.NameBox('nameBox'); * nameBox.bind(spread); * var nameBoxInstance = GC.Spread.Sheets.NameBox.findControl('nameBox'); * ``` */ function findControl(host: HTMLElement|string): GC.Spread.Sheets.NameBox.NameBox; export interface INameBoxOptions{ dropDownMaxHeight?: number; enableAddCustomName?: boolean; enableNavigateToRange?: boolean; showCustomNameListIndicator?: boolean; } export class NameBox{ /** * Represents name box. * @class * @param {HTMLElement | string} host The DOM Element. * @param {GC.Spread.Sheets.Workbook} spread The workbook which the namebox bound. * @param {GC.Spread.Sheets.NameBox.INameBoxOptions} [options] options of the name box. */ constructor(host: HTMLElement | string, workbook: GC.Spread.Sheets.Workbook, options?: GC.Spread.Sheets.NameBox.INameBoxOptions); /** * Indicates the options of the name box. * @type {GC.Spread.Sheets.NameBox.INameBoxOptions} * @property {boolean} [enableAddCustomName] Indicates whether enable add custom name when input a name which is not existed to the selector. * @property {boolean} [enableNavigateToRange] Indicates whether enable navigate to the named range or drawing item when input its name or click on custom list item. * @property {boolean} [showCustomNameList] Indicates whether show the custom name list dropdown indicator. * @property {number} [dropDownMaxHeight] Indicates the drop down list element max height. * @example * ```javascript * var spread = new GC.Spread.Sheets.Workbook(document.getElementById("ss")); * var div = document.createElement('div'); * div.id = 'nameBox'; * div.style.width = '300px'; * div.style.height = '50px'; * document.getElementById('panel').appendChild(div); * * var nameBox = new GC.Spread.Sheets.NameBox.NameBox(document.getElementById('nameBox'), spread); * nameBox.options.enableAddCustomName = false; // cannot add custom name with inputting in name box input box now. * nameBox.options.enableNavigateToRange = false; // cannot swap the selected range to the value of the name box input box now. * nameBox.options.showCustomNameList = false; // cannot open the custom name list by down arrow button right side and the button will be hidden now. * nameBox.options.dropDownMaxHeight = 100; // the custom name list host DOM element height will no larger than 100px now. * * ``` */ options: GC.Spread.Sheets.NameBox.INameBoxOptions; /** * Dispose the NameBox and unbind all events. * @example * ```javascript * var spread = new GC.Spread.Sheets.Workbook(document.getElementById("ss")); * var nameBox = new GC.Spread.Sheets.NameBox.NameBox(document.getElementById('nameBox'), spread); * // do something * nameBox.dispose(); * ``` */ dispose(): void; /** * get the NameBox host element. * @example * ```javascript * var spread = new GC.Spread.Sheets.Workbook(document.getElementById("ss")); * var nameBox = new GC.Spread.Sheets.NameBox.NameBox(document.getElementById('nameBox'), spread); * var host = nameBox.getHost(); * ``` */ getHost(): HTMLElement; /** * refresh the NameBox and sync the name box value to the work sheet selection. * @example * ```javascript * var spread = new GC.Spread.Sheets.Workbook(document.getElementById("ss")); * var nameBox = new GC.Spread.Sheets.NameBox.NameBox(document.getElementById('nameBox'), spread); * var sheet = spread.getActiveSheet(); * sheet.setSelection(0, 0, 3, 3); * nameBox.refresh(); * ``` */ refresh(): void; } } module OutlineColumn{ export interface IOutlineColumnOptions{ /** * OutlineColumn index. */ columnIndex?: number; /** * Whether to display images. */ showImage?: boolean; /** * The images by level (url or base64Image). */ images?: string[]; /** * Whether to display the check box. */ showCheckBox?: boolean; /** * Whether to display the indicator. */ showIndicator?: boolean; /** * The expand indicator (url or base64Image). */ expandIndicator?: string; /** * The collapse indicator (url or base64Image). */ collapseIndicator?: string; /** * When the current row level is greater than maxLevel, the IncreaseCellIndent action does not take effect. */ maxLevel?: number; } export class OutlineColumn{ /** * Represents an indented column. * @class * @param {GC.Spread.Sheets.Worksheet} sheet The outlineColumn's WorkSheet. */ constructor(sheet: GC.Spread.Sheets.Worksheet); /** * Gets the check status of the row or all rows. * @param {number} [row] The index of the row. * @returns {boolean|boolean[]} If row is undefined, returns all row's check status; otherwise, returns the check status of the row. * @example * ```javascript * spread.suspendPaint(); * activeSheet.setValue(0, 0, "Name", GC.Spread.Sheets.SheetArea.colHeader); * activeSheet.setValue(0, 1, "Chapter", GC.Spread.Sheets.SheetArea.colHeader); * activeSheet.setValue(0, 2, "Page", GC.Spread.Sheets.SheetArea.colHeader); * activeSheet.setColumnWidth(0, 200); * activeSheet.setRowCount(13); * var commands = [ * {name: 'Preface', chapter: '1', page: 1, indent: 0}, * {name: 'Java SE5 and SE6', chapter: '1.1', page: 2, indent: 1}, * {name: 'Java SE6', chapter: '1.1.1', page: 2, indent: 2}, * {name: 'The 4th edition', chapter: '1.2', page: 2, indent: 1}, * {name: 'Changes', chapter: '1.2.1', page: 3, indent: 2}, * {name: 'Note on the cover design', chapter: '1.3', page: 4, indent: 1}, * {name: 'Acknowledgements', chapter: '1.4', page: 4, indent: 1}, * {name: 'Introduction', chapter: '2', page: 9, indent: 0}, * {name: 'Prerequisites', chapter: '2.1', page: 9, indent: 1}, * {name: 'Learning Java', chapter: '2.2', page: 10, indent: 1}, * {name: 'Goals', chapter: '2.3', page: 10, indent: 1}, * {name: 'Teaching from this book', chapter: '2.4', page: 11, indent: 1}, * {name: 'JDK HTML documentation', chapter: '2.5', page: 11, indent: 1}, * ]; * for (var r = 0; r < commands.length; r++) { * activeSheet.setValue(r, 0, commands[r]['name']); * activeSheet.setValue(r, 1, commands[r]['chapter']); * activeSheet.setValue(r, 2, commands[r]['page']); * activeSheet.getRange(r, 0, 1, 1).textIndent(commands[r].indent); * } * activeSheet.outlineColumn.options({ * columnIndex: 0, * showImage: true, * showCheckBox: true, * images: ['star2.png', 'box4.png', 'rating4.png'], * maxLevel: 2 * }); * activeSheet.showRowOutline(true); * spread.invalidateLayout(); * spread.resumePaint(); * * console.log(activeSheet.outlineColumn.getCheckStatus(1)); // false * activeSheet.outlineColumn.setCheckStatus(1, true); * console.log(activeSheet.outlineColumn.getCheckStatus(1)); // true * console.log(activeSheet.outlineColumn.getCheckStatus(2)); // true -> sub node of row 1 * console.log(activeSheet.outlineColumn.getCheckStatus()); // [false, true, true, false, false, false, false, false, false, false, false, false, false] * ``` */ getCheckStatus(row?: number): any; /** * Gets the collapsed setting of the row or all rows. * @param {number} [row] The index of the collapsed row. * @returns {boolean|boolean[]} If row is undefined, returns all row's collapsed status; otherwise, returns the collapsed setting of the row. * @example * ```javascript * spread.suspendPaint(); * activeSheet.setValue(0, 0, "Name", GC.Spread.Sheets.SheetArea.colHeader); * activeSheet.setValue(0, 1, "Chapter", GC.Spread.Sheets.SheetArea.colHeader); * activeSheet.setValue(0, 2, "Page", GC.Spread.Sheets.SheetArea.colHeader); * activeSheet.setColumnWidth(0, 200); * activeSheet.setRowCount(13); * var commands = [ * {name: 'Preface', chapter: '1', page: 1, indent: 0}, * {name: 'Java SE5 and SE6', chapter: '1.1', page: 2, indent: 1}, * {name: 'Java SE6', chapter: '1.1.1', page: 2, indent: 2}, * {name: 'The 4th edition', chapter: '1.2', page: 2, indent: 1}, * {name: 'Changes', chapter: '1.2.1', page: 3, indent: 2}, * {name: 'Note on the cover design', chapter: '1.3', page: 4, indent: 1}, * {name: 'Acknowledgements', chapter: '1.4', page: 4, indent: 1}, * {name: 'Introduction', chapter: '2', page: 9, indent: 0}, * {name: 'Prerequisites', chapter: '2.1', page: 9, indent: 1}, * {name: 'Learning Java', chapter: '2.2', page: 10, indent: 1}, * {name: 'Goals', chapter: '2.3', page: 10, indent: 1}, * {name: 'Teaching from this book', chapter: '2.4', page: 11, indent: 1}, * {name: 'JDK HTML documentation', chapter: '2.5', page: 11, indent: 1}, * ]; * for (var r = 0; r < commands.length; r++) { * activeSheet.setValue(r, 0, commands[r]['name']); * activeSheet.setValue(r, 1, commands[r]['chapter']); * activeSheet.setValue(r, 2, commands[r]['page']); * activeSheet.getRange(r, 0, 1, 1).textIndent(commands[r].indent); * } * activeSheet.outlineColumn.options({ * columnIndex: 0, * showImage: true, * showCheckBox: true, * images: ['star2.png', 'box4.png', 'rating4.png'], * maxLevel: 2 * }); * activeSheet.showRowOutline(true); * spread.invalidateLayout(); * spread.resumePaint(); * * console.log(activeSheet.outlineColumn.getCollapsed(1)); // false * activeSheet.outlineColumn.setCollapsed(1, true); * console.log(activeSheet.outlineColumn.getCollapsed(1)); // true * console.log(activeSheet.outlineColumn.getCollapsed(2)); // false -> sub node of row 1 * console.log(activeSheet.outlineColumn.getCollapsed()); // [false, true, false, false, false, false, false, false, false, false, false, false, false] * ``` */ getCollapsed(row?: number): any; /** * Gets or sets the outlineColumn options. * @param {GC.Spread.Sheets.OutlineColumn.IOutlineColumnOptions} outlineColumnOptions The outlineColumn options. * @returns {GC.Spread.Sheets.OutlineColumn.IOutlineColumnOptions | GC.Spread.Sheets.OutlineColumn.OutlineColumn} outlineColumnOptions|outlineColumn * If no outlineColumnOptions item is set, returns outlineColumnOptions; otherwise, returns the outlineColumn instance. * @example * ```javascript * var rowCount = 38; * var colCount = 10; * activeSheet.setColumnCount(colCount); * activeSheet.setRowCount(rowCount); * activeSheet.setColumnWidth(0, 310); * activeSheet.setColumnWidth(1, 150); * activeSheet.setColumnWidth(2, 150); * activeSheet.frozenColumnCount(1); * activeSheet.setValue(0, 0, "Name", GC.Spread.Sheets.SheetArea.colHeader); * activeSheet.setValue(0, 1, "Chapter", GC.Spread.Sheets.SheetArea.colHeader); * activeSheet.setValue(0, 2, "Page", GC.Spread.Sheets.SheetArea.colHeader); * var commands = [ * {name: 'Preface', chapter: '1', page: 1, indent: 0}, * {name: 'Java SE5 and SE6', chapter: '1.1', page: 2, indent: 1}, * {name: 'Java SE6', chapter: '1.1.1', page: 2, indent: 2}, * {name: 'The 4th edition', chapter: '1.2', page: 2, indent: 1}, * {name: 'Changes', chapter: '1.2.1', page: 3, indent: 2}, * {name: 'Note on the cover design', chapter: '1.3', page: 4, indent: 1}, * {name: 'Acknowledgements', chapter: '1.4', page: 4, indent: 1}, * {name: 'Introduction', chapter: '2', page: 9, indent: 0}, * {name: 'Prerequisites', chapter: '2.1', page: 9, indent: 1}, * {name: 'Learning Java', chapter: '2.2', page: 10, indent: 1}, * {name: 'Goals', chapter: '2.3', page: 10, indent: 1}, * {name: 'Teaching from this book', chapter: '2.4', page: 11, indent: 1}, * {name: 'JDK HTML documentation', chapter: '2.5', page: 11, indent: 1}, * {name: 'Exercises', chapter: '2.6', page: 12, indent: 1}, * {name: 'Foundations for Java', chapter: '2.7', page: 12, indent: 1}, * {name: 'Source code', chapter: '2.8', page: 12, indent: 1}, * {name: 'Coding standards', chapter: '2.8.1', page: 14, indent: 2}, * {name: 'Errors', chapter: '2.9', page: 14, indent: 1}, * {name: 'Introduction to Objects', chapter: '3', page: 15, indent: 0}, * {name: 'The progress of abstraction', chapter: '3.1', page: 15, indent: 1}, * {name: 'An object has an interface', chapter: '3.2', page: 17, indent: 1}, * {name: 'An object provides services', chapter: '3.3', page: 18, indent: 1}, * {name: 'The hidden implementation', chapter: '3.4', page: 19, indent: 1}, * {name: 'Reusing the implementation', chapter: '3.5', page: 20, indent: 1}, * {name: 'Inheritance', chapter: '3.6', page: 21, indent: 1}, * {name: 'Is-a vs. is-like-a relationships', chapter: '3.6.1', page: 24, indent: 2}, * {name: 'Interchangeable objects with polymorphism', chapter: '3.7', page: 25, indent: 1}, * {name: 'The singly rooted hierarchy', chapter: '3.8', page: 28, indent: 1}, * {name: 'Containers', chapter: '3.9', page: 28, indent: 1}, * {name: 'Parameterized types (Generics)', chapter: '3.10', page: 29, indent: 1}, * {name: 'Object creation & lifetime', chapter: '3.11', page: 30, indent: 1}, * {name: 'Exception handling: dealing with errors', chapter: '3.12', page: 31, indent: 1}, * {name: 'Concurrent programming', chapter: '3.13', page: 32, indent: 1}, * {name: 'Java and the Internet', chapter: '3.14', page: 33, indent: 1}, * {name: 'What is the Web?', chapter: '3.14.1', page: 33, indent: 2}, * {name: 'Client-side programming', chapter: '3.14.2', page: 34, indent: 2}, * {name: 'Server-side programming', chapter: '3.14.3', page: 38, indent: 2}, * {name: 'Summary', chapter: '3.15', page: 38, indent: 1}, * ]; * for (var r = 0; r < commands.length; r++) { * activeSheet.setValue(r, 0, commands[r]['name']); * activeSheet.setValue(r, 1, commands[r]['chapter']); * activeSheet.setValue(r, 2, commands[r]['page']); * activeSheet.getRange(r, 0, 1, 1).textIndent(commands[r].indent); * } * activeSheet.outlineColumn.options({ * columnIndex: 0, * showImage: true, * showCheckBox: true, * images: ['star2.png', 'box4.png', 'rating4.png'], * maxLevel: 2 * }); * activeSheet.showRowOutline(true); * spread.invalidateLayout(); * spread.repaint(); * ``` */ options(outlineColumnOptions?: GC.Spread.Sheets.OutlineColumn.IOutlineColumnOptions): any; /** * Refreshes the indented column. */ refresh(): void; /** * Sets the check status of the row. * @param {number} row The index of the row. * @param {boolean} checkStatus The check status of the row. * @example * ```javascript * spread.suspendPaint(); * activeSheet.setValue(0, 0, "Name", GC.Spread.Sheets.SheetArea.colHeader); * activeSheet.setValue(0, 1, "Chapter", GC.Spread.Sheets.SheetArea.colHeader); * activeSheet.setValue(0, 2, "Page", GC.Spread.Sheets.SheetArea.colHeader); * activeSheet.setColumnWidth(0, 200); * activeSheet.setRowCount(13); * var commands = [ * {name: 'Preface', chapter: '1', page: 1, indent: 0}, * {name: 'Java SE5 and SE6', chapter: '1.1', page: 2, indent: 1}, * {name: 'Java SE6', chapter: '1.1.1', page: 2, indent: 2}, * {name: 'The 4th edition', chapter: '1.2', page: 2, indent: 1}, * {name: 'Changes', chapter: '1.2.1', page: 3, indent: 2}, * {name: 'Note on the cover design', chapter: '1.3', page: 4, indent: 1}, * {name: 'Acknowledgements', chapter: '1.4', page: 4, indent: 1}, * {name: 'Introduction', chapter: '2', page: 9, indent: 0}, * {name: 'Prerequisites', chapter: '2.1', page: 9, indent: 1}, * {name: 'Learning Java', chapter: '2.2', page: 10, indent: 1}, * {name: 'Goals', chapter: '2.3', page: 10, indent: 1}, * {name: 'Teaching from this book', chapter: '2.4', page: 11, indent: 1}, * {name: 'JDK HTML documentation', chapter: '2.5', page: 11, indent: 1}, * ]; * for (var r = 0; r < commands.length; r++) { * activeSheet.setValue(r, 0, commands[r]['name']); * activeSheet.setValue(r, 1, commands[r]['chapter']); * activeSheet.setValue(r, 2, commands[r]['page']); * activeSheet.getRange(r, 0, 1, 1).textIndent(commands[r].indent); * } * activeSheet.outlineColumn.options({ * columnIndex: 0, * showImage: true, * showCheckBox: true, * images: ['star2.png', 'box4.png', 'rating4.png'], * maxLevel: 2 * }); * activeSheet.showRowOutline(true); * spread.invalidateLayout(); * spread.resumePaint(); * * console.log(activeSheet.outlineColumn.getCheckStatus(1)); // false * activeSheet.outlineColumn.setCheckStatus(1, true); * console.log(activeSheet.outlineColumn.getCheckStatus(1)); // true * console.log(activeSheet.outlineColumn.getCheckStatus(2)); // true -> sub node of row 1 * ``` */ setCheckStatus(row: number, checkStatus: boolean): void; /** * Sets whether the row is collapsed. * @param {number} row The index of the row. * @param {boolean} collapsed The collapsed setting for the row. * @example * ```javascript * spread.suspendPaint(); * activeSheet.setValue(0, 0, "Name", GC.Spread.Sheets.SheetArea.colHeader); * activeSheet.setValue(0, 1, "Chapter", GC.Spread.Sheets.SheetArea.colHeader); * activeSheet.setValue(0, 2, "Page", GC.Spread.Sheets.SheetArea.colHeader); * activeSheet.setColumnWidth(0, 200); * activeSheet.setRowCount(13); * var commands = [ * {name: 'Preface', chapter: '1', page: 1, indent: 0}, * {name: 'Java SE5 and SE6', chapter: '1.1', page: 2, indent: 1}, * {name: 'Java SE6', chapter: '1.1.1', page: 2, indent: 2}, * {name: 'The 4th edition', chapter: '1.2', page: 2, indent: 1}, * {name: 'Changes', chapter: '1.2.1', page: 3, indent: 2}, * {name: 'Note on the cover design', chapter: '1.3', page: 4, indent: 1}, * {name: 'Acknowledgements', chapter: '1.4', page: 4, indent: 1}, * {name: 'Introduction', chapter: '2', page: 9, indent: 0}, * {name: 'Prerequisites', chapter: '2.1', page: 9, indent: 1}, * {name: 'Learning Java', chapter: '2.2', page: 10, indent: 1}, * {name: 'Goals', chapter: '2.3', page: 10, indent: 1}, * {name: 'Teaching from this book', chapter: '2.4', page: 11, indent: 1}, * {name: 'JDK HTML documentation', chapter: '2.5', page: 11, indent: 1}, * ]; * for (var r = 0; r < commands.length; r++) { * activeSheet.setValue(r, 0, commands[r]['name']); * activeSheet.setValue(r, 1, commands[r]['chapter']); * activeSheet.setValue(r, 2, commands[r]['page']); * activeSheet.getRange(r, 0, 1, 1).textIndent(commands[r].indent); * } * activeSheet.outlineColumn.options({ * columnIndex: 0, * showImage: true, * showCheckBox: true, * images: ['star2.png', 'box4.png', 'rating4.png'], * maxLevel: 2 * }); * activeSheet.showRowOutline(true); * spread.invalidateLayout(); * spread.resumePaint(); * * console.log(activeSheet.outlineColumn.getCollapsed(1)); // false * activeSheet.outlineColumn.setCollapsed(1, true); * console.log(activeSheet.outlineColumn.getCollapsed(1)); // true * console.log(activeSheet.outlineColumn.getCollapsed(2)); // false -> sub node of row 1 * ``` */ setCollapsed(row: number, collapsed: boolean): void; } } module Outlines{ /** * Specifies the status of an outline (range group) summary row or column position. * @enum {number} * @example * ```javascript * sheet.suspendPaint(); * sheet.rowOutlines.group(3,2); * sheet.columnOutlines.group(4,1); * sheet.rowOutlines.direction(GC.Spread.Sheets.Outlines.OutlineDirection.backward); * sheet.columnOutlines.direction(GC.Spread.Sheets.Outlines.OutlineDirection.forward); * sheet.resumePaint(); * ``` */ export enum OutlineDirection{ /** The summary row is above or to the left of the group detail. * @type {number} */ backward= 0, /** The summary row is below or to the right of the group detail. * @type {number} */ forward= 1 } /** * Specifies the status of an outline (range group). * @enum {number} * @example * ```javascript * //The following example specifies to display a range group as collapsed. * sheet.rowOutlines.group(0,5); * var rgi = sheet.rowOutlines.find(1, 0); * rgi.state(GC.Spread.Sheets.Outlines.OutlineState.collapsed); * spread.invalidateLayout(); * spread.repaint(); * ``` */ export enum OutlineState{ /** Indicates expanded status with the minus sign. * @type {number} */ expanded= 0, /** Indicates collapsed status with the plus sign. * @type {number} */ collapsed= 1 } export class Outline{ /** * Represents an outline (range group) for the worksheet. * @param {number} count The number of rows or columns. * @class */ constructor(count: number); /** * Gets or sets the outline's (range group) direction. * @param {GC.Spread.Sheets.Outlines.OutlineDirection} [direction] The outline's (range group) direction. * @returns {GC.Spread.Sheets.Outlines.OutlineDirection | GC.Spread.Sheets.Outlines.Outline} If no value is set, returns the outline's (range group) direction; otherwise, returns the outline. * @example * ```javascript * activeSheet.suspendPaint(); * activeSheet.rowOutlines.group(3,2); * activeSheet.columnOutlines.group(4,1); * activeSheet.rowOutlines.direction(GC.Spread.Sheets.Outlines.OutlineDirection.forward); * activeSheet.resumePaint(); * ``` */ direction(direction?: GC.Spread.Sheets.Outlines.OutlineDirection): any; /** * Expands all outlines (range groups), using the specified level. * @param {number} level The level of the outline to expand or collapse. * @param {boolean} expand Whether to expand the groups. * @example * ```javascript * //This example uses the expand method. * activeSheet.suspendPaint(); * activeSheet.rowOutlines.group(0,5); * activeSheet.rowOutlines.expand(0,false); * activeSheet.resumePaint(); * ``` */ expand(level: number, expand: boolean): void; /** * Expands or collapses the specified outline (range group) of rows or columns. * @param {GC.Spread.Sheets.Outlines.OutlineInfo} groupInfo The group information of the range group. * @param {boolean} expand Whether to expand the groups. * @example * ```javascript * activeSheet.suspendPaint(); * activeSheet.rowOutlines.group(2, 5); * var groupInfo = activeSheet.rowOutlines.find(2, 0); * activeSheet.rowOutlines.expandGroup(groupInfo, false); * activeSheet.resumePaint(); // the group is created and collapsed now. * activeSheet.rowOutlines.expandGroup(groupInfo, true); // the group and expand now. * ``` */ expandGroup(groupInfo: GC.Spread.Sheets.Outlines.OutlineInfo, expand: boolean): void; /** * Gets the outline (range group) with the specified group level and row or column index. * @param {number} index The index of the row or column. * @param {number} level The level of the outline (range group). * @returns {GC.Spread.Sheets.Outlines.OutlineInfo} The specified range group. * @example * ```javascript * //This example uses the find method. * activeSheet.rowOutlines.group(0,5); * var rgi = activeSheet.rowOutlines.find(1, 0); * rgi.state(GC.Spread.Sheets.Outlines.OutlineState.collapsed); * spread.invalidateLayout(); * spread.repaint(); * ``` */ find(index: number, level: number): GC.Spread.Sheets.Outlines.OutlineInfo; /** * Gets the collapsed internal. * @param {number} index The index. * @returns {boolean} `true` if collapsed; otherwise, `false`. * @example * ```javascript * //This example uses the getCollapsed method. * activeSheet.suspendPaint(); * activeSheet.rowOutlines.group(0,5); * activeSheet.rowOutlines.expand(0,true); * activeSheet.resumePaint(); * alert(activeSheet.rowOutlines.isCollapsed(0)); * ``` */ getCollapsed(index: number): boolean; /** * Gets the level of a specified row or column. * The level's index is zero-based. * @param {number} index The index of the row or column. * @returns {number} The level for the row or column. * @example * ```javascript * //This example uses the getLevel method. * activeSheet.suspendPaint(); * activeSheet.rowOutlines.group(0,5); * activeSheet.rowOutlines.expand(0,true); * activeSheet.resumePaint(); * alert(activeSheet.rowOutlines.getLevel(0)); * ``` */ getLevel(index: number): number; /** * Gets the number of the deepest level. * @remarks The level index is zero-based. * @returns {number} The number of the deepest level. * @example * ```javascript * //This example uses the getMaxLevel method. * activeSheet.suspendPaint(); * activeSheet.rowOutlines.group(0,5); * activeSheet.rowOutlines.group(1,4); * activeSheet.rowOutlines.expand(0,true); * activeSheet.columnOutlines.group(0,1); * activeSheet.resumePaint(); * alert(activeSheet.rowOutlines.getMaxLevel()); * ``` */ getMaxLevel(): number; /** * Gets the state for the specified group. * @param {GC.Spread.Sheets.Outlines.OutlineInfo} groupInfo The group information. * @returns {GC.Spread.Sheets.Outlines.OutlineState} The group state. * @example * ```javascript * //This example uses the getState method. * activeSheet.suspendPaint(); * activeSheet.rowOutlines.group(0,5); * var rgi = activeSheet.rowOutlines.find(1, 0); * rgi.state(GC.Spread.Sheets.Outlines.OutlineState.collapsed); * alert(activeSheet.rowOutlines.getState(rgi)); * activeSheet.resumePaint(); * ``` */ getState(groupInfo: GC.Spread.Sheets.Outlines.OutlineInfo): GC.Spread.Sheets.Outlines.OutlineState; /** * Groups a range of rows or columns into an outline (range group) from a specified start index. * @param {number} index The group starting index. * @param {number} count The number of rows or columns to group. * @example * ```javascript * //This example uses the group method. * activeSheet.suspendPaint(); * activeSheet.rowOutlines.group(0,5); * activeSheet.rowOutlines.expand(0,false); * activeSheet.resumePaint(); * ``` */ group(index: number, count: number): void; /** * Determines whether the range group at the specified index is collapsed. * @param {number} index The index of the row or column in the range group. * @returns {boolean} `true` if the specified row or column is collapsed; otherwise, `false`. * @example * ```javascript * //This example uses the isCollapsed method. * activeSheet.suspendPaint(); * activeSheet.rowOutlines.group(0,5); * activeSheet.rowOutlines.expand(0,true); * activeSheet.resumePaint(); * alert(activeSheet.rowOutlines.isCollapsed(0)); * ``` */ isCollapsed(index: number): boolean; /** * Determines whether the specified index is the end of the group. * @param {number} index The index. * @param {number} processLevel The process level. * @returns {boolean} `true` if the specified index is the end of the group; otherwise, `false`. * @example * ```javascript * activeSheet.suspendPaint(); * activeSheet.rowOutlines.group(2, 5); * activeSheet.rowOutlines.group(3, 2); * activeSheet.resumePaint(); * * console.log(activeSheet.rowOutlines.isGroupEnd(2, 0)); // false * console.log(activeSheet.rowOutlines.isGroupEnd(4, 0)); // false * console.log(activeSheet.rowOutlines.isGroupEnd(4, 1)); // true * console.log(activeSheet.rowOutlines.isGroupEnd(6, 0)); // true * ``` */ isGroupEnd(index: number, processLevel: number): boolean; /** * Refreshes this range group. */ refresh(): void; /** * Resumes the adding group when the row/column is inserting the group range. * @example * ```javascript * activeSheet.suspendPaint(); * activeSheet.rowOutlines.group(2, 5); * activeSheet.resumePaint(); * * console.log(activeSheet.rowOutlines.find(3, 0).end); // 6 * console.log(activeSheet.rowOutlines.find(5, 0).end); // 6 * activeSheet.addRows(4, 1); * console.log(activeSheet.rowOutlines.find(3, 0).end); // 7 * console.log(activeSheet.rowOutlines.find(5, 0).end); // 7 * * activeSheet.rowOutlines.suspendAdding(); * activeSheet.addRows(4, 1); * console.log(activeSheet.rowOutlines.find(3, 0).end); // 3 // cause adding suspended, the group spilt into two parts. * console.log(activeSheet.rowOutlines.find(5, 0).end); // 8 * activeSheet.rowOutlines.resumeAdding(); * ``` */ resumeAdding(): void; /** * Sets the collapsed level. * @param {number} index The index. * @param {boolean} collapsed Set to `true` to collapse the level. * @example * ```javascript * //This example uses the setCollapsed method. * activeSheet.suspendPaint(); * activeSheet.rowOutlines.group(0,5); * activeSheet.rowOutlines.setCollapsed(0,false); * activeSheet.resumePaint(); * ``` */ setCollapsed(index: number, collapsed: boolean): void; /** * Suspends the adding group when the row/column is inserting the group range. * @example * ```javascript * activeSheet.suspendPaint(); * activeSheet.rowOutlines.group(2, 5); * activeSheet.resumePaint(); * * console.log(activeSheet.rowOutlines.find(3, 0).end); // 6 * console.log(activeSheet.rowOutlines.find(5, 0).end); // 6 * activeSheet.addRows(4, 1); * console.log(activeSheet.rowOutlines.find(3, 0).end); // 7 * console.log(activeSheet.rowOutlines.find(5, 0).end); // 7 * * activeSheet.rowOutlines.suspendAdding(); * activeSheet.addRows(4, 1); * console.log(activeSheet.rowOutlines.find(3, 0).end); // 3 // cause adding suspended, the group spilt into two parts. * console.log(activeSheet.rowOutlines.find(5, 0).end); // 8 * activeSheet.rowOutlines.resumeAdding(); * ``` */ suspendAdding(): void; /** * Removes all outlines (range groups). * @example * ```javascript * //This example uses the ungroup method. * activeSheet.suspendPaint(); * activeSheet.rowOutlines.group(0,5); * activeSheet.rowOutlines.ungroup(); * activeSheet.resumePaint(); * ``` */ ungroup(): void; /** * Removes a range of rows or columns from the outline (range group) at the specified start index. * @param {number} index The group starting index. * @param {number} count The number of rows or columns to remove. * @example * ```javascript * //This example uses the ungroupRange method. * activeSheet.suspendPaint(); * activeSheet.rowOutlines.group(0,5); * activeSheet.rowOutlines.ungroupRange(0,1); * activeSheet.resumePaint(); * ``` */ ungroupRange(index: number, count: number): void; } export class OutlineInfo{ /** * Represents the outline (range group) information. * @param {GC.Spread.Sheets.Outlines.Outline} model The owner of the outline. * @param {number} start The start index of the outline. * @param {number} end The end index of the outline. * @param {number} level The level of the outline. * @class */ constructor(model: GC.Spread.Sheets.Outlines.Outline, start: number, end: number, level: number); /** The children of the group. * @type {Array} * @example * ```javascript * activeSheet.rowOutlines.group(2, 10); * activeSheet.rowOutlines.group(4, 2); * var outlineInfo = activeSheet.rowOutlines.find(2, 0); * console.log(outlineInfo.children[0] === activeSheet.rowOutlines.find(4, 1)); // true * ``` */ children: any[]; /** The end index of the group. * @type {number} * @example * ```javascript * activeSheet.rowOutlines.group(2, 10); * var outlineInfo = activeSheet.rowOutlines.find(2, 0); * console.log(outlineInfo.end); // 11 * ``` */ end: number; /** The level of the group. * @type {number} * @example * ```javascript * activeSheet.rowOutlines.group(2, 10); * var outlineInfo = activeSheet.rowOutlines.find(2, 0); * console.log(outlineInfo.level); // 0 * ``` */ level: number; /** The owner of the group. * @type {GC.Spread.Sheets.Outlines.Outline} * @example * ```javascript * activeSheet.rowOutlines.group(2, 10); * var outlineInfo = activeSheet.rowOutlines.find(2, 0); * console.log(outlineInfo.model === activeSheet.rowOutlines); // true * ``` */ model: GC.Spread.Sheets.Outlines.Outline; /** The parent of the group. * @type {GC.Spread.Sheets.Outlines.OutlineInfo} * @example * ```javascript * activeSheet.rowOutlines.group(2, 10); * activeSheet.rowOutlines.group(4, 2); * var outlineInfo = activeSheet.rowOutlines.find(4, 1); * console.log(outlineInfo.parent === activeSheet.rowOutlines.find(2, 0)); // true * ``` */ parent: GC.Spread.Sheets.Outlines.OutlineInfo; /** The start index of the group. * @type {number} * @example * ```javascript * activeSheet.rowOutlines.group(2, 10); * var outlineInfo = activeSheet.rowOutlines.find(2, 0); * console.log(outlineInfo.start); // 2 * ``` */ start: number; /** * Adds the child. * @param {Object} child The child. */ addChild(child: Object): void; /** * Compares this instance to a specified OutlineInfo object and returns an indication of their relative values. * @param {number} index The index of the group item. * @returns {boolean} `true` if the range group contains the specified index; otherwise, `false`. * @example * ```javascript * activeSheet.rowOutlines.group(2, 10); * activeSheet.rowOutlines.group(4, 2); * var outlineInfo1 = activeSheet.rowOutlines.find(2, 0); * var outlineInfo2 = activeSheet.rowOutlines.find(4, 1); * console.log(outlineInfo1.contains(5)); // true; * console.log(outlineInfo2.contains(5)); // true; * console.log(outlineInfo1.contains(6)); // true; * console.log(outlineInfo2.contains(6)); // false; * ``` */ contains(index: number): boolean; /** * Gets or sets the state of this outline (range group). * @param {GC.Spread.Sheets.Outlines.OutlineState} [value] The state of this outline (range group). * @returns {GC.Spread.Sheets.Outlines.OutlineState} The state of this outline (range group). * @example * ```javascript * activeSheet.rowOutlines.group(2, 10); * activeSheet.rowOutlines.group(4, 2); * var outlineInfo = activeSheet.rowOutlines.find(4, 1); * console.log(outlineInfo.state()); // equals to GC.Spread.Sheets.Outlines.OutlineState.expanded * outlineInfo.state(GC.Spread.Sheets.Outlines.OutlineState.collapsed); * console.log(outlineInfo.state()); // equals to GC.Spread.Sheets.Outlines.OutlineState.collapsed * activeSheet.repaint(); // the outline is collapsed * ``` */ state(value?: GC.Spread.Sheets.Outlines.OutlineState): GC.Spread.Sheets.Outlines.OutlineState; } } module PDF{ export class PDFFontsManager{ /** * Represent a pdf fonts manager. * @constructor */ constructor(); /** *Provide a fallback font for the specific font. * @static * @param {string} font the css font string. * @return {string | ArrayBuffer} The font file in base64 string or ArrayBuffer. */ static fallbackFont(font: string): any; /** * Register a Font for export PDF. * @static * @param {string} name The font name. * @param {Object} [font] The font object. * @param {string | ArrayBuffer} [font.normal] The normal font file in base64 string or ArrayBuffer. * @param {string | ArrayBuffer} [font.bold] The bold font file in base64 string or ArrayBuffer. * @param {string | ArrayBuffer} [font.italic] The italic font file in base64 string or ArrayBuffer. * @param {string | ArrayBuffer} [font.boldItalic] The boldItalic font file in base64 string or ArrayBuffer. */ static registerFont(name: string, font: Object): void; } } module Print{ export interface IPageCustomHeaderFooterOptions{ normal?: GC.Spread.Sheets.Print.IPageHeaderFooterOptions; first?: GC.Spread.Sheets.Print.IPageHeaderFooterOptions; odd?: GC.Spread.Sheets.Print.IPageHeaderFooterOptions; even?: GC.Spread.Sheets.Print.IPageHeaderFooterOptions; } export interface IPageHeaderFooterOptions{ header?: GC.Spread.Sheets.Print.IPageSectionOptions; footer?: GC.Spread.Sheets.Print.IPageSectionOptions; } export interface IPageInfo{ pages: IPageInfoItem[]; } export interface IPageInfoItem{ row: number; column: number; rowCount: number; columnCount: number; } export interface IPageSectionOptions{ left?: string; center?: string; right?: string; leftImage?: string; centerImage?: string; rightImage?: string; } export interface IWatermarkItem{ /** * The watermark begin x position. */ x: number; /** * The watermark begin y position. */ y: number; /** * The watermark width. */ width: number; /** * The watermark height. */ height: number; /** * The watermark image src. */ imageSrc: string; /** * The watermark page, support "all", "odd", \u201ceven\u201d, "1,3,4,7,8,9,". */ page: string; } export interface PrintMargins{ /** * The top margin, in hundredths of an inch. */ top: number; /** * The bottom margin, in hundredths of an inch. */ bottom: number; /** * The left margin, in hundredths of an inch. */ left: number; /** * The right margin, in hundredths of an inch. */ right: number; /** * The header offset, in hundredths of an inch. */ header: number; /** * The footer offset, in hundredths of an inch. */ footer: number; } export interface PrintSize{ /** * The width of the size, in hundredths of an inch. */ height: number; /** * The height of the size, in hundredths of an inch. */ width: number; } /** * Specifies the paper kind for the printed page. * @enum {number} * @example * ```javascript * activeSheet.setArray(0, 0, new Array(60).fill(["sample text"])); * var printInfo = new GC.Spread.Sheets.Print.PrintInfo(); * printInfo.paperSize(new GC.Spread.Sheets.Print.PaperSize(GC.Spread.Sheets.Print.PaperKind.a4)); * activeSheet.printInfo(printInfo); * spread.print(0); * ``` */ export enum PaperKind{ /** * Specifies the paper size is 420 mm * 594 mm. */ a2= 66, /** * Specifies the paper size is 297 mm * 420 mm. */ a3= 8, /** * Specifies the paper size is 322 mm * 445 mm. */ a3Extra= 63, /** * Specifies the paper size is 322 mm * 445 mm. */ a3ExtraTransverse= 68, /** * Specifies the paper size is 420 mm * 297 mm. */ a3Rotated= 76, /** * Specifies the paper size is 297 mm * 420 mm. */ a3Transverse= 67, /** * Specifies the paper size is 210 mm * 297 mm. */ a4= 9, /** * Specifies the paper size is 236 mm * 322 mm. */ a4Extra= 53, /** * Specifies the paper size is 210 mm * 330 mm. */ a4Plus= 60, /** * Specifies the paper size is 297 mm * 210 mm. */ a4Rotated= 77, /** * Specifies the paper size is 210 mm * 297 mm. */ a4Small= 10, /** * Specifies the paper size is 210 mm * 297 mm. */ a4Transverse= 55, /** * Specifies the paper size is 148 mm * 210 mm. */ a5= 11, /** * Specifies the paper size is 174 mm * 235 mm. */ a5Extra= 64, /** * Specifies the paper size is 210 mm * 148 mm. */ a5Rotated= 78, /** * Specifies the paper size is 148 mm * 210 mm. */ a5Transverse= 61, /** * Specifies the paper size is 105 mm * 148 mm. */ a6= 70, /** * Specifies the paper size is 148 mm * 105 mm. */ a6Rotated= 83, /** * Specifies the paper size is 227 mm * 356 mm. */ aPlus= 57, /** * Specifies the paper size is 250 mm * 353 mm. */ b4= 12, /** * Specifies the paper size is 250 mm * 353 mm. */ b4Envelope= 33, /** * Specifies the paper size is 364 mm * 257 mm. */ b4JisRotated= 79, /** * Specifies the paper size is 176 mm * 250 mm. */ b5= 13, /** * Specifies the paper size is 176 mm * 250 mm. */ b5Envelope= 34, /** * Specifies the paper size is 201 mm * 276 mm. */ b5Extra= 65, /** * Specifies the paper size is 257 mm * 182 mm. */ b5JisRotated= 80, /** * Specifies the paper size is 182 mm * 257 mm. */ b5Transverse= 62, /** * Specifies the paper size is 176 mm * 125 mm. */ b6Envelope= 35, /** * Specifies the paper size is 128 mm * 182 mm. */ b6Jis= 88, /** * Specifies the paper size is 182 mm * 128 mm. */ b6JisRotated= 89, /** * Specifies the paper size is 305 mm * 487 mm. */ bPlus= 58, /** * Specifies the paper size is 324 mm * 458 mm. */ c3Envelope= 29, /** * Specifies the paper size is 229 mm * 324 mm. */ c4Envelope= 30, /** * Specifies the paper size is 162 mm * 229 mm. */ c5Envelope= 28, /** * Specifies the paper size is 114 mm * 229 mm. */ c65Envelope= 32, /** * Specifies the paper size is 114 mm * 162 mm. */ c6Envelope= 31, /** * Specifies the paper size is 17 in. * 22 in. */ cSheet= 24, /** * Specifies the paper size is defined by the user. */ custom= 0, /** * Specifies the paper size is 110 mm * 220 mm. */ dlEnvelope= 27, /** * Specifies the paper size is 22 in. * 34 in. */ dSheet= 25, /** * Specifies the paper size is 34 in. * 44 in. */ eSheet= 26, /** * Specifies the paper size is 7.25 in. * 10.5 in. */ executive= 7, /** * Specifies the paper size is 8.5 in. * 13 in. */ folio= 14, /** * Specifies the paper size is 8.5 in. * 13 in. */ germanLegalFanfold= 41, /** * Specifies the paper size is 8.5 in. * 12 in. */ germanStandardFanfold= 40, /** * Specifies the paper size is 220 mm * 220 mm. */ inviteEnvelope= 47, /** * Specifies the paper size is 250 mm * 353 mm. */ isoB4= 42, /** * Specifies the paper size is 110 mm * 230 mm. */ italyEnvelope= 36, /** * Specifies the paper size is 200 mm * 148 mm. */ japaneseDoublePostcard= 69, /** * Specifies the paper size is 148 mm * 200 mm. */ japaneseDoublePostcardRotated= 82, /** * Specifies the paper size is Japanese Chou #3 envelope, 120 mm * 235 mm. */ japaneseEnvelopeChouNumber3= 73, /** * Specifies the paper size is Japanese rotated Chou #3 envelope, 235 mm * 120 mm. */ japaneseEnvelopeChouNumber3Rotated= 86, /** * Specifies the paper size is Japanese Chou #4 envelope, 90 mm * 205 mm. */ japaneseEnvelopeChouNumber4= 74, /** * Specifies the paper size is Japanese rotated Chou #4 envelope, 205 mm * 90 mm. */ japaneseEnvelopeChouNumber4Rotated= 87, /** * Specifies the paper size is Japanese Kaku #2 envelope, 240 mm * 332 mm. */ japaneseEnvelopeKakuNumber2= 71, /** * Specifies the paper size is Japanese rotated Kaku #2 envelope, 332 mm * 240 mm. */ japaneseEnvelopeKakuNumber2Rotated= 84, /** * Specifies the paper size is Japanese Kaku #3 envelope, 216 mm * 277 mm. */ japaneseEnvelopeKakuNumber3= 72, /** * Specifies the paper size is Japanese rotated Kaku #3 envelope, 277 mm * 216 mm. */ japaneseEnvelopeKakuNumber3Rotated= 85, /** * Specifies the paper size is Japanese You #4 envelope, 235 mm * 105 mm. */ japaneseEnvelopeYouNumber4= 91, /** * Specifies the paper size is Japanese You #4 rotated envelope, 105 mm * 235 mm. */ japaneseEnvelopeYouNumber4Rotated= 92, /** * Specifies the paper size is 100 mm * 148 mm. */ japanesePostcard= 43, /** * Specifies the paper size is 148 mm * 100 mm. */ japanesePostcardRotated= 81, /** * Specifies the paper size is 17 in. * 11 in. */ ledger= 4, /** * Specifies the paper size is 8.5 in. * 14 in. */ legal= 5, /** * Specifies the paper size is legal extra paper (9.275 in. * 15 in.). * This value is specific to the PostScript driver and is used only by Linotronic printers in order to conserve paper. */ legalExtra= 51, /** * Specifies the paper size is 8.5 in. * 11 in. */ letter= 1, /** * Specifies the paper size is letter extra paper (9.275 in. * 12 in.). * This value is specific to the PostScript driver and is used only by Linotronic printers in order to conserve paper. */ letterExtra= 50, /** * Specifies the paper size 9.275 in. * 12 in. */ letterExtraTransverse= 56, /** * Specifies the paper size is 8.5 in. * 12.69 in. */ letterPlus= 59, /** * Specifies the paper size is 11 in. * 8.5 in. */ letterRotated= 75, /** * Specifies the paper size is 8.5 in. * 11 in. */ letterSmall= 2, /** * Specifies the paper size is 8.275 in. * 11 in. */ letterTransverse= 54, /** * Specifies the paper size is 3.875 in. * 7.5 in. */ monarchEnvelope= 37, /** * Specifies the paper size is 8.5 in. * 11 in. */ note= 18, /** * Specifies the paper size is 4.125 in. * 9.5 in. */ number10Envelope= 20, /** * Specifies the paper size is 4.5 in. * 10.375 in. */ number11Envelope= 21, /** * Specifies the paper size is 4.75 in. * 11 in. */ number12Envelope= 22, /** * Specifies the paper size is 5 in. * 11.5 in. */ number14Envelope= 23, /** * Specifies the paper size is 3.875 in. * 8.875 in. */ number9Envelope= 19, /** * Specifies the paper size is 3.625 in. * 6.5 in. */ personalEnvelope= 38, /** * Specifies the paper size is 146 mm * 215 mm. */ prc16K= 93, /** * Specifies the paper size is 146 mm * 215 mm. */ prc16KRotated= 106, /** * Specifies the paper size is 97 mm * 151 mm. */ prc32K= 94, /** * Specifies the paper size is 97 mm * 151 mm. */ prc32KBig= 95, /** * Specifies the paper size is 97 mm * 151 mm. */ prc32KBigRotated= 108, /** * Specifies the paper size is 97 mm * 151 mm. */ prc32KRotated= 107, /** * Specifies the paper size is 102 mm * 165 mm. */ prcEnvelopeNumber1= 96, /** * Specifies the paper size is 324 mm * 458 mm. */ prcEnvelopeNumber10= 105, /** * Specifies the paper size is 458 mm * 324 mm. */ prcEnvelopeNumber10Rotated= 118, /** * Specifies the paper size is 165 mm * 102 mm. */ prcEnvelopeNumber1Rotated= 109, /** * Specifies the paper size is 102 mm * 176 mm. */ prcEnvelopeNumber2= 97, /** * Specifies the paper size is 176 mm * 102 mm. */ prcEnvelopeNumber2Rotated= 110, /** * Specifies the paper size is 125 mm * 176 mm. */ prcEnvelopeNumber3= 98, /** * Specifies the paper size is 176 mm * 125 mm. */ prcEnvelopeNumber3Rotated= 111, /** * Specifies the paper size is 110 mm * 208 mm. */ prcEnvelopeNumber4= 99, /** * Specifies the paper size is 208 mm * 110 mm. */ prcEnvelopeNumber4Rotated= 112, /** * Specifies the paper size is 110 mm * 220 mm. */ prcEnvelopeNumber5= 100, /** * Specifies the paper size is 220 mm * 110 mm. */ prcEnvelopeNumber5Rotated= 113, /** * Specifies the paper size is 120 mm * 230 mm. */ prcEnvelopeNumber6= 101, /** * Specifies the paper size is 230 mm * 120 mm. */ prcEnvelopeNumber6Rotated= 114, /** * Specifies the paper size is 160 mm * 230 mm. */ prcEnvelopeNumber7= 102, /** * Specifies the paper size is 230 mm * 160 mm. */ prcEnvelopeNumber7Rotated= 115, /** * Specifies the paper size is 120 mm * 309 mm. */ prcEnvelopeNumber8= 103, /** * Specifies the paper size is 309 mm * 120 mm. */ prcEnvelopeNumber8Rotated= 116, /** * Specifies the paper size is 229 mm * 324 mm. */ prcEnvelopeNumber9= 104, /** * Specifies the paper size is 324 mm * 229 mm. */ prcEnvelopeNumber9Rotated= 117, /** * Specifies the paper size is 215 mm * 275 mm. */ quarto= 15, /** * Specifies the paper size is 10 in. * 11 in. */ standard10x11= 45, /** * Specifies the paper size is 10 in. * 14 in. */ standard10x14= 16, /** * Specifies the paper size is 11 in. * 17 in. */ standard11x17= 17, /** * Specifies the paper size is 12 in. * 11 in. */ standard12x11= 90, /** * Specifies the paper size is 15 in. * 11 in. */ standard15x11= 46, /** * Specifies the paper size is 9 in. * 11 in. */ standard9x11= 44, /** * Specifies the paper size is 5.5 in. * 8.5 in. */ statement= 6, /** * Specifies the paper size is 11 in. * 17 in. */ tabloid= 3, /** * Specifies the paper size is 11.69 in. * 18 in. */ tabloidExtra= 52, /** * Specifies the paper size is 14.875 in. * 11 in. */ usStandardFanfold= 39 } /** * Specifics the type of centering for the printed page. * @enum {number} * @example * ```javascript * var printInfo = new GC.Spread.Sheets.Print.PrintInfo(); * printInfo.columnStart(0); * printInfo.columnEnd(2); * printInfo.centering(GC.Spread.Sheets.Print.PrintCentering.horizontal); * activeSheet.printInfo(printInfo); * spread.print(0); * ``` */ export enum PrintCentering{ /** * Does not center the printed page at all. */ none= 0, /** * Centers the printed layout horizontally on the page. */ horizontal= 1, /** * Centers the printed layout vertically on the page. */ vertical= 2, /** * Centers the printed layout both horizontally and vertically on the page. */ both= 3 } /** * Specifies the order in which pages are printed. * @enum {number} * @example * ```javascript * var printInfo = new GC.Spread.Sheets.Print.PrintInfo(); * printInfo.pageOrder(GC.Spread.Sheets.Print.PrintPageOrder.auto); * activeSheet.printInfo(printInfo); * spread.print(0); * ``` */ export enum PrintPageOrder{ /** * Automatically determines the best order for printing pages. */ auto= 0, /** * Prints pages down then across. */ downThenOver= 1, /** * Prints pages across then down. */ overThenDown= 2 } /** * Specifies the page orientation used for printing. * @enum {number} * @example * ```javascript * activeSheet.setArray(0, 0, [['Title 1', 'Title 2'], [1, 2], [3, 4]]); * var printInfo = new GC.Spread.Sheets.Print.PrintInfo(); * // Specify the page orientation for printing. * printInfo.orientation(GC.Spread.Sheets.Print.PrintPageOrientation.landscape); * activeSheet.printInfo(printInfo); * spread.print(0); * ``` */ export enum PrintPageOrientation{ /** * Prints portrait orientation. */ portrait= 1, /** * Prints landscape orientation. */ landscape= 2 } /** * Specifies whether the area is visible. * @enum {number} * @example * ```javascript * activeSheet.setArray(0, 0, [['Title 1', 'Title 2'], [1, 2], [3, 4]]); * var printInfo = new GC.Spread.Sheets.Print.PrintInfo(); * printInfo.showColumnHeader(GC.Spread.Sheets.Print.PrintVisibilityType.hide); * activeSheet.printInfo(printInfo); * spread.print(0); * ``` */ export enum PrintVisibilityType{ /** * Inherits the setting from the Worksheet class. */ inherit= 0, /** * Hides the area. */ hide= 1, /** * Shows in each page. */ show= 2, /** * Shows once. */ showOnce= 3 } export class PaperSize{ /** * Specifies the paper size.
* The constructor has 3 modes.
* If there are 2 parameters, the parameters are width and height with a type of number;
* If there is 1 parameter, the parameter is kind which is a GC.Spread.Sheets.Print.PaperKind type;
* If there is no parameter, the result is the same as the second mode and the kind option is GC.Spread.Sheets.Print.PaperKind.letter. * @class * @param {number|GC.Spread.Sheets.Print.PaperKind} [widthOrKind] The width of the paper, in hundredths of an inch; or the kind of the paper and the type is GC.Spread.Sheets.Print.PaperKind. * @param {number} [height] The height of the paper, in hundredths of an inch. * @example * ```javascript * var printInfo = new GC.Spread.Sheets.Print.PrintInfo(); * printInfo.pageHeaderFooter({ * normal: { * header: { * left: "Header Left" * } * } * }); * printInfo.paperSize(new GC.Spread.Sheets.Print.PaperSize(GC.Spread.Sheets.Print.PaperKind.a4)); * spread.print(0); * ``` */ constructor(widthOrKind?: number|GC.Spread.Sheets.Print.PaperKind, height?: number); /** * Gets the paper size, in hundredths of an inch. * @param {GC.Spread.Sheets.Print.PaperKind} kind The kind of the paper. * @returns {GC.Spread.Sheets.Print.PrintSize} The size which contains width and height of the paper. * @example * ```javascript * var paperSize = new GC.Spread.Sheets.Print.PaperSize(); * console.log(paperSize.getPageSize(GC.Spread.Sheets.Print.PaperKind.a4)); // Get the size of a4 paper. * console.log(paperSize.getPageSize(GC.Spread.Sheets.Print.PaperKind.a5)); // Get the size of a5 paper. * ``` */ getPageSize(kind: GC.Spread.Sheets.Print.PaperKind): GC.Spread.Sheets.Print.PrintSize; /** * Gets or sets the height of the paper, in hundredths of an inch. * @param {number} [value] The height of the paper. * @returns {number | GC.Spread.Sheets.Print.PaperSize} If no value is set, returns the height of the paper; otherwise, returns the paper size. * @example * ```javascript * var paperSize = new GC.Spread.Sheets.Print.PaperSize(GC.Spread.Sheets.Print.PaperKind.a4); * var height = paperSize.height(); // Get the height of the paper. * paperSize.height(height / 2); // Set the height of paper. * ``` */ height(value?: number): any; /** * Gets or sets the kind of the paper. * @param {GC.Spread.Sheets.Print.PaperKind} [value] The kind of the paper. * @returns {GC.Spread.Sheets.Print.PaperKind | GC.Spread.Sheets.Print.PaperSize} If no value is set, returns the kind of the paper; otherwise, returns the paper size. * @example * ```javascript * var paperSize = new GC.Spread.Sheets.Print.PaperSize(GC.Spread.Sheets.Print.PaperKind.a4); * console.log(paperSize.kind()); // Get the kind of the paper. * paperSize.kind(GC.Spread.Sheets.Print.PaperKind.a5); // Set the kind of paper. * ``` */ kind(value?: GC.Spread.Sheets.Print.PaperKind): any; /** * Gets or sets the width of the paper, in hundredths of an inch. * @param {number} [value] The width of the paper. * @returns {number | GC.Spread.Sheets.Print.PaperSize} If no value is set, returns the width of the paper; otherwise, returns the paper size. * @example * ```javascript * var paperSize = new GC.Spread.Sheets.Print.PaperSize(GC.Spread.Sheets.Print.PaperKind.a4); * var width = paperSize.width(); // Get the width of the paper. * paperSize.width(width / 2); // Set the width of paper. * ``` */ width(value?: number): any; } export class PrintInfo{ /** * Represents the information to use when printing a Worksheet. * @class * @param {GC.Spread.Sheets.Worksheet} [sheet] the specified worksheet * @example * ```javascript * var printInfo = new GC.Spread.Sheets.Print.PrintInfo(); * printInfo.bestFitColumns(true); * printInfo.orientation(GC.Spread.Sheets.Print.PrintPageOrientation.landscape); * activeSheet.printInfo(printInfo); * spread.print(0); * ``` */ constructor(sheet?: GC.Spread.Sheets.Worksheet); /** * Gets or sets whether column widths are adjusted to fit the longest text width for printing. * @param {boolean} [value] Whether column widths are adjusted to fit the longest text width for printing. * @returns {boolean | GC.Spread.Sheets.Print.PrintInfo} If no value is set, returns whether column widths are adjusted to fit the longest text width for printing; otherwise, returns the print setting information. * @example * ```javascript * var printInfo = new GC.Spread.Sheets.Print.PrintInfo(); * printInfo.bestFitColumns(true); * printInfo.orientation(GC.Spread.Sheets.Print.PrintPageOrientation.landscape); * printInfo.pageHeaderFooter({ * normal: { * footer: { * center: "SpreadJS" * } * } * }); * activeSheet.printInfo(printInfo); * spread.print(0); * ``` */ bestFitColumns(value?: boolean): any; /** * Gets or sets whether row heights are adjusted to fit the tallest text height for printing. * @param {boolean} [value] Whether row heights are adjusted to fit the tallest text height for printing. * @returns {boolean | GC.Spread.Sheets.Print.PrintInfo} If no value is set, returns whether row heights are adjusted to fit the tallest text height for printing; otherwise, returns the print setting information. * @example * ```javascript * activeSheet.getCell(0,0).wordWrap(true); * activeSheet.getCell(0,0).value("The quick brown fox jumps over the lazy dog."); * var printInfo = new GC.Spread.Sheets.Print.PrintInfo(); * printInfo.bestFitRows(true); * activeSheet.printInfo(printInfo); * spread.print(0); * ``` */ bestFitRows(value?: boolean): any; /** * Gets or sets whether to print in black and white. * @param {boolean} [value] Whether to print in black and white. * @returns {boolean | GC.Spread.Sheets.Print.PrintInfo} If no value is set, returns whether to print in black and white; otherwise, returns the print setting information. * @example * ```javascript * activeSheet.getRange(0, 0, 5, 5).backColor("red"); * var printInfo = new GC.Spread.Sheets.Print.PrintInfo(); * printInfo.blackAndWhite(true); * activeSheet.printInfo(printInfo); * spread.print(0); * ``` */ blackAndWhite(value?: boolean): any; /** * Gets or sets how the printed page is centered. * @param {GC.Spread.Sheets.Print.PrintCentering} [value] How the printed page is centered. * @returns {GC.Spread.Sheets.Print.PrintCentering | GC.Spread.Sheets.Print.PrintInfo} If no value is set, returns how the printed page is centered; otherwise, returns the print setting information. * @example * ```javascript * var printInfo = new GC.Spread.Sheets.Print.PrintInfo(); * printInfo.columnStart(0); * printInfo.columnEnd(2); * printInfo.centering(GC.Spread.Sheets.Print.PrintCentering.horizontal); * activeSheet.printInfo(printInfo); * spread.print(0); * ``` */ centering(value?: GC.Spread.Sheets.Print.PrintCentering): any; /** * Gets or sets the last column to print when printing a cell range. * @param {number} [value] The last column to print when printing a cell range. * @returns {number | GC.Spread.Sheets.Print.PrintInfo} If no value is set, returns the last column to print when printing a cell range; otherwise, returns the print setting information. * @example * ```javascript * var data = [ * ["1", "NewYork", "1968/6/8", "80", "180"], * ["4", "NewYork", "1972/7/3", "72", "168"], * ["5", "Washington", "1972/8/8","80", "171"], * ]; * activeSheet.setArray(0, 0, data); * var printInfo = new GC.Spread.Sheets.Print.PrintInfo(); * printInfo.columnStart(0); * printInfo.columnEnd(2); * printInfo.centering(GC.Spread.Sheets.Print.PrintCentering.horizontal); * activeSheet.printInfo(printInfo); * spread.print(0); * ``` */ columnEnd(value?: number): any; /** * Gets or sets the first column to print when printing a cell range. * @param {number} [value] The first column to print when printing a cell range. * @returns {number | GC.Spread.Sheets.Print.PrintInfo} If no value is set, returns the first column to print when printing a cell range; otherwise, returns the print setting information. * @example * ```javascript * var data = [ * ["1", "NewYork", "1968/6/8", "80", "180"], * ["4", "NewYork", "1972/7/3", "72", "168"], * ["5", "Washington", "1972/8/8","80", "171"], * ]; * activeSheet.setArray(0, 0, data); * var printInfo = new GC.Spread.Sheets.Print.PrintInfo(); * printInfo.columnStart(2); * printInfo.columnEnd(4); * printInfo.centering(GC.Spread.Sheets.Print.PrintCentering.horizontal); * activeSheet.printInfo(printInfo); * spread.print(0); * ``` */ columnStart(value?: number): any; /** * Gets or sets whether to print the different text and format of the header/footer on first page. * @param {boolean} [value] Whether to print the different text and format of the header/footer on first page. * @returns {boolean | GC.Spread.Sheets.Print.PrintInfo} If no value is set, returns whether to print the different text and format of the header/footer on first page; otherwise, returns the print setting information. * @example * ```javascript * activeSheet.setArray(0, 0, new Array(60).fill(["sample text"])); * var printInfo = activeSheet.printInfo(); * printInfo.differentFirstPage(true); * printInfo.pageHeaderFooter({ * first: { * header: { * left: "It is &A.", * center: "&SThis is text.", * right: "&BHeader" * } * } * }); * activeSheet.printInfo(printInfo); * spread.print(0); * ``` */ differentFirstPage(value?: boolean): any; /** * Gets or sets whether to print the different text and format of the header/footer on odd and even pages. * @param {boolean} [value] Whether to print the different text and format of the header/footer on odd and even pages. * @returns {boolean | GC.Spread.Sheets.Print.PrintInfo} If no value is set, returns whether to print the different text and format of the header/footer on odd and even pages; otherwise, returns the print setting information. * @example * ```javascript * activeSheet.setArray(0, 0, new Array(60).fill(["sample text"])); * var printInfo = activeSheet.printInfo(); * printInfo.differentOddAndEvenPages(true); * printInfo.pageHeaderFooter({ * odd: { * header: { * left: "odd page", * center: "page number: &P", * right: "&BHeader" * } * }, * even: { * header: { * left: "even page", * center: "page number: &P", * right: "&BHeader" * } * } * }); * activeSheet.printInfo(printInfo); * spread.print(0); * ``` */ differentOddAndEvenPages(value?: boolean): any; /** * Gets or sets the page number to print on the even pages. * @param {number} [value] The page number to print on the even pages. * @returns {number | GC.Spread.Sheets.Print.PrintInfo} If no value is set, returns the page number to print on the even pages; otherwise, returns the print setting information. * @example * ```javascript * activeSheet.setArray(0, 0, new Array(60).fill(["sample text"])); * var printInfo = new GC.Spread.Sheets.Print.PrintInfo(); * printInfo.firstPageNumber(5); * printInfo.pageHeaderFooter({ * normal: { * header: { * left: "page number: &N" * } * } * }); * activeSheet.printInfo(printInfo); * spread.print(0); * ``` */ firstPageNumber(value?: number): any; /** * Gets or sets the number of vertical pages to check when optimizing printing. * @param {number} [value] The number of vertical pages to check when optimizing printing. * @returns {number | GC.Spread.Sheets.Print.PrintInfo} If no value is set, returns the number of vertical pages to check; otherwise, returns the print setting information. * @example * ```javascript * activeSheet.setArray(0, 0, new Array(60).fill(["sample text"])); * var printInfo = new GC.Spread.Sheets.Print.PrintInfo(); * printInfo.fitPagesTall(1); * activeSheet.printInfo(printInfo); * spread.print(0); * ``` */ fitPagesTall(value?: number): any; /** * Gets or sets the number of horizontal pages to check when optimizing the printing. * @param {number} [value] The number of horizontal pages to check when optimizing the printing. * @returns {number | GC.Spread.Sheets.Print.PrintInfo} If no value is set, returns the number of horizontal pages to check; otherwise, returns the print setting information. * @example * ```javascript * activeSheet.setArray(0, 0, [new Array(16).fill("A")]); * var printInfo = new GC.Spread.Sheets.Print.PrintInfo(); * printInfo.fitPagesWide(1); * activeSheet.printInfo(printInfo); * spread.print(0); * ``` */ fitPagesWide(value?: number): any; /** * Gets or sets the margins for printing, in hundredths of an inch. * @param {GC.Spread.Sheets.Print.PrintMargins} [value] The margins for printing. * @returns {GC.Spread.Sheets.Print.PrintMargins | GC.Spread.Sheets.Print.PrintInfo} If no value is set, returns the margins for printing; otherwise, returns the print setting information. * @example * ```javascript * var printInfo = new GC.Spread.Sheets.Print.PrintInfo(); * printInfo.pageHeaderFooter({ * normal: { * header: { * left: "Header Left", * right: "Header Right" * }, * footer: { * left: "Footer Left", * center: "Footer Center", * right: "Footer Right" * } * } * }); * printInfo.margin({top:75, bottom:75, left:20, right:20, header:10, footer:20}); * activeSheet.printInfo(printInfo); * spread.print(0); * ``` */ margin(value?: GC.Spread.Sheets.Print.PrintMargins): any; /** * Gets or sets the page orientation used for printing. * @param {GC.Spread.Sheets.Print.PrintPageOrientation} [value] The page orientation used for printing. * @returns {GC.Spread.Sheets.Print.PrintPageOrientation | GC.Spread.Sheets.Print.PrintInfo} If no value is set, returns the page orientation used for printing; otherwise, returns the print setting information. * @example * ```javascript * activeSheet.setArray(0, 0, [['Title 1', 'Title 2'], [1, 2], [3, 4]]); * var printInfo = new GC.Spread.Sheets.Print.PrintInfo(); * // Specify the page orientation for printing. * printInfo.orientation(GC.Spread.Sheets.Print.PrintPageOrientation.landscape); * activeSheet.printInfo(printInfo); * spread.print(0); * ``` */ orientation(value?: GC.Spread.Sheets.Print.PrintPageOrientation): any; /** * Gets or sets options to print the text and format of the custom header/footer on the page. * @param {GC.Spread.Sheets.Print.IPageCustomHeaderFooterOptions} [value] The options to print the text and format of the custom header/footer on the page. * @returns {GC.Spread.Sheets.Print.IPageCustomHeaderFooterOptions | GC.Spread.Sheets.Print.PrintInfo} If no value is set, returns the options to print the text and format of the custom header/footer on the page; otherwise, returns the print setting information. * @example * ```javascript * activeSheet.setArray(0, 0, new Array(60).fill(["sample text"])); * var printInfo = new GC.Spread.Sheets.Print.PrintInfo(); * printInfo.pageHeaderFooter({ * normal: { * header: { * left: "It is &T.", * center: "&SThis is text.", * right: "&BHeader" * } * } * }); * activeSheet.printInfo(printInfo); * spread.print(0); * ``` */ pageHeaderFooter(value?: GC.Spread.Sheets.Print.IPageCustomHeaderFooterOptions): any; /** * Gets or sets the order in which pages print. * @param {GC.Spread.Sheets.Print.PrintPageOrder} [value] The order in which pages print. * @returns {GC.Spread.Sheets.Print.PrintPageOrder | GC.Spread.Sheets.Print.PrintInfo} If no value is set, returns a value that specifies the order in which pages print; otherwise, returns the print setting information. * @example * ```javascript * activeSheet.setRowCount(200); * activeSheet.setColumnCount(20); * activeSheet.setArray(0, 0, Array.from({ length: 200 }, (_, i) => [i])); * activeSheet.setArray(0, 0, [Array.from({ length: 20 }, (_, i) => i)]); * var printInfo = new GC.Spread.Sheets.Print.PrintInfo(); * printInfo.pageOrder(GC.Spread.Sheets.Print.PrintPageOrder.auto); * activeSheet.printInfo(printInfo); * spread.print(0); * ``` */ pageOrder(value?: GC.Spread.Sheets.Print.PrintPageOrder): any; /** * Gets or sets the page range for printing. * @param {string} [value] The page numbers or page ranges separated by commas counting from the beginning of the document. For example, type "1,3,5-12". * @returns {string | GC.Spread.Sheets.Print.PrintInfo} If no value is set, returns a string that provides page numbers or page ranges; otherwise, returns the print setting information.} * @example * ```javascript * activeSheet.setRowCount(200); * activeSheet.setArray(0, 0, Array.from({ length: 200 }, (_, i) => [i])); * var printInfo = new GC.Spread.Sheets.Print.PrintInfo(); * printInfo.pageRange("1-3"); * activeSheet.printInfo(printInfo); * spread.print(0); * ``` */ pageRange(value?: string): any; /** * Gets or sets the paper size for printing. * @param {GC.Spread.Sheets.Print.PaperSize} [value] The paper size for printing. * @returns {GC.Spread.Sheets.Print.PaperSize | GC.Spread.Sheets.Print.PrintInfo} If no value is set, returns the paper size for printing; otherwise, returns the print setting information. * @example * ```javascript * activeSheet.setArray(0, 0, new Array(20).fill(["sample text"])); * var printInfo = new GC.Spread.Sheets.Print.PrintInfo(); * printInfo.paperSize(new GC.Spread.Sheets.Print.PaperSize(300, 300)); * activeSheet.printInfo(printInfo); * spread.print(0); * ``` */ paperSize(value?: GC.Spread.Sheets.Print.PaperSize): any; /** * Gets or sets the quality factor for printing. * @param {number} [value] The quality factor for printing is a positive integer between 1 and 8. The greater the quality factor, the better the printing quality. When the quality factor is bigger, the printing efficiency is affected. * @returns {number | GC.Spread.Sheets.Print.PrintInfo} If no value is set, returns the quality factor for printing; otherwise, returns the print setting information. * @example * ```javascript * activeSheet.setArray(0, 0, new Array(20).fill(["sample text"])); * var printInfo = new GC.Spread.Sheets.Print.PrintInfo(); * printInfo.qualityFactor(6); * activeSheet.printInfo(printInfo); * spread.print(); * ``` */ qualityFactor(value?: number): any; /** * Gets or sets the last column of a range of columns to print on the left of each page. * @param {number} [value] The last column of a range of columns to print on the left of each page. * @returns {number | GC.Spread.Sheets.Print.PrintInfo} If no value is set, returns the last column of a range of columns to print on the left of each page; otherwise, returns the print setting information. * @example * ```javascript * activeSheet.setArray(0, 0, [['Title 1', 'Title 2']]); * activeSheet.setArray(0, 2, [Array.from({ length: 18 }, (_, i) => i)]); * var printInfo = new GC.Spread.Sheets.Print.PrintInfo(); * printInfo.repeatColumnStart(0); * printInfo.repeatColumnEnd(1); * activeSheet.printInfo(printInfo); * spread.print(); // "Title 1" and "Title 2" will be printed repeatedly on each page. * ``` */ repeatColumnEnd(value?: number): any; /** * Gets or sets the first column of a range of columns to print on the left of each page. * @param {number} [value] The first column of a range of columns to print on the left of each page. * @returns {number | GC.Spread.Sheets.Print.PrintInfo} If no value is set, returns the first column of a range of columns to print on the left of each page; otherwise, returns the print setting information. * @example * ```javascript * activeSheet.setArray(0, 0, [['Title 1', 'Title 2']]); * activeSheet.setArray(0, 2, [Array.from({ length: 18 }, (_, i) => i)]); * var printInfo = new GC.Spread.Sheets.Print.PrintInfo(); * printInfo.repeatColumnStart(0); * printInfo.repeatColumnEnd(1); * activeSheet.printInfo(printInfo); * spread.print(); // "Title 1" and "Title 2" will be printed repeatedly on each page. * ``` */ repeatColumnStart(value?: number): any; /** * Gets or sets the last row of a range of rows to print at the top of each page. * @param {number} [value] The last row of a range of rows to print at the top of each page. * @returns {number | GC.Spread.Sheets.Print.PrintInfo} If no value is set, returns the last row of a range of rows to print at the top of each page; otherwise, returns the print setting information. * @example * ```javascript * activeSheet.setArray(0, 0, [['Title 1'], ['Title 2']]); * activeSheet.setArray(2, 0, Array.from({ length: 60 }, (_, i) => [i])); * var printInfo = new GC.Spread.Sheets.Print.PrintInfo(); * printInfo.repeatRowStart(0); * printInfo.repeatRowEnd(1); * activeSheet.printInfo(printInfo); * spread.print(); // "Title 1" and "Title 2" will be printed repeatedly on each page. * ``` */ repeatRowEnd(value?: number): any; /** * Gets or sets the first row of a range of rows to print at the top of each page. * @param {number} [value] The first row of a range of rows to print at the top of each page. * @returns {number | GC.Spread.Sheets.Print.PrintInfo} If no value is set, returns the first row of a range of rows to print at the top of each page; otherwise, returns the print setting information. * @example * ```javascript * activeSheet.setArray(0, 0, [['Title 1'], ['Title 2']]); * activeSheet.setArray(2, 0, Array.from({ length: 60 }, (_, i) => [i])); * var printInfo = new GC.Spread.Sheets.Print.PrintInfo(); * printInfo.repeatRowStart(0); * printInfo.repeatRowEnd(1); * activeSheet.printInfo(printInfo); * spread.print(); // "Title 1" and "Title 2" will be printed repeatedly on each page. * ``` */ repeatRowStart(value?: number): any; /** * Gets or sets the last row to print when printing a cell range. * @param {number} [value] The last row to print when printing a cell range. * @returns {number | GC.Spread.Sheets.Print.PrintInfo} If no value is set, returns the last row to print when printing a cell range; otherwise, returns the print setting information. * @example * ```javascript * activeSheet.setColumnCount(3); * activeSheet.setArray(0, 0, new Array(60).fill(["sample text"])); * var printInfo = new GC.Spread.Sheets.Print.PrintInfo(); * printInfo.rowStart(0); * printInfo.rowEnd(2); * activeSheet.printInfo(printInfo); * spread.print(0); * ``` */ rowEnd(value?: number): any; /** * Gets or sets the first row to print when printing a cell range. * @param {number} [value] The first row to print when printing a cell range. * @returns {number | GC.Spread.Sheets.Print.PrintInfo} If no value is set, returns the first row to print when printing a cell range; otherwise, returns the print setting information. * @example * ```javascript * activeSheet.setColumnCount(3); * activeSheet.setArray(0, 0, new Array(60).fill(["sample text"])); * var printInfo = new GC.Spread.Sheets.Print.PrintInfo(); * printInfo.rowStart(0); * printInfo.rowEnd(2); * activeSheet.printInfo(printInfo); * spread.print(0); * ``` */ rowStart(value?: number): any; /** * Gets or sets whether to print an outline border around the entire control. * @param {boolean} [value] Whether to print an outline border around the entire control. * @returns {boolean | GC.Spread.Sheets.Print.PrintInfo} If no value is set, returns whether to print an outline border around the entire control; otherwise, returns the print setting information. * @example * ```javascript * activeSheet.setArray(0, 0, [['Title 1', 'Title 2'], [1, 2], [3, 4]]); * var printInfo = new GC.Spread.Sheets.Print.PrintInfo(); * printInfo.showBorder(false); * activeSheet.printInfo(printInfo); * spread.print(0); * ``` */ showBorder(value?: boolean): any; /** * Gets or sets whether to print the column header. * @param {GC.Spread.Sheets.Print.PrintVisibilityType} [value] Whether to print the column header. * @returns {GC.Spread.Sheets.Print.PrintVisibilityType | GC.Spread.Sheets.Print.PrintInfo} If no value is set, returns whether to print the column header; otherwise, returns the print setting information. * @example * ```javascript * activeSheet.setArray(0, 0, [['Title 1', 'Title 2'], [1, 2], [3, 4]]); * var printInfo = new GC.Spread.Sheets.Print.PrintInfo(); * printInfo.showColumnHeader(GC.Spread.Sheets.Print.PrintVisibilityType.hide); * activeSheet.printInfo(printInfo); * spread.print(0); * ``` */ showColumnHeader(value?: GC.Spread.Sheets.Print.PrintVisibilityType): any; /** * Gets or sets whether to print the grid lines. * @param {boolean} [value] Whether to print the grid lines. * @returns {boolean | GC.Spread.Sheets.Print.PrintInfo} If no value is set, returns whether to print the grid lines; otherwise, returns the print setting information. * @example * ```javascript * activeSheet.setArray(0, 0, [['Title 1', 'Title 2'], [1, 2], [3, 4]]); * var printInfo = new GC.Spread.Sheets.Print.PrintInfo(); * printInfo.showGridLine(true); * activeSheet.printInfo(printInfo); * spread.print(0); * ``` */ showGridLine(value?: boolean): any; /** * Gets or sets whether to print the row header. * @param {GC.Spread.Sheets.Print.PrintVisibilityType} [value] Whether to print the row header. * @returns {GC.Spread.Sheets.Print.PrintVisibilityType | GC.Spread.Sheets.Print.PrintInfo} If no value is set, returns whether to print the row header; otherwise, returns the print setting information. * @example * ```javascript * activeSheet.setArray(0, 0, [['Title 1', 'Title 2'], [1, 2], [3, 4]]); * var printInfo = new GC.Spread.Sheets.Print.PrintInfo(); * printInfo.showRowHeader(GC.Spread.Sheets.Print.PrintVisibilityType.hide); * activeSheet.printInfo(printInfo); * spread.print(0); * ``` */ showRowHeader(value?: GC.Spread.Sheets.Print.PrintVisibilityType): any; /** * Gets or sets whether to print only rows and columns that contain data. * @param {boolean} [value] Whether to print only rows and columns that contain data. * @returns {boolean | GC.Spread.Sheets.Print.PrintInfo} If no value is set, returns whether to print only rows and columns that contain data; otherwise, returns the print setting information. * @example * ```javascript * activeSheet.setArray(0, 0, [['Title 1', 'Title 2'], [1, 2], [3, 4]]); * var printInfo = new GC.Spread.Sheets.Print.PrintInfo(); * printInfo.useMax(false); * activeSheet.printInfo(printInfo); * spread.print(0); * ``` */ useMax(value?: boolean): any; /** * Gets or set all watermark. * @param {GC.Spread.Sheets.Print.IWatermarkItem[]} [value] The watermark item. * @return {GC.Spread.Sheets.Print.IWatermarkItem[] | GC.Spread.Sheets.Print.PrintInfo} The watermark item. * @example * ```javascript * // This example shows how to set watermark. * var printInfo = activeSheet.printInfo(); * printInfo.watermark([{x:0, y:0, width:100, height:100, imageSrc:".image/watermark.jpg", page:"all"}]); * activeSheet.printInfo(printInfo); * spread.print(0); * ``` */ watermark(value?: GC.Spread.Sheets.Print.IWatermarkItem[]): any; /** * Gets or sets the zoom factor used for printing. * @param {number} [value] The zoom factor used for printing. * @returns {number | GC.Spread.Sheets.Print.PrintInfo} If no value is set, returns a value that specifies the amount to enlarge or reduce the printed worksheet; otherwise, returns the print setting information. * @example * ```javascript * activeSheet.setArray(0, 0, [['Title 1', 'Title 2'], [1, 2], [3, 4]]); * var printInfo = new GC.Spread.Sheets.Print.PrintInfo(); * printInfo.zoomFactor(2); * activeSheet.printInfo(printInfo); * spread.print(0); * ``` */ zoomFactor(value?: number): any; } } module Search{ /** * Specifies the type of search flags. * @enum {number} * @example * ```javascript * //This example uses the SearchFlags enumeration. * activeSheet.getCell(2,3).value("testSearch"); * var searchCondition = new GC.Spread.Sheets.Search.SearchCondition(); * searchCondition.searchString = "testSearch"; * searchCondition.startSheetIndex = spread.getActiveSheetIndex(); * searchCondition.endSheetIndex = spread.getActiveSheetIndex(); * searchCondition.searchOrder = GC.Spread.Sheets.Search.SearchOrder.nOrder; * searchCondition.searchTarget = GC.Spread.Sheets.Search.SearchFoundFlags.cellText; * searchCondition.searchFlags = GC.Spread.Sheets.Search.SearchFlags.ignoreCase| GC.Spread.Sheets.Search.SearchFlags.useWildCards; * var searchresult= activeSheet.search(searchCondition); * var str ="[searchFoundFlag:"+ searchresult.searchFoundFlag+",\r\n foundSheetIndex:"+searchresult.foundSheetIndex+",foundRowIndex:" + * searchresult.foundRowIndex+", foundColumnIndex:"+searchresult.foundColumnIndex+", foundString:"+searchresult.foundSheetIndex+"]"; * alert(str); * ``` */ export enum SearchFlags{ /** Specifies no search flags. * @type {number} */ none= 0, /** Determines whether the search considers the case of the letters in the search string. * @type {number} */ ignoreCase= 1, /** Determines whether the search considers only an exact match. * @type {number} */ exactMatch= 2, /** Determines whether the search considers wildcard characters (*, ?) in the search string. * @type {number} */ useWildCards= 4, /** Determines whether to search within a cell range. * @type {number} */ blockRange= 8 } /** * Specifies where the search string is found. * @enum {number} * @example * ```javascript * //This example uses the SearchFlags enumeration. * activeSheet.getCell(2,3).value("testSearch"); * var searchCondition = new GC.Spread.Sheets.Search.SearchCondition(); * searchCondition.searchString = "testSearch"; * searchCondition.startSheetIndex = spread.getActiveSheetIndex(); * searchCondition.endSheetIndex = spread.getActiveSheetIndex(); * searchCondition.searchOrder = GC.Spread.Sheets.Search.SearchOrder.nOrder; * searchCondition.searchTarget = GC.Spread.Sheets.Search.SearchFoundFlags.cellText; * searchCondition.searchFlags = GC.Spread.Sheets.Search.SearchFlags.ignoreCase| GC.Spread.Sheets.Search.SearchFlags.useWildCards; * var searchresult= activeSheet.search(searchCondition); * var str ="[searchFoundFlag:"+ searchresult.searchFoundFlag+",\r\n foundSheetIndex:"+searchresult.foundSheetIndex+",foundRowIndex:" + * searchresult.foundRowIndex+", foundColumnIndex:"+searchresult.foundColumnIndex+", foundString:"+searchresult.foundSheetIndex+"]"; * alert(str); * ``` */ export enum SearchFoundFlags{ /** * Indicates that no string is found. * @type {number} */ none= 0, /** * Indicates that the string is found in the cell text. * @type {number} */ cellText= 1, /** * Indicates that the string is found in the cell tag. * @type {number} */ cellTag= 4, /** * Indicates that the string is found in the cell formula. * @type {number} */ cellFormula= 8, /** * Indicates that the string is found in the cell comment. * @type {number} */ cellComment= 16 } /** * Specifies the type of search direction. * @enum {number} * @example * ```javascript * //This example uses the SearchFlags enumeration. * activeSheet.getCell(2,3).value("testSearch"); * var searchCondition = new GC.Spread.Sheets.Search.SearchCondition(); * searchCondition.searchString = "testSearch"; * searchCondition.startSheetIndex = spread.getActiveSheetIndex(); * searchCondition.endSheetIndex = spread.getActiveSheetIndex(); * searchCondition.searchOrder = GC.Spread.Sheets.Search.SearchOrder.nOrder; * searchCondition.searchTarget = GC.Spread.Sheets.Search.SearchFoundFlags.cellText; * searchCondition.searchFlags = GC.Spread.Sheets.Search.SearchFlags.ignoreCase| GC.Spread.Sheets.Search.SearchFlags.useWildCards; * var searchresult= activeSheet.search(searchCondition); * var str ="[searchFoundFlag:"+ searchresult.searchFoundFlag+",\r\n foundSheetIndex:"+searchresult.foundSheetIndex+",foundRowIndex:" + * searchresult.foundRowIndex+", foundColumnIndex:"+searchresult.foundColumnIndex+", foundString:"+searchresult.foundSheetIndex+"]"; * alert(str); * ``` */ export enum SearchOrder{ /** Determines whether the search goes by column, row coordinates. * @type {number} */ zOrder= 0, /** Determines whether the search goes by row, column coordinates. * @type {number} */ nOrder= 1 } export class SearchCondition{ /** * Defines the search condition. * @class * @example * ```javascript * activeSheet.getCell(5,4).text("testSearch"); * var searchCondition = new GC.Spread.Sheets.Search.SearchCondition(); * searchCondition.searchString = "testSearch"; * searchCondition.startSheetIndex = spread.getActiveSheetIndex(); * searchCondition.endSheetIndex = spread.getActiveSheetIndex(); * searchCondition.searchOrder = GC.Spread.Sheets.Search.SearchOrder.nOrder; * searchCondition.searchTarget = GC.Spread.Sheets.Search.SearchFoundFlags.cellText; * searchCondition.searchFlags = GC.Spread.Sheets.Search.SearchFlags.ignoreCase| GC.Spread.Sheets.Search.SearchFlags.useWildCards; * var searchresult= spread.search(searchCondition); * var str ="[searchFoundFlag:"+ searchresult.searchFoundFlag+",\r\n foundSheetIndex:"+searchresult.foundSheetIndex+",foundRowIndex:" + searchresult.foundRowIndex+", * foundColumnIndex:"+searchresult.foundColumnIndex+", foundString:"+searchresult.foundString+"]"; * alert(str); * ``` */ constructor(); /** The index of the column at which to end. * @type {number} * @example * ```javascript * //This example searches a block of cells. * activeSheet.getCell(0,0).text("testSearch"); * activeSheet.getCell(5,4).text("testSearch"); * var searchCondition = new GC.Spread.Sheets.Search.SearchCondition(); * searchCondition.searchString = "testSearch"; * searchCondition.startSheetIndex = spread.getActiveSheetIndex(); * searchCondition.endSheetIndex = spread.getActiveSheetIndex(); * searchCondition.columnStart = 1; * searchCondition.columnEnd = 10; * searchCondition.rowStart = 1; * searchCondition.rowEnd = 10; * searchCondition.sheetArea = GC.Spread.Sheets.SheetArea.viewport; * searchCondition.searchOrder = GC.Spread.Sheets.Search.SearchOrder.nOrder; * searchCondition.searchTarget = GC.Spread.Sheets.Search.SearchFoundFlags.cellText; * searchCondition.searchFlags = GC.Spread.Sheets.Search.SearchFlags.blockRange; * var searchresult= spread.search(searchCondition); * var str ="[searchFoundFlag:"+ searchresult.searchFoundFlag+",\r\n foundSheetIndex:"+searchresult.foundSheetIndex+",foundRowIndex:" + searchresult.foundRowIndex+", foundColumnIndex:"+searchresult.foundColumnIndex+", foundString:"+searchresult.foundString+"]"; * alert(str); * ``` */ columnEnd: number; /** The index of the column at which to start. * @type {number} * @example * ```javascript * //This example searches a block of cells. * activeSheet.getCell(0,0).text("testSearch"); * activeSheet.getCell(5,4).text("testSearch"); * var searchCondition = new GC.Spread.Sheets.Search.SearchCondition(); * searchCondition.searchString = "testSearch"; * searchCondition.startSheetIndex = spread.getActiveSheetIndex(); * searchCondition.endSheetIndex = spread.getActiveSheetIndex(); * searchCondition.columnStart = 1; * searchCondition.columnEnd = 10; * searchCondition.rowStart = 1; * searchCondition.rowEnd = 10; * searchCondition.sheetArea = GC.Spread.Sheets.SheetArea.viewport; * searchCondition.searchOrder = GC.Spread.Sheets.Search.SearchOrder.nOrder; * searchCondition.searchTarget = GC.Spread.Sheets.Search.SearchFoundFlags.cellText; * searchCondition.searchFlags = GC.Spread.Sheets.Search.SearchFlags.blockRange; * var searchresult= spread.search(searchCondition); * var str ="[searchFoundFlag:"+ searchresult.searchFoundFlag+",\r\n foundSheetIndex:"+searchresult.foundSheetIndex+",foundRowIndex:" + searchresult.foundRowIndex+", foundColumnIndex:"+searchresult.foundColumnIndex+", foundString:"+searchresult.foundString+"]"; * alert(str); * ``` */ columnStart: number; /** Index of the sheet on which to end searching. * @type {number} * @example * ```javascript * activeSheet.getCell(5,4).text("testSearch"); * var searchCondition = new GC.Spread.Sheets.Search.SearchCondition(); * searchCondition.searchString = "testSearch"; * searchCondition.startSheetIndex = spread.getActiveSheetIndex(); * searchCondition.endSheetIndex = spread.getActiveSheetIndex(); * searchCondition.searchOrder = GC.Spread.Sheets.Search.SearchOrder.nOrder; * searchCondition.searchTarget = GC.Spread.Sheets.Search.SearchFoundFlags.cellText; * searchCondition.searchFlags = GC.Spread.Sheets.Search.SearchFlags.ignoreCase| GC.Spread.Sheets.Search.SearchFlags.useWildCards; * var searchresult= spread.search(searchCondition); * var str ="[searchFoundFlag:"+ searchresult.searchFoundFlag+",\r\n foundSheetIndex:"+searchresult.foundSheetIndex+",foundRowIndex:" + searchresult.foundRowIndex+", foundColumnIndex:"+searchresult.foundColumnIndex+", foundString:"+searchresult.foundString+"]"; * alert(str); * ``` */ endSheetIndex: number; /** The index of the row at which to end. * @type {number} * @example * ```javascript * //This example searches a block of cells. * activeSheet.getCell(0,0).text("testSearch"); * activeSheet.getCell(5,4).text("testSearch"); * var searchCondition = new GC.Spread.Sheets.Search.SearchCondition(); * searchCondition.searchString = "testSearch"; * searchCondition.startSheetIndex = spread.getActiveSheetIndex(); * searchCondition.endSheetIndex = spread.getActiveSheetIndex(); * searchCondition.columnStart = 1; * searchCondition.columnEnd = 10; * searchCondition.rowStart = 1; * searchCondition.rowEnd = 10; * searchCondition.sheetArea = GC.Spread.Sheets.SheetArea.viewport; * searchCondition.searchOrder = GC.Spread.Sheets.Search.SearchOrder.nOrder; * searchCondition.searchTarget = GC.Spread.Sheets.Search.SearchFoundFlags.cellText; * searchCondition.searchFlags = GC.Spread.Sheets.Search.SearchFlags.blockRange; * var searchresult= spread.search(searchCondition); * var str ="[searchFoundFlag:"+ searchresult.searchFoundFlag+",\r\n foundSheetIndex:"+searchresult.foundSheetIndex+",foundRowIndex:" + searchresult.foundRowIndex+", foundColumnIndex:"+searchresult.foundColumnIndex+", foundString:"+searchresult.foundString+"]"; * alert(str); * ``` */ rowEnd: number; /** The index of the row at which to start. * @type {number} * @example * ```javascript * //This example searches a block of cells. * activeSheet.getCell(0,0).text("testSearch"); * activeSheet.getCell(5,4).text("testSearch"); * var searchCondition = new GC.Spread.Sheets.Search.SearchCondition(); * searchCondition.searchString = "testSearch"; * searchCondition.startSheetIndex = spread.getActiveSheetIndex(); * searchCondition.endSheetIndex = spread.getActiveSheetIndex(); * searchCondition.columnStart = 1; * searchCondition.columnEnd = 10; * searchCondition.rowStart = 1; * searchCondition.rowEnd = 10; * searchCondition.sheetArea = GC.Spread.Sheets.SheetArea.viewport; * searchCondition.searchOrder = GC.Spread.Sheets.Search.SearchOrder.nOrder; * searchCondition.searchTarget = GC.Spread.Sheets.Search.SearchFoundFlags.cellText; * searchCondition.searchFlags = GC.Spread.Sheets.Search.SearchFlags.blockRange; * var searchresult= spread.search(searchCondition); * var str ="[searchFoundFlag:"+ searchresult.searchFoundFlag+",\r\n foundSheetIndex:"+searchresult.foundSheetIndex+",foundRowIndex:" + searchresult.foundRowIndex+", foundColumnIndex:"+searchresult.foundColumnIndex+", foundString:"+searchresult.foundString+"]"; * alert(str); * ``` */ rowStart: number; /** The enumeration that specifies the options of the search. * @type {GC.Spread.Sheets.Search.SearchFlags} * @example * ```javascript * //This example sets the searchFlags property. * activeSheet.getCell(5,4).text("testSearch"); * var searchCondition = new GC.Spread.Sheets.Search.SearchCondition(); * searchCondition.searchString = "testSearch"; * searchCondition.startSheetIndex = spread.getActiveSheetIndex(); * searchCondition.endSheetIndex = spread.getActiveSheetIndex(); * searchCondition.searchOrder = GC.Spread.Sheets.Search.SearchOrder.nOrder; * searchCondition.searchTarget = GC.Spread.Sheets.Search.SearchFoundFlags.cellText; * searchCondition.searchFlags = GC.Spread.Sheets.Search.SearchFlags.ignoreCase| GC.Spread.Sheets.Search.SearchFlags.useWildCards; * var searchresult= spread.search(searchCondition); * var str ="[searchFoundFlag:"+ searchresult.searchFoundFlag+",\r\n foundSheetIndex:"+searchresult.foundSheetIndex+",foundRowIndex:" + searchresult.foundRowIndex+", foundColumnIndex:"+searchresult.foundColumnIndex+", foundString:"+searchresult.foundString+"]"; * alert(str); * ``` */ searchFlags: GC.Spread.Sheets.Search.SearchFlags; /** The enumeration that specifies whether the search goes by coordinates of (column, row) or (row, column). * @type {GC.Spread.Sheets.Search.SearchOrder} * @example * ```javascript * //This example sets the searchFlags property. * activeSheet.getCell(5,4).text("testSearch"); * var searchCondition = new GC.Spread.Sheets.Search.SearchCondition(); * searchCondition.searchString = "testSearch"; * searchCondition.startSheetIndex = spread.getActiveSheetIndex(); * searchCondition.endSheetIndex = spread.getActiveSheetIndex(); * searchCondition.searchOrder = GC.Spread.Sheets.Search.SearchOrder.nOrder; * searchCondition.searchTarget = GC.Spread.Sheets.Search.SearchFoundFlags.cellText; * searchCondition.searchFlags = GC.Spread.Sheets.Search.SearchFlags.ignoreCase| GC.Spread.Sheets.Search.SearchFlags.useWildCards; * var searchresult= spread.search(searchCondition); * var str ="[searchFoundFlag:"+ searchresult.searchFoundFlag+",\r\n foundSheetIndex:"+searchresult.foundSheetIndex+",foundRowIndex:" + searchresult.foundRowIndex+", foundColumnIndex:"+searchresult.foundColumnIndex+", foundString:"+searchresult.foundString+"]"; * alert(str); * ``` */ searchOrder: GC.Spread.Sheets.Search.SearchOrder; /** The string for which to search. * @type {string} * @example * ```javascript * //This example sets the searchFlags property. * activeSheet.getCell(5,4).text("testSearch"); * var searchCondition = new GC.Spread.Sheets.Search.SearchCondition(); * searchCondition.searchString = "testSearch"; * searchCondition.startSheetIndex = spread.getActiveSheetIndex(); * searchCondition.endSheetIndex = spread.getActiveSheetIndex(); * searchCondition.searchOrder = GC.Spread.Sheets.Search.SearchOrder.nOrder; * searchCondition.searchTarget = GC.Spread.Sheets.Search.SearchFoundFlags.cellText; * searchCondition.searchFlags = GC.Spread.Sheets.Search.SearchFlags.ignoreCase| GC.Spread.Sheets.Search.SearchFlags.useWildCards; * var searchresult= spread.search(searchCondition); * var str ="[searchFoundFlag:"+ searchresult.searchFoundFlag+",\r\n foundSheetIndex:"+searchresult.foundSheetIndex+",foundRowIndex:" + searchresult.foundRowIndex+", foundColumnIndex:"+searchresult.foundColumnIndex+", foundString:"+searchresult.foundString+"]"; * alert(str); * ``` */ searchString: string; /** The enumeration that indicates whether the search includes the content in the cell notes, tags, or text. * @type {GC.Spread.Sheets.Search.SearchFoundFlags} * @example * ```javascript * //This example sets the searchFlags property. * activeSheet.getCell(5,4).text("testSearch"); * var searchCondition = new GC.Spread.Sheets.Search.SearchCondition(); * searchCondition.searchString = "testSearch"; * searchCondition.startSheetIndex = spread.getActiveSheetIndex(); * searchCondition.endSheetIndex = spread.getActiveSheetIndex(); * searchCondition.searchOrder = GC.Spread.Sheets.Search.SearchOrder.nOrder; * searchCondition.searchTarget = GC.Spread.Sheets.Search.SearchFoundFlags.cellText; * searchCondition.searchFlags = GC.Spread.Sheets.Search.SearchFlags.ignoreCase| GC.Spread.Sheets.Search.SearchFlags.useWildCards; * var searchresult= spread.search(searchCondition); * var str ="[searchFoundFlag:"+ searchresult.searchFoundFlag+",\r\n foundSheetIndex:"+searchresult.foundSheetIndex+",foundRowIndex:" + searchresult.foundRowIndex+", foundColumnIndex:"+searchresult.foundColumnIndex+", foundString:"+searchresult.foundString+"]"; * alert(str); * ``` */ searchTarget: GC.Spread.Sheets.Search.SearchFoundFlags; /** The area of the sheet for search. * @type {GC.Spread.Sheets.SheetArea} * @example * ```javascript * //This example searches a block of cells. * activeSheet.getCell(0,0).text("testSearch"); * activeSheet.getCell(5,4).text("testSearch"); * var searchCondition = new GC.Spread.Sheets.Search.SearchCondition(); * searchCondition.searchString = "testSearch"; * searchCondition.startSheetIndex = spread.getActiveSheetIndex(); * searchCondition.endSheetIndex = spread.getActiveSheetIndex(); * searchCondition.columnStart = 1; * searchCondition.columnEnd = 10; * searchCondition.rowStart = 1; * searchCondition.rowEnd = 10; * searchCondition.sheetArea = GC.Spread.Sheets.SheetArea.viewport; * searchCondition.searchOrder = GC.Spread.Sheets.Search.SearchOrder.nOrder; * searchCondition.searchTarget = GC.Spread.Sheets.Search.SearchFoundFlags.cellText; * searchCondition.searchFlags = GC.Spread.Sheets.Search.SearchFlags.blockRange; * var searchresult= spread.search(searchCondition); * var str ="[searchFoundFlag:"+ searchresult.searchFoundFlag+",\r\n foundSheetIndex:"+searchresult.foundSheetIndex+",foundRowIndex:" + searchresult.foundRowIndex+", foundColumnIndex:"+searchresult.foundColumnIndex+", foundString:"+searchresult.foundString+"]"; * alert(str); * ``` */ sheetArea: GC.Spread.Sheets.SheetArea; /** Index of the sheet on which to start searching. * @type {number} * @example * ```javascript * //This example searches a block of cells. * activeSheet.getCell(0,0).text("testSearch"); * activeSheet.getCell(5,4).text("testSearch"); * var searchCondition = new GC.Spread.Sheets.Search.SearchCondition(); * searchCondition.searchString = "testSearch"; * searchCondition.startSheetIndex = spread.getActiveSheetIndex(); * searchCondition.endSheetIndex = spread.getActiveSheetIndex(); * searchCondition.columnStart = 1; * searchCondition.columnEnd = 10; * searchCondition.rowStart = 1; * searchCondition.rowEnd = 10; * searchCondition.sheetArea = GC.Spread.Sheets.SheetArea.viewport; * searchCondition.searchOrder = GC.Spread.Sheets.Search.SearchOrder.nOrder; * searchCondition.searchTarget = GC.Spread.Sheets.Search.SearchFoundFlags.cellText; * searchCondition.searchFlags = GC.Spread.Sheets.Search.SearchFlags.blockRange; * var searchresult= spread.search(searchCondition); * var str ="[searchFoundFlag:"+ searchresult.searchFoundFlag+",\r\n foundSheetIndex:"+searchresult.foundSheetIndex+",foundRowIndex:" + searchresult.foundRowIndex+", foundColumnIndex:"+searchresult.foundColumnIndex+", foundString:"+searchresult.foundString+"]"; * alert(str); * ``` */ startSheetIndex: number; } export class SearchResult{ /** * Defines the search result. * @class */ constructor(); /** The index of the column at which a match is found. * @type {number} * @example * ```javascript * //This example gets the foundColumnIndex property. * activeSheet.getCell(5,4).text("testSearch"); * var searchCondition = new GC.Spread.Sheets.Search.SearchCondition(); * searchCondition.searchString = "testSearch"; * searchCondition.startSheetIndex = spread.getActiveSheetIndex(); * searchCondition.endSheetIndex = spread.getActiveSheetIndex(); * searchCondition.searchOrder = GC.Spread.Sheets.Search.SearchOrder.nOrder; * searchCondition.searchTarget = GC.Spread.Sheets.Search.SearchFoundFlags.cellText; * searchCondition.searchFlags = GC.Spread.Sheets.Search.SearchFlags.ignoreCase| GC.Spread.Sheets.Search.SearchFlags.useWildCards; * var searchresult= spread.search(searchCondition); * var str ="[searchFoundFlag:"+ searchresult.searchFoundFlag+",\r\n foundSheetIndex:"+searchresult.foundSheetIndex+",foundRowIndex:" + searchresult.foundRowIndex+", foundColumnIndex:"+searchresult.foundColumnIndex+", foundString:"+searchresult.foundString+"]"; * alert(str); * ``` */ foundColumnIndex: number; /** The index of the row at which a match is found. * @type {number} * @example * ```javascript * //This example gets the foundColumnIndex property. * activeSheet.getCell(5,4).text("testSearch"); * var searchCondition = new GC.Spread.Sheets.Search.SearchCondition(); * searchCondition.searchString = "testSearch"; * searchCondition.startSheetIndex = spread.getActiveSheetIndex(); * searchCondition.endSheetIndex = spread.getActiveSheetIndex(); * searchCondition.searchOrder = GC.Spread.Sheets.Search.SearchOrder.nOrder; * searchCondition.searchTarget = GC.Spread.Sheets.Search.SearchFoundFlags.cellText; * searchCondition.searchFlags = GC.Spread.Sheets.Search.SearchFlags.ignoreCase| GC.Spread.Sheets.Search.SearchFlags.useWildCards; * var searchresult= spread.search(searchCondition); * var str ="[searchFoundFlag:"+ searchresult.searchFoundFlag+",\r\n foundSheetIndex:"+searchresult.foundSheetIndex+",foundRowIndex:" + searchresult.foundRowIndex+", foundColumnIndex:"+searchresult.foundColumnIndex+", foundString:"+searchresult.foundString+"]"; * alert(str); * ``` */ foundRowIndex: number; /** The index of the sheet in which a match is found. * @type {number} * @example * ```javascript * //This example gets the foundColumnIndex property. * activeSheet.getCell(5,4).text("testSearch"); * var searchCondition = new GC.Spread.Sheets.Search.SearchCondition(); * searchCondition.searchString = "testSearch"; * searchCondition.startSheetIndex = spread.getActiveSheetIndex(); * searchCondition.endSheetIndex = spread.getActiveSheetIndex(); * searchCondition.searchOrder = GC.Spread.Sheets.Search.SearchOrder.nOrder; * searchCondition.searchTarget = GC.Spread.Sheets.Search.SearchFoundFlags.cellText; * searchCondition.searchFlags = GC.Spread.Sheets.Search.SearchFlags.ignoreCase| GC.Spread.Sheets.Search.SearchFlags.useWildCards; * var searchresult= spread.search(searchCondition); * var str ="[searchFoundFlag:"+ searchresult.searchFoundFlag+",\r\n foundSheetIndex:"+searchresult.foundSheetIndex+",foundRowIndex:" + searchresult.foundRowIndex+", foundColumnIndex:"+searchresult.foundColumnIndex+", foundString:"+searchresult.foundString+"]"; * alert(str); * ``` */ foundSheetIndex: number; /** The found string. * @type {object} * @example * ```javascript * //This example gets the foundColumnIndex property. * activeSheet.getCell(5,4).text("testSearch"); * var searchCondition = new GC.Spread.Sheets.Search.SearchCondition(); * searchCondition.searchString = "testSearch"; * searchCondition.startSheetIndex = spread.getActiveSheetIndex(); * searchCondition.endSheetIndex = spread.getActiveSheetIndex(); * searchCondition.searchOrder = GC.Spread.Sheets.Search.SearchOrder.nOrder; * searchCondition.searchTarget = GC.Spread.Sheets.Search.SearchFoundFlags.cellText; * searchCondition.searchFlags = GC.Spread.Sheets.Search.SearchFlags.ignoreCase| GC.Spread.Sheets.Search.SearchFlags.useWildCards; * var searchresult= spread.search(searchCondition); * var str ="[searchFoundFlag:"+ searchresult.searchFoundFlag+",\r\n foundSheetIndex:"+searchresult.foundSheetIndex+",foundRowIndex:" + searchresult.foundRowIndex+", foundColumnIndex:"+searchresult.foundColumnIndex+", foundString:"+searchresult.foundString+"]"; * alert(str); * ``` */ foundString: Object; /** * An enumeration that specifies what is matched. * @type {GC.Spread.Sheets.Search.SearchFoundFlags} * @example * ```javascript * //This example gets the foundColumnIndex property. * activeSheet.getCell(5,4).text("testSearch"); * var searchCondition = new GC.Spread.Sheets.Search.SearchCondition(); * searchCondition.searchString = "testSearch"; * searchCondition.startSheetIndex = spread.getActiveSheetIndex(); * searchCondition.endSheetIndex = spread.getActiveSheetIndex(); * searchCondition.searchOrder = GC.Spread.Sheets.Search.SearchOrder.nOrder; * searchCondition.searchTarget = GC.Spread.Sheets.Search.SearchFoundFlags.cellText; * searchCondition.searchFlags = GC.Spread.Sheets.Search.SearchFlags.ignoreCase| GC.Spread.Sheets.Search.SearchFlags.useWildCards; * var searchresult= spread.search(searchCondition); * var str ="[searchFoundFlag:"+ searchresult.searchFoundFlag+",\r\n foundSheetIndex:"+searchresult.foundSheetIndex+",foundRowIndex:" + searchresult.foundRowIndex+", foundColumnIndex:"+searchresult.foundColumnIndex+", foundString:"+searchresult.foundString+"]"; * alert(str); * ``` */ searchFoundFlag: GC.Spread.Sheets.Search.SearchFoundFlags; } } module Shapes{ export interface IBoundingRect{ left: number; right: number; top: number; bottom: number; } export interface ICheckBoxFormControlOptions{ cellLink: string; threeDShading: boolean; } export interface IComboBoxFormControlOptions{ inputRange: string; cellLink: string; dropDownLines: number; threeDShading: boolean; } export interface IControlInfo{ /** * A number value or a formula string (starts with =) will get a number value */ x: number | string; /** * A number value or a formula string (starts with =) will get a number value */ y: number | string; /** * 0 if can do adjust in x (horizontal), otherwise 1 */ xBehavior: 0 | 1; /** * 0 if can do adjust in y (vertical), otherwise 1 */ yBehavior: 0 | 1; } export interface IGradientColorStopOption{ color: string; position: number; transparency?: number; brightness?: number; } export interface IGradientFillOption{ type: GC.Spread.Sheets.Shapes.GradientFillType; stops: GC.Spread.Sheets.Shapes.IGradientColorStopOption[]; angle?: number; direction?: GC.Spread.Sheets.Shapes.LinearGradientFillDirection | GC.Spread.Sheets.Shapes.RadialGradientFillDirection; } export interface IGroupBoxFormControlOptions{ threeDShading: boolean; } export interface IHitTestAdjustmentHandle{ index: number; vertical?: boolean; } export interface IHitTestResizeHandle{ type: GC.Spread.Sheets.Shapes.ResizeHandleType; } export interface IListBoxFormControlOptions{ inputRange: string; cellLink: string; selectionType: GC.Spread.Sheets.Shapes.ListBoxSelectionType; threeDShading: boolean; } export interface IOptionButtonFormControlOptions{ cellLink: string; threeDShading: boolean; } export interface IPictureFillOption{ src: string; tilePictureAsTexture?: false; transparency?: number; offsetLeft?: number; offsetRight?: number; offsetTop?: number; offsetBottom?: number; } export interface IPictureFormat{ transparency?: number; crop?: GC.Spread.Sheets.Shapes.IBoundingRect; brightness?: number; contrast?: number; grayscale?: boolean; duotone?: { color1: string, color2: string }; blackAndWhite?: number; } export interface IPointInfo{ /** * A number value or a formula string (starts with =) will get a number value */ x: number | string; /** * A number value or a formula string (starts with =) will get a number value */ y: number | string; } export interface IScrollBarFormControlOptions{ minValue: number; maxValue: number; step: number; pageChange: number; cellLink: string; } export interface IShapeBorder{ color: string; lineStyle: GC.Spread.Sheets.Shapes.PresetLineDashStyle; width: number; capType: GC.Spread.Sheets.Shapes.LineCapStyle; joinType: GC.Spread.Sheets.Shapes.LineJoinStyle; compoundType: GC.Spread.Sheets.Shapes.CompoundType; } export interface IShapeConnector{ name: string; index: number; shape?: GC.Spread.Sheets.Shapes.Shape; } export interface IShapeFill{ /** * The fill type, it is ShapeFillType enum or formula(starts with =) */ type?: GC.Spread.Sheets.Shapes.ShapeFillType | string; /** * The background color, it is a color string or formula(starts with =). */ color?: string; /** * The background color transparency, it is a number that is between 0 and 1 or formula(starts with =) */ transparency?: number | string; } export interface IShapeFillOption{ type?: GC.Spread.Sheets.Shapes.ShapeFillType; color?: string; /** * 0 ~ 1 */ transparency?: number; } export interface IShapeGradientFill{ type: GC.Spread.Sheets.Shapes.GradientFillType | string; stops: GC.Spread.Sheets.Shapes.IShapeGradientFillColorStop[]; angle?: number | string; direction?: GC.Spread.Sheets.Shapes.LinearGradientFillDirection | GC.Spread.Sheets.Shapes.RadialGradientFillDirection | string; } export interface IShapeGradientFillColorStop{ color: string; position: number | string; transparency?: number | string; brightness?: number | string; } export interface IShapeLine{ /** * The line color, it is a color string or formula(starts with =). */ color?: string; /** * The line style, it is PresetLineDashStyle enum or formula(starts with =). */ lineStyle?: GC.Spread.Sheets.Shapes.PresetLineDashStyle | string; /** * The line width, it is a number or formula(starts with =). */ width?: number | string; /** * The line cap type, it is LineCapStyle enum or formula(starts with =). */ capType?: GC.Spread.Sheets.Shapes.LineCapStyle | string; /** * The line join type, it is LineJoinStyle enum or formula(starts with =). */ joinType?: GC.Spread.Sheets.Shapes.LineJoinStyle | string; /** * The line compound type, it is CompoundType enum or formula(starts with =). */ compoundType?: GC.Spread.Sheets.Shapes.CompoundType | string; /** * The line color transparency, it is a number that is between 0 and 1 or formula(starts with =). */ transparency?: number | string; /** * The begin arrowhead style, it is ArrowheadStyle enum. */ beginArrowheadStyle?: GC.Spread.Sheets.Shapes.ArrowheadStyle; /** * The begin arrowhead width, it is ArrowheadWidth enum. */ beginArrowheadWidth?: GC.Spread.Sheets.Shapes.ArrowheadWidth; /** * The begin arrowhead length, it is ArrowheadLength enum. */ beginArrowheadLength?: GC.Spread.Sheets.Shapes.ArrowheadLength; /** * The end arrowhead style, it is ArrowheadStyle enum. */ endArrowheadStyle?: GC.Spread.Sheets.Shapes.ArrowheadStyle; /** * The end arrowhead width, it is ArrowheadWidth enum. */ endArrowheadWidth?: GC.Spread.Sheets.Shapes.ArrowheadWidth; /** * The end arrowhead length, it is ArrowheadLength enum. */ endArrowheadLength?: GC.Spread.Sheets.Shapes.ArrowheadLength; } export interface IShapeLineArrowConfig{ type: GC.Spread.Sheets.Shapes.ArrowheadStyle; widthType: GC.Spread.Sheets.Shapes.ArrowheadWidth; lengthType: GC.Spread.Sheets.Shapes.ArrowheadLength; } export interface IShapeLineArrowOption{ beginArrow?: GC.Spread.Sheets.Shapes.IShapeLineArrowConfig; endArrow?: GC.Spread.Sheets.Shapes.IShapeLineArrowConfig; } export interface IShapeModel{ id?: string; /** * A number value or a formula string (starts with =) will get a number value */ left?: number | string; /** * A number value or a formula string (starts with =) will get a number value */ top?: number | string; /** * A number value or a formula string (starts with =) will get a number value */ width?: number | string; /** * A number value or a formula string (starts with =) will get a number value */ height?: number | string; /** * A number value or a formula string (starts with =) will get a number value */ angle?: number | string; options?: GC.Spread.Sheets.Shapes.IShapeOptions; path: string[][]; controls?: GC.Spread.Sheets.Shapes.IControlInfo[]; connectionPoints?: GC.Spread.Sheets.Shapes.IPointInfo[]; /** * a key-value pairs object, value can be a number or formula string (starts with =), can be referred by variables[key] in formula */ variables?: Object; /** * specify the rectangle for shape text */ textRect?: {left: number, top: number, bottom: number, right: number }; } export interface IShapeOptions{ fill?: GC.Spread.Sheets.Shapes.IShapeFillOption | GC.Spread.Sheets.Shapes.IGradientFillOption | GC.Spread.Sheets.Shapes.IPictureFillOption | GC.Spread.Sheets.Shapes.ITextureFillOption; textFormatOptions?: GC.Spread.Sheets.Shapes.IShapeTextFormatOption; stroke?: GC.Spread.Sheets.Shapes.IShapeStrokeOption; endPoints?: GC.Spread.Sheets.Shapes.IShapeLineArrowOption } export interface IShapePictureFill{ src: string; tilePictureAsTexture?: false | string; transparency?: number | string; offsetLeft?: number | string; offsetRight?: number | string; offsetTop?: number | string; offsetBottom?: number | string; } export interface IShapeStrokeOption{ /** * 0: none, 1: solid */ type: 0 | 1; color?: string; width?: number; /** * 0: round, 1: square, 2: butt */ capType?: 0 | 1 | 2; /** * 0: round, 1: miter, 2: bevel */ joinType?: 0 | 1 | 2; /** * 0: simple, 1: double, 2: thickThin, 3: thinThick, 4: triple */ compoundType?: 0 | 1 | 2 | 3 | 4; lineStyle?: GC.Spread.Sheets.Shapes.PresetLineDashStyle; } export interface IShapeTextEffect{ /** * The font color, it is a color string or formula(starts with =). */ color?: string; /** * The font color transparency, it is a number that is between 0 and 1 or formula(starts with =). */ transparency?: number | string; /** * The font, it is a font string or formula(starts with =). */ font?: string; } export interface IShapeTextFormatOption{ text?: string; fill?: GC.Spread.Sheets.Shapes.IShapeFillOption; /** * css font string */ font?: string; margins?: [number, number, number, number]; textDirection?: GC.Spread.Sheets.Shapes.TextDirection; /** * 0: left, 1: center, 2: right */ horizontalAlignment?: 0 | 1 | 2; /** * 0: top, 1: center, 2: bottom */ verticalAlignment?: 0 | 1 | 2; wrapTextInShape?: boolean; allowTextToOverflowShape?: boolean; resizeToFitText?: boolean; } export interface IShapeTextFrame{ /** * The text vertical alignment, it is VerticalAlign enum or formula(starts with =). */ vAlign?: GC.Spread.Sheets.VerticalAlign | string; /** * The text horizontal alignment, it is HorizontalAlign enum or formula(starts with =). */ hAlign?: GC.Spread.Sheets.HorizontalAlign | string; /** * Resize the shape to fit text size. */ resizeToFitText?: boolean | string; /** * The text direction, it is TextDirection enum or formula(starts with =). */ textDirection?: GC.Spread.Sheets.Shapes.TextDirection | string; } export interface IShapeTextureFill{ src: string; tilePictureAsTexture: true | string; transparency?: number | string; offsetX?: number | string; offsetY?: number | string; scaleX?: number | string; scaleY?: number | string; alignment?: GC.Spread.Sheets.Shapes.TextureFillAlignment | string; mirrorType?: GC.Spread.Sheets.Shapes.TextureFillMirrorType | string; } export interface ISpinButtonFormControlOptions{ minValue: number; maxValue: number; step: number; cellLink: string; threeDShading: boolean; } export interface ITextureFillOption{ src: string; tilePictureAsTexture: true; transparency?: number; offsetX?: number; offsetY?: number; scaleX?: number; scaleY?: number; alignment?: GC.Spread.Sheets.Shapes.TextureFillAlignment; mirrorType?: GC.Spread.Sheets.Shapes.TextureFillMirrorType; } /** * @typedef GC.Spread.Sheets.Shapes.IFormControlShapeOptions * @type {IOptionButtonFormControlOptions|ICheckBoxFormControlOptions|ISpinButtonFormControlOptions|IScrollBarFormControlOptions|IListBoxFormControlOptions|IComboBoxFormControlOptions|IGroupBoxFormControlOptions|{}} * @description The form control shape options type. */ export type IFormControlShapeOptions = IOptionButtonFormControlOptions|ICheckBoxFormControlOptions|ISpinButtonFormControlOptions|IScrollBarFormControlOptions|IListBoxFormControlOptions|IComboBoxFormControlOptions|IGroupBoxFormControlOptions|{} /** * @typedef GC.Spread.Sheets.Shapes.IFormControlShapeValue * @type {number|string|boolean|undefined} * @description The form control shape value type. */ export type IFormControlShapeValue = number|string|boolean|undefined /** * Specifies the length of the arrowhead at the end of a line. * @enum {number} */ export enum ArrowheadLength{ /** * Short */ short= 0, /** * Medium */ medium= 1, /** * Long */ long= 2 } /** * Specifies the style of the arrowhead at the end of a line. * @enum {number} */ export enum ArrowheadStyle{ /** * No arrowhead */ none= 0, /** * Triangular */ triangle= 1, /** * Stealth-shaped */ stealth= 2, /** * Diamond-shaped */ diamond= 3, /** * Oval-shaped */ oval= 4, /** * Open */ open= 5 } /** * Specifies the width of the arrowhead at the end of a line. * @enum {number} */ export enum ArrowheadWidth{ /** * Narrow */ narrow= 0, /** * Medium */ medium= 1, /** * Wide */ wide= 2 } /** * Defines all the types of build-in shapes. * @enum {number} */ export enum AutoShapeType{ /** * Specifies a rectangle. */ rectangle= 1, /** * Specifies a parallelogram. */ parallelogram= 2, /** * Specifies a trapezoid. */ trapezoid= 3, /** * Specifies a diamond. */ diamond= 4, /** * Specifies a rounded rectangle. */ roundedRectangle= 5, /** * Specifies an octagon. */ octagon= 6, /** * Specifies an isosceles triangle. */ isoscelesTriangle= 7, /** * Specifies a right triangle. */ rightTriangle= 8, /** * Specifies an oval. */ oval= 9, /** * Specifies a hexagon. */ hexagon= 10, /** * Specifies a cross. */ cross= 11, /** * Specifies a pentagon. */ regularPentagon= 12, /** * Specifies a can. */ can= 13, /** * Specifies a cube. */ cube= 14, /** * Specifies a bevel. */ bevel= 15, /** * Specifies a folded corner. */ foldedCorner= 16, /** * Specifies a smiley face. */ smileyFace= 17, /** * Specifies a donut. */ donut= 18, /** * Specifies the "No" symbol. */ noSymbol= 19, /** * Specifies a block arc. */ blockArc= 20, /** * Specifies a heart. */ heart= 21, /** * Specifies a lightning bolt. */ lightningBolt= 22, /** * Specifies a sun. */ sun= 23, /** * Specifies a moon. */ moon= 24, /** * Specifies an arc. */ arc= 25, /** * Specifies a double bracket. */ doubleBracket= 26, /** * Specifies a double brace. */ doubleBrace= 27, /** * Specifies a plaque. */ plaque= 28, /** * Specifies the left bracket. */ leftBracket= 29, /** * Specifies the right bracket. */ rightBracket= 30, /** * Specifies the left brace. */ leftBrace= 31, /** * Specifies the right brace. */ rightBrace= 32, /** * Specifies a block arrow that points right. */ rightArrow= 33, /** * Specifies a block arrow that points left. */ leftArrow= 34, /** * Specifies a block arrow that points up. */ upArrow= 35, /** * Specifies a block arrow that points down. */ downArrow= 36, /** * Specifies a block arrow with arrowheads that point both left and right. */ leftRightArrow= 37, /** * Specifies a block arrow that points up and down. */ upDownArrow= 38, /** * Specifies block arrows that point up, down, left, and right. */ quadArrow= 39, /** * Specifies a block arrow with arrowheads that point left, right, and up. */ leftRightUpArrow= 40, /** * Specifies a block arrow that follows a curved 90-degree angle. */ bentArrow= 41, /** * Specifies a block arrow forming a U shape. */ uTurnArrow= 42, /** * Specifies a block arrow with arrowheads that point left and up. */ leftUpArrow= 43, /** * Specifies a block arrow that follows a sharp 90-degree angle. Points up by default. */ bentUpArrow= 44, /** * Specifies a block arrow that curves right */ curvedRightArrow= 45, /** * Specifies a block arrow that curves left. */ curvedLeftArrow= 46, /** * Specifies a block arrow that curves up. */ curvedUpArrow= 47, /** * Specifies a block arrow that curves down. */ curvedDownArrow= 48, /** * Specifies a block arrow that points right with stripes at the tail. */ stripedRightArrow= 49, /** * Specifies a notched block arrow that points right */ notchedRightArrow= 50, /** * Specifies a pentagon. */ pentagon= 51, /** * Specifies a chevron. */ chevron= 52, /** * Specifies a callout with an arrow that points right. */ rightArrowCallout= 53, /** * Specifies a callout with an arrow that points left. */ leftArrowCallout= 54, /** * Specifies a callout with an arrow that points up. */ upArrowCallout= 55, /** * Specifies a callout with an arrow that points down. */ downArrowCallout= 56, /** * Specifies a callout with arrowheads that point both left and right. */ leftRightArrowCallout= 57, /** * Specifies a callout with arrows that point up and down. */ upDownArrowCallout= 58, /** * Specifies a callout with arrows that point up, down, left, and right. */ quadArrowCallout= 59, /** * Specifies a block arrow that follows a curved 180-degree angle. */ circularArrow= 60, /** * Specifies a process flowchart symbol. */ flowchartProcess= 61, /** * Specifies an alternate process flowchart symbol. */ flowchartAlternateProcess= 62, /** * Specifies a decision flowchart symbol. */ flowchartDecision= 63, /** * Specifies a data flowchart symbol. */ flowchartData= 64, /** * Specifies a predefined process flowchart symbol. */ flowchartPredefinedProcess= 65, /** * Specifies an internal storage flowchart symbol. */ flowchartInternalStorage= 66, /** * Specifies a document flowchart symbol. */ flowchartDocument= 67, /** * Specifies a multi-document flowchart symbol. */ flowchartMultidocument= 68, /** * Specifies a terminator flowchart symbol. */ flowchartTerminator= 69, /** * Specifies a preparation flowchart symbol. */ flowchartPreparation= 70, /** * Specifies a manual input flowchart symbol. */ flowchartManualInput= 71, /** * Specifies a manual operation flowchart symbol. */ flowchartManualOperation= 72, /** * Specifies a connector flowchart symbol. */ flowchartConnector= 73, /** * Specifies an off-page connector flowchart symbol. */ flowchartOffpageConnector= 74, /** * Specifies a card flowchart symbol. */ flowchartCard= 75, /** * Specifies a punched tape flowchart symbol. */ flowchartPunchedTape= 76, /** * Specifies a summing junction flowchart symbol. */ flowchartSummingJunction= 77, /** * Specifies the "Or" flowchart symbol. */ flowchartOr= 78, /** * Specifies a collate flowchart symbol. */ flowchartCollate= 79, /** * Specifies a sort flowchart symbol. */ flowchartSort= 80, /** * Specifies an extract flowchart symbol. */ flowchartExtract= 81, /** * Specifies a merge flowchart symbol. */ flowchartMerge= 82, /** * Specifies a stored data flowchart symbol. */ flowchartStoredData= 83, /** * Specifies a delay flowchart symbol. */ flowchartDelay= 84, /** * Specifies a sequential access storage flowchart symbol. */ flowchartSequentialAccessStorage= 85, /** * Specifies a magnetic disk flowchart symbol. */ flowchartMagneticDisk= 86, /** * Specifies a direct access storage flowchart symbol. */ flowchartDirectAccessStorage= 87, /** * Specifies a display flowchart symbol. */ flowchartDisplay= 88, /** * Specifies an explosion. */ explosion1= 89, /** * Specifies an explosion. */ explosion2= 90, /** * Specifies a 4-point star. */ shape4pointStar= 91, /** * Specifies a 5-point star. */ shape5pointStar= 92, /** * Specifies an 8-point star. */ shape8pointStar= 93, /** * Specifies a 16-point star. */ shape16pointStar= 94, /** * Specifies a 24-point star. */ shape24pointStar= 95, /** * Specifies a 32-point star. */ shape32pointStar= 96, /** * Specifies a ribbon banner with a center area above the ribbon ends. */ upRibbon= 97, /** * Specifies a ribbon banner with a center area below the ribbon ends. */ downRibbon= 98, /** * Specifies a ribbon banner that curves up. */ curvedUpRibbon= 99, /** * Specifies a ribbon banner that curves down. */ curvedDownRibbon= 100, /** * Specifies a vertical scroll shape. */ verticalScroll= 101, /** * Specifies a horizontal scroll shape. */ horizontalScroll= 102, /** * Specifies a wave shape. */ wave= 103, /** * Specifies a double wave shape. */ doubleWave= 104, /** * Specifies a rectangular callout. */ rectangularCallout= 105, /** * Specifies a rounded rectangle-shaped callout. */ roundedRectangularCallout= 106, /** * Specifies an oval-shaped callout. */ ovalCallout= 107, /** * Specifies a cloud callout. */ cloudCallout= 108, /** * Specifies a callout with border and horizontal callout lines. */ lineCallout1= 109, /** * Specifies a callout with a diagonal straight line. */ lineCallout2= 110, /** * Specifies a callout with an angled line. */ lineCallout3= 111, /** * Specifies a callout with callout line segments forming a U-shape. */ lineCallout4= 112, /** * Specifies a callout with a horizontal accent bar. */ lineCallout1AccentBar= 113, /** * Specifies a callout with a diagonal callout line and accent bar. */ lineCallout2AccentBar= 114, /** * Specifies a callout with an angled callout line and accent bar. */ lineCallout3AccentBar= 115, /** * Specifies a callout with an accent bar and callout line segments forming a U-shape. */ lineCallout4AccentBar= 116, /** * Specifies a callout with a horizontal line. */ lineCallout1NoBorder= 117, /** * Specifies a callout with no border and a diagonal callout line. */ lineCallout2NoBorder= 118, /** * Specifies a callout with no border and an angled callout line. */ lineCallout3NoBorder= 119, /** * Specifies a callout with no border and callout line segments forming a U-shape. */ lineCallout4NoBorder= 120, /** * Specifies a callout with a border and horizontal accent bar. */ lineCallout1BorderandAccentBar= 121, /** * Specifies a callout with border, diagonal straight line, and accent bar. */ lineCallout2BorderandAccentBar= 122, /** * Specifies a callout with border, angled callout line, and accent bar. */ lineCallout3BorderandAccentBar= 123, /** * Specifies a callout with border, accent bar, and callout line segments forming a U-shape. */ lineCallout4BorderandAccentBar= 124, /** * Specifies a button with no default picture or text. Supports mouse-click and mouse-over actions. */ actionButtonCustom= 125, /** * Specifies the Home button. Supports mouse-click and mouse-over actions. */ actionButtonHome= 126, /** * Specifies the Help button. Supports mouse-click and mouse-over actions. */ actionButtonHelp= 127, /** * Specifies the Information button. Supports mouse-click and mouse-over actions. */ actionButtonInformation= 128, /** * Specifies the Back or Previous button. Supports mouse-click and mouse-over actions. */ actionButtonBackorPrevious= 129, /** * Specifies the Forward or Next button. Supports mouse-click and mouse-over actions. */ actionButtonForwardorNext= 130, /** * Specifies the Beginning button. Supports mouse-click and mouse-over actions. */ actionButtonBeginning= 131, /** * Specifies the End button. Supports mouse-click and mouse-over actions. */ actionButtonEnd= 132, /** * Specifies the Return button. Supports mouse-click and mouse-over actions. */ actionButtonReturn= 133, /** * Specifies the Document button. Supports mouse-click and mouse-over actions. */ actionButtonDocument= 134, /** * Specifies the Sound button. Supports mouse-click and mouse-over actions. */ actionButtonSound= 135, /** * Specifies the Movie button. Supports mouse-click and mouse-over actions. */ actionButtonMovie= 136, /** * Specifies a balloon. */ balloon= 137, /** * Specifies an offline storage flowchart symbol. */ flowchartOfflineStorage= 138, /** * Specifies a ribbon with an arrow at both ends. */ leftRightRibbon= 139, /** * Specifies a rectangle with two triangle-shapes removed; a diagonal stripe. */ diagonalStripe= 140, /** * Specifies a circle (\u2018pie\u2019) with a portion missing. */ pie= 141, /** * Specifies a trapezoid with asymmetrical non-parallel sides. */ nonIsoscelesTrapezoid= 142, /** * Specifies a decagon. */ decagon= 143, /** * Specifies a heptagon. */ heptagon= 144, /** * Specifies a dodecagon */ dodecagon= 145, /** * Specifies a 6-point star. */ star6Point= 146, /** * Specifies a 7-point star. */ star7Point= 147, /** * Specifies a 10-point star. */ star10Point= 148, /** * Specifies a 12-point star. */ star12Point= 149, /** * Specifies a rectangle with one rounded corner. */ round1Rectangle= 150, /** * Specifies a rectangle with two-rounded corners that share a side. */ round2SameRectangle= 151, /** * Specifies a rectangle with two rounded corners, diagonally-opposed. */ round2DiagRectangle= 152, /** * Specifies a rectangle with one snipped corner and one rounded corner. */ snipRoundRectangle= 153, /** * Specifies a rectangle with one snipped corner. */ snip1Rectangle= 154, /** * Specifies a rectangle with two snipped corners that share a side. */ snip2SameRectangle= 155, /** * Specifies a rectangle with two snipped corners, diagonally-opposed. */ snip2DiagRectangle= 156, /** * Specifies a rectangular picture frame. */ frame= 157, /** * Specifies half of a rectangular picture frame. */ halfFrame= 158, /** * Specifies a water droplet. */ tear= 159, /** * Specifies a circle with a line connecting two points on the perimeter through the interior of the circle; a circle with a chord. */ chord= 160, /** * Specifies a rectangle with a rectangular-shaped hole. */ corner= 161, /** * Specifies the addition symbol \u2018+\u2019. */ mathPlus= 162, /** * Specifies the subtraction symbol \u2018-\u2018. */ mathMinus= 163, /** * Specifies the multiplication symbol \u2018x\u2019. */ mathMultiply= 164, /** * Specifies the division symbol \u2018\xf7\u2019. */ mathDivide= 165, /** * Specifies the equivalence symbol \u2018=\u2019. */ mathEqual= 166, /** * Specifies the non-equivalence symbol \u2018\u2260\u2019. */ mathNotEqual= 167, /** * Specifies four right triangles aligning along a rectangular path with four \u2018snipped\u2019 corners. */ cornerTabs= 168, /** * Specifies four small squares that define a rectangular shape. */ squareTabs= 169, /** * Specifies four quarter-circles defining a rectangular shape. */ plaqueTabs= 170, /** * Specifies a gear with six teeth. */ gear6= 171, /** * Specifies a gear with nine teeth */ gear9= 172, /** * Specifies a funnel. */ funnel= 173, /** * Specifies a quarter of a circular shape. */ pieWedge= 174, /** * Specifies a circular arrow pointing counter-clockwise. */ leftCircularArrow= 175, /** * Specifies a circular arrow pointing clockwise and counter-clockwise; a curved arrow with points at both ends. */ leftRightCircularArrow= 176, /** * Specifies a curved arrow. */ swooshArrow= 177, /** * Specifies a cloud shape. */ cloud= 178, /** * Specifies a square divided into four parts along diagonal lines. */ chartX= 179, /** * Specifies a square divided six parts along vertical and diagonal lines. */ chartStar= 180, /** * Specifies a square divided vertically and horizontally into four quarters. */ chartPlus= 181, /** * Specifies an inverse line. */ lineInverse= 182, /** * Specifies an inverse line. */ line= 183 } /** * Specifies the shape line compound type. * @enum {number} */ export enum CompoundType{ /** * Specifies only display one line around shape path */ simple= 0, /** * Specifies two lines display at both sides of shape path */ double= 1, /** * Specifies two lines, one thick line display at shape outter range, another thin line display at shape inner range */ thickThin= 2, /** * Specifies two lines, one thin line display at shape outter range, another thick line display at shape inner range */ thinThick= 3, /** * Specifies three lines, one thick line display around shape path, the other two thin line display at inner and outter shape range */ triple= 4 } /** * Defines the type of Connector. * @enum {number} */ export enum ConnectorType{ /** * Specifies a straight line connector. */ straight= 0, /** * Specifies an elbow connector. */ elbow= 1 } /** * Defines all the types of build-in form control. * @enum {string} */ export enum FormControlType{ /** * button */ button= "button", /** * spinButton */ spinButton= "spinButton", /** * scrollBar */ scrollBar= "scrollBar", /** * listBox */ listBox= "listBox", /** * checkBox */ checkBox= "checkBox", /** * optionButton */ optionButton= "optionButton", /** * label */ label= "label", /** * groupBox */ groupBox= "groupBox", /** * comboBox */ comboBox= "comboBox" } /** * Defines gradient fill type of shape. * @enum {number} */ export enum GradientFillType{ /** * Linear Gradient Fill */ linear= 0, /** * Radial Gradient Fill */ radial= 1 } /** * Specifies shape hit test line end. * @enum {string} */ export enum HitTestLineEnd{ /** * Head */ head= "head", /** * Tail */ tail= "tail" } /** * Specifies shape hit test type. * @enum {string} */ export enum HitTestType{ /** * Hit test on shape body. */ body= "body", /** * Hit test on shape border. */ border= "border", /** * Hit test on shape line end. */ lineEnd= "lineEnd", /** * Hit test on shape rotate handle. */ rotate= "rotate", /** * Hit test on shape resize handle. */ resize= "resize", /** * Hit test on shape connection point. */ connectionPoint= "connectionPoint", /** * Hit test on shape adjustment handle. */ adjustment= "adjustment" } /** * Specifies shape horizontal alignment. * @enum {number} */ export enum HorizontalAlign{ /** * Left */ left= 0, /** * Center */ center= 1, /** * Right */ right= 2 } /** * Defines linear gradient fill direction of shape. * @enum {number} */ export enum LinearGradientFillDirection{ /** * Linear Right */ linearRight= 0, /** * Top Left To Bottom Right */ topLeftToBottomRight= 45, /** * Linear Down */ linearDown= 90, /** * Top Right To Bottom Right */ topRightToBottomLeft= 135, /** * Linear Left */ linearLeft= 180, /** * Bottom Right To TopLeft */ bottomRightToTopLeft= 225, /** * Linear Up */ linearUp= 270, /** * Bottom Left To Top Right */ bottomLeftToTopRight= 315 } /** * Specifies the cap type for a line. * @enum {number} */ export enum LineCapStyle{ /** * Specifies the end of the line is flat. */ flat= 2, /** * Specifies the end of the line is capped with a square shape. */ square= 1, /** * Specifies the end of the line is rounded. */ round= 0 } /** * Specifies the corners style of two intersecting lines. * @enum {number} */ export enum LineJoinStyle{ /** * Specifies the corners where the two lines intersect are rounded. */ round= 0, /** * Specifies the corners where the two lines intersect are squared off. */ miter= 1, /** * Specifies the corners where the two lines intersect are cut off at a 45 degree angle. */ bevel= 2 } /** * Specifies listBox form control selection type. * @enum {string} */ export enum ListBoxSelectionType{ /** * single */ single= "single", /** * multi */ multi= "multi", /** * extend */ extend= "extended" } /** * Specifies the dash style for a line. * @enum {number} */ export enum PresetLineDashStyle{ /** * Line is solid. */ solid= 0, /** * Line is made up of square dots. */ squareDot= 1, /** * Line consists of dashes only. */ dash= 2, /** * Line consists of long dashes. */ longDash= 3, /** * Line is a dash-dot pattern. */ dashDot= 4, /** * Line is a long dash-dot pattern. */ longDashDot= 5, /** * Line is a long dash-dot-dot pattern. */ longDashDotDot= 6, /** * Line is a system dash pattern. */ sysDash= 7, /** * Line is a system dot pattern. */ sysDot= 8, /** * Line is a system dash-dot pattern. */ sysDashDot= 9, /** * Line is a dash-dot-dot pattern. */ dashDotDot= 10 } /** * Defines radial gradient fill direction of shape. * @enum {number} */ export enum RadialGradientFillDirection{ /** * From Center */ fromCenter= 0, /** * From Top Left */ fromTopLeft= 1, /** * From Top Right */ fromTopRight= 2, /** * From Bottom Left */ fromBottomLeft= 3, /** * From Bottom Right */ fromBottomRight= 4 } /** * Specifies shape resize handle type. * @enum {string} */ export enum ResizeHandleType{ /** * Top Left */ topLeft= "topLeft", /** * Top Center */ topCenter= "topCenter", /** * Top Right */ topRight= "topRight", /** * Middle Left */ middleLeft= "middleLeft", /** * Middle Center */ middleRight= "middleRight", /** * Bottom Left */ bottomLeft= "bottomLeft", /** * Bottom Center */ bottomCenter= "bottomCenter", /** * Bottom Right */ bottomRight= "bottomRight" } /** * Specifies shape resize mode. * @enum {number} */ export enum ResizeMode{ /** * Show all resize handler, when using the [NW, NE, SW, SE] handler to resize shape, the aspect ratio of the shape will be maintained. */ aspect= 0, /** * Only show the [W, E] resize handler, which can only change the width of shape when resize shape. */ horizontal= 1, /** * Only show the [N, S] resize handler, which can only change the height of shape when resize shape. */ vertical= 2 } /** * Defines fill type of shape. * @enum {number} */ export enum ShapeFillType{ /** * No Fill */ none= 0, /** * Solid Fill */ solid= 1 } /** * Specifies shape snap basis. * @enum {number} */ export enum SnapMode{ /** * When resize or move shape, not snap to any refernce position. */ none= 0, /** * When resize or move shape, close to the grid line, shape will be snap to grid line. */ grid= 1, /** * When resize or move shape, close to other shape boundary, shape will be snap to boundary. */ shape= 2 } /** * Defines text direction of the shape. * @enum {number} * @example * ```javascript * //This sample sets the textDirection for the shape. * var rectangleShape = sheet.shapes.add("Shape1", GC.Spread.Sheets.Shapes.AutoShapeType.rectangle, 100, 60, 200, 160); * var oldStyle = rectangleShape.style(); * oldStyle.textFrame.textDirection = GC.Spread.Sheets.Shapes.TextDirection.wordArtVertRtl; * rectangleShape.style(oldStyle); * ``` */ export enum TextDirection{ /** Specifies that text display as horizontal. * @type {number} */ horz= 0, /** Specifies that text display as Vertical 90 deg. * @type {number} */ vert= 1, /** Specifies that text display as Vertical 270 deg. * @type {number} */ vert270= 2, /** Specifies that text display as Word Art Vertical Left to Right. * @type {number} */ wordArtVert= 3, /** Specifies that text display as East Asian Vertical Right to Left. * @type {number} */ eaVert= 4, /** Specifies that text display as East Asian Vertical Left to Right. * @type {number} */ eaVertLtr= 5, /** Specifies that text display as Word Art Vertical Right to Left. * @type {number} */ wordArtVertRtl= 6 } /** * Defines texture fill aligmnet of shape. * @enum {number} */ export enum TextureFillAlignment{ /** * Top Left */ topLeft= 0, /** * Top */ top= 1, /** * Top Right */ topRight= 2, /** * Left */ left= 3, /** * Center */ center= 4, /** * Right */ right= 5, /** * Bottom Left */ bottomLeft= 6, /** * Bottom */ bottom= 7, /** * Bottom Right */ bottomRight= 8 } /** * Defines texture fill mirrorType of shape. * @enum {number} */ export enum TextureFillMirrorType{ /** * None */ none= 0, /** * Horizontal */ horizontal= 1, /** * Vertical */ vertical= 2, /** * Both */ both= 3 } /** * Specifies shape vertical alignment. * @enum {number} */ export enum VerticalAlign{ /** * Top */ top= 0, /** * Middle */ middle= 1, /** * Bottom */ bottom= 2 } export class CameraShape extends GC.Spread.Sheets.Shapes.ShapeBase{ /** * @param {GC.Spread.Sheets.Worksheet} worksheet The host worksheet of the shape. * @param {string} name The name of the camera shape. If name is empty string, a unique name will be generated. * @param {string} range The range of the shape generated from, it should be a range formula, like Sheet1!A1:A8. * @param {number} [left] The x location of the shape. * @param {number} [top] The y location of the shape. * @param {number} [width] The width of the camera shape, if leave blank the default value should be same as the original range width. * @param {number} [height] The height of the camera shape, if leave blank the default value should be same as the original range height. */ constructor(worksheet: GC.Spread.Sheets.Worksheet, name: string, range: string, left?: number, top?: number, width?: number, height?: number); /** * Gets or sets the double-click command of the shape. * @param {string | Function} [value] The behavior when double clicking the camera shape rather than jump to cell range source, if value is a function, it won't be serialized. The default command is 'openUrl'. * @return {string | Function | void} If no value is set, returns the current double-click command settings of the shape. * @example * ```javascript * var shape = sheet.shapes.addCameraShape("shape1", 'Sheet1!A1:A8', 100, 50, 100, 150); * shape.doubleClickCommand(null); * ``` */ doubleClickCommand(value?: string | Function): string | Function | void; /** * Gets or sets the cell range of the camera shape. * @param {string} value The cell range of the camera shape specified by cell range formula (like Sheet1!A1:A8). * @returns {string | void} If no value is set, returns the cell range of the camera shape. * @example * ```javascript * var shape = sheet.shapes.addCameraShape("shape1", 'Sheet1!A1:A8', 100, 50, 100, 150); * shape.range('Sheet2!A2:B8'); * ``` */ range(value?: string): string | void; /** * Gets or sets the rotated angle of the camera shape (unit in degree). * @param {number | string} value The rotated angle of the camera shape (unit in degree) specified by a number or formula (starts with =) can get a number value. * @returns {number | void} If no value is set, returns the rotated angle of the camera shape (unit in degree). * @example * ```javascript * var shape = sheet.shapes.addCameraShape("shape1", 'Sheet1!A1:A8', 100, 50, 100, 150); * var n = shape.rotate(); * shape.rotate(n + 30); * ``` */ rotate(value?: number | string): number | void; /** * Gets or sets the style of the camera shape. * @param {GC.Spread.Sheets.Shapes.ShapeStyle} value The shape style. * @return {GC.Spread.Sheets.Shapes.ShapeStyle | void} If no value is set, returns the current style of the shape. * @example * ```javascript * //This sample sets style for the shape. * var shape = sheet.shapes.addCameraShape("shape1", 'Sheet1!A1:A8', 100, 50, 100, 150); * var oldStyle = shape.style(); * oldStyle.fill.color = "red"; * oldStyle.fill.transparency = 0.5; * oldStyle.line.color = "green"; * oldStyle.line.lineStyle = GC.Spread.Sheets.Shapes.PresetLineDashStyle.dashDot; * oldStyle.line.width = 5; * oldStyle.line.capType = GC.Spread.Sheets.Shapes.LineCapStyle.square; * oldStyle.line.joinType = GC.Spread.Sheets.Shapes.LineJoinStyle.miter; * oldStyle.line.transparency = 0.5; * shape.style(oldStyle); * ``` */ style(value?: GC.Spread.Sheets.Shapes.ShapeStyle): any; } export class ConnectorShape extends GC.Spread.Sheets.Shapes.ShapeBase{ /** * Represents a ConnectorShape. * @param {GC.Spread.Sheets.Worksheet} worksheet The host sheet of the shape. * @param {string} name The name of shape. * @param {GC.Spread.Sheets.Shapes.ConnectorType} connectorType The type of the connector shape. * @param {number} beginX The x location of the start point for the connector shape. * @param {number} beginY The y location of the start point for the connector shape. * @param {number} endX The x location of the end point for the connector shape. * @param {number} endY The y location of the end point for the connector shape. */ constructor(worksheet: GC.Spread.Sheets.Worksheet, name: string, connectorType?: GC.Spread.Sheets.Shapes.ConnectorType, beginX?: number, beginY?: number, endX?: number, endY?: number); /** * Gets or sets the adjustment values of the connector shape. * @param {number[]} arrayValue The adjustment values in array. * @return {number[] | void} if no value is set, returns the current adjustment values of the shape. * @example * ```javascript * var myConnector = sheet.shapes.addConnector("myConnector", GC.Spread.Sheets.Shapes.ConnectorType.elbow, 50, 50, 200, 500); * var adjustments = myConnector.adjustments(); * console.log(adjustments); * adjustments = [-0.8]; * myConnector.adjustments(adjustments); * ``` */ adjustments(arrayValue?: number[]): any; /** * Gets or sets the end connector info of the connectorShape. * @param {object} connector The end connector info of the connectorShape. * @param {string} connector.name The name of the end connector. * @param {number} connector.index The connect point index of the end connector. * @returns {object} connectorInfo - If no value is set, returns the end connector info of the connectorShape. When the connectorShape has no end connector returns null. * connectorInfo.name {string} The name of the end connector. * connectorInfo.index {number} The connect point index of the end connector. * connectorInfo.shape {GC.Spread.Sheets.Shapes.Shape} The end connector. * @example * ```javascript * var shape1 = sheet.shapes.add("myShape1", GC.Spread.Sheets.Shapes.AutoShapeType.rectangle, 62 * 9, 0, 200, 200); * var shape2 = sheet.shapes.addConnector("myShape", GC.Spread.Sheets.Shapes.ConnectorType.straight, 220, 120, 300, 120); * shape2.endConnector({name: shape1.name(), index: 2}); * console.log(shape2.endConnector()); * ``` */ endConnector(connector?: GC.Spread.Sheets.Shapes.IShapeConnector): GC.Spread.Sheets.Shapes.IShapeConnector; /** * Gets the formula string from the shape by the path. * @param {string} path The path which can accept a formula string, it could be one of "x", "y", "width", "height", * "style.line.color", "style.line.lineStyle", "style.line.width", "style.line.capType", "style.line.joinType", "style.line.compoundType", "style.line.transparency". * @returns {string} Returns the formula string from the shape by the path. * @example * ```javascript * sheet.name("Sheet1"); * sheet.setValue(0, 1, "red"); * var myConnector = sheet.shapes.addConnector("myConnector", GC.Spread.Sheets.Shapes.ConnectorType.elbow, 50, 50, 200, 500); * myConnector.setFormula("style.line.color", "=Sheet1!B1"); * myConnector.getFormula("style.line.color");//returns "=Sheet1!B1" * ``` */ getFormula(path: string): string; /** * Sets the formula string to the shape by the path. * @param {string} path The path which can accept a formula string, it could be one of "x", "y", "width", "height", * "style.line.color", "style.line.lineStyle", "style.line.width", "style.line.capType", "style.line.joinType", "style.line.compoundType", "style.line.transparency". * @param {string} formula The formula string. * @example * ```javascript * sheet.name("Sheet1"); * sheet.setValue(0, 1, "red"); * var myConnector = sheet.shapes.addConnector("myConnector", GC.Spread.Sheets.Shapes.ConnectorType.elbow, 50, 50, 200, 500); * myConnector.setFormula("style.line.color", "=Sheet1!B1"); * ``` */ setFormula(path: string, formula: string): void; /** * Gets or sets the start connector info of the connectorShape. * @param {object} connector The start connector info of the connectorShape. * @param {string} connector.name The name of the start connector. * @param {number} connector.index The connect point index of the start connector. * @returns {object} connectorInfo - If no value is set, returns the start connector info of the connectorShape. When the connectorShape has no start connector returns return null. * connectorInfo.name {string} The name of the start connector. * connectorInfo.index {number} The connect point index of the start connector. * connectorInfo.shape {GC.Spread.Sheets.Shapes.Shape} The start connector. * @example * ```javascript * var shape1 = sheet.shapes.add("myShape1", GC.Spread.Sheets.Shapes.AutoShapeType.rectangle, 62 * 9, 0, 200, 200); * var shape2 = sheet.shapes.addConnector("myShape", GC.Spread.Sheets.Shapes.ConnectorType.straight, 220, 120, 300, 120); * shape2.startConnector({name: shape1.name(), index: 2}); * console.log(shape2.startConnector()); * ``` */ startConnector(connector?: GC.Spread.Sheets.Shapes.IShapeConnector): GC.Spread.Sheets.Shapes.IShapeConnector; /** * Gets or sets the style of the connector shape. * @param {GC.Spread.Sheets.Shapes.ShapeStyle} value The connector shape style. * @return {GC.Spread.Sheets.Shapes.ShapeStyle | void} If no value is set, returns the current style of the connector shape. * * @example * ```javascript * //This sample sets style for the connector shape. * var shape = sheet.shapes.addConnector("Shape1", GC.Spread.Sheets.Shapes.ConnectorType.straight, 100, 60, 200, 160); * var oldStyle = shape.style(); * oldStyle.line.color = "red"; * oldStyle.line.lineStyle = GC.Spread.Sheets.Shapes.PresetLineDashStyle.dashDot; * oldStyle.line.width = 5; * oldStyle.line.capType = GC.Spread.Sheets.Shapes.LineCapStyle.square; * oldStyle.line.joinType = GC.Spread.Sheets.Shapes.LineJoinStyle.miter; * oldStyle.line.compoundType = GC.Spread.Sheets.Shapes.CompoundType.double; * oldStyle.line.transparency = 0.5; * oldStyle.line.beginArrowheadStyle = GC.Spread.Sheets.Shapes.ArrowheadStyle.triangle; * oldStyle.line.beginArrowheadWidth = GC.Spread.Sheets.Shapes.ArrowheadWidth.narrow; * oldStyle.line.beginArrowheadLength = GC.Spread.Sheets.Shapes.ArrowheadLength.short; * oldStyle.line.endArrowheadStyle = GC.Spread.Sheets.Shapes.ArrowheadStyle.diamond; * oldStyle.line.endArrowheadWidth = GC.Spread.Sheets.Shapes.ArrowheadWidth.wide; * oldStyle.line.endArrowheadLength = GC.Spread.Sheets.Shapes.ArrowheadLength.long; * shape.style(oldStyle); * ``` */ style(value?: GC.Spread.Sheets.Shapes.ShapeStyle): GC.Spread.Sheets.Shapes.ShapeStyle | void; /** * Gets the connector type of the connectorShape. * @returns {GC.Spread.Sheets.Shapes.ConnectorType} returns the connector type of the shape. * @example * ```javascript * var shape = sheet.shapes.addConnector("myShape", GC.Spread.Sheets.Shapes.ConnectorType.straight, 220, 120, 300, 120); * var shapeName = shape.type(); * ``` */ type(): GC.Spread.Sheets.Shapes.ConnectorType; } export class FormControlShape extends GC.Spread.Sheets.Shapes.Shape{ /** * @class * @param {GC.Spread.Sheets.Worksheet} worksheet The host worksheet of the shape. * @param {string} name The name of the shape. If name is empty string, a unique name will be generated. * @param {GC.Spread.Sheets.Shapes.FormControlType} Form control specific type. * @param {number} [left] The x location of the shape. * @param {number} [top] The y location of the shape. * @param {number} [width] The width of the shape. * @param {number} [height] The height of the shape. */ constructor(worksheet: GC.Spread.Sheets.Worksheet, formControlType: GC.Spread.Sheets.Shapes.FormControlType, left?: number, top?: number, width?: number, height?: number); /** * Gets or Sets the enabled of form control shape. * @param {boolean} enabled The enabled of the form control shape. * @returns {GC.Spread.Sheets.Shapes.FormControlType} */ enabled(v?: boolean): boolean; /** * Gets FormControl specific type. * @returns {GC.Spread.Sheets.Shapes.FormControlType} */ formControlType(): GC.Spread.Sheets.Shapes.FormControlType; /** * Gets or Sets the options of form control shape. * @returns {IFormControlShapeOptions} */ options(v?: GC.Spread.Sheets.Shapes.IFormControlShapeOptions): GC.Spread.Sheets.Shapes.IFormControlShapeOptions; /** * Gets or Sets the value of form control shape. * @returns {IFormControlShapeValue} */ value(v?: GC.Spread.Sheets.Shapes.IFormControlShapeValue): GC.Spread.Sheets.Shapes.IFormControlShapeValue; } export class GroupShape extends GC.Spread.Sheets.Shapes.ShapeBase{ /** * Represents a groupShape. * @class * @param {GC.Spread.Sheets.Worksheet} worksheet The host sheet of the groupShape. * @param {string} [name] The name of groupShape */ constructor(worksheet: GC.Spread.Sheets.Worksheet, name?: string); /** * add a shape to the group shape. * @param {GC.Spread.Sheets.Shapes.Shape} shape The shape which added to the group shape. * @returns {void} * @example * ```javascript * var shape1 = activeSheet.shapes.add("shape1", GC.Spread.Sheets.Shapes.AutoShapeType.heart, 100, 50, 100, 150); * var shape2 = activeSheet.shapes.add("shape2", GC.Spread.Sheets.Shapes.AutoShapeType.heart, 260, 50, 100, 150); * var groupShape = activeSheet.shapes.group([shape1, shape2]); * var shape3 = activeSheet.shapes.add("shape3", GC.Spread.Sheets.Shapes.AutoShapeType.heart, 100, 260, 100, 150); * // add shape3 to groupShape. * groupShape.add(shape3); * ``` */ add(shape: GC.Spread.Sheets.Shapes.Shape): void; /** * get all shapes of group shape. * @returns {GC.Spread.Sheets.Shapes.Shape[]} all shapes * @example * ```javascript * // This sample shows how to get all shapes in group shape. * var shape1 = sheet.shapes.add("myShape1", GC.Spread.Sheets.Shapes.AutoShapeType.rectangle, 62 * 9, 0, 200, 200); * var shape2 = sheet.shapes.add("myShape2", GC.Spread.Sheets.Shapes.AutoShapeType.rectangle, 20, 20, 200, 200); * var groupShape = sheet.shapes.group([shape1, shape2]); * var shapes = groupShape.all(); * ``` */ all(): GC.Spread.Sheets.Shapes.Shape[]; /** * Get shape by name in group shape. * @param {string} name The name of shape in groupShape. * @return {GC.Spread.Sheets.Shapes.Shape} The Shape instance if the name belongs to a shape of group shapes; otherwise, null. * @example * ```javascript * var shape1 = activeSheet.shapes.add("heart1", GC.Spread.Sheets.Shapes.AutoShapeType.heart, 100, 50, 100, 150); * var shape2 = activeSheet.shapes.add("heart2", GC.Spread.Sheets.Shapes.AutoShapeType.heart, 260, 50, 100, 150); * var groupShape = activeSheet.shapes.group([shape1, shape2]); * var heart1 = groupShape.find("heart1"); // heart1 is equal to shape1. * ``` */ find(name: string): GC.Spread.Sheets.Shapes.Shape; /** * Gets the formula string from the shape by the path. * @param {string} path The path which can accept a formula string, it could be one of "x", "y", "width", "height", "rotate". * @returns {string} Returns the formula string from the shape by the path. * @example * ```javascript * sheet.name("Sheet1"); * sheet.setValue(0, 1, 30); * var shape1 = sheet.shapes.add("myShape1", GC.Spread.Sheets.Shapes.AutoShapeType.rectangle, 62 * 9, 0, 200, 200); * var shape2 = sheet.shapes.add("myShape2", GC.Spread.Sheets.Shapes.AutoShapeType.rectangle, 20, 20, 200, 200); * var shape = sheet.shapes.group([shape1, shape2]); * shape.setFormula("rotate", "=Sheet1!B1"); * shape.getFormula("rotate");//returns "=Sheet1!B1" * ``` */ getFormula(path: string): string; /** * remove a shape from group shape. * @param {GC.Spread.Sheets.Shapes.Shape} shape The shape to be removed from the group shape. * @returns {void} * @example * ```javascript * var shape1 = activeSheet.shapes.add("shape1", GC.Spread.Sheets.Shapes.AutoShapeType.heart, 100, 50, 100, 150); * var shape2 = activeSheet.shapes.add("shape2", GC.Spread.Sheets.Shapes.AutoShapeType.heart, 260, 50, 100, 150); * var shape3 = activeSheet.shapes.add("shape3", GC.Spread.Sheets.Shapes.AutoShapeType.heart, 100, 260, 100, 150); * var groupShape = activeSheet.shapes.group([shape1, shape2, shape3]); * // remove shape3 from groupShape. * groupShape.remove(shape3); * ``` */ remove(shape: GC.Spread.Sheets.Shapes.Shape): void; /** * Gets or sets the rotate of groupShape. * @param {number|string} value The rotate of the groupShape.The unit of measurement is the angle. * @return {number | void} If the parameter 'value' is null or undefined,it will return the rotate of the groupShape. * @example * ```javascript * var shape1 = sheet.shapes.add("myShape1", GC.Spread.Sheets.Shapes.AutoShapeType.rectangle, 62 * 9, 0, 200, 200); * var shape2 = sheet.shapes.add("myShape2", GC.Spread.Sheets.Shapes.AutoShapeType.rectangle, 20, 20, 200, 200); * var shape = sheet.shapes.group([shape1, shape2]); * shape.rotate(60); * var angle = shape.rotate(); * ``` */ rotate(value?: number | string): number | void; /** * Sets the formula string to the shape by the path. * @param {string} path The path which can accept a formula string, it could be one of "x", "y", "width", "height", "rotate". * @param {string} formula The formula string. * @example * ```javascript * sheet.name("Sheet1"); * sheet.setValue(0, 1, 30); * var shape1 = sheet.shapes.add("myShape1", GC.Spread.Sheets.Shapes.AutoShapeType.rectangle, 62 * 9, 0, 200, 200); * var shape2 = sheet.shapes.add("myShape2", GC.Spread.Sheets.Shapes.AutoShapeType.rectangle, 20, 20, 200, 200); * var shape = sheet.shapes.group([shape1, shape2]); * shape.setFormula("rotate", "=Sheet1!B1"); * ``` */ setFormula(path: string, formula: string): void; /** * Get or set the z-index for a shape in a groupShape. * @param shapeName {string} The name of the shape. * @param zIndex {number} The z-index for the shape. The zIndex should be between 0 to all shapes length(not contains). A shape with greater zIndex is always in front of a shape with a lower zIndex. * @returns {number|void} * @example * ```javascript * //This is a sample shows how to use zIndex in groupShape. * var shape1 = activeSheet.shapes.add("shape1", GC.Spread.Sheets.Shapes.AutoShapeType.heart, 100, 50, 100, 150); * var shape2 = activeSheet.shapes.add("shape2", GC.Spread.Sheets.Shapes.AutoShapeType.heart, 150, 50, 100, 150); * var style = shape1.style(); * style.fill.color = "red"; * shape1.style(style); * var myGroup = activeSheet.shapes.group([shape1, shape2]); * myGroup.zIndex("shape2"); // 1 * myGroup.zIndex("shape2", 0); * ``` */ zIndex(shapeName: string, zIndex?: number): any; } export class PictureShape extends GC.Spread.Sheets.Shapes.ShapeBase{ /** * @param {GC.Spread.Sheets.Worksheet} worksheet The host worksheet of the shape. * @param {string} name The name of the picture shape. If name is empty string, a unique name will be generated. * @param {string} src The src of the picture. * @param {number} [left] The x location of the shape. * @param {number} [top] The y location of the shape. * @param {number} [width] The width of the picture shape, if leave blank the default value should be same as the picture original width. * @param {number} [height] The height of the picture shape, if leave blank the default value should be same as the picture original height. */ constructor(worksheet: GC.Spread.Sheets.Worksheet, name: string, src: string, left?: number, top?: number, width?: number, height?: number); /** * Gets or sets the geometry type of the picture. * @param {GC.Spread.Sheets.Shapes.AutoShapeType} [value] The geometry type of the picture. * @return {GC.Spread.Sheets.Shapes.AutoShapeType | void} If no value is set, returns the current geometry type of the picture. * @example * ```javascript * //This sample sets geometry type for the picture shape. * var shape = sheet.shapes.addPictureShape("Picture 1", "data:image/svg+xml;base64.....", 100, 50, 100, 100); * shape.geometryType(GC.Spread.Sheets.Shapes.AutoShapeType.oval); * ``` */ geometryType(value?: GC.Spread.Sheets.Shapes.AutoShapeType): GC.Spread.Sheets.Shapes.AutoShapeType | void; /** * Gets the original height of the image. * @return {number | undefined} returns original height of the image, if no image or the image did not finish loading, undefiend is returned. * @example * ```javascript * sheet.bind(GC.Spread.Sheets.Events.ShapeChanged, function(s, e) { * if (e.propertyName === "originalSize") { * // Set the size of the picture shape to the original size of the image. * e.shape.width(e.shape.getOriginalWidth()); * e.shape.height(e.shape.getOriginalHeight()); * } * }); * var src = "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBzdGFuZGFsb25lPSJubyI/Pjxzdmcgd2lkdGg9IjEwMCIgaGVpZ2h0PSIxMDAiIHZlcnNpb249IjEuMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48Y2lyY2xlIGN4PSI1MCIgY3k9IjUwIiByPSI1MCIgZmlsbD0iYmx1ZSIvPjxwYXRoIGQ9Ik0xMCw1MCBRNDAsMzAgNTAsNTAgVDkwLDUwIiBmaWxsPSJub25lIiBzdHJva2U9Im9yYW5nZSIgc3Ryb2tlLXdpZHRoPSI1Ii8+PC9zdmc+"; * var shape = sheet.shapes.addPictureShape("Picture 1", src, 100, 50, 200, 200); * ``` */ getOriginalHeight(): number | undefined; /** * Gets the original width of the image. * @return {number | undefined} returns original width of the image, if no image or the image did not finish loading, undefiend is returned. * @example * ```javascript * sheet.bind(GC.Spread.Sheets.Events.ShapeChanged, function(s, e) { * if (e.propertyName === "originalSize") { * // Set the size of the picture shape to the original size of the image. * e.shape.width(e.shape.getOriginalWidth()); * e.shape.height(e.shape.getOriginalHeight()); * } * }); * var src = "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBzdGFuZGFsb25lPSJubyI/Pjxzdmcgd2lkdGg9IjEwMCIgaGVpZ2h0PSIxMDAiIHZlcnNpb249IjEuMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48Y2lyY2xlIGN4PSI1MCIgY3k9IjUwIiByPSI1MCIgZmlsbD0iYmx1ZSIvPjxwYXRoIGQ9Ik0xMCw1MCBRNDAsMzAgNTAsNTAgVDkwLDUwIiBmaWxsPSJub25lIiBzdHJva2U9Im9yYW5nZSIgc3Ryb2tlLXdpZHRoPSI1Ii8+PC9zdmc+"; * var shape = sheet.shapes.addPictureShape("Picture 1", src, 100, 50, 200, 200); * ``` */ getOriginalWidth(): number | undefined; /** * Gets or sets the format of the picture. * @param {GC.Spread.Sheets.Shapes.IPictureFormat} [value] The format of the picture. * @return {GC.Spread.Sheets.Shapes.IPictureFormat | void} If no value is set, returns the current format of the picture. * @example * ```javascript * //This sample sets format for the picture shape. * var shape = sheet.shapes.addPictureShape("Picture 1", "data:image/svg+xml;base64.....", 100, 50, 100, 100); * shape.pictureFormat({ grayscale: true, crop: { left: 0.25, right: 0.25, top: 0.25, bottom: 0.25 }}); * ``` */ pictureFormat(value?: GC.Spread.Sheets.Shapes.IPictureFormat): GC.Spread.Sheets.Shapes.IPictureFormat | void; /** * Gets or sets the rotated angle of the picture shape (unit in degree). * @param {number | string} value The rotated angle of the picture shape (unit in degree) specified by a number or formula (starts with =) can get a number value. * @returns {number | void} If no value is set, returns the rotated angle of the picture shape (unit in degree). * @example * ```javascript * var shape = sheet.shapes.addPictureShape("Picture 1", "data:image/svg+xml;base64.....", 100, 50, 100, 100); * var n = shape.rotate(); * shape.rotate(n + 30); * ``` */ rotate(value?: number | string): number | void; /** * Gets or sets the src of the picture. * @param {string} [value] The src of the picture. * @return {string | void} If no value is set, returns the current src of the picture. * @example * ```javascript * var dataURL = "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBzdGFuZGFsb25lPSJubyI/Pjxzdmcgd2lkdGg9IjEwMCIgaGVpZ2h0PSIxMDAiIHZlcnNpb249IjEuMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48Y2lyY2xlIGN4PSI1MCIgY3k9IjUwIiByPSI1MCIgZmlsbD0iYmx1ZSIvPjxwYXRoIGQ9Ik0xMCw1MCBRNDAsMzAgNTAsNTAgVDkwLDUwIiBmaWxsPSJub25lIiBzdHJva2U9Im9yYW5nZSIgc3Ryb2tlLXdpZHRoPSI1Ii8+PC9zdmc+"; * var shape = sheet.shapes.addPictureShape("Picture 1", dataURL, 100, 50, 200, 200); * // get current image source, the src is equal to dataURL. * var src = shape.src(); * // set new image source. * shape.src("data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBzdGFuZGFsb25lPSJubyI/Pjxzdmcgd2lkdGg9IjEwMCIgaGVpZ2h0PSIxMDAiIHZlcnNpb249IjEuMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48Y2lyY2xlIGN4PSI1MCIgY3k9IjUwIiByPSI1MCIgZmlsbD0iYmxhY2siLz48cGF0aCBkPSJNMTAsNTAgUTQwLDMwIDUwLDUwIFQ5MCw1MCIgZmlsbD0ibm9uZSIgc3Ryb2tlPSJvcmFuZ2UiIHN0cm9rZS13aWR0aD0iNSIvPjwvc3ZnPg=="); * ``` */ src(value?: string): string | void; /** * Gets or sets the style of the picture shape. * @param {GC.Spread.Sheets.Shapes.ShapeStyle} value The shape style. * @return {GC.Spread.Sheets.Shapes.ShapeStyle | void} If no value is set, returns the current style of the shape. * @example * ```javascript * //This sample sets style for the shape. * var shape = sheet.shapes.addPictureShape("Picture 1", "data:image/svg+xml;base64.....", 100, 50, 100, 100); * var oldStyle = shape.style(); * oldStyle.fill.color = "red"; * oldStyle.line.color = "green"; * oldStyle.line.lineStyle = GC.Spread.Sheets.Shapes.PresetLineDashStyle.dashDot; * oldStyle.line.width = 5; * oldStyle.line.capType = GC.Spread.Sheets.Shapes.LineCapStyle.square; * oldStyle.line.joinType = GC.Spread.Sheets.Shapes.LineJoinStyle.miter; * oldStyle.line.transparency = 0.5; * shape.style(oldStyle); * ``` */ style(value?: GC.Spread.Sheets.Shapes.ShapeStyle): any; } export class Shape extends GC.Spread.Sheets.Shapes.ShapeBase{ /** * @class * @param {GC.Spread.Sheets.Worksheet} worksheet The host worksheet of the shape. * @param {string} name The name of the shape. If name is empty string, a unique name will be generated. * @param {GC.Spread.Sheets.Shapes.AutoShapeType | GC.Spread.Sheets.Shapes.IShapeModel} autoShapeTypeOrModel The type of the shape (for one of the buildin types) or the model for custom shape. * @param {number} [left] The x location of the shape. * @param {number} [top] The y location of the shape. * @param {number} [width] The width of the shape. * @param {number} [height] The height of the shape. */ constructor(worksheet: GC.Spread.Sheets.Worksheet, name: string, autoShapeTypeOrModel: GC.Spread.Sheets.Shapes.AutoShapeType | GC.Spread.Sheets.Shapes.IShapeModel, left?: number, top?: number, width?: number, height?: number); /** * Gets or sets the adjustment values of the shape. * @param {number[]} arrayValue The adjustment values in array. * @return {number[] | void} if no value is set, returns the current adjustment values of the shape. * @example * ```javascript * var blockArc = sheet.shapes.add("", GC.Spread.Sheets.Shapes.AutoShapeType.blockArc, 100, 60, 200, 160); * var adjustments = blockArc.adjustments(); * console.log(adjustments); * adjustments[0] = 150; * adjustments[1] = 15; * adjustments[2] = 0.35; * blockArc.adjustments(adjustments); * blockArc.isSelected(true); * ``` */ adjustments(arrayValue?: number[]): number[] | void; /** * Gets the formula string from the shape by the path. * @param {string} path The path which can accept a formula string, it could be one of "x", "y", "width", "height", "rotate", "text", * "style.fill.color", "style.fill.transparency", * "style.fill.src", "style.fill.tilePictureAsTexture", * "style.fill.offsetLeft", "style.fill.offsetRight", "style.fill.offsetTop", "style.fill.offsetBottom", * "style.fill.offsetX", "style.fill.offsetY", "style.fill.scaleX", "style.fill.scaleY", "style.fill.alignment", "style.fill.mirrorType", * "style.fill.type", "style.fill.angle", "style.fill.direction", * "style.fill.stops.0.color", "style.fill.stops.0.position", "style.fill.stops.0.transparency", "style.fill.stops.0.brightness", * "style.line.color", "style.line.lineStyle", "style.line.width", "style.line.capType", "style.line.joinType", "style.line.compoundType", "style.line.transparency", * "style.textEffect.color", "style.textEffect.transparency", "style.textEffect.font", * "style.textFrame.vAlign", "style.textFrame.hAlign". * @returns {string} Returns the formula string from the shape by the path. * @example * ```javascript * sheet.name("Sheet1"); * sheet.setValue(0, 1, "This is a rectangle."); * var shape1 = sheet.shapes.add("myShape1", GC.Spread.Sheets.Shapes.AutoShapeType.rectangle, 100, 100, 200, 200); * shape1.setFormula("text", "=Sheet1!B1"); * shape1.getFormula("text");//returns "=Sheet1!B1" * ``` */ getFormula(path: string): string; /** * Gets or sets the shape is text box. * @param {boolean} [value] The value indicating whether the shape is a text box. * @returns {boolean | void} If no value is set, return whether shape is a text box. * @example * ```javascript * var rectangle = sheet.shapes.add("Shape1", GC.Spread.Sheets.Shapes.AutoShapeType.rectangle, 100, 60, 200, 160); * rectangle.isTextBox(true); * ``` */ isTextBox(value?: boolean): boolean | void; /** * Gets or sets the rotated angle of the shape (unit in degree). * @param {number | string} value The rotated angle of the shape (unit in degree) specified by a number or formula (starts with =) can get a number value. * @returns {number | void} If no value is set, returns the rotated angle of the shape (unit in degree). * @example * ```javascript * var heart = sheet.shapes.add("Shape1", GC.Spread.Sheets.Shapes.AutoShapeType.heart, 100, 60, 200, 160); * var n = heart.rotate(); * heart.rotate(n + 30); * ``` */ rotate(value?: number | string): number | void; /** * Sets the formula string to the shape by the path. * @param {string} path The path which can accept a formula string, it could be one of "x", "y", "width", "height", "rotate", "text", * "style.fill.color", "style.fill.transparency", * "style.fill.src", "style.fill.tilePictureAsTexture", * "style.fill.offsetLeft", "style.fill.offsetRight", "style.fill.offsetTop", "style.fill.offsetBottom", * "style.fill.offsetX", "style.fill.offsetY", "style.fill.scaleX", "style.fill.scaleY", "style.fill.alignment", "style.fill.mirrorType", * "style.fill.type", "style.fill.angle", "style.fill.direction", * "style.fill.stops.0.color", "style.fill.stops.0.position", "style.fill.stops.0.transparency", "style.fill.stops.0.brightness", * "style.line.color", "style.line.lineStyle", "style.line.width", "style.line.capType", "style.line.joinType", "style.line.compoundType", "style.line.transparency", * "style.textEffect.color", "style.textEffect.transparency", "style.textEffect.font", * "style.textFrame.vAlign", "style.textFrame.hAlign". * @param {string} formula The formula string. * @example * ```javascript * sheet.name("Sheet1"); * sheet.setValue(0, 1, "This is a rectangle."); * var shape1 = sheet.shapes.add("myShape1", GC.Spread.Sheets.Shapes.AutoShapeType.rectangle, 100, 100, 200, 200); * shape1.setFormula("text", "=Sheet1!B1"); * ``` */ setFormula(path: string, formula: string): void; /** * Gets or sets the style of the shape. * @param {GC.Spread.Sheets.Shapes.ShapeStyle} value The shape style. * @return {GC.Spread.Sheets.Shapes.ShapeStyle | void} If no value is set, returns the current style of the shape. * @example * ```javascript * //This sample sets style for the shape. * var heart = sheet.shapes.add("Shape1", GC.Spread.Sheets.Shapes.AutoShapeType.heart, 100, 60, 200, 160); * var oldStyle = heart.style(); * oldStyle.fill.color = "red"; * oldStyle.fill.transparency = 0.5; * oldStyle.line.color = "green"; * oldStyle.line.lineStyle = GC.Spread.Sheets.Shapes.PresetLineDashStyle.dashDot; * oldStyle.line.width = 5; * oldStyle.line.capType = GC.Spread.Sheets.Shapes.LineCapStyle.square; * oldStyle.line.joinType = GC.Spread.Sheets.Shapes.LineJoinStyle.miter; * oldStyle.line.compoundType = GC.Spread.Sheets.Shapes.CompoundType.double; * oldStyle.line.transparency = 0.5; * oldStyle.textEffect.color = "yellow"; * oldStyle.textEffect.transparency = 0.5; * oldStyle.textEffect.font = "20px Arial"; * oldStyle.textFrame.vAlign = GC.Spread.Sheets.VerticalAlign.center; * oldStyle.textFrame.hAlign = GC.Spread.Sheets.HorizontalAlign.center; * heart.style(oldStyle); * heart.text("Heart"); * ``` */ style(value?: GC.Spread.Sheets.Shapes.ShapeStyle): any; /** * Gets or sets the text of the shape. * @param {string} value The text of the shape specified by a string or formula (starts with =) can get a string. * @returns {string | void} If no value is set, returns the text of the shape. * @example * ```javascript * var heart = sheet.shapes.add("Shape1", GC.Spread.Sheets.Shapes.AutoShapeType.heart, 100, 60, 200, 160); * heart.text("My Shape"); * var s = heart.text(); * ``` */ text(value?: string): any; /** * Gets or sets the type of the shape. * @param {GC.Spread.Sheets.Shapes.AutoShapeType} value The type of the shape. * @returns {GC.Spread.Sheets.Shapes.AutoShapeType | void} If no value is set, returns the type of the shape. * @example * ```javascript * var heart = sheet.shapes.add("Shape1", GC.Spread.Sheets.Shapes.AutoShapeType.heart, 100, 60, 200, 160); * var n = heart.type(); * heart.type(GC.Spread.Sheets.Shapes.AutoShapeType.cloud); * ``` */ type(value?: GC.Spread.Sheets.Shapes.AutoShapeType): any; } export class ShapeBase{ /** * Represents the base class for Shape, GroupShape and ConnectorShape. * @class */ constructor(); /** * Gets or sets whether to disable moving the shape. * @param {boolean} value The setting for whether to disable moving the shape. * @returns {boolean | GC.Spread.Sheets.Shapes.ShapeBase} If no value is set, returns the setting for whether to disable moving the shape. * @example * ```javascript * var heart = sheet.shapes.add("Shape1", GC.Spread.Sheets.Shapes.AutoShapeType.heart, 100, 60, 200, 160); * var state = heart.allowMove(); * heart.allowMove(!state); * ``` */ allowMove(value?: boolean): any; /** * Gets or sets the resize mode of the shape. * @param {GC.Spread.Sheets.Shapes.ResizeMode | boolean} value The setting for whether to disable resizing the shape. * @returns {GC.Spread.Sheets.Shapes.ResizeMode | boolean | GC.Spread.Sheets.Shapes.ShapeBase} If no value is set, returns the setting for whether to disable resizing the shape. * @example * ```javascript * var heart = sheet.shapes.add("Shape1", GC.Spread.Sheets.Shapes.AutoShapeType.heart, 100, 60, 200, 160); * var state = heart.allowResize(); * heart.allowResize(GC.Spread.Sheets.Shapes.ResizeMode.aspect); * ``` */ allowResize(value?: GC.Spread.Sheets.Shapes.ResizeMode | boolean): any; /** * Gets or sets whether to disable rotating the shape. * @param {boolean} value The setting for whether to disable rotating the shape. * @returns {boolean | GC.Spread.Sheets.Shapes.ShapeBase} If no value is set, returns the setting for whether to disable rotating the shape. * @example * ```javascript * var heart = sheet.shapes.add("Shape1", GC.Spread.Sheets.Shapes.AutoShapeType.heart, 100, 60, 200, 160); * var state = heart.allowRotate(); * heart.allowRotate(!state); * ``` */ allowRotate(value?: boolean): any; /** * Gets or sets the alternative text of the shape for screen readers. * @param {string} [value] The alternative text of the shape. * @returns {string | GC.Spread.Sheets.Shapes.ShapeBase} The alternative text of the shape. * @example * ```javascript * var heart = sheet.shapes.add("Shape1", GC.Spread.Sheets.Shapes.AutoShapeType.heart, 100, 60, 200, 160); * heart.alt("A heart shape"); * ``` */ alt(value?: string): any; /** * Gets or sets whether this shape is printable. * @param {boolean} [value] The value that indicates whether this shape is printable. * @returns {boolean | GC.Spread.Sheets.Shapes.ShapeBase} If no value is set, returns whether this shape is printable. * @example * ```javascript * var heart = sheet.shapes.add("Shape1", GC.Spread.Sheets.Shapes.AutoShapeType.heart, 100, 60, 200, 160); * var state = heart.canPrint(); // Get whether the shape is printable, defaulat value is true. * workbook.print(); // The heart shape is printed. * heart.canPrint(false); * workbook.print(); // The heart shape is not printed. * ``` */ canPrint(value?: boolean): any; /** * Gets or sets whether the shape moves when hiding or showing, resizing, or moving rows or columns. * @param {boolean} value The value indicates whether the shape moves when hiding or showing, resizing, or moving rows or columns. * @returns {boolean | GC.Spread.Sheets.Shapes.ShapeBase} If no value is set, returns whether this shape dynamically moves. * @example * ```javascript * var heart = sheet.shapes.add("Shape1", GC.Spread.Sheets.Shapes.AutoShapeType.heart, 100, 60, 200, 160); * var state = heart.dynamicMove(); * heart.dynamicMove(!state); * ``` */ dynamicMove(value?: boolean): any; /** * Gets or sets whether the size of the shape changes when hiding or showing, resizing, or moving rows or columns. * @param {boolean} value The value indicates whether the size of the shape changes when hiding or showing, resizing, or moving rows or columns. * @returns {boolean | GC.Spread.Sheets.Shapes.ShapeBase} If no value is set, returns whether this shape dynamically changes size. * @example * ```javascript * var heart = sheet.shapes.add("Shape1", GC.Spread.Sheets.Shapes.AutoShapeType.heart, 100, 60, 200, 160); * var state = heart.dynamicSize(); * heart.dynamicSize(!state); * ``` */ dynamicSize(value?: boolean): any; /** * Gets or sets the end column index of the shape position. * @param {number} value The end column index of the shape position. * @returns {number | GC.Spread.Sheets.Shapes.ShapeBase} If no value is set, returns the end column index of the shape position. * @example * ```javascript * var heart = sheet.shapes.add("Shape1", GC.Spread.Sheets.Shapes.AutoShapeType.heart, 100, 60, 200, 160); * var n = heart.endColumn(); * heart.endColumn(n + 1); * ``` */ endColumn(value?: number): any; /** * Gets or sets the offset relative to the end column of the shape. * @param {number} value The offset relative to the end column of the shape. * @returns {number | GC.Spread.Sheets.Shapes.ShapeBase} If no value is set, returns the offset relative to the end column of the shape. * @example * ```javascript * var heart = sheet.shapes.add("Shape1", GC.Spread.Sheets.Shapes.AutoShapeType.heart, 100, 60, 200, 160); * var n = heart.endColumnOffset(); * heart.endColumnOffset(0); * ``` */ endColumnOffset(value?: number): any; /** * Gets or sets the end row index of the shape position. * @param {number} value The end row index of the shape position. * @returns {number | GC.Spread.Sheets.Shapes.ShapeBase} If no value is set, returns the end row index of the shape position. * @example * ```javascript * var heart = sheet.shapes.add("Shape1", GC.Spread.Sheets.Shapes.AutoShapeType.heart, 100, 60, 200, 160); * var n = heart.endRow(); * heart.endRow(n + 2); * ``` */ endRow(value?: number): any; /** * Gets or sets the offset relative to the end row of the shape. * @param {number} value The offset relative to the end row of the shape. * @returns {number | GC.Spread.Sheets.Shapes.ShapeBase} If no value is set, returns the offset relative to the end row of the shape. * @example * ```javascript * var heart = sheet.shapes.add("Shape1", GC.Spread.Sheets.Shapes.AutoShapeType.heart, 100, 60, 200, 160); * var n = heart.endRowOffset(); * heart.endRowOffset(0); * ``` */ endRowOffset(value?: number): any; /** * Gets the formula string from the shape by the path. * @param {string} path The path which can accept a formula string, it could be one of "x", "y", "width", "height". * @returns {string} Returns the formula string from the shape by the path. * @example * ```javascript * sheet.name("Sheet1"); * sheet.setValue(0, 1, 150); * var shape1 = sheet.shapes.add("myShape1", GC.Spread.Sheets.Shapes.AutoShapeType.rectangle, 100, 100, 200, 200); * shape1.setFormula("x", "=Sheet1!B1"); * shape1.getFormula("x");//returns "=Sheet1!B1" * ``` */ getFormula(path: string): string; /** * Gets or sets the height of the shape. * @param {number | string} value The height of the shape specified by a number or formula (starts with =) can get a number value. * @returns {number | GC.Spread.Sheets.Shapes.ShapeBase} If no value is set, returns the height of the shape. * @example * ```javascript * var heart = sheet.shapes.add("Shape1", GC.Spread.Sheets.Shapes.AutoShapeType.heart, 100, 60, 200, 160); * var n = heart.height(); * heart.height(n + 50); * ``` */ height(value?: number | string): any; /** * Gets or sets the hyperlink of the shape. * @param {object} [value] The hyperlink settings. * @param {string} [value.url] The location that the hyperlink points to. * @param {string} [value.tooltip] The tooltip message which shows when hover over the cell with hyperlink. * @param {number} [value.target] The way that user open the hyperlinked document. Default is 0 (blank). * @param {string | function} [value.command] The behavior when clicking the hyperlink rather than default opening url. * @return {object | void} If no value is set, returns the current hyperlink settings of the shape. * @example * ```javascript * var shape = sheet.shapes.add("myShape", GC.Spread.Sheets.Shapes.AutoShapeType.rectangle, 62 * 9, 0, 200, 200); * shape.hyperlink({url: "http://www.spreadjs.com", target: 0, tooltip: 'goes to SpreadJS'}); * ``` */ hyperlink(value?: GC.Spread.Sheets.IHyperlink): IHyperlink | void; /** * Gets or sets whether this shape is locked. * @param {boolean} value The value that indicates whether this shape is locked. * @returns {boolean | GC.Spread.Sheets.Shapes.ShapeBase} If no value is set, returns whether this shape is locked. * @example * ```javascript * var heart = sheet.shapes.add("Shape1", GC.Spread.Sheets.Shapes.AutoShapeType.heart, 100, 60, 200, 160); * var state = heart.isLocked(); * heart.isLocked(!state); * ``` */ isLocked(value?: boolean): any; /** * Gets or sets whether this shape is selected. * @param {boolean} value The value that indicates whether this shape is selected. * @returns {boolean | GC.Spread.Sheets.Shapes.ShapeBase} If no value is set, returns whether this shape is selected. * @example * ```javascript * var heart = sheet.shapes.add("Shape1", GC.Spread.Sheets.Shapes.AutoShapeType.heart, 100, 60, 200, 160); * var state = heart.isSelected(); * heart.isSelected(!state); * ``` */ isSelected(value?: boolean): any; /** * Gets or sets whether this shape is visible. * @param {boolean} value The value that indicates whether this shape is visible. * @returns {boolean | GC.Spread.Sheets.Shapes.ShapeBase} If no value is set, returns whether this shape is visible. * @example * ```javascript * var heart = sheet.shapes.add("Shape1", GC.Spread.Sheets.Shapes.AutoShapeType.heart, 100, 60, 200, 160); * var state = heart.isVisible(); * heart.isVisible(!state); * ``` */ isVisible(value?: boolean): any; /** * Gets or sets the name of the shape. * @param {string} value The name of the shape. * @returns {string | GC.Spread.Sheets.Shapes.ShapeBase} If no value is set, returns the name of the shape. * @example * ```javascript * var shape1 = sheet.shapes.add("myShape1", GC.Spread.Sheets.Shapes.AutoShapeType.rectangle, 62 * 9, 0, 200, 200); * var shape2 = sheet.shapes.add("myShape2", GC.Spread.Sheets.Shapes.AutoShapeType.rectangle, 20, 20, 200, 200); * var shape = sheet.shapes.group([shape1, shape2]); * shape.name("myGroupShape"); * var shapeName = shape.name(); * ``` */ name(value?: string): any; /** * Sets the formula string to the shape by the path. * @param {string} path The path which can accept a formula string, it could be one of "x", "y", "width", "height". * @param {string} formula The formula string. * @example * ```javascript * sheet.name("Sheet1"); * sheet.setValue(0, 1, 150); * var shape1 = sheet.shapes.add("myShape1", GC.Spread.Sheets.Shapes.AutoShapeType.rectangle, 100, 100, 200, 200); * shape1.setFormula("x", "=Sheet1!B1"); * ``` */ setFormula(path: string, formula: string): void; /** * Gets or sets whether to show handle of shape. * @param {boolean} value The setting for whether to show handle of shape. * @returns {boolean | GC.Spread.Sheets.Shapes.ShapeBase} If no value is set, returns the setting for whether to show handle of shape. * @example * ```javascript * var heart = sheet.shapes.add("Shape1", GC.Spread.Sheets.Shapes.AutoShapeType.heart, 100, 60, 200, 160); * var state = heart.showHandle(); * heart.showHandle(!state); * ``` */ showHandle(value?: boolean): any; /** * Gets or sets the starting column index of the shape position. * @param {number} value The starting column index of the shape position. * @returns {number | GC.Spread.Sheets.Shapes.ShapeBase} If no value is set, returns the starting column index of the shape position. * @example * ```javascript * var heart = sheet.shapes.add("Shape1", GC.Spread.Sheets.Shapes.AutoShapeType.heart, 100, 60, 200, 160); * var n = heart.startColumn(); * heart.startColumn(n + 2); * ``` */ startColumn(value?: number): any; /** * Gets or sets the offset relative to the start column of the shape. * @param {number} value The offset relative to the start column of the shape. * @returns {number | GC.Spread.Sheets.Shapes.ShapeBase} If no value is set, returns the offset relative to the start column of the shape. * @example * ```javascript * var heart = sheet.shapes.add("Shape1", GC.Spread.Sheets.Shapes.AutoShapeType.heart, 100, 60, 200, 160); * var n = heart.startColumnOffset(); * heart.startColumnOffset(0); * ``` */ startColumnOffset(value?: number): any; /** * Gets or sets the starting row index of the shape position. * @param {number} value The starting row index of the shape position. * @returns {number | GC.Spread.Sheets.Shapes.ShapeBase} If no value is set, returns the starting row index of the shape. * @example * ```javascript * var heart = sheet.shapes.add("Shape1", GC.Spread.Sheets.Shapes.AutoShapeType.heart, 100, 60, 200, 160); * var n = heart.startRow(); * heart.startRow(n + 2); * ``` */ startRow(value?: number): any; /** * Gets or sets the offset relative to the start row of the shape. * @param {number} value The offset relative to the start row of the shape. * @returns {number | GC.Spread.Sheets.Shapes.ShapeBase} If no value is set, returns the offset relative to the start row of the shape. * @example * ```javascript * var heart = sheet.shapes.add("Shape1", GC.Spread.Sheets.Shapes.AutoShapeType.heart, 100, 60, 200, 160); * var n = heart.startRowOffset(); * heart.startRowOffset(0); * ``` */ startRowOffset(value?: number): any; /** * Get the shape Image src of type Base64 string. * @returns {String} return the shape Image Base64 src string. * @example * ```javascript * let shapeImageSrc = sheet.shapes.all()[0].toImageSrc(); * ``` */ toImageSrc(): string; /** * Get the shape Image src of type Base64 string. * @returns {Promise} return the shape Image Base64 src string. * @example * ```javascript * let shapeImageSrc = await sheet.shapes.all()[0].toImageSrcAsync(); * ``` */ toImageSrcAsync(): Promise; /** * Gets or sets the width of the shape. * @param {number | string} value The width of the shape specified by a number or formula (starts with =) can get a number value. * @returns {number | GC.Spread.Sheets.Shapes.ShapeBase} If no value is set, returns the width of the shape. * @example * ```javascript * var heart = sheet.shapes.add("Shape1", GC.Spread.Sheets.Shapes.AutoShapeType.heart, 100, 60, 200, 160); * var n = heart.width(); * heart.width(n + 50); * ``` */ width(value?: number | string): any; /** * Gets or sets the horizontal location of the shape. * @param {number | string} value The horizontal location of the shape specified by a number or formula (starts with =) can get a number value. * @return {number | GC.Spread.Sheets.Shapes.ShapeBase} If no value is set, returns the horizontal location of the shape. * @example * ```javascript * var heart = sheet.shapes.add("Shape1", GC.Spread.Sheets.Shapes.AutoShapeType.heart, 100, 60, 200, 160); * var n = heart.x(); * heart.x(n + 50); * ``` */ x(value?: number | string): any; /** * Gets or sets the vertical location of the shape. * @param {number | string} value The vertical location of the shape specified by a number or formula (starts with =) can get a number value. * @return {number | GC.Spread.Sheets.Shapes.ShapeBase} If no value is set, returns the vertical location of the shape. * @example * ```javascript * var heart = sheet.shapes.add("Shape1", GC.Spread.Sheets.Shapes.AutoShapeType.heart, 100, 60, 200, 160); * var n = heart.y(); * heart.y(n + 50); * ``` */ y(value?: number | string): any; } export class ShapeCollection{ /** * Represents a shape manager that managers all shapes in a sheet. * @class * @param {GC.Spread.Sheets.Worksheet} sheet The worksheet. */ constructor(sheet: GC.Spread.Sheets.Worksheet); /** * Add a new shape to shape collection * @param {string} name The name of the shape. If name is empty string, a unique name will be generated. * @param {GC.Spread.Sheets.Shapes.AutoShapeType | GC.Spread.Sheets.Shapes.IShapeModel} autoShapeTypeOrModel The type of the shape (for one of the buildin types) or the model for custom shape. * @param {number} [left] The x location of the shape. * @param {number} [top] The y location of the shape. * @param {number} [width] The width of the shape. * @param {number} [height] The height of the shape. * @return {GC.Spread.Sheets.Shapes.Shape} The shape that has been added to the sheet. * @example * ```javascript * // This example shows how to add a new shape * var shape = activeSheet.shapes.add("shape1", GC.Spread.Sheets.Shapes.AutoShapeType.heart, 100, 50, 100, 150); * ``` */ add(name: string, autoShapeTypeOrModel: GC.Spread.Sheets.Shapes.AutoShapeType | GC.Spread.Sheets.Shapes.IShapeModel, left?: number, top?: number, width?: number, height?: number): GC.Spread.Sheets.Shapes.Shape; /** * Add a new camera shape to shape collection * @param {string} name The name of the camera shape. If name is empty string, a unique name will be generated. * @param {string} range The range of the shape generated from, it should be a range formula, like Sheet1!A1:A8. * @param {number} [left] The x location of the camera shape, if leave blank the default value will be 0. * @param {number} [top] The y location of the camera shape, if leave blank the default value will be 0. * @param {number} [width] The width of the camera shape, if leave blank the default value should be same as the original range width. * @param {number} [height] The height of the camera shape, if leave blank the default value should be same as the original range height. * @return {GC.Spread.Sheets.Shapes.CameraShape} The shape that has been added to the sheet. * @example * ```javascript * // This example shows how to add a new camera shape * var shape = activeSheet.shapes.addCameraShape("camera shape 1", 'Sheet1!A1:A8', 100, 50, 100, 150); * ``` */ addCameraShape(name: string, range: string, left?: number, top?: number, width?: number, height?: number): GC.Spread.Sheets.Shapes.CameraShape; /** * Add a Connector Shape to shape collection * @param {string} name The name of the shape. If name is empty string, a unique name will be generated. * @param {GC.Spread.Sheets.Shapes.ConnectorType} connectorType The type of the connector. * @param {number} [beginX] The x location of the start point for the connector shape. * @param {number} [beginY] The y location of the start point for the connector shape. * @param {number} [endX] The x location of the end point for the connector shape. * @param {number} [endY] The y location of the end point for the connector shape. * @return {GC.Spread.Sheets.Shapes.ConnectorShape} The connector shape that has been added to the sheet. * @example * ```javascript * //This example shows how to add a connector shape * var shape1 = activeSheet.shapes.addConnector("shape1", GC.Spread.Sheets.Shapes.ConnectorType.elbow, 200, 50, 300, 200); * ``` */ addConnector(name: string, connectorType: GC.Spread.Sheets.Shapes.ConnectorType, beginX?: number, beginY?: number, endX?: number, endY?: number): GC.Spread.Sheets.Shapes.ConnectorShape; /** * Add a new form control shape to shape collection * @param {string} name The name of the shape. If name is empty string, a unique name will be generated. * @param {GC.Spread.Sheets.Shapes.FormControlType} formControlType The type of the form control shape * @param {number} [left] The x location of the form control shape. * @param {number} [top] The y location of the form control shape. * @param {number} [width] The width of the form control shape. * @param {number} [height] The height of the form control shape. * @return {GC.Spread.Sheets.Shapes.FormControlShape} The from control shape that has been added to the sheet. * @example * ```javascript * // This example shows how to add a new form control shape * var shape = activeSheet.shapes.addFormControl("spinButton", GC.Spread.Sheets.Shapes.FormControlType.spinButton, 100, 50, 100, 50); * ``` */ addFormControl(name: string, formControlType: GC.Spread.Sheets.Shapes.FormControlType, left?: number, top?: number, width?: number, height?: number): GC.Spread.Sheets.Shapes.FormControlShape; /** * Add a new picture shape to shape collection * @param {string} name The name of the shape. If name is empty string, a unique name will be generated. * @param {string} src The src of the picture. * @param {number} [left] The x location of the picture shape. * @param {number} [top] The y location of the picture shape. * @param {number} [width] The width of the picture shape. * @param {number} [height] The height of the picture shape. * @return {GC.Spread.Sheets.Shapes.PictureShape} The picture shape that has been added to the sheet. * @example * ```javascript * // This example shows how to add a new picture shape * var shape = activeSheet.shapes.addPictureShape("Picture 1", "data:image/svg+xml;base64.....", 100, 50, 100, 100); * ``` */ addPictureShape(name: string, src: string, left?: number, top?: number, width?: number, height?: number): GC.Spread.Sheets.Shapes.PictureShape; /** * get all shapes * @returns {GC.Spread.Sheets.Shapes.Shape[]} all shapes * @example * ```javascript * // This sample shows how to get all shapes in shape collection * activeSheet.shapes.add("shape1", GC.Spread.Sheets.Shapes.AutoShapeType.heart, 100, 50, 100, 150); * activeSheet.shapes.addConnector("shape2", GC.Spread.Sheets.Shapes.ConnectorType.elbow, 200, 50, 300, 200); * var shapes = activeSheet.shapes.all(); * ``` */ all(): GC.Spread.Sheets.Shapes.Shape[]; /** * clear all shapes * @example * ```javascript * //This example shows how to clear all shapes in shape collection * activeSheet.shapes.add("shape1", GC.Spread.Sheets.Shapes.AutoShapeType.heart, 100, 50, 100, 150); * activeSheet.shapes.addConnector("shape2", GC.Spread.Sheets.Shapes.ConnectorType.elbow, 200, 50, 300, 200); * activeSheet.shapes.clear(); * ``` */ clear(): void; /** * Get a shape with name * @param {string} name The name of the shape. * @returns {GC.Spread.Sheets.Shapes.Shape} The Shape * @example * ```javascript * //This example shows how to get a shape with name. * activeSheet.shapes.add("shape1", GC.Spread.Sheets.Shapes.AutoShapeType.heart, 100, 50, 100, 150); * activeSheet.shapes.get("shape1"); * ``` */ get(name: string): GC.Spread.Sheets.Shapes.Shape; /** * Groups the Shapes. * @param {GC.Spread.Sheets.Shapes.Shape[]} shapes The shapes to group. * @returns {GC.Spread.Sheets.Shapes.Shape} The Shape group. * @example * ```javascript * //This sample shows how to group some shapes * var shape1 = activeSheet.shapes.add("shape1", GC.Spread.Sheets.Shapes.AutoShapeType.heart, 100, 50, 100, 150); * var shape2 = activeSheet.shapes.addConnector("shape2", GC.Spread.Sheets.Shapes.ConnectorType.elbow, 200, 50, 300, 200); * var shapes = [shape1, shape2]; * var groupShape = activeSheet.shapes.group(shapes) * ``` */ group(shapes: GC.Spread.Sheets.Shapes.Shape[]): GC.Spread.Sheets.Shapes.GroupShape; /** * remove a shape * @param {string} name The name of the shape. * @example * ```javascript * //This example shows how to remove a shape * activeSheet.shapes.add("shape1", GC.Spread.Sheets.Shapes.AutoShapeType.heart, 100, 50, 100, 150); * activeSheet.shapes.remove("shape1"); * ``` */ remove(name: string): void; /** * Gets or sets whether to align shape to grid line or the other shapes. * @param {GC.Spread.Sheets.SnapMode} value Whether to snap shapes to the grid line or other shapes. * @returns {GC.Spread.Sheets.SnapMode | void} If no value is set, returns which snapMode use. * @example * ```javascript * sheet1.shapes.SnapMode(GC.Spread.Sheets.Shapes.SnapMode.grid); * var snapMode = sheet1.shapes.snapMode(); * ``` */ snapMode(value?: GC.Spread.Sheets.Shapes.SnapMode): GC.Spread.Sheets.Shapes.SnapMode | void; /** * Separate a groupShape to some shapes * @param {GC.Spread.Sheets.Shapes.GroupShape} groupShape The groupShape to separate. * @example * ```javascript * //This sample shows how to separate a groupShape to some shapes * var shape1 = activeSheet.shapes.add("shape1", GC.Spread.Sheets.Shapes.AutoShapeType.heart, 100, 50, 100, 150); * var shape2 = activeSheet.shapes.addConnector("shape2", GC.Spread.Sheets.Shapes.ConnectorType.elbow, 200, 50, 300, 200); * var shapes = [shape1, shape2]; * var groupShape = activeSheet.shapes.group(shapes); * activeSheet.shapes.ungroup(groupShape); * ``` */ ungroup(groupShape: GC.Spread.Sheets.Shapes.GroupShape): void; /** * Get or set the z-index for a shape * @param shapeName {string} The name of the shape * @param zIndex {number} The z-index for the shape. The zIndex should be between 0 to all shapes length(not contains). A shape with greater zIndex is always in front of a shape with a lower zIndex. * @example * ```javascript * //This is a sample shows how to use zIndex. * var shape1 = activeSheet.shapes.add("shape1", GC.Spread.Sheets.Shapes.AutoShapeType.heart, 100, 50, 100, 150); * var style = shape1.style(); * style.fill.color = "red"; * shape1.style(style); * var shape2 = activeSheet.shapes.addConnector("shape2", GC.Spread.Sheets.Shapes.ConnectorType.elbow, 100, 50, 200, 200); * activeSheet.shapes.zIndex("shape2"); // 1 * activeSheet.shapes.zIndex("shape2", 0); * ``` */ zIndex(shapeName: string, zIndex: number): number; } export class ShapeStyle{ /** * Represents a shape style. * @param {Object} style The style is an object that has same structure with a ShapeStyle instance, it is optional. * @class */ constructor(style?: Object); /** * Indicates the fill options. * @example * ```javascript * //This sample sets background color and background color transparency for the shape. * var heart = sheet.shapes.add("Shape1", GC.Spread.Sheets.Shapes.AutoShapeType.heart, 100, 60, 200, 160); * var oldStyle = heart.style(); * oldStyle.fill = { * type: GC.Spread.Sheets.Shapes.ShapeFillType.solid, * color: "red", * transparency: 0.5 * }; * heart.style(oldStyle); * * //This sample sets gradient background for the shape. * var heart = sheet.shapes.add("Shape1", GC.Spread.Sheets.Shapes.AutoShapeType.heart, 100, 60, 200, 160); * var oldStyle = heart.style(); * oldStyle.fill = { * type: GC.Spread.Sheets.Shapes.GradientFillType.linear, * angle: 45, * stops: [ * { color: 'blue', position: 0}, * { color: 'pink', position: 1} * ] * }; * heart.style(oldStyle); * * //This sample sets picture background for the shape. * var heart = sheet.shapes.add("Shape1", GC.Spread.Sheets.Shapes.AutoShapeType.heart, 100, 60, 200, 160); * var oldStyle = heart.style(); * oldStyle.fill = { src: "data:image/svg+xml;base64....." }; * heart.style(oldStyle); * * //This sample sets background color and background color transparency with formula for the shape. * var heart = sheet.shapes.add("Shape1", GC.Spread.Sheets.Shapes.AutoShapeType.heart, 100, 60, 200, 160); * sheet.setValue(0, 1, 1); * sheet.setValue(1, 1, "red"); * sheet.setValue(2, 1, 0.5); * var oldStyle = heart.style(); * oldStyle.fill = { * type: "=Sheet1!B1", * color: "=Sheet1!B2", * transparency: "=Sheet1!B3" * }; * heart.style(oldStyle); * * //This sample sets gradient background with formula for the shape. * var heart = sheet.shapes.add("Shape1", GC.Spread.Sheets.Shapes.AutoShapeType.heart, 100, 60, 200, 160); * var oldStyle = heart.style(); * oldStyle.fill = { * type: "=Sheet1!A1", * angle: "=Sheet1!B1", * stops: [ * { color: "=Sheet1!A2", position: "=Sheet1!B2"}, * { color: "=Sheet1!A3", position: "=Sheet1!B3"} * ] * }; * heart.style(oldStyle); * ``` */ fill: GC.Spread.Sheets.Shapes.IShapeFill | GC.Spread.Sheets.Shapes.IShapeGradientFill | GC.Spread.Sheets.Shapes.IShapePictureFill | GC.Spread.Sheets.Shapes.IShapeTextureFill; /** * Indicates the line options. * @example * ```javascript * //This sample sets line color, line style, line width, cap type, join type and line color transparency for the shape. * var shape = sheet.shapes.add("Shape1", GC.Spread.Sheets.Shapes.AutoShapeType.heart, 100, 60, 200, 160); * var oldStyle = shape.style(); * oldStyle.line.color = "red"; * oldStyle.line.lineStyle = GC.Spread.Sheets.Shapes.PresetLineDashStyle.dashDot; * oldStyle.line.width = 5; * oldStyle.line.capType = GC.Spread.Sheets.Shapes.LineCapStyle.square; * oldStyle.line.joinType = GC.Spread.Sheets.Shapes.LineJoinStyle.miter; * oldStyle.line.compoundType = GC.Spread.Sheets.Shapes.CompoundType.double; * oldStyle.line.transparency = 0.5; * shape.style(oldStyle); * * //This sample sets line color, line style, line width, cap type, join type and line color transparency with formula for the shape. * var shape = sheet.shapes.add("Shape1", GC.Spread.Sheets.Shapes.AutoShapeType.heart, 100, 60, 200, 160); * sheet.setValue(0, 1, "red"); * sheet.setValue(1, 1, 4); * sheet.setValue(2, 1, 5); * sheet.setValue(3, 1, 1); * sheet.setValue(4, 1, 1); * sheet.setValue(5, 1, 0.5); * var oldStyle = shape.style(); * oldStyle.line.color = "=Sheet1!B1"; * oldStyle.line.lineStyle = "=Sheet1!B2"; * oldStyle.line.width = "=Sheet1!B3"; * oldStyle.line.capType = "=Sheet1!B4"; * oldStyle.line.joinType = "=Sheet1!B5"; * oldStyle.line.transparency = "=Sheet1!B6"; * oldStyle.line.compoundType = "=Sheet1!B7"; * shape.style(oldStyle); * * //This sample sets line's begin arrowhead style, width, length and end arrowhead style, width, height for the shape. * var shape = sheet.shapes.addConnector("Shape1", GC.Spread.Sheets.Shapes.ConnectorType.straight, 100, 60, 200, 160); * var oldStyle = shape.style(); * oldStyle.line.beginArrowheadStyle = GC.Spread.Sheets.Shapes.ArrowheadStyle.triangle; * oldStyle.line.beginArrowheadWidth = GC.Spread.Sheets.Shapes.ArrowheadWidth.narrow; * oldStyle.line.beginArrowheadLength = GC.Spread.Sheets.Shapes.ArrowheadLength.short; * oldStyle.line.endArrowheadStyle = GC.Spread.Sheets.Shapes.ArrowheadStyle.diamond; * oldStyle.line.endArrowheadWidth = GC.Spread.Sheets.Shapes.ArrowheadWidth.wide; * oldStyle.line.endArrowheadLength = GC.Spread.Sheets.Shapes.ArrowheadLength.long; * shape.style(oldStyle); * ``` */ line: GC.Spread.Sheets.Shapes.IShapeLine; /** * Indicates the text effect options. * @example * ```javascript * //This sample sets the font color, font color transparency and font for the shape. * var heart = sheet.shapes.add("Shape1", GC.Spread.Sheets.Shapes.AutoShapeType.heart, 100, 60, 200, 160); * var oldStyle = heart.style(); * oldStyle.textEffect.color = "red"; * oldStyle.textEffect.transparency = 0.5; * oldStyle.textEffect.font = "20px Arial"; * heart.style(oldStyle); * heart.text("Heart"); * * //This sample sets the font color, font color transparency and font with formula for the shape. * var heart = sheet.shapes.add("Shape1", GC.Spread.Sheets.Shapes.AutoShapeType.heart, 100, 60, 200, 160); * sheet.setValue(0, 1, "red"); * sheet.setValue(1, 1, 0.5); * sheet.setValue(2, 1, "20px Arial"); * var oldStyle = heart.style(); * oldStyle.textEffect.color = "=Sheet1!B1"; * oldStyle.textEffect.transparency = "=Sheet1!B2"; * oldStyle.textEffect.font = "=Sheet1!B3"; * heart.style(oldStyle); * heart.text("Heart"); * ``` */ textEffect: GC.Spread.Sheets.Shapes.IShapeTextEffect; /** * Indicates the text frame options. * @example * ```javascript * //This sample sets the text horizontal alignment and vertical alignment for the shape. * var heart = sheet.shapes.add("Shape1", GC.Spread.Sheets.Shapes.AutoShapeType.heart, 100, 60, 200, 160); * var oldStyle = heart.style(); * oldStyle.textFrame.vAlign = GC.Spread.Sheets.VerticalAlign.center; * oldStyle.textFrame.hAlign = GC.Spread.Sheets.HorizontalAlign.center; * heart.style(oldStyle); * heart.text("Heart"); * * //This sample sets the text horizontal alignment and vertical alignment with formula for the shape. * var heart = sheet.shapes.add("Shape1", GC.Spread.Sheets.Shapes.AutoShapeType.heart, 100, 60, 200, 160); * sheet.setValue(0, 1, 1); * sheet.setValue(1, 1, 1); * var oldStyle = heart.style(); * oldStyle.textFrame.vAlign = "=Sheet1!B1"; * oldStyle.textFrame.hAlign = "=Sheet1!B2"; * heart.style(oldStyle); * heart.text("Heart"); * * // This sample sets the resizeToFitText for the shape. * var rectangle = sheet.shapes.add("Shape1", GC.Spread.Sheets.Shapes.AutoShapeType.rectangle, 100, 60, 200, 160); * var oldStyle = rectangle.style(); * oldStyle.textFrame.resizeToFitText = true; * rectangle.style(style); * ``` */ textFrame: GC.Spread.Sheets.Shapes.IShapeTextFrame; } } module Slicers{ export interface ISlicer{ style: (style?: string | SlicerStyle, shouldCallback?: boolean) => SlicerStyle | ISlicer; getStyleName: () => string | undefined; name: (name?: string, shouldCallback?: boolean) => string | ISlicer; captionName: (name?: string, shouldCallback?: boolean) => string | ISlicer; columnCount: (value?: number, shouldCallback?: boolean) => number | ISlicer; itemHeight: (value?: number, shouldCallback?: boolean) => number | ISlicer; showHeader: (value?: boolean, shouldCallback?: boolean) => boolean | ISlicer; sortState: (value?: GC.Spread.Sheets.SortState) => GC.Spread.Sheets.SortState | ISlicer; showNoDataItems: (isShow?: boolean) => boolean | ISlicer; showNoDataItemsInLast: (isShow?: boolean) => boolean | ISlicer; visuallyNoDataItems: (value?: boolean) => boolean | ISlicer; nameInFormula: () => string; sourceName: () => string; position: (value?: GC.Spread.Sheets.Point) => GC.Spread.Sheets.Point | ISlicer; refresh: () => void; fromJSON (data: any): any; toJSON (): any; isSelected: (value?: boolean) => boolean | ISlicer; isVisible: (value?: boolean) => boolean | ISlicer; isLocked: (value?: boolean) => boolean | ISlicer; disableResizingAndMoving: (value?: boolean, shouldCallback?: boolean) => boolean | ISlicer; dynamicMove: (value?: boolean) => boolean | ISlicer; dynamicSize: (value?: boolean) => boolean | ISlicer; x: (value?: number, shouldCallback?: boolean) => number | ISlicer; y: (value?: number, shouldCallback?: boolean) => number | ISlicer; height: (value?: number) => number | ISlicer; width: (value?: number) => number | ISlicer; startRow: (value?: number, shouldCallback?: boolean) => number | ISlicer; startColumn: (value?: number, shouldCallback?: boolean) => number | ISlicer; endRow: (value?: number, shouldCallback?: boolean) => number | ISlicer; endColumn: (value?: number, shouldCallback?: boolean) => number | ISlicer; startRowOffset: (value?: number, shouldCallback?: boolean) => number | ISlicer; startColumnOffset: (value?: number, shouldCallback?: boolean) => number | ISlicer; endRowOffset: (value?: number, shouldCallback?: boolean) => number | ISlicer; endColumnOffset: (value?: number, shouldCallback?: boolean) => number | ISlicer; allowResize: (value?: boolean, shouldCallback?: boolean) => boolean | ISlicer; allowMove: (value?: boolean, shouldCallback?: boolean) => boolean | ISlicer; toImageSrc: () => string | ISlicer; toImageSrcAsync: () => Promise | ISlicer; } /** * @typedef GC.Spread.Sheets.Slicers.SlicerBorderStyle * @type {"empty" | "thin" | "medium" | "dashed" | "dotted" | "thick" | "double" | "hair" | "mediumDashed" | "dashDot" | "mediumDashDot" | "dashDotDot" | "mediumDashDotDot" | "slantedDashDot"} * @description The border type of slicer border style. */ export type SlicerBorderStyle = "empty" | "thin" | "medium" | "dashed" | "dotted" | "thick" | "double" | "hair" | "mediumDashed" | "dashDot" | "mediumDashDot" | "dashDotDot" | "mediumDashDotDot" | "slantedDashDot" /** * Specifies which type to add a slicer * @enum {number} */ export enum SlicerType{ /** * table slicer. */ table= "table", /** * pivot table item slicer. */ pivotTable= "pivot", /** * pivot table timeline slicer. */ pivotTimeline= "timeline" } /** * Specifies timeline slicer time level * @enum {number} */ export enum TimelineLevel{ /** * years */ years= 1, /** * quarters */ quarters= 2, /** * months */ months= 3, /** * days */ days= 4 } export class CustomSlicerThemeManager extends GC.Spread.Sheets.CustomThemeManagerBase{ /** * Represents a custom slicer theme manager that can manage all custom slicer themes. * @class * @param {GC.Spread.Sheets.Workbook} workbook The workbook. * @extends GC.Spread.Sheets.CustomThemeManagerBase */ constructor(workbook: GC.Spread.Sheets.Workbook); /** * add a new slicer theme. * @param {string | GC.Spread.Sheets.Slicers.SlicerStyle} theme the new slicer theme or just a new slicer theme name you want to add * @returns {GC.Spread.Sheets.Slicers.SlicerStyle | undefined} return the newly added slicer theme, if the named slicer theme is existed, failed to add slicer theme and return undefined * @example * ```javascript * // add a new slicer theme named "custom0" * var spread = new GC.Spread.Sheets.Workbook(document.getElementById("ss")); * let slicerStyle = spread.customSlicerThemes.add("custom0"); * let wholeSlicerStyle = new GC.Spread.Sheets.Slicers.SlicerStyleInfo(); * wholeSlicerStyle.backColor = "#0C66E4"; * slicerStyle.wholeSlicerStyle(wholeSlicerStyle); * ``` */ add(theme: string | GC.Spread.Sheets.Slicers.SlicerStyle): GC.Spread.Sheets.Slicers.SlicerStyle | undefined; /** * get the slicer themes collection. * @returns Array * @example * ```javascript * // get all slicer slicer themes * let slicerStylesCollection = spread.customSlicerThemes.all(); * ``` */ all(): Array; /** * get the slicer theme by name. * @param {string} name the specific name of the slicer theme to get * @returns {GC.Spread.Sheets.Slicers.SlicerStyle | undefined} If the corresponding slicer theme with the spefic name is found, return the theme; otherwise, return undefined. * @example * ```javascript * // get slicer theme * slicerStyle = spread.customSlicerThemes.get("custom0"); * ``` */ get(name: string): GC.Spread.Sheets.Slicers.SlicerStyle | undefined; /** * remove the slicer theme by name. * @param {string} name the specific name of the slicer theme to remove * @returns {void} * @example * ```javascript * // delete slicer theme * spread.customSlicerThemes.remove("custom0"); * ``` */ remove(name: string): void; /** * update the slicer theme. * @param {string} oldThemeName the specific name of the slicer theme to update * @param {GC.Spread.Sheets.Slicers.SlicerStyle} newTheme the specific name of the slicer theme to update * @returns {void} * @example * ```javascript * // update slicer theme * slicerStyle = spread.customSlicerThemes.update("custom0", new GC.Spread.Sheets.Slicers.SlicerStyle()); * ``` */ update(oldThemeName: string, newTheme: GC.Spread.Sheets.Slicers.SlicerStyle): void; } export class CustomTimelineThemeManager extends GC.Spread.Sheets.CustomThemeManagerBase{ /** * Represents a custom timeline slicer theme manager that can manage all custom timeline slicer themes. * @class * @param {GC.Spread.Sheets.Workbook} workbook The workbook. * @extends GC.Spread.Sheets.CustomThemeManagerBase */ constructor(workbook: GC.Spread.Sheets.Workbook); /** * add a new timeLine theme. * @param {string | GC.Spread.Sheets.Slicers.TimelineStyle} theme the new timeLine theme or just a new timeLine theme name you want to add. * @returns {GC.Spread.Sheets.Slicers.TimelineStyle | undefined} return the newly added timeLine theme, if the named timeLine theme is existed, failed to add timeLine theme and return undefined * @example * ```javascript * // add a new timeLine theme named "custom0" * var spread = new GC.Spread.Sheets.Workbook(document.getElementById("ss")); * let timeLineStyle = spread.customTimelineThemes.add("custom0"); * let wholeTimelineStyle = new GC.Spread.Sheets.Slicers.TimelineStyleInfo(); * wholeTimelineStyle.backColor = "#0C66E4"; * timeLineStyle.wholeTimelineStyle(wholeTimelineStyle); * ``` */ add(theme: string | GC.Spread.Sheets.Slicers.TimelineStyle): GC.Spread.Sheets.Slicers.TimelineStyle | undefined; /** * get the timeLine themes collection. * @returns Array * @example * ```javascript * // get all timeLine timeLine themes * let timeLineStylesCollection = spread.customTimelineThemes.all(); * ``` */ all(): Array; /** * get the timeLine theme by name. * @param {string} name the specific name of the timeLine theme to get * @returns {GC.Spread.Sheets.Slicers.TimelineStyle | undefined} If the corresponding timeLine theme with the spefic name is found, return the theme; otherwise, return undefined. * @example * ```javascript * // get timeLine theme * timeLineStyle = spread.customTimelineThemes.get("custom0"); * ``` */ get(name: string): GC.Spread.Sheets.Slicers.TimelineStyle | undefined; /** * remove the timeLine theme by name. * @param {string} name the specific name of the timeLine theme to remove * @returns {void} * @example * ```javascript * // delete timeLine theme * spread.customTimelineThemes.remove("custom0"); * ``` */ remove(name: string): void; /** * update the timeline slicer theme. * @param {string} oldThemeName the specific name of the timeline slicer theme to update * @param {GC.Spread.Sheets.Slicers.TimelineStyle} newTheme the specific name of the timeline slicer theme to update * @returns {void} * @example * ```javascript * // update timeline slicer theme * timelineStyle = spread.customTimelineThemes.update("custom0", new GC.Spread.Sheets.Slicers.TimelineStyle()); * ``` */ update(oldThemeName: string, newTheme: GC.Spread.Sheets.Slicers.TimelineStyle): void; } export class DOMTableSlicer extends GC.Spread.Sheets.FloatingObjects.FloatingObject{ /** * Represents a slicer. * @class GC.Spread.Sheets.DOMTableSlicer * @param {string} name The slicer name. * @param {GC.Spread.Sheets.Tables.Table} table The table that relates to the slicer. * @param {string} columnName The name of the table's column. */ constructor(name: string, table: GC.Spread.Sheets.Tables.Table, columnName: string); /** * Gets or sets the caption name of the slicer. * @param {string} [value] The caption name of the slicer. captionName property is displayed in the header of the slicer. * @returns {string | GC.Spread.Sheets.Slicers.ISlicer} If no value is set, returns the caption name of the slicer; otherwise, returns the slicer. * @example * ```javascript * //This example uses the captionName method. * //create a table * var spread = new GC.Spread.Sheets.Workbook('ss'); * var activeSheet = spread.getActiveSheet(); * datas = [ * ["1", "NewYork", "1968/6/8", "80", "180"], * ["4", "NewYork", "1972/7/3", "72", "168"], * ["4", "NewYork", "1964/3/2", "71", "179"], * ["5", "Washington", "1972/8/8","80", "171"], * ["6", "Washington", "1986/2/2", "89", "161"], * ["7", "Washington", "2012/2/15", "71", "240"]]; * var table = activeSheet.tables.addFromDataSource("table1", 2, 2, datas); * dataColumns = ["Name", "City", "Birthday", "Weight", "Height"]; * table.setColumnName(0, dataColumns[0]); * table.setColumnName(1, dataColumns[1]); * table.setColumnName(2, dataColumns[2]); * table.setColumnName(3, dataColumns[3]); * table.setColumnName(4, dataColumns[4]); * //slicer style * var style1 = new GC.Spread.Sheets.Slicers.SlicerStyles.light4(); * var slicer = new GC.Spread.Sheets.Slicers.DOMTableSlicer('slicer1', table, 'Name'); * //change the slicer properties. * slicer.position(new GC.Spread.Sheets.Point(100, 200)); * slicer.captionName("S1"); * slicer.style(style1); * ``` */ captionName(value?: string): any; /** * Gets or sets the column count for the slicer. * @param {number} [value] The column count of the slicer. The columnCount property of a slicer specifies the number of columns displayed per row within the slicer. * @returns {number | GC.Spread.Sheets.Slicers.ISlicer} If no value is set, returns the column count for the slicer; otherwise, returns the slicer. * @example * ```javascript * //This example changes the slicer column count * //create a table * datas = [ * ["1", "NewYork", "1968/6/8", "80", "180"], * ["4", "NewYork", "1972/7/3", "72", "168"], * ["4", "NewYork", "1964/3/2", "71", "179"], * ["5", "Washington", "1972/8/8","80", "171"], * ["6", "Washington", "1986/2/2", "89", "161"], * ["7", "Washington", "2012/2/15", "71", "240"]]; * var spread = new GC.Spread.Sheets.Workbook('ss'); * var activeSheet = spread.getActiveSheet(); * var table = activeSheet.tables.addFromDataSource("table1", 2, 2, datas); * dataColumns = ["Name", "City", "Birthday", "Weight", "Height"]; * table.setColumnName(0, dataColumns[0]); * table.setColumnName(1, dataColumns[1]); * table.setColumnName(2, dataColumns[2]); * table.setColumnName(3, dataColumns[3]); * table.setColumnName(4, dataColumns[4]); * //add a slicer to the sheet and return the slicer instance. * var slicer = new GC.Spread.Sheets.Slicers.DOMTableSlicer('slicer1', table, 'Name'); * console.log(slicer.columnCount()); * slicer.columnCount(3); * console.log(slicer.columnCount()); * ``` */ columnCount(value?: number): any; /** * Gets or sets whether to disable resizing and moving the slicer. * @param {boolean} [value] The setting for whether to disable resizing and moving the slicer. The disableResizingAndMoving property of a slicer specifies whether the user is allowed to resize or move the slicer control, restricting any changes to its size or position. * @returns {boolean | GC.Spread.Sheets.Slicers.ISlicer} If no value is set, returns whether to disable resizing and moving the slicer; otherwise, returns the slicer. * @example * ```javascript * //This example prevents moving or resizing the slicer. * //create a table * var spread = new GC.Spread.Sheets.Workbook('ss'); * var activeSheet = spread.getActiveSheet(); * datas = [ * ["1", "NewYork", "1968/6/8", "80", "180"], * ["4", "NewYork", "1972/7/3", "72", "168"], * ["4", "NewYork", "1964/3/2", "71", "179"], * ["5", "Washington", "1972/8/8","80", "171"], * ["6", "Washington", "1986/2/2", "89", "161"], * ["7", "Washington", "2012/2/15", "71", "240"]]; * var table = activeSheet.tables.addFromDataSource("table1", 2, 2, datas); * dataColumns = ["Name", "City", "Birthday", "Weight", "Height"]; * table.setColumnName(0, dataColumns[0]); * table.setColumnName(1, dataColumns[1]); * table.setColumnName(2, dataColumns[2]); * table.setColumnName(3, dataColumns[3]); * table.setColumnName(4, dataColumns[4]); * //slicer style * var style1 = new GC.Spread.Sheets.Slicers.SlicerStyles.light4(); * var slicer = new GC.Spread.Sheets.Slicers.DOMTableSlicer('slicer1', table, 'Name'); * //change the slicer properties. * slicer.position(new GC.Spread.Sheets.Point(100, 200)); * slicer.disableResizingAndMoving(true); * slicer.style(style1); * ``` */ disableResizingAndMoving(value?: boolean): any; /** * Gets or sets the item height for the slicer. * @param {number} [value] The item height of the slicer. The itemHeight property of a slicer specifies the height of each item or row within the slicer. * @returns {number | GC.Spread.Sheets.Slicers.ISlicer} If no value is set, returns the item height for the slicer; otherwise, returns the slicer. * @example * ```javascript * //This example changes the slicer item height. * //create a table * datas = [ * ["1", "NewYork", "1968/6/8", "80", "180"], * ["4", "NewYork", "1972/7/3", "72", "168"], * ["4", "NewYork", "1964/3/2", "71", "179"], * ["5", "Washington", "1972/8/8","80", "171"], * ["6", "Washington", "1986/2/2", "89", "161"], * ["7", "Washington", "2012/2/15", "71", "240"]]; * var spread = new GC.Spread.Sheets.Workbook('ss'); * var activeSheet = spread.getActiveSheet(); * var table = activeSheet.tables.addFromDataSource("table1", 2, 2, datas); * dataColumns = ["Name", "City", "Birthday", "Weight", "Height"]; * table.setColumnName(0, dataColumns[0]); * table.setColumnName(1, dataColumns[1]); * table.setColumnName(2, dataColumns[2]); * table.setColumnName(3, dataColumns[3]); * table.setColumnName(4, dataColumns[4]); * * var slicer = new GC.Spread.Sheets.Slicers.DOMTableSlicer('slicer1', table, 'Name'); * console.log(slicer.itemHeight()); // 21 * slicer.itemHeight(35); * console.log(slicer.itemHeight()); // 35 * ``` */ itemHeight(value?: number): any; /** * Gets or sets the name of the slicer. * @param {string} [value] The name of the slicer. The name must be unique across all slicers within a workbook. * @returns {string | GC.Spread.Sheets.Slicers.ISlicer} If no value is set, returns the name of the slicer; otherwise, returns the slicer. */ name(value?: string): any; /** * Gets or sets whether to show the slicer header. * @param {boolean} [value] The show header setting of the slicer. The showHeader property of a slicer specifies whether the header, which includes the title and filter-related controls, is displayed in the slicer. * @returns {boolean | GC.Spread.Sheets.Slicers.ISlicer} If no value is set, returns whether to show the slicer header; otherwise, returns the slicer. * @example * ```javascript * //This example hides the slicer header. * //create a table * datas = [ * ["1", "NewYork", "1968/6/8", "80", "180"], * ["4", "NewYork", "1972/7/3", "72", "168"], * ["4", "NewYork", "1964/3/2", "71", "179"], * ["5", "Washington", "1972/8/8","80", "171"], * ["6", "Washington", "1986/2/2", "89", "161"], * ["7", "Washington", "2012/2/15", "71", "240"]]; * var spread = new GC.Spread.Sheets.Workbook('ss'); * var activeSheet = spread.getActiveSheet(); * var table = activeSheet.tables.addFromDataSource("table1", 2, 2, datas); * dataColumns = ["Name", "City", "Birthday", "Weight", "Height"]; * table.setColumnName(0, dataColumns[0]); * table.setColumnName(1, dataColumns[1]); * table.setColumnName(2, dataColumns[2]); * table.setColumnName(3, dataColumns[3]); * table.setColumnName(4, dataColumns[4]); * //slicer style * var style1 = new GC.Spread.Sheets.Slicers.SlicerStyles.light4(); * //add a slicer to the sheet and return the slicer instance. * var slicer = new GC.Spread.Sheets.Slicers.DOMTableSlicer('slicer1', table, 'Name'); * slicer.position(new GC.Spread.Sheets.Point(100, 200)); * slicer.showHeader(false); * slicer.style(style1); * ``` */ showHeader(value?: boolean): any; /** * Gets or sets whether to show the no data items of the slicer. * @param {boolean} [value] The show no data items setting of the slicer. The showNoDataItems property of a slicer specifies whether to display items with no associated data in the connected PivotTable or data source within the slicer. * @returns {boolean | GC.Spread.Sheets.Slicers.ISlicer} If no value is set, returns whether to show the no data items of the slicer; otherwise, returns the slicer. * @example * ```javascript * //create a table * var spread = new GC.Spread.Sheets.Workbook('ss'); * var activeSheet = spread.getActiveSheet(); * datas = [ * ["1", "NewYork", "1968/6/8", "80", "180"], * ["4", "NewYork", "1972/7/3", "72", "168"], * ["4", "NewYork", "1964/3/2", "71", "179"], * ["5", "Washington", "1972/8/8","80", "171"], * ["6", "Washington", "1986/2/2", "89", "161"], * ["7", "Washington", "2012/2/15", "71", "240"]]; * var table = activeSheet.tables.addFromDataSource("table1", 2, 2, datas); * dataColumns = ["Name", "City", "Birthday", "Weight", "Height"]; * table.setColumnName(0, dataColumns[0]); * table.setColumnName(1, dataColumns[1]); * table.setColumnName(2, dataColumns[2]); * table.setColumnName(3, dataColumns[3]); * table.setColumnName(4, dataColumns[4]); * var slicer = new GC.Spread.Sheets.Slicers.DOMTableSlicer('slicer1', table, 'Name'); * //change the slicer properties. * slicer.showNoDataItems(false); * ``` */ showNoDataItems(value?: boolean): any; /** * Gets or sets whether to show the no data items last. * @param {boolean} [value] The show no data items last setting of the slicer. The showNoDataItemsInLast property of a slicer specifies whether to display items with no associated data at the end of the slicer's list when presenting the items. * @returns {boolean | GC.Spread.Sheets.Slicers.ISlicer} If no value is set, returns whether to show the no data items last; otherwise, returns the slicer. * @example * ```javascript * //create a table * var spread = new GC.Spread.Sheets.Workbook('ss'); * var activeSheet = spread.getActiveSheet(); * datas = [ * ["1", "NewYork", "1968/6/8", "80", "180"], * ["4", "NewYork", "1972/7/3", "72", "168"], * ["4", "NewYork", "1964/3/2", "71", "179"], * ["5", "Washington", "1972/8/8","80", "171"], * ["6", "Washington", "1986/2/2", "89", "161"], * ["7", "Washington", "2012/2/15", "71", "240"]]; * var table = activeSheet.tables.addFromDataSource("table1", 2, 2, datas); * dataColumns = ["Name", "City", "Birthday", "Weight", "Height"]; * table.setColumnName(0, dataColumns[0]); * table.setColumnName(1, dataColumns[1]); * table.setColumnName(2, dataColumns[2]); * table.setColumnName(3, dataColumns[3]); * table.setColumnName(4, dataColumns[4]); * var slicer = new GC.Spread.Sheets.Slicers.DOMTableSlicer('slicer1', table, 'Name'); * //change the slicer properties. * slicer.showNoDataItemsInLast(false); * ``` */ showNoDataItemsInLast(value?: boolean): any; /** * Gets or sets the sort state of the slicer. * @param {GC.Spread.Sheets.SortState} [value] The sort state of the slicer. The sortState property of a slicer specifies the current sorting state applied to the items within the slicer, indicating whether they are sorted in ascending, descending order. * @returns {GC.Spread.Sheets.SortState | GC.Spread.Sheets.Slicers.ISlicer} If no value is set, returns the sort state of the slicer; otherwise, returns the slicer. * @example * ```javascript * //This example sets the sort order of the items in the slicer. * //create a table * var spread = new GC.Spread.Sheets.Workbook('ss'); * var activeSheet = spread.getActiveSheet(); * datas = [ * ["1", "NewYork", "1968/6/8", "80", "180"], * ["4", "NewYork", "1972/7/3", "72", "168"], * ["4", "NewYork", "1964/3/2", "71", "179"], * ["5", "Washington", "1972/8/8","80", "171"], * ["6", "Washington", "1986/2/2", "89", "161"], * ["7", "Washington", "2012/2/15", "71", "240"]]; * var table = activeSheet.tables.addFromDataSource("table1", 2, 2, datas); * dataColumns = ["Name", "City", "Birthday", "Weight", "Height"]; * table.setColumnName(0, dataColumns[0]); * table.setColumnName(1, dataColumns[1]); * table.setColumnName(2, dataColumns[2]); * table.setColumnName(3, dataColumns[3]); * table.setColumnName(4, dataColumns[4]); * // slicer style * var style1 = new GC.Spread.Sheets.Slicers.SlicerStyles.light4(); * var slicer = new GC.Spread.Sheets.Slicers.DOMTableSlicer('slicer1', table, 'Name'); * //set slicer properties * slicer.position(new GC.Spread.Sheets.Point(100, 200)); * slicer.sortState(GC.Spread.Sheets.SortState.descending); * slicer.style(style1); * ``` */ sortState(value?: GC.Spread.Sheets.SortState): any; /** * Gets or sets the style of the slicer. * @param {string | GC.Spread.Sheets.Slicers.SlicerStyle} value The style or style name of the slicer. The style property of a slicer specifies the visual appearance and formatting style applied to the slicer, defining its overall look and presentation. * @returns {GC.Spread.Sheets.Slicers.SlicerStyle | GC.Spread.Sheets.Slicers.ISlicer} If no value is set, returns The style of the slicer; otherwise, returns the slicer. * @example * ```javascript * //This example uses a built-in style. * //create a table * var spread = new GC.Spread.Sheets.Workbook('ss'); * var activeSheet = spread.getActiveSheet(); * datas = [ * ["1", "NewYork", "1968/6/8", "80", "180"], * ["4", "NewYork", "1972/7/3", "72", "168"], * ["4", "NewYork", "1964/3/2", "71", "179"], * ["5", "Washington", "1972/8/8","80", "171"], * ["6", "Washington", "1986/2/2", "89", "161"], * ["7", "Washington", "2012/2/15", "71", "240"]]; * var table = activeSheet.tables.addFromDataSource("table1", 2, 2, datas); * dataColumns = ["Name", "City", "Birthday", "Weight", "Height"]; * table.setColumnName(0, dataColumns[0]); * table.setColumnName(1, dataColumns[1]); * table.setColumnName(2, dataColumns[2]); * table.setColumnName(3, dataColumns[3]); * table.setColumnName(4, dataColumns[4]); * // slicer style * var style1 = new GC.Spread.Sheets.Slicers.SlicerStyles.light4(); * var slicer = new GC.Spread.Sheets.Slicers.DOMTableSlicer('slicer1', table, 'Name'); * //change the slicer properties. * slicer.position(new GC.Spread.Sheets.Point(100, 200)); * slicer.style(style1); * ``` */ style(value?: string | GC.Spread.Sheets.Slicers.SlicerStyle): any; /** * Get the slicer Image src of type Base64 string. * @returns {String} return the slicer Image Base64 src string. * @example * ```javascript * let slicerImageSrc = sheet.slicers.all()[0].toImageSrc(); * ``` */ toImageSrc(): string; /** * Get the slicer Image src of type Base64 string. * @returns {Promise} return the slicer Image Base64 src string. * @example * ```javascript * let slicerImageSrc = await sheet.slicers.all()[0].toImageSrcAsync(); * ``` */ toImageSrcAsync(): Promise; /** * Gets or sets whether to visually distinguish the items with no data. * @param {boolean} [value] The setting for items with no data. The visuallyNoDataItems property of a slicer specifies the visual representation or handling of items with no associated data within the slicer. * @returns {boolean | GC.Spread.Sheets.Slicers.ISlicer} If no value is set, returns whether to visually distinguish the items with no data; otherwise, returns the slicer. * @example * ```javascript * //create a table * var spread = new GC.Spread.Sheets.Workbook('ss'); * var activeSheet = spread.getActiveSheet(); * datas = [ * ["1", "NewYork", "1968/6/8", "80", "180"], * ["4", "NewYork", "1972/7/3", "72", "168"], * ["4", "NewYork", "1964/3/2", "71", "179"], * ["5", "Washington", "1972/8/8","80", "171"], * ["6", "Washington", "1986/2/2", "89", "161"], * ["7", "Washington", "2012/2/15", "71", "240"]]; * var table = activeSheet.tables.addFromDataSource("table1", 2, 2, datas); * dataColumns = ["Name", "City", "Birthday", "Weight", "Height"]; * table.setColumnName(0, dataColumns[0]); * table.setColumnName(1, dataColumns[1]); * table.setColumnName(2, dataColumns[2]); * table.setColumnName(3, dataColumns[3]); * table.setColumnName(4, dataColumns[4]); * var slicer = new GC.Spread.Sheets.Slicers.DOMTableSlicer('slicer1', table, 'Name'); * //change the slicer properties. * slicer.visuallyNoDataItems(false); * ``` */ visuallyNoDataItems(value?: boolean): any; } export class ItemSlicer{ /** * Represents an item slicer. * @param {string} name The name of the item slicer. * @param {GC.Spread.Slicers.GeneralSlicerData} slicerData An instance of the GeneralSlicerData or TableSlicerData. * @param {string} columnName The column name that relates to the item slicer. * @class GC.Spread.Sheets.Slicers.ItemSlicer * @example * ```javascript * //This example creates an item slicer. * //create table * var dataSource = [ * { Name: "Bob", City: "NewYork", Birthday: "1968/6/8" }, * { Name: "Betty", City: "NewYork", Birthday: "1972/7/3" }, * { Name: "Alice", City: "Washington", Birthday: "2012/2/15" }, * ]; * var table = activeSheet.tables.addFromDataSource("table1", 1, 1, dataSource); * var slicerData = new GC.Spread.Sheets.Slicers.TableSlicerData(table) * //Set slicer data to item slicer. * var slicer = new GC.Spread.Sheets.Slicers.ItemSlicer("slicer", slicerData, "Name"); * //Add the item slicer to the dom tree. * //The "slicerHost" is the div you want to add the slicer's dom to. * $("#slicerHost").append(slicer.getDOMElement()); * ``` */ constructor(name: string, slicerData: GC.Spread.Slicers.GeneralSlicerData, columnName: string); /** * Gets or sets the caption name of the item slicer. * @param {string} [value] The caption name of the item slicer. captionName property is displayed in the header of the slicer. * @returns {string | GC.Spread.Sheets.Slicers.ItemSlicer} If no value is set, returns the caption name of the item slicer; otherwise, returns the item slicer. * @example * ```javascript * var spread = new GC.Spread.Sheets.Workbook('ss'); * var activeSheet = spread.getActiveSheet(); * var dataSource = [ * { Name: "Bob", City: "NewYork", Birthday: "1968/6/8" }, * { Name: "Betty", City: "NewYork", Birthday: "1972/7/3" }, * { Name: "Alice", City: "Washington", Birthday: "2012/2/15" }, * ]; * var table = activeSheet.tables.addFromDataSource("table1", 1, 1, dataSource); * var slicerData = new GC.Spread.Sheets.Slicers.TableSlicerData(table) * //Set slicer data to item slicer. * var slicer = new GC.Spread.Sheets.Slicers.ItemSlicer("slicer", slicerData, "Name"); * var oldValue = slicer.captionName(); * console.log(oldValue); * slicer.captionName('Slicer_Caption'); * var newValue = slicer.captionName(); * console.log(newValue); * ``` */ captionName(value?: string): any; /** * Gets or sets the column count of the item slicer. * @param {number} [value] The column count of the item slicer. The columnCount property of a slicer specifies the number of columns displayed per row within the slicer. * @returns {number | GC.Spread.Sheets.Slicers.ItemSlicer} If no value is set, returns the column count of the item slicer; otherwise, returns the item slicer. * @example * ```javascript * var spread = new GC.Spread.Sheets.Workbook('ss'); * var activeSheet = spread.getActiveSheet(); * var dataSource = [ * { Name: "Bob", City: "NewYork", Birthday: "1968/6/8" }, * { Name: "Betty", City: "NewYork", Birthday: "1972/7/3" }, * { Name: "Alice", City: "Washington", Birthday: "2012/2/15" }, * ]; * var table = activeSheet.tables.addFromDataSource("table1", 1, 1, dataSource); * var slicerData = new GC.Spread.Sheets.Slicers.TableSlicerData(table) * //Set slicer data to item slicer. * var slicer = new GC.Spread.Sheets.Slicers.ItemSlicer("slicer", slicerData, "Name"); * var oldValue = slicer.columnCount(); * console.log(oldValue); * slicer.columnCount(3); * var newValue = slicer.columnCount(); * console.log(newValue); * ``` */ columnCount(value?: number): any; /** * Gets the dom element of the item slicer. * @returns {HTMLElement} The dom element of the item slicer. * @example * ```javascript * //This example creates an item slicer. * //create table * var dataSource = [ * { Name: "Bob", City: "NewYork", Birthday: "1968/6/8" }, * { Name: "Betty", City: "NewYork", Birthday: "1972/7/3" }, * { Name: "Alice", City: "Washington", Birthday: "2012/2/15" }, * ]; * var table = activeSheet.tables.addFromDataSource("table1", 1, 1, dataSource); * var slicerData = new GC.Spread.Sheets.Slicers.TableSlicerData(table) * //Set slicer data to item slicer. * var slicer = new GC.Spread.Sheets.Slicers.ItemSlicer("slicer", slicerData, "Name"); * //Add the item slicer to the dom tree. * //The "slicerHost" is the div you want to add the slicer's dom to. * $("#slicerHost").append(slicer.getDOMElement()); * ``` */ getDOMElement(): HTMLElement; /** * Gets or sets a style name for the table item slicer. * @returns {string} returns the table item slicer style name. */ getStyleName(): string | undefined; /** * Gets or sets the height of the item slicer. * @param {number} [value] The height of the item slicer. The height property of a slicer specifies the vertical dimension or height of the slicer, determining its size along the y-axis. * @returns {number | GC.Spread.Sheets.Slicers.ItemSlicer} If no value is set, returns the height of the item slicer; otherwise, returns the item slicer. * @example * ```javascript * var spread = new GC.Spread.Sheets.Workbook('ss'); * var activeSheet = spread.getActiveSheet(); * var dataSource = [ * { Name: "Bob", City: "NewYork", Birthday: "1968/6/8" }, * { Name: "Betty", City: "NewYork", Birthday: "1972/7/3" }, * { Name: "Alice", City: "Washington", Birthday: "2012/2/15" }, * ]; * var table = activeSheet.tables.addFromDataSource("table1", 1, 1, dataSource); * var slicerData = new GC.Spread.Sheets.Slicers.TableSlicerData(table) * //Set slicer data to item slicer. * var slicer = new GC.Spread.Sheets.Slicers.ItemSlicer("slicer", slicerData, "Name"); * var oldValue = slicer.height(); * console.log(oldValue); * slicer.height(120); * var newValue = slicer.height(); * console.log(newValue); * ``` */ height(value?: number): any; /** * Gets or sets the item height of the item slicer. * @param {number} [value] The item height of the item slicer. The ItemHeight property of a slicer specifies the height of each item or row within the slicer control. * @returns {number | GC.Spread.Sheets.Slicers.ItemSlicer} If no value is set, returns the item height of the item slicer; otherwise, returns the item slicer. * @example * ```javascript * var spread = new GC.Spread.Sheets.Workbook('ss'); * var activeSheet = spread.getActiveSheet(); * var dataSource = [ * { Name: "Bob", City: "NewYork", Birthday: "1968/6/8" }, * { Name: "Betty", City: "NewYork", Birthday: "1972/7/3" }, * { Name: "Alice", City: "Washington", Birthday: "2012/2/15" }, * ]; * var table = activeSheet.tables.addFromDataSource("table1", 1, 1, dataSource); * var slicerData = new GC.Spread.Sheets.Slicers.TableSlicerData(table) * //Set slicer data to item slicer. * var slicer = new GC.Spread.Sheets.Slicers.ItemSlicer("slicer", slicerData, "Name"); * var oldValue = slicer.itemHeight(); * console.log(oldValue); * slicer.itemHeight(34); * var newValue = slicer.itemHeight(); * console.log(newValue); * ``` */ itemHeight(value?: number): any; /** * Gets or sets the name of the item slicer. * @param {string} [value] The name of the item slicer. The name property of a slicer specifies the unique identifier or label assigned to the slicer, allowing for identification and reference within the workbook or programmatic interactions. * @returns {string | GC.Spread.Sheets.Slicers.ItemSlicer} If no value is set, returns the name of the item slicer; otherwise, returns the item slicer. * @example * ```javascript * var spread = new GC.Spread.Sheets.Workbook('ss'); * var activeSheet = spread.getActiveSheet(); * var dataSource = [ * { Name: "Bob", City: "NewYork", Birthday: "1968/6/8" }, * { Name: "Betty", City: "NewYork", Birthday: "1972/7/3" }, * { Name: "Alice", City: "Washington", Birthday: "2012/2/15" }, * ]; * var table = activeSheet.tables.addFromDataSource("table1", 1, 1, dataSource); * var slicerData = new GC.Spread.Sheets.Slicers.TableSlicerData(table) * //Set slicer data to item slicer. * var slicer = new GC.Spread.Sheets.Slicers.ItemSlicer("slicer", slicerData, "Name"); * var oldValue = slicer.name(); * console.log(oldValue); * slicer.name('SlicerA'); * var newValue = slicer.name(); * console.log(newValue); * ``` */ name(value?: string): any; /** * Gets or sets whether to show the header of the item slicer. * @param {boolean} [value] The show header setting of the item slicer. The showHeader property of a slicer specifies whether the header, which includes the title and filter-related controls, is displayed in the slicer. * @returns {boolean | GC.Spread.Sheets.Slicers.ItemSlicer} If no value is set, returns whether to show the header of the item slicer; otherwise, returns the item slicer. * @example * ```javascript * var spread = new GC.Spread.Sheets.Workbook('ss'); * var activeSheet = spread.getActiveSheet(); * var dataSource = [ * { Name: "Bob", City: "NewYork", Birthday: "1968/6/8" }, * { Name: "Betty", City: "NewYork", Birthday: "1972/7/3" }, * { Name: "Alice", City: "Washington", Birthday: "2012/2/15" }, * ]; * var table = activeSheet.tables.addFromDataSource("table1", 1, 1, dataSource); * var slicerData = new GC.Spread.Sheets.Slicers.TableSlicerData(table) * //Set slicer data to item slicer. * var slicer = new GC.Spread.Sheets.Slicers.ItemSlicer("slicer", slicerData, "Name"); * var oldValue = slicer.showHeader(); * console.log(oldValue); * slicer.showHeader(false); * var newValue = slicer.showHeader(); * console.log(newValue); * ``` */ showHeader(value?: boolean): any; /** * Gets or sets whether to show the no data items of the item slicer. * @param {boolean} [value] The show no data items setting of the slicer. The showNoDataItems property of a slicer specifies whether to display items with no associated data in the connected PivotTable or data source within the slicer control. * @returns {boolean | GC.Spread.Sheets.Slicers.ItemSlicer} If no value is set, returns whether to show the no data items of the item slicer; otherwise, returns the item slicer. * @example * ```javascript * var spread = new GC.Spread.Sheets.Workbook('ss'); * var activeSheet = spread.getActiveSheet(); * var dataSource = [ * { Name: "Bob", City: "NewYork", Birthday: "1968/6/8" }, * { Name: "Betty", City: "NewYork", Birthday: "1972/7/3" }, * { Name: "Alice", City: "Washington", Birthday: "2012/2/15" }, * ]; * var table = activeSheet.tables.addFromDataSource("table1", 1, 1, dataSource); * var slicerData = new GC.Spread.Sheets.Slicers.TableSlicerData(table) * //Set slicer data to item slicer. * var slicer = new GC.Spread.Sheets.Slicers.ItemSlicer("slicer", slicerData, "Name"); * var oldValue = slicer.showNoDataItems(); * console.log(oldValue); * slicer.showNoDataItems(false); * var newValue = slicer.showNoDataItems(); * console.log(newValue); * ``` */ showNoDataItems(value?: boolean): any; /** * Gets or sets whether to show the no data items last. * @param {boolean} [value] The show no data items in last setting of the slicer. The showNoDataItemsInLast property of a slicer specifies whether to display items with no associated data at the end of the slicer control's list when presenting the items. * @returns {boolean | GC.Spread.Sheets.Slicers.ItemSlicer} If no value is set, returns whether to show the no data items last; otherwise, returns the item slicer. * @example * ```javascript * var spread = new GC.Spread.Sheets.Workbook('ss'); * var activeSheet = spread.getActiveSheet(); * var dataSource = [ * { Name: "Bob", City: "NewYork", Birthday: "1968/6/8" }, * { Name: "Betty", City: "NewYork", Birthday: "1972/7/3" }, * { Name: "Alice", City: "Washington", Birthday: "2012/2/15" }, * ]; * var table = activeSheet.tables.addFromDataSource("table1", 1, 1, dataSource); * var slicerData = new GC.Spread.Sheets.Slicers.TableSlicerData(table) * //Set slicer data to item slicer. * var slicer = new GC.Spread.Sheets.Slicers.ItemSlicer("slicer", slicerData, "Name"); * var oldValue = slicer.showNoDataItemsInLast(); * console.log(oldValue); * slicer.showNoDataItemsInLast(false); * var newValue = slicer.showNoDataItemsInLast(); * console.log(newValue); * ``` */ showNoDataItemsInLast(value?: boolean): any; /** * Gets or sets the sort state of the item slicer. * @param {GC.Spread.Sheets.SortState} [value] The sort state of the item slicer. The sortState property of a slicer specifies the current sorting state applied to the items within the slicer, indicating whether they are sorted in ascending, descending order, or not sorted. * @returns {GC.Spread.Sheets.SortState | GC.Spread.Sheets.Slicers.ItemSlicer} If no value is set, returns the sort state of the item slicer; otherwise, returns the item slicer. * @example * ```javascript * var spread = new GC.Spread.Sheets.Workbook('ss'); * var activeSheet = spread.getActiveSheet(); * var dataSource = [ * { Name: "Bob", City: "NewYork", Birthday: "1968/6/8" }, * { Name: "Betty", City: "NewYork", Birthday: "1972/7/3" }, * { Name: "Alice", City: "Washington", Birthday: "2012/2/15" }, * ]; * var table = activeSheet.tables.addFromDataSource("table1", 1, 1, dataSource); * var slicerData = new GC.Spread.Sheets.Slicers.TableSlicerData(table) * //Set slicer data to item slicer. * var slicer = new GC.Spread.Sheets.Slicers.ItemSlicer("slicer", slicerData, "Name"); * var oldValue = slicer.sortState(); * console.log(oldValue); * slicer.sortState(GC.Spread.Sheets.SortState.descending); * var newValue = slicer.sortState(); * console.log(newValue); * ``` */ sortState(value?: GC.Spread.Sheets.SortState): any; /** * Gets or sets the style of the item slicer. * @param {string | GC.Spread.Sheets.Slicers.SlicerStyle} value The style or style name of the item slicer. The style property of a slicer specifies the visual appearance and formatting style applied to the slicer control, defining its overall look and presentation. * @returns {GC.Spread.Sheets.Slicers.SlicerStyle | GC.Spread.Sheets.Slicers.ItemSlicer} If no value is set, returns The style of the item slicer; otherwise, returns the item slicer. * @example * ```javascript * The style is json data, its json schema is as follows: * { * "$schema" : "http://json-schema.org/draft-04/schema#", * "title" : "style", * "type" : "object", * "properties" : { * "wholeSlicerStyle" : { * "$ref" : "#/definitions/StyleInfo" * }, * "headerStyle" : { * "$ref" : "#/definitions/StyleInfo" * }, * "selectedItemWithDataStyle" : { * "$ref" : "#/definitions/StyleInfo" * }, * "selectedItemWithNoDataStyle" : { * "$ref" : "#/definitions/StyleInfo" * }, * "unSelectedItemWithDataStyle" : { * "$ref" : "#/definitions/StyleInfo" * }, * "unSelectedItemWithNoDataStyle" : { * "$ref" : "#/definitions/StyleInfo" * }, * "hoveredSelectedItemWithDataStyle" : { * "$ref" : "#/definitions/StyleInfo" * }, * "hoveredSelectedItemWithNoDataStyle" : { * "$ref" : "#/definitions/StyleInfo" * }, * "hoveredUnSelectedItemWithDataStyle" : { * "$ref" : "#/definitions/StyleInfo" * }, * "hoveredUnSelectedItemWithNoDataStyle" : { * "$ref" : "#/definitions/StyleInfo" * } * }, * "definitions" : { * "StyleInfo" : { * "type" : "object", * "properties" : { * "backColor" : { * "type" : "string" * }, * "foreColor" : { * "type" : "string" * }, * "font" : { * "type" : "string" * }, * "borderLeft" : { * "$ref" : "#/definitions/SlicerBorder" * }, * "borderTop" : { * "$ref" : "#/definitions/SlicerBorder" * }, * "borderRight" : { * "$ref" : "#/definitions/SlicerBorder" * }, * "borderBottom" : { * "$ref" : "#/definitions/SlicerBorder" * }, * "textDecoration":{ * "type" : "string" * } * } * }, * "SlicerBorder":{ * "type":"object", * "properties":{ * "borderWidth":{ * "type":"number" * }, * "borderStyle":{ * "type":"string" * }, * "borderColor":{ * "type":"string" * } * } * } * } * } * using sample: * var style = new GC.Spread.Sheets.Slicers.SlicerStyle(); * style.wholeSlicerStyle(new GC.Spread.Sheets.Slicers.SlicerStyleInfo('red', 'blue', '16pt Calibri')); * style.headerStyle(new GC.Spread.Sheets.Slicers.SlicerStyleInfo(undefined, 'green')); * style.selectedItemWithDataStyle(new GC.Spread.Sheets.Slicers.SlicerStyleInfo(undefined, undefined, undefined, new GC.Spread.Sheets.LineBorder('pink', GC.Spread.Sheets.LineStyle.double))); * var spread = new GC.Spread.Sheets.Workbook('ss'); * var activeSheet = spread.getActiveSheet(); * var dataSource = [ * { Name: "Bob", City: "NewYork", Birthday: "1968/6/8" }, * { Name: "Betty", City: "NewYork", Birthday: "1972/7/3" }, * { Name: "Alice", City: "Washington", Birthday: "2012/2/15" }, * ]; * var table = activeSheet.tables.addFromDataSource("table1", 1, 1, dataSource); * var slicerData = new GC.Spread.Sheets.Slicers.TableSlicerData(table) * //Set slicer data to item slicer. * var slicer = new GC.Spread.Sheets.Slicers.ItemSlicer("slicer", slicerData, "Name"); * var oldValue = slicer.style(); * console.log(oldValue); * slicer.style(style); * var newValue = slicer.style(); * console.log(newValue); * ``` */ style(value?: string | GC.Spread.Sheets.Slicers.SlicerStyle): GC.Spread.Sheets.Slicers.SlicerStyle | GC.Spread.Sheets.Slicers.ItemSlicer; /** * Gets or sets whether to visually distinguish the items with no data. * @param {boolean} [value] The setting for items with no data. The visuallyNoDataItems property of a slicer specifies the visual representation or handling of items with no associated data within the slicer control. * @returns {boolean | GC.Spread.Sheets.Slicers.ItemSlicer} If no value is set, returns whether to visually distinguish the items with no data; otherwise, returns the item slicer. * @example * ```javascript * var spread = new GC.Spread.Sheets.Workbook('ss'); * var activeSheet = spread.getActiveSheet(); * var dataSource = [ * { Name: "Bob", City: "NewYork", Birthday: "1968/6/8" }, * { Name: "Betty", City: "NewYork", Birthday: "1972/7/3" }, * { Name: "Alice", City: "Washington", Birthday: "2012/2/15" }, * ]; * var table = activeSheet.tables.addFromDataSource("table1", 1, 1, dataSource); * var slicerData = new GC.Spread.Sheets.Slicers.TableSlicerData(table) * //Set slicer data to item slicer. * var slicer = new GC.Spread.Sheets.Slicers.ItemSlicer("slicer", slicerData, "Name"); * var oldValue = slicer.visuallyNoDataItems(); * console.log(oldValue); * slicer.visuallyNoDataItems(false); * var newValue = slicer.visuallyNoDataItems(); * console.log(newValue); * ``` */ visuallyNoDataItems(value?: boolean): any; /** * Gets or sets the width of the item slicer. * @param {number} [value] The width of the item slicer. The width property of a slicer specifies the horizontal dimension or width of the slicer, determining its size along the x-axis. * @returns {number | GC.Spread.Sheets.Slicers.ItemSlicer} If no value is set, returns the width of the item slicer; otherwise, returns the item slicer. * @example * ```javascript * var spread = new GC.Spread.Sheets.Workbook('ss'); * var activeSheet = spread.getActiveSheet(); * var dataSource = [ * { Name: "Bob", City: "NewYork", Birthday: "1968/6/8" }, * { Name: "Betty", City: "NewYork", Birthday: "1972/7/3" }, * { Name: "Alice", City: "Washington", Birthday: "2012/2/15" }, * ]; * var table = activeSheet.tables.addFromDataSource("table1", 1, 1, dataSource); * var slicerData = new GC.Spread.Sheets.Slicers.TableSlicerData(table) * //Set slicer data to item slicer. * var slicer = new GC.Spread.Sheets.Slicers.ItemSlicer("slicer", slicerData, "Name"); * var oldValue = slicer.width(); * console.log(oldValue); * slicer.width(120); * var newValue = slicer.width(); * console.log(newValue); * ``` */ width(value?: number): any; } export class Slicer{ /** * Represents a table item slicer. * @class GC.Spread.Sheets.Slicers.Slicer */ constructor(); /** * Gets or sets the allowMove of the slicer. * @param {boolean} [value] The allowMove of the slicer. The allowMove property of a slicer specifies whether users are permitted to move the slicer, enabling or disabling the repositioning functionality. * @returns {boolean | GC.Spread.Sheets.Slicers.IItemSlicer} If no value is set, returns the allowMove of the slicer; otherwise, returns the slicer. * @example * ```javascript * var spread = new GC.Spread.Sheets.Workbook('ss'); * var activeSheet = spread.getActiveSheet(); * var dataSource = [ * { Name: "Bob", City: "NewYork", Birthday: "1968/6/8" }, * { Name: "Betty", City: "NewYork", Birthday: "1972/7/3" }, * { Name: "Alice", City: "Washington", Birthday: "2012/2/15" }, * ]; * var table = activeSheet.tables.addFromDataSource("table1", 1, 1, dataSource); * var slicer = activeSheet.slicers.add("slicer", "table1", "Name"); * var oldValue = slicer.allowMove(); * console.log(oldValue); * slicer.allowMove(false); * var newValue = slicer.allowMove(); * console.log(newValue); * ``` */ allowMove(value?: boolean): any; /** * Gets or sets the allowResize of the slicer. * @param {boolean} [value] The allowResize of the slicer. The allowResize property of a slicer specifies whether users are permitted to adjust the size of the slicer, enabling or disabling the resizing functionality. * @returns {boolean | GC.Spread.Sheets.Slicers.IItemSlicer} If no value is set, returns the allowResize of the slicer; otherwise, returns the slicer. * @example * ```javascript * var spread = new GC.Spread.Sheets.Workbook('ss'); * var activeSheet = spread.getActiveSheet(); * var dataSource = [ * { Name: "Bob", City: "NewYork", Birthday: "1968/6/8" }, * { Name: "Betty", City: "NewYork", Birthday: "1972/7/3" }, * { Name: "Alice", City: "Washington", Birthday: "2012/2/15" }, * ]; * var table = activeSheet.tables.addFromDataSource("table1", 1, 1, dataSource); * var slicer = activeSheet.slicers.add("slicer", "table1", "Name"); * var oldValue = slicer.allowResize(); * console.log(oldValue); * slicer.allowResize(false); * var newValue = slicer.allowResize(); * console.log(newValue); * ``` */ allowResize(value?: boolean): any; /** * Gets or sets the captionName of the slicer. * @param {string} [value] The captionName of the slicer. captionName property is displayed in the header of the slicer. * @returns {string | GC.Spread.Sheets.Slicers.IItemSlicer} If no value is set, returns the captionName of the slicer; otherwise, returns the slicer. * @example * ```javascript * var spread = new GC.Spread.Sheets.Workbook('ss'); * var activeSheet = spread.getActiveSheet(); * var dataSource = [ * { Name: "Bob", City: "NewYork", Birthday: "1968/6/8" }, * { Name: "Betty", City: "NewYork", Birthday: "1972/7/3" }, * { Name: "Alice", City: "Washington", Birthday: "2012/2/15" }, * ]; * var table = activeSheet.tables.addFromDataSource("table1", 1, 1, dataSource); * var slicer = activeSheet.slicers.add("slicer", "table1", "Name"); * var oldValue = slicer.captionName(); * console.log(oldValue); * slicer.captionName('Slicer_Caption'); * var newValue = slicer.captionName(); * console.log(newValue); * ``` */ captionName(value?: string): any; /** * Gets or sets the columnCount of the slicer. * @param {number} [value] The columnCount of the slicer. * @returns {number | GC.Spread.Sheets.Slicers.IItemSlicer} If no value is set, returns the columnCount of the slicer; otherwise, returns the slicer. * @example * ```javascript * var spread = new GC.Spread.Sheets.Workbook('ss'); * var activeSheet = spread.getActiveSheet(); * var dataSource = [ * { Name: "Bob", City: "NewYork", Birthday: "1968/6/8" }, * { Name: "Betty", City: "NewYork", Birthday: "1972/7/3" }, * { Name: "Alice", City: "Washington", Birthday: "2012/2/15" }, * ]; * var table = activeSheet.tables.addFromDataSource("table1", 1, 1, dataSource); * var slicer = activeSheet.slicers.add("slicer", "table1", "Name"); * var oldValue = slicer.columnCount(); * console.log(oldValue); * slicer.columnCount(3); * var newValue = slicer.columnCount(); * console.log(newValue); * ``` */ columnCount(value?: number): any; /** * Get the columnName of the slicer. The columnName property of a slicer specifies the name of the column within the source data field that is associated with the slicer. * @returns {string} returns the columnName of the slicer. */ columnName(): string; /** * Gets or sets the disableResizingAndMoving of the slicer. * @param {boolean} [value] The disableResizingAndMoving of the slicer. The disableResizingAndMoving property of a slicer specifies whether the user is allowed to resize or move the slicer control, restricting any changes to its size or position. * @returns {boolean | GC.Spread.Sheets.Slicers.IItemSlicer} If no value is set, returns the disableResizingAndMoving of the slicer; otherwise, returns the slicer. * @example * ```javascript * var spread = new GC.Spread.Sheets.Workbook('ss'); * var activeSheet = spread.getActiveSheet(); * var dataSource = [ * { Name: "Bob", City: "NewYork", Birthday: "1968/6/8" }, * { Name: "Betty", City: "NewYork", Birthday: "1972/7/3" }, * { Name: "Alice", City: "Washington", Birthday: "2012/2/15" }, * ]; * var table = activeSheet.tables.addFromDataSource("table1", 1, 1, dataSource); * var slicer = activeSheet.slicers.add("slicer", "table1", "Name"); * var oldValue = slicer.disableResizingAndMoving(); * console.log(oldValue); * slicer.disableResizingAndMoving(true); * var newValue = slicer.disableResizingAndMoving(); * console.log(newValue); * ``` */ disableResizingAndMoving(value?: boolean): any; /** * Gets or sets the dynamicMove of the slicer. * @param {boolean} [value] The dynamicMove of the slicer. The dynamicMove property of a slicer specifies whether the slicer control is configured to dynamically adjust its position or size based on changes in the associated data or PivotTable layout. * @returns {boolean | GC.Spread.Sheets.Slicers.IItemSlicer} If no value is set, returns the dynamicMove of the slicer; otherwise, returns the slicer. * @example * ```javascript * var spread = new GC.Spread.Sheets.Workbook('ss'); * var activeSheet = spread.getActiveSheet(); * var dataSource = [ * { Name: "Bob", City: "NewYork", Birthday: "1968/6/8" }, * { Name: "Betty", City: "NewYork", Birthday: "1972/7/3" }, * { Name: "Alice", City: "Washington", Birthday: "2012/2/15" }, * ]; * var table = activeSheet.tables.addFromDataSource("table1", 1, 1, dataSource); * var slicer = activeSheet.slicers.add("slicer", "table1", "Name"); * var oldValue = slicer.dynamicMove(); * console.log(oldValue); * slicer.dynamicMove(false); * var newValue = slicer.dynamicMove(); * console.log(newValue); * ``` */ dynamicMove(value?: boolean): any; /** * Gets or sets the dynamicSize of the slicer. * @param {boolean} [value] The dynamicSize of the slicer. The dynamicSize property of a slicer specifies whether the slicer control is configured to dynamically adjust its size based on changes in the associated data or pivot table layout. * @returns {boolean | GC.Spread.Sheets.Slicers.IItemSlicer} If no value is set, returns the dynamicSize of the slicer; otherwise, returns the slicer. * @example * ```javascript * var spread = new GC.Spread.Sheets.Workbook('ss'); * var activeSheet = spread.getActiveSheet(); * var dataSource = [ * { Name: "Bob", City: "NewYork", Birthday: "1968/6/8" }, * { Name: "Betty", City: "NewYork", Birthday: "1972/7/3" }, * { Name: "Alice", City: "Washington", Birthday: "2012/2/15" }, * ]; * var table = activeSheet.tables.addFromDataSource("table1", 1, 1, dataSource); * var slicer = activeSheet.slicers.add("slicer", "table1", "Name"); * var oldValue = slicer.dynamicSize(); * console.log(oldValue); * slicer.dynamicSize(false); * var newValue = slicer.dynamicSize(); * console.log(newValue); * ``` */ dynamicSize(value?: boolean): any; /** * Gets or sets the endColumn of the slicer. * @param {number} [value] The endColumn of the slicer. The endColumn property of a slicer specifies the ending column index or position within the worksheet where the slicer concludes or is bounded. * @returns {number | GC.Spread.Sheets.Slicers.IItemSlicer} If no value is set, returns the endColumn of the slicer; otherwise, returns the slicer. * @example * ```javascript * var spread = new GC.Spread.Sheets.Workbook('ss'); * var activeSheet = spread.getActiveSheet(); * var dataSource = [ * { Name: "Bob", City: "NewYork", Birthday: "1968/6/8" }, * { Name: "Betty", City: "NewYork", Birthday: "1972/7/3" }, * { Name: "Alice", City: "Washington", Birthday: "2012/2/15" }, * ]; * var table = activeSheet.tables.addFromDataSource("table1", 1, 1, dataSource); * var slicer = activeSheet.slicers.add("slicer", "table1", "Name"); * var oldValue = slicer.endColumn(); * console.log(oldValue); * slicer.endColumn(20); * var newValue = slicer.endColumn(); * console.log(newValue); * ``` */ endColumn(value?: number): any; /** * Gets or sets the endColumnOffset of the slicer. * @param {number} [value] The endColumnOffset of the slicer. The endColumnOffset property of a slicer specifies the horizontal offset or distance from the ending column index where the slicer concludes its placement within the worksheet. * @returns {number | GC.Spread.Sheets.Slicers.IItemSlicer} If no value is set, returns the endColumnOffset of the slicer; otherwise, returns the slicer. * @example * ```javascript * var spread = new GC.Spread.Sheets.Workbook('ss'); * var activeSheet = spread.getActiveSheet(); * var dataSource = [ * { Name: "Bob", City: "NewYork", Birthday: "1968/6/8" }, * { Name: "Betty", City: "NewYork", Birthday: "1972/7/3" }, * { Name: "Alice", City: "Washington", Birthday: "2012/2/15" }, * ]; * var table = activeSheet.tables.addFromDataSource("table1", 1, 1, dataSource); * var slicer = activeSheet.slicers.add("slicer", "table1", "Name"); * var oldValue = slicer.endColumnOffset(); * console.log(oldValue); * slicer.endColumnOffset(5); * var newValue = slicer.endColumnOffset(); * console.log(newValue); * ``` */ endColumnOffset(value?: number): any; /** * Gets or sets the endRow of the slicer. * @param {number} [value] The endRow of the slicer. The endRow property of a slicer specifies the ending row index or position within the worksheet where the slicer concludes or is bounded. * @returns {number | GC.Spread.Sheets.Slicers.IItemSlicer} If no value is set, returns the endRow of the slicer; otherwise, returns the slicer. * @example * ```javascript * var spread = new GC.Spread.Sheets.Workbook('ss'); * var activeSheet = spread.getActiveSheet(); * var dataSource = [ * { Name: "Bob", City: "NewYork", Birthday: "1968/6/8" }, * { Name: "Betty", City: "NewYork", Birthday: "1972/7/3" }, * { Name: "Alice", City: "Washington", Birthday: "2012/2/15" }, * ]; * var table = activeSheet.tables.addFromDataSource("table1", 1, 1, dataSource); * var slicer = activeSheet.slicers.add("slicer", "table1", "Name"); * var oldValue = slicer.endRow(); * console.log(oldValue); * slicer.endRow(20); * var newValue = slicer.endRow(); * console.log(newValue); * ``` */ endRow(value?: number): any; /** * Gets or sets the endRowOffset of the slicer. * @param {number} [value] The endRowOffset of the slicer. The endRowOffset property of a slicer specifies the vertical offset or distance from the ending row index where the slicer concludes its placement within the worksheet. * @returns {number | GC.Spread.Sheets.Slicers.IItemSlicer} If no value is set, returns the endRowOffset of the slicer; otherwise, returns the slicer. * @example * ```javascript * var spread = new GC.Spread.Sheets.Workbook('ss'); * var activeSheet = spread.getActiveSheet(); * var dataSource = [ * { Name: "Bob", City: "NewYork", Birthday: "1968/6/8" }, * { Name: "Betty", City: "NewYork", Birthday: "1972/7/3" }, * { Name: "Alice", City: "Washington", Birthday: "2012/2/15" }, * ]; * var table = activeSheet.tables.addFromDataSource("table1", 1, 1, dataSource); * var slicer = activeSheet.slicers.add("slicer", "table1", "Name"); * var oldValue = slicer.endRowOffset(); * console.log(oldValue); * slicer.endRowOffset(5); * var newValue = slicer.endRowOffset(); * console.log(newValue); * ``` */ endRowOffset(value?: number): any; /** * Gets or sets the height of the slicer. * @param {number} [value] The height of the slicer. The height property of a slicer specifies the vertical dimension or height of the slicer control, determining its size along the y-axis. * @returns {number | GC.Spread.Sheets.Slicers.IItemSlicer} If no value is set, returns the height of the slicer; otherwise, returns the slicer. * @example * ```javascript * var spread = new GC.Spread.Sheets.Workbook('ss'); * var activeSheet = spread.getActiveSheet(); * var dataSource = [ * { Name: "Bob", City: "NewYork", Birthday: "1968/6/8" }, * { Name: "Betty", City: "NewYork", Birthday: "1972/7/3" }, * { Name: "Alice", City: "Washington", Birthday: "2012/2/15" }, * ]; * var table = activeSheet.tables.addFromDataSource("table1", 1, 1, dataSource); * var slicer = activeSheet.slicers.add("slicer", "table1", "Name"); * var oldValue = slicer.height(); * console.log(oldValue); * slicer.height(200); * var newValue = slicer.height(); * console.log(newValue); * ``` */ height(value?: number): any; /** * Gets or sets the isLocked of the slicer. * @param {boolean} [value] The isLocked of the slicer. The isLocked property of a slicer specifies whether the slicer is currently locked or unlocked, indicating whether users can make changes to its settings or selections when Worksheet is protected. * @returns {boolean | GC.Spread.Sheets.Slicers.IItemSlicer} If no value is set, returns the isLocked of the slicer; otherwise, returns the slicer. * @example * ```javascript * var spread = new GC.Spread.Sheets.Workbook('ss'); * var activeSheet = spread.getActiveSheet(); * var dataSource = [ * { Name: "Bob", City: "NewYork", Birthday: "1968/6/8" }, * { Name: "Betty", City: "NewYork", Birthday: "1972/7/3" }, * { Name: "Alice", City: "Washington", Birthday: "2012/2/15" }, * ]; * var table = activeSheet.tables.addFromDataSource("table1", 1, 1, dataSource); * var slicer = activeSheet.slicers.add("slicer", "table1", "Name"); * var oldValue = slicer.isLocked(); * console.log(oldValue); * slicer.isLocked(false); * var newValue = slicer.isLocked(); * console.log(newValue); * ``` */ isLocked(value?: boolean): any; /** * Gets or sets the isSelected of the slicer. * @param {boolean} [value] The isSelected of the slicer. The isSelected property of a slicer specifies whether a particular item within the slicer is currently selected or highlighted. * @returns {boolean | GC.Spread.Sheets.Slicers.IItemSlicer} If no value is set, returns the isSelected of the slicer; otherwise, returns the slicer. * @example * ```javascript * var spread = new GC.Spread.Sheets.Workbook('ss'); * var activeSheet = spread.getActiveSheet(); * var dataSource = [ * { Name: "Bob", City: "NewYork", Birthday: "1968/6/8" }, * { Name: "Betty", City: "NewYork", Birthday: "1972/7/3" }, * { Name: "Alice", City: "Washington", Birthday: "2012/2/15" }, * ]; * var table = activeSheet.tables.addFromDataSource("table1", 1, 1, dataSource); * var slicer = activeSheet.slicers.add("slicer", "table1", "Name"); * var oldValue = slicer.isSelected(); * console.log(oldValue); * slicer.isSelected(true); * var newValue = slicer.isSelected(); * console.log(newValue); * ``` */ isSelected(value?: boolean): any; /** * Gets or sets the isVisible of the slicer. * @param {boolean} [value] The isVisible of the slicer. The isVisible property of a slicer specifies whether the slicer is currently visible or hidden within the workbook. * @returns {boolean | GC.Spread.Sheets.Slicers.IItemSlicer} If no value is set, returns the isVisible of the slicer; otherwise, returns the slicer. * @example * ```javascript * var spread = new GC.Spread.Sheets.Workbook('ss'); * var activeSheet = spread.getActiveSheet(); * var dataSource = [ * { Name: "Bob", City: "NewYork", Birthday: "1968/6/8" }, * { Name: "Betty", City: "NewYork", Birthday: "1972/7/3" }, * { Name: "Alice", City: "Washington", Birthday: "2012/2/15" }, * ]; * var table = activeSheet.tables.addFromDataSource("table1", 1, 1, dataSource); * var slicer = activeSheet.slicers.add("slicer", "table1", "Name"); * var oldValue = slicer.isVisible(); * console.log(oldValue); * slicer.isVisible(false); * var newValue = slicer.isVisible(); * console.log(newValue); * ``` */ isVisible(value?: boolean): any; /** * Gets or sets the itemHeight of the slicer. * @param {number} [value] The itemHeight of the slicer. The itemHeight property of a slicer specifies the height of each item or row within the slicer control. * @returns {number | GC.Spread.Sheets.Slicers.IItemSlicer} If no value is set, returns the itemHeight of the slicer; otherwise, returns the slicer. * @example * ```javascript * var spread = new GC.Spread.Sheets.Workbook('ss'); * var activeSheet = spread.getActiveSheet(); * var dataSource = [ * { Name: "Bob", City: "NewYork", Birthday: "1968/6/8" }, * { Name: "Betty", City: "NewYork", Birthday: "1972/7/3" }, * { Name: "Alice", City: "Washington", Birthday: "2012/2/15" }, * ]; * var table = activeSheet.tables.addFromDataSource("table1", 1, 1, dataSource); * var slicer = activeSheet.slicers.add("slicer", "table1", "Name"); * var oldValue = slicer.itemHeight(); * console.log(oldValue); * slicer.itemHeight(34); * var newValue = slicer.itemHeight(); * console.log(newValue); * ``` */ itemHeight(value?: number): any; /** * Gets or sets the multiSelect of the slicer. * @param {boolean} [value] The multiSelect of the slicer. The multiSelect property of a slicer specifies whether multiple items can be selected simultaneously within the slicer. * @returns {boolean} If no value is set, returns the multiSelect of the slicer * @example * ```javascript * var spread = GC.Spread.Sheets.findControl('ss'); * var activeSheet = spread.getActiveSheet(); * var dataSource = [ * { Name: "Bob", City: "NewYork", Birthday: "1968/6/8" }, * { Name: "Betty", City: "NewYork", Birthday: "1972/7/3" }, * { Name: "Alice", City: "Washington", Birthday: "2012/2/15" }, * ]; * var table = activeSheet.tables.addFromDataSource("table1", 1, 1, dataSource); * var slicer = activeSheet.slicers.add("slicer", "table1", "Name"); * var oldValue = slicer.multiSelect(); * console.log(oldValue); * slicer.multiSelect(true); * var newValue = slicer.multiSelect(); * console.log(newValue); * ``` */ multiSelect(value?: boolean): any; /** * Gets or sets the name of the slicer. * @param {string} [value] The name of the slicer. The name property of a slicer specifies the unique identifier or label assigned to the slicer, allowing for identification and reference within the workbook or programmatic interactions. * @returns {string | GC.Spread.Sheets.Slicers.IItemSlicer} If no value is set, returns the name of the slicer; otherwise, returns the slicer. * @example * ```javascript * var spread = new GC.Spread.Sheets.Workbook('ss'); * var activeSheet = spread.getActiveSheet(); * var dataSource = [ * { Name: "Bob", City: "NewYork", Birthday: "1968/6/8" }, * { Name: "Betty", City: "NewYork", Birthday: "1972/7/3" }, * { Name: "Alice", City: "Washington", Birthday: "2012/2/15" }, * ]; * var table = activeSheet.tables.addFromDataSource("table1", 1, 1, dataSource); * var slicer = activeSheet.slicers.add("slicer", "table1", "Name"); * var oldValue = slicer.name(); * console.log(oldValue); * slicer.name('SlicerA'); * var newValue = slicer.name(); * console.log(newValue); * ``` */ name(value?: string): any; /** * Gets the nameInFormula of the slicer. * @returns {string} returns the nameInFormula of the slicer. */ nameInFormula(): string; /** * Gets or sets the position of the slicer. * @param {GC.Spread.Sheets.Point} [value] The position of the slicer. The position property of a slicer specifies the placement of the slicer within the worksheet. * @returns {GC.Spread.Sheets.Point | GC.Spread.Sheets.Slicers.IItemSlicer} If no value is set, returns the position of the slicer; otherwise, returns the slicer. * @example * ```javascript * var spread = new GC.Spread.Sheets.Workbook('ss'); * var activeSheet = spread.getActiveSheet(); * var dataSource = [ * { Name: "Bob", City: "NewYork", Birthday: "1968/6/8" }, * { Name: "Betty", City: "NewYork", Birthday: "1972/7/3" }, * { Name: "Alice", City: "Washington", Birthday: "2012/2/15" }, * ]; * var table = activeSheet.tables.addFromDataSource("table1", 1, 1, dataSource); * var slicer = activeSheet.slicers.add("slicer", "table1", "Name"); * var oldValue = slicer.position(); * console.log(oldValue); * slicer.position(new GC.Spread.Sheets.Point(100, 200)); * var newValue = slicer.position(); * console.log(newValue); * ``` */ position(value?: GC.Spread.Sheets.Point): any; /** * Refresh the slicer. */ refresh(): void; /** * Get the worksheet of the slicer. * @returns {GC.Spread.Sheets.Worksheet} returns the worksheet of the slicer. */ sheet(): GC.Spread.Sheets.Worksheet; /** * Gets or sets the showHeader of the slicer. * @param {boolean} [value] The showHeader of the slicer. The showHeader property of a slicer specifies whether the header, which includes the title and filter-related controls, is displayed in the slicer. * @returns {boolean | GC.Spread.Sheets.Slicers.IItemSlicer} If no value is set, returns the showHeader of the slicer; otherwise, returns the slicer. * @example * ```javascript * var spread = new GC.Spread.Sheets.Workbook('ss'); * var activeSheet = spread.getActiveSheet(); * var dataSource = [ * { Name: "Bob", City: "NewYork", Birthday: "1968/6/8" }, * { Name: "Betty", City: "NewYork", Birthday: "1972/7/3" }, * { Name: "Alice", City: "Washington", Birthday: "2012/2/15" }, * ]; * var table = activeSheet.tables.addFromDataSource("table1", 1, 1, dataSource); * var slicer = activeSheet.slicers.add("slicer", "table1", "Name"); * var oldValue = slicer.showHeader(); * console.log(oldValue); * slicer.showHeader(false); * var newValue = slicer.showHeader(); * console.log(newValue); * ``` */ showHeader(value?: boolean): any; /** * Gets or sets the showNoDataItems of the slicer. * @param {boolean} [value] The showNoDataItems of the slicer. The showNoDataItems property of a slicer specifies whether to display items with no associated data in the connected PivotTable or data source within the slicer control. * @returns {boolean | GC.Spread.Sheets.Slicers.IItemSlicer} If no value is set, returns the showNoDataItems of the slicer; otherwise, returns the slicer. * @example * ```javascript * var spread = new GC.Spread.Sheets.Workbook('ss'); * var activeSheet = spread.getActiveSheet(); * var dataSource = [ * { Name: "Bob", City: "NewYork", Birthday: "1968/6/8" }, * { Name: "Betty", City: "NewYork", Birthday: "1972/7/3" }, * { Name: "Alice", City: "Washington", Birthday: "2012/2/15" }, * ]; * var table = activeSheet.tables.addFromDataSource("table1", 1, 1, dataSource); * var slicer = activeSheet.slicers.add("slicer", "table1", "Name"); * var oldValue = slicer.showNoDataItems(); * console.log(oldValue); * slicer.showNoDataItems(false); * var newValue = slicer.showNoDataItems(); * console.log(newValue); * ``` */ showNoDataItems(value?: boolean): any; /** * Gets or sets the showNoDataItemsInLast of the slicer. * @param {boolean} [value] The showNoDataItemsInLast of the slicer. The showNoDataItemsInLast property of a slicer specifies whether to display items with no associated data at the end of the slicer control's list when presenting the items. * @returns {boolean | GC.Spread.Sheets.Slicers.IItemSlicer} If no value is set, returns the showNoDataItemsInLast of the slicer; otherwise, returns the slicer. * @example * ```javascript * var spread = new GC.Spread.Sheets.Workbook('ss'); * var activeSheet = spread.getActiveSheet(); * var dataSource = [ * { Name: "Bob", City: "NewYork", Birthday: "1968/6/8" }, * { Name: "Betty", City: "NewYork", Birthday: "1972/7/3" }, * { Name: "Alice", City: "Washington", Birthday: "2012/2/15" }, * ]; * var table = activeSheet.tables.addFromDataSource("table1", 1, 1, dataSource); * var slicer = activeSheet.slicers.add("slicer", "table1", "Name"); * var oldValue = slicer.showNoDataItemsInLast(); * console.log(oldValue); * slicer.showNoDataItemsInLast(false); * var newValue = slicer.showNoDataItemsInLast(); * console.log(newValue); * ``` */ showNoDataItemsInLast(value?: boolean): any; /** * Gets or sets the sortState of the slicer. * @param {GC.Spread.Sheets.SortState} [value] The sortState of the slicer. The sortState property of a slicer specifies the current sorting state applied to the items within the slicer, indicating whether they are sorted in ascending, descending order, or not sorted. * @returns {GC.Spread.Sheets.SortState | GC.Spread.Sheets.Slicers.IItemSlicer} If no value is set, returns the sortState of the slicer; otherwise, returns the slicer. * @example * ```javascript * var spread = new GC.Spread.Sheets.Workbook('ss'); * var activeSheet = spread.getActiveSheet(); * var dataSource = [ * { Name: "Bob", City: "NewYork", Birthday: "1968/6/8" }, * { Name: "Betty", City: "NewYork", Birthday: "1972/7/3" }, * { Name: "Alice", City: "Washington", Birthday: "2012/2/15" }, * ]; * var table = activeSheet.tables.addFromDataSource("table1", 1, 1, dataSource); * var slicer = activeSheet.slicers.add("slicer", "table1", "Name"); * var oldValue = slicer.sortState(); * console.log(oldValue); * slicer.sortState(GC.Spread.Sheets.SortState.descending); * var newValue = slicer.sortState(); * console.log(newValue); * ``` */ sortState(value?: GC.Spread.Sheets.SortState): any; /** * Get the sourceName of the slicer. The sourceName property of a slicer specifies the name of the source data field associated with the slicer. * @returns {string} returns the sourceName of the slicer. */ sourceName(): string; /** * Gets or sets the startColumn of the slicer. * @param {number} [value] The startColumn of the slicer. The startColumn property of a slicer specifies the starting column index or position within the worksheet where the slicer is anchored * @returns {number | GC.Spread.Sheets.Slicers.IItemSlicer} If no value is set, returns the startColumn of the slicer; otherwise, returns the slicer. * @example * ```javascript * var spread = new GC.Spread.Sheets.Workbook('ss'); * var activeSheet = spread.getActiveSheet(); * var dataSource = [ * { Name: "Bob", City: "NewYork", Birthday: "1968/6/8" }, * { Name: "Betty", City: "NewYork", Birthday: "1972/7/3" }, * { Name: "Alice", City: "Washington", Birthday: "2012/2/15" }, * ]; * var table = activeSheet.tables.addFromDataSource("table1", 1, 1, dataSource); * var slicer = activeSheet.slicers.add("slicer", "table1", "Name"); * var oldValue = slicer.startColumn(); * console.log(oldValue); * slicer.startColumn(10); * var newValue = slicer.startColumn(); * console.log(newValue); * ``` */ startColumn(value?: number): any; /** * Gets or sets the startColumnOffset of the slicer. * @param {number} [value] The startColumnOffset of the slicer. The startColumnOffset property of a slicer specifies the horizontal offset or distance from the starting column index where the slicer begins its placement within the worksheet. * @returns {number | GC.Spread.Sheets.Slicers.IItemSlicer} If no value is set, returns the startColumnOffset of the slicer; otherwise, returns the slicer. * @example * ```javascript * var spread = new GC.Spread.Sheets.Workbook('ss'); * var activeSheet = spread.getActiveSheet(); * var dataSource = [ * { Name: "Bob", City: "NewYork", Birthday: "1968/6/8" }, * { Name: "Betty", City: "NewYork", Birthday: "1972/7/3" }, * { Name: "Alice", City: "Washington", Birthday: "2012/2/15" }, * ]; * var table = activeSheet.tables.addFromDataSource("table1", 1, 1, dataSource); * var slicer = activeSheet.slicers.add("slicer", "table1", "Name"); * var oldValue = slicer.startColumnOffset(); * console.log(oldValue); * slicer.startColumnOffset(15); * var newValue = slicer.startColumnOffset(); * console.log(newValue); * ``` */ startColumnOffset(value?: number): any; /** * Gets or sets the startRow of the slicer. * @param {number} [value] The startRow of the slicer. The startRow property of a slicer specifies the starting row index or position within the worksheet where the slicer is anchored. * @returns {number | GC.Spread.Sheets.Slicers.IItemSlicer} If no value is set, returns the startRow of the slicer; otherwise, returns the slicer. * @example * ```javascript * var spread = new GC.Spread.Sheets.Workbook('ss'); * var activeSheet = spread.getActiveSheet(); * var dataSource = [ * { Name: "Bob", City: "NewYork", Birthday: "1968/6/8" }, * { Name: "Betty", City: "NewYork", Birthday: "1972/7/3" }, * { Name: "Alice", City: "Washington", Birthday: "2012/2/15" }, * ]; * var table = activeSheet.tables.addFromDataSource("table1", 1, 1, dataSource); * var slicer = activeSheet.slicers.add("slicer", "table1", "Name"); * var oldValue = slicer.startRow(); * console.log(oldValue); * slicer.startRow(10); * var newValue = slicer.startRow(); * console.log(newValue); * ``` */ startRow(value?: number): any; /** * Gets or sets the startRowOffset of the slicer. * @param {number} [value] The startRowOffset of the slicer. The startRowOffset property of a slicer specifies the vertical offset or distance from the starting row index where the slicer begins its placement within the worksheet. * @returns {number | GC.Spread.Sheets.Slicers.IItemSlicer} If no value is set, returns the startRowOffset of the slicer; otherwise, returns the slicer. * @example * ```javascript * var spread = new GC.Spread.Sheets.Workbook('ss'); * var activeSheet = spread.getActiveSheet(); * var dataSource = [ * { Name: "Bob", City: "NewYork", Birthday: "1968/6/8" }, * { Name: "Betty", City: "NewYork", Birthday: "1972/7/3" }, * { Name: "Alice", City: "Washington", Birthday: "2012/2/15" }, * ]; * var table = activeSheet.tables.addFromDataSource("table1", 1, 1, dataSource); * var slicer = activeSheet.slicers.add("slicer", "table1", "Name"); * var oldValue = slicer.startRowOffset(); * console.log(oldValue); * slicer.startRowOffset(15); * var newValue = slicer.startRowOffset(); * console.log(newValue); * ``` */ startRowOffset(value?: number): any; /** * Gets or sets the style of the slicer. * @param {string | GC.Spread.Sheets.Slicers.SlicerStyle} [value] The style of the slicer. The style property of a slicer specifies the visual appearance and formatting style applied to the slicer control, defining its overall look and presentation. * @returns {GC.Spread.Sheets.Slicers.SlicerStyle | GC.Spread.Sheets.Slicers.IItemSlicer} If no style is set, returns the style of the slicer; otherwise, returns the slicer. * @example * ```javascript * var spread = new GC.Spread.Sheets.Workbook('ss'); * var activeSheet = spread.getActiveSheet(); * var dataSource = [ * { Name: "Bob", City: "NewYork", Birthday: "1968/6/8" }, * { Name: "Betty", City: "NewYork", Birthday: "1972/7/3" }, * { Name: "Alice", City: "Washington", Birthday: "2012/2/15" }, * ]; * var table = activeSheet.tables.addFromDataSource("table1", 1, 1, dataSource); * var slicer = activeSheet.slicers.add("slicer", "table1", "Name"); * * var style = new GC.Spread.Sheets.Slicers.SlicerStyle(); * style.wholeSlicerStyle(new GC.Spread.Sheets.Slicers.SlicerStyleInfo('red', 'blue', '16pt Calibri')); * style.headerStyle(new GC.Spread.Sheets.Slicers.SlicerStyleInfo(undefined, 'green')); * style.selectedItemWithDataStyle(new GC.Spread.Sheets.Slicers.SlicerStyleInfo(undefined, undefined, undefined, new GC.Spread.Sheets.LineBorder('pink', GC.Spread.Sheets.LineStyle.double))); * * var oldValue = slicer.style(); * console.log(oldValue); * slicer.style(style); * var newValue = slicer.style(); * console.log(newValue); * ``` */ style(value?: string | GC.Spread.Sheets.Slicers.SlicerStyle): any; /** * Get the slicer Image src of type Base64 string. * @returns {String} return the slicer Image Base64 src string. * @example * ```javascript * let slicerImageSrc = sheet.slicers.all()[0].toImageSrc(); * ``` */ toImageSrc(): string; /** * Get the slicer Image src of type Base64 string. * @returns {Promise} return the slicer Image Base64 src string. * @example * ```javascript * let slicerImageSrc = await sheet.slicers.all()[0].toImageSrcAsync(); * ``` */ toImageSrcAsync(): Promise; /** * Gets or sets the visuallyNoDataItems of the slicer. * @param {boolean} [value] The visuallyNoDataItems of the slicer. The visuallyNoDataItems property of a slicer specifies the visual representation or handling of items with no associated data within the slicer control. * @returns {boolean | GC.Spread.Sheets.Slicers.IItemSlicer} If no value is set, returns the visuallyNoDataItems of the slicer; otherwise, returns the slicer. * @example * ```javascript * var spread = new GC.Spread.Sheets.Workbook('ss'); * var activeSheet = spread.getActiveSheet(); * var dataSource = [ * { Name: "Bob", City: "NewYork", Birthday: "1968/6/8" }, * { Name: "Betty", City: "NewYork", Birthday: "1972/7/3" }, * { Name: "Alice", City: "Washington", Birthday: "2012/2/15" }, * ]; * var table = activeSheet.tables.addFromDataSource("table1", 1, 1, dataSource); * var slicer = activeSheet.slicers.add("slicer", "table1", "Name"); * var oldValue = slicer.visuallyNoDataItems(); * console.log(oldValue); * slicer.visuallyNoDataItems(false); * var newValue = slicer.visuallyNoDataItems(); * console.log(newValue); * ``` */ visuallyNoDataItems(value?: boolean): any; /** * Gets or sets the width of the slicer. * @param {number} [value] The width of the slicer. The width property of a slicer specifies the horizontal dimension or width of the slicer, determining its size along the x-axis. * @returns {number | GC.Spread.Sheets.Slicers.IItemSlicer} If no value is set, returns the width of the slicer; otherwise, returns the slicer. * @example * ```javascript * var spread = new GC.Spread.Sheets.Workbook('ss'); * var activeSheet = spread.getActiveSheet(); * var dataSource = [ * { Name: "Bob", City: "NewYork", Birthday: "1968/6/8" }, * { Name: "Betty", City: "NewYork", Birthday: "1972/7/3" }, * { Name: "Alice", City: "Washington", Birthday: "2012/2/15" }, * ]; * var table = activeSheet.tables.addFromDataSource("table1", 1, 1, dataSource); * var slicer = activeSheet.slicers.add("slicer", "table1", "Name"); * var oldValue = slicer.width(); * console.log(oldValue); * slicer.width(200); * var newValue = slicer.width(); * console.log(newValue); * ``` */ width(value?: number): any; /** * Gets or sets the x of the slicer. * @param {number} [value] The x of the slicer. The x property of a slicer specifies the horizontal position or coordinate of the upper-left corner of the slicer within the worksheet. * @returns {number | GC.Spread.Sheets.Slicers.IItemSlicer} If no value is set, returns the x of the slicer; otherwise, returns the slicer. * @example * ```javascript * var spread = new GC.Spread.Sheets.Workbook('ss'); * var activeSheet = spread.getActiveSheet(); * var dataSource = [ * { Name: "Bob", City: "NewYork", Birthday: "1968/6/8" }, * { Name: "Betty", City: "NewYork", Birthday: "1972/7/3" }, * { Name: "Alice", City: "Washington", Birthday: "2012/2/15" }, * ]; * var table = activeSheet.tables.addFromDataSource("table1", 1, 1, dataSource); * var slicer = activeSheet.slicers.add("slicer", "table1", "Name"); * var oldValue = slicer.x(); * console.log(oldValue); * slicer.x(100); * var newValue = slicer.x(); * console.log(newValue); * ``` */ x(value?: number): any; /** * Gets or sets the y of the slicer. * @param {number} [value] The y of the slicer. The y property of a slicer specifies the vertical position or coordinate of the upper-left corner of the slicer within the worksheet. * @returns {number | GC.Spread.Sheets.Slicers.IItemSlicer} If no value is set, returns the y of the slicer; otherwise, returns the slicer. * @example * ```javascript * var spread = new GC.Spread.Sheets.Workbook('ss'); * var activeSheet = spread.getActiveSheet(); * var dataSource = [ * { Name: "Bob", City: "NewYork", Birthday: "1968/6/8" }, * { Name: "Betty", City: "NewYork", Birthday: "1972/7/3" }, * { Name: "Alice", City: "Washington", Birthday: "2012/2/15" }, * ]; * var table = activeSheet.tables.addFromDataSource("table1", 1, 1, dataSource); * var slicer = activeSheet.slicers.add("slicer", "table1", "Name"); * var oldValue = slicer.y(); * console.log(oldValue); * slicer.y(100); * var newValue = slicer.y(); * console.log(newValue); * ``` */ y(value?: number): any; } export class SlicerBorder{ /** * Represents the slicer border. * @param {number} borderWidth The border width. * @param {GC.Spread.Sheets.Slicers.SlicerBorderStyle} borderStyle The border style. * @param {string} borderColor The border color. * @class * @example * ```javascript * //This example sets a border style. * //create a table * var spread = new GC.Spread.Sheets.Workbook(document.getElementById("ss"), { sheetCount: 2 }); * var activeSheet = spread.getActiveSheet(); * var datas = [ * ["1", "NewYork", "1968/6/8", "80", "180"], * ["4", "NewYork", "1972/7/3", "72", "168"], * ["4", "NewYork", "1964/3/2", "71", "179"], * ["5", "Washington", "1972/8/8","80", "171"], * ["6", "Washington", "1986/2/2", "89", "161"], * ["7", "Washington", "2012/2/15", "71", "240"]]; * var table = activeSheet.tables.addFromDataSource("table1", 2, 2, datas); * var dataColumns = ["Name", "City", "Birthday", "Weight", "Height"]; * table.setColumnName(0, dataColumns[0]); * table.setColumnName(1, dataColumns[1]); * table.setColumnName(2, dataColumns[2]); * table.setColumnName(3, dataColumns[3]); * table.setColumnName(4, dataColumns[4]); * //style info * var hstyle = new GC.Spread.Sheets.Slicers.SlicerStyleInfo(); * hstyle.backColor("red"); * hstyle.borderBottom(new GC.Spread.Sheets.Slicers.SlicerBorder(3, "dashed", "green")); * var style1 = new GC.Spread.Sheets.Slicers.SlicerStyle(); * style1.hoveredSelectedItemWithDataStyle(hstyle); * //add a slicer to the sheet and return the slicer instance. * var slicer = activeSheet.slicers.add("slicer1",table.name(),"Name"); * //change the slicer properties. * slicer.position(new GC.Spread.Sheets.Point(100, 200)); * slicer.style(style1); * ``` */ constructor(borderWidth: number, borderStyle: GC.Spread.Sheets.Slicers.SlicerBorderStyle, borderColor: string); /** * Gets or sets the border color. * @param {string} [value] The border color. * @returns {string | GC.Spread.Sheets.Slicers.SlicerBorder} If no value is set, returns the border color; otherwise, returns the slicer border. * @example * ```javascript * //create a table * var spread = new GC.Spread.Sheets.Workbook(document.getElementById("ss"), { sheetCount: 2 }); * var activeSheet = spread.getActiveSheet(); * var datas = [ * ["1", "NewYork", "1968/6/8", "80", "180"], * ["4", "NewYork", "1972/7/3", "72", "168"], * ["4", "NewYork", "1964/3/2", "71", "179"], * ["5", "Washington", "1972/8/8","80", "171"], * ["6", "Washington", "1986/2/2", "89", "161"], * ["7", "Washington", "2012/2/15", "71", "240"]]; * var table = activeSheet.tables.addFromDataSource("table1", 2, 2, datas); * var dataColumns = ["Name", "City", "Birthday", "Weight", "Height"]; * table.setColumnName(0, dataColumns[0]); * table.setColumnName(1, dataColumns[1]); * table.setColumnName(2, dataColumns[2]); * table.setColumnName(3, dataColumns[3]); * table.setColumnName(4, dataColumns[4]); * //style info * var hstyle = new GC.Spread.Sheets.Slicers.SlicerStyleInfo(); * var border = new GC.Spread.Sheets.Slicers.SlicerBorder(3, "dashed", "green"); * * console.log(border.borderWidth()); // green * border.borderWidth('red'); * console.log(border.borderWidth()); // red * * hstyle.borderBottom(border); * var style1 = new GC.Spread.Sheets.Slicers.SlicerStyle(); * style1.hoveredSelectedItemWithDataStyle(hstyle); * //add a slicer to the sheet and return the slicer instance. * var slicer = activeSheet.slicers.add("slicer1",table.name(),"Name"); * slicer.style(style1); * ``` */ borderColor(value?: string): any; /** * Gets or sets the border style. * @param {GC.Spread.Sheets.Slicers.SlicerBorderStyle} [value] The border style.
* @returns {GC.Spread.Sheets.Slicers.SlicerBorderStyle | GC.Spread.Sheets.Slicers.SlicerBorder} If no value is set, returns the border style; otherwise, returns the slicer border. * @example * ```javascript * //create a table * var spread = new GC.Spread.Sheets.Workbook(document.getElementById("ss"), { sheetCount: 2 }); * var activeSheet = spread.getActiveSheet(); * var datas = [ * ["1", "NewYork", "1968/6/8", "80", "180"], * ["4", "NewYork", "1972/7/3", "72", "168"], * ["4", "NewYork", "1964/3/2", "71", "179"], * ["5", "Washington", "1972/8/8","80", "171"], * ["6", "Washington", "1986/2/2", "89", "161"], * ["7", "Washington", "2012/2/15", "71", "240"]]; * var table = activeSheet.tables.addFromDataSource("table1", 2, 2, datas); * var dataColumns = ["Name", "City", "Birthday", "Weight", "Height"]; * table.setColumnName(0, dataColumns[0]); * table.setColumnName(1, dataColumns[1]); * table.setColumnName(2, dataColumns[2]); * table.setColumnName(3, dataColumns[3]); * table.setColumnName(4, dataColumns[4]); * //style info * var hstyle = new GC.Spread.Sheets.Slicers.SlicerStyleInfo(); * var border = new GC.Spread.Sheets.Slicers.SlicerBorder(3, 'dashed', "green"); * * console.log(border.borderStyle()); // 'dashed' * border.borderStyle('mediumDashDot'); * console.log(border.borderStyle()); // 'mediumDashDot' * * hstyle.borderBottom(border); * var style1 = new GC.Spread.Sheets.Slicers.SlicerStyle(); * style1.hoveredSelectedItemWithDataStyle(hstyle); * //add a slicer to the sheet and return the slicer instance. * var slicer = activeSheet.slicers.add("slicer1",table.name(),"Name"); * slicer.style(style1); * ``` */ borderStyle(value?: GC.Spread.Sheets.Slicers.SlicerBorderStyle): any; /** * Gets or sets the border width. * @param {number} [value] The border width. * @returns {number | GC.Spread.Sheets.Slicers.SlicerBorder} If no value is set, returns the border width; otherwise, returns the slicer border. * @example * ```javascript * //create a table * var spread = new GC.Spread.Sheets.Workbook(document.getElementById("ss"), { sheetCount: 2 }); * var activeSheet = spread.getActiveSheet(); * var datas = [ * ["1", "NewYork", "1968/6/8", "80", "180"], * ["4", "NewYork", "1972/7/3", "72", "168"], * ["4", "NewYork", "1964/3/2", "71", "179"], * ["5", "Washington", "1972/8/8","80", "171"], * ["6", "Washington", "1986/2/2", "89", "161"], * ["7", "Washington", "2012/2/15", "71", "240"]]; * var table = activeSheet.tables.addFromDataSource("table1", 2, 2, datas); * var dataColumns = ["Name", "City", "Birthday", "Weight", "Height"]; * table.setColumnName(0, dataColumns[0]); * table.setColumnName(1, dataColumns[1]); * table.setColumnName(2, dataColumns[2]); * table.setColumnName(3, dataColumns[3]); * table.setColumnName(4, dataColumns[4]); * //style info * var hstyle = new GC.Spread.Sheets.Slicers.SlicerStyleInfo(); * var border = new GC.Spread.Sheets.Slicers.SlicerBorder(3, "dashed", "green"); * * console.log(border.borderWidth()); // 3 * border.borderWidth(5); * console.log(border.borderWidth()); // 5 * * hstyle.borderBottom(border); * var style1 = new GC.Spread.Sheets.Slicers.SlicerStyle(); * style1.hoveredSelectedItemWithDataStyle(hstyle); * //add a slicer to the sheet and return the slicer instance. * var slicer = activeSheet.slicers.add("slicer1",table.name(),"Name"); * slicer.style(style1); * ``` */ borderWidth(value?: number): any; } export class SlicerCollection{ /** * Represents a slicer manager that managers all slicers in a sheet. * @class * @param {GC.Spread.Sheets.Worksheet} sheet The worksheet. */ constructor(sheet: GC.Spread.Sheets.Worksheet); /** * Adds a slicer to the sheet. * @param {string} slicerName The name of the slicer. * @param {string} targetName The name of the table or pivot table that relates to the slicer. * @param {string} itemName The name of the table column or pivot table field that relates to the slicer. * @param {string | GC.Spread.Sheets.Slicers.SlicerStyle | GC.Spread.Sheets.Slicers.TimelineStyle} style The style of the slicer. * @param {GC.Spread.Sheets.Slicers.SlicerType} [type] slicer type, table slicer / pivot item slicer / pivot timeline slicer have their own type. * @return {GC.Spread.Sheets.Slicers.ISlicer} The slicer that has been added to the sheet. * @example * ```javascript * //This example uses the add method. * //create a table * var datas = [ * ["1", "NewYork", "1968/6/8", "80", "180"], * ["4", "NewYork", "1972/7/3", "72", "168"], * ["4", "NewYork", "1964/3/2", "71", "179"], * ["5", "Washington", "1972/8/8","80", "171"], * ["6", "Washington", "1986/2/2", "89", "161"], * ["7", "Washington", "2012/2/15", "71", "240"]]; * var table = activeSheet.tables.addFromDataSource("table1", 2, 2, datas); * dataColumns = ["Name", "City", "Birthday", "Weight", "Height"]; * table.setColumnName(0, dataColumns[0]); * table.setColumnName(1, dataColumns[1]); * table.setColumnName(2, dataColumns[2]); * table.setColumnName(3, dataColumns[3]); * table.setColumnName(4, dataColumns[4]); * //add a slicer to the sheet and return the slicer instance. * var slicer = activeSheet.slicers.add("slicer1",table.name(),"Name"); * //change the slicer properties. * slicer.position(new GC.Spread.Sheets.Point(100, 200)); * ``` */ add(slicerName: string, targetName: string, itemName: string, style?: string | GC.Spread.Sheets.Slicers.SlicerStyle | GC.Spread.Sheets.Slicers.TimelineStyle, type?: GC.Spread.Sheets.Slicers.SlicerType): GC.Spread.Sheets.Slicers.ISlicer; /** * Gets all of the slicers in the sheet with the indicated table name and column name. * @param {string} [targetName] The name of the target (table or pivot table). * @param {string} [itemName] The name of the item. * @returns {GC.Spread.Sheets.Slicers.ISlicer[]} The slicer collection. * @example * ```javascript * //create a table * var datas = [ * ["1", "NewYork", "1968/6/8", "80", "180"], * ["4", "NewYork", "1972/7/3", "72", "168"], * ["4", "NewYork", "1964/3/2", "71", "179"], * ["5", "Washington", "1972/8/8","80", "171"], * ["6", "Washington", "1986/2/2", "89", "161"], * ["7", "Washington", "2012/2/15", "71", "240"]]; * var activeSheet = spread.getActiveSheet(); * var table = activeSheet.tables.addFromDataSource("table1", 2, 2, datas); * dataColumns = ["Name", "City", "Birthday", "Weight", "Height"]; * table.setColumnName(0, dataColumns[0]); * table.setColumnName(1, dataColumns[1]); * table.setColumnName(2, dataColumns[2]); * table.setColumnName(3, dataColumns[3]); * table.setColumnName(4, dataColumns[4]); * //add a slicer to the sheet and return the slicer instance. * var slicer = activeSheet.slicers.add("slicer1",table.name(),"Name"); * * var allSlicers = activeSheet.slicers.all(); * console.log(allSlicers.length); // 1; * console.log(allSlicers[0] === slicer); // true * ``` */ all(targetName?: string, itemName?: string): GC.Spread.Sheets.Slicers.ISlicer[]; /** * Removes all of the slicers from the sheet. * @example * ```javascript * //create a table * var datas = [ * ["1", "NewYork", "1968/6/8", "80", "180"], * ["4", "NewYork", "1972/7/3", "72", "168"], * ["4", "NewYork", "1964/3/2", "71", "179"], * ["5", "Washington", "1972/8/8","80", "171"], * ["6", "Washington", "1986/2/2", "89", "161"], * ["7", "Washington", "2012/2/15", "71", "240"]]; * var activeSheet = spread.getActiveSheet(); * var table = activeSheet.tables.addFromDataSource("table1", 2, 2, datas); * dataColumns = ["Name", "City", "Birthday", "Weight", "Height"]; * table.setColumnName(0, dataColumns[0]); * table.setColumnName(1, dataColumns[1]); * table.setColumnName(2, dataColumns[2]); * table.setColumnName(3, dataColumns[3]); * table.setColumnName(4, dataColumns[4]); * //add a slicer to the sheet and return the slicer instance. * var slicer1 = activeSheet.slicers.add("slicer1",table.name(),"Name"); * var slicer2 = activeSheet.slicers.add("slicer2",table.name(),"City"); * * var allSlicers = activeSheet.slicers.all(); * console.log(allSlicers.length); // 2; * * activeSheet.slicers.clear(); * allSlicers = activeSheet.slicers.all(); * console.log(allSlicers.length); // 0; * ``` */ clear(): void; /** * Gets a slicer in the sheet by the name. * @param {string} name The name of the slicer. * @returns {GC.Spread.Sheets.Slicers.ISlicer} The slicer that has the indicated name. */ get(name: string): GC.Spread.Sheets.Slicers.ISlicer; /** * Removes a slicer from the sheet using the indicated slicer name. * @param {string} name The name of the slicer. * @example * ```javascript * //create a table * var datas = [ * ["1", "NewYork", "1968/6/8", "80", "180"], * ["4", "NewYork", "1972/7/3", "72", "168"], * ["4", "NewYork", "1964/3/2", "71", "179"], * ["5", "Washington", "1972/8/8","80", "171"], * ["6", "Washington", "1986/2/2", "89", "161"], * ["7", "Washington", "2012/2/15", "71", "240"]]; * var activeSheet = spread.getActiveSheet(); * var table = activeSheet.tables.addFromDataSource("table1", 2, 2, datas); * dataColumns = ["Name", "City", "Birthday", "Weight", "Height"]; * table.setColumnName(0, dataColumns[0]); * table.setColumnName(1, dataColumns[1]); * table.setColumnName(2, dataColumns[2]); * table.setColumnName(3, dataColumns[3]); * table.setColumnName(4, dataColumns[4]); * //add a slicer to the sheet and return the slicer instance. * var slicer1 = activeSheet.slicers.add("slicer1",table.name(),"Name"); * var slicer2 = activeSheet.slicers.add("slicer2",table.name(),"City"); * * var allSlicers = activeSheet.slicers.all(); * console.log(allSlicers.length); // 2; * * activeSheet.slicers.remove('slicer1'); * allSlicers = activeSheet.slicers.all(); * console.log(allSlicers.length); // 1; * console.log(allSlicers[0] === slicer2); // true; * ``` */ remove(name: string): void; } export class SlicerStyle{ /** * Represents the slicer style settings. * @class * @example * ```javascript * var spread = new GC.Spread.Sheets.Workbook(document.getElementById("ss"), { sheetCount: 2 }); * var activeSheet = spread.getActiveSheet(); * var datas = [ * ["1", "NewYork", "1968/6/8"], * ["4", "NewYork", "1972/7/3"], * ["4", "NewYork", "1964/3/2"]]; * var table = activeSheet.tables.addFromDataSource("table1", 2, 2, datas); * var dataColumns = ["Name", "City", "Birthday"]; * table.setColumnName(0, dataColumns[0]); * table.setColumnName(1, dataColumns[1]); * table.setColumnName(2, dataColumns[2]); * var slicer = activeSheet.slicers.add("slicer1",table.name(),"Name"); * //set customized style * var style = new GC.Spread.Sheets.Slicers.SlicerStyle(); * var styleInfo1 = new GC.Spread.Sheets.Slicers.SlicerStyleInfo(); * styleInfo1.backColor("orange"); * styleInfo1.borderBottom(new GC.Spread.Sheets.Slicers.SlicerBorder(2,"solid","green")); * style.wholeSlicerStyle(styleInfo1); * var styleInfo2 = new GC.Spread.Sheets.Slicers.SlicerStyleInfo(); * styleInfo2.backColor("red"); * styleInfo2.borderBottom(new GC.Spread.Sheets.Slicers.SlicerBorder(4,"solid","gray")); * style.hoveredSelectedItemWithDataStyle(styleInfo2); * slicer.style(style); * ``` */ constructor(); /** * Loads the object state from the specified JSON string. * @param {Object} data The item slicer theme data from deserialization. * @example * ```javascript * //This example uses the fromJSON method. * const light1 = GC.Spread.Sheets.Slicers.SlicerStyles.light1(); * //export * const jsonStr = JSON.stringify(light1.toJSON()); * //import * const newTheme = new GC.Spread.Sheets.Slicers.SlicerStyle(); * newTheme.fromJSON(JSON.parse(jsonStr)); * newTheme.name('custom1'); * alert(jsonStr); * ``` */ fromJSON(data: Object): void; /** * Gets or sets the style of the slicer header. * @param {GC.Spread.Sheets.Slicers.SlicerStyleInfo} [value] The style of the slicer header. * @returns {GC.Spread.Sheets.Slicers.SlicerStyleInfo | GC.Spread.Sheets.Slicers.SlicerStyle} If no value is set, returns the style of the slicer header; otherwise, returns the slicer style. * @example * ```javascript * //This example sets the header backcolor. * //create a table * var spread = new GC.Spread.Sheets.Workbook(document.getElementById("ss"), { sheetCount: 2 }); * var activeSheet = spread.getActiveSheet(); * var datas = [ * ["1", "NewYork", "1968/6/8", "80", "180"], * ["4", "NewYork", "1972/7/3", "72", "168"], * ["4", "NewYork", "1964/3/2", "71", "179"], * ["5", "Washington", "1972/8/8","80", "171"], * ["6", "Washington", "1986/2/2", "89", "161"], * ["7", "Washington", "2012/2/15", "71", "240"]]; * var table = activeSheet.tables.addFromDataSource("table1", 2, 2, datas); * var dataColumns = ["Name", "City", "Birthday", "Weight", "Height"]; * table.setColumnName(0, dataColumns[0]); * table.setColumnName(1, dataColumns[1]); * table.setColumnName(2, dataColumns[2]); * table.setColumnName(3, dataColumns[3]); * table.setColumnName(4, dataColumns[4]); * //slicer info * var hstyle = new GC.Spread.Sheets.Slicers.SlicerStyleInfo(); * hstyle.backColor("red"); * var style1 = new GC.Spread.Sheets.Slicers.SlicerStyle(); * style1.headerStyle(hstyle); * //add a slicer to the sheet and return the slicer instance. * var slicer = activeSheet.slicers.add("slicer1",table.name(),"Name"); * //change the slicer properties. * slicer.position(new GC.Spread.Sheets.Point(100, 200)); * slicer.style(style1); * ``` */ headerStyle(value?: GC.Spread.Sheets.Slicers.SlicerStyleInfo): any; /** * Gets or sets the style of the hovered selected item with data. * @param {GC.Spread.Sheets.Slicers.SlicerStyleInfo} [value] The style of the hovered selected item with data. * @returns {GC.Spread.Sheets.Slicers.SlicerStyleInfo | GC.Spread.Sheets.Slicers.SlicerStyle} If no value is set, returns the style of the hovered selected item with data; otherwise, returns the slicer style. * @example * ```javascript * //This example sets the hoveredSelectedItemWithDataStyle method. * //create a table * var spread = new GC.Spread.Sheets.Workbook(document.getElementById("ss"), { sheetCount: 2 }); * var activeSheet = spread.getActiveSheet(); * var datas = [ * ["1", "NewYork", "1968/6/8", "80", "180"], * ["4", "NewYork", "1972/7/3", "72", "168"], * ["4", "NewYork", "1964/3/2", "71", "179"], * ["5", "Washington", "1972/8/8","80", "171"], * ["6", "Washington", "1986/2/2", "89", "161"], * ["7", "Washington", "2012/2/15", "71", "240"]]; * var table = activeSheet.tables.addFromDataSource("table1", 2, 2, datas); * var dataColumns = ["Name", "City", "Birthday", "Weight", "Height"]; * table.setColumnName(0, dataColumns[0]); * table.setColumnName(1, dataColumns[1]); * table.setColumnName(2, dataColumns[2]); * table.setColumnName(3, dataColumns[3]); * table.setColumnName(4, dataColumns[4]); * // slicer info * var hstyle = new GC.Spread.Sheets.Slicers.SlicerStyleInfo(); * hstyle.backColor("red"); * hstyle.borderBottom(new GC.Spread.Sheets.Slicers.SlicerBorder(3, "dashed", "green")); * var style1 = new GC.Spread.Sheets.Slicers.SlicerStyle(); * style1.hoveredSelectedItemWithDataStyle(hstyle); * //add a slicer to the sheet and return the slicer instance. * var slicer = activeSheet.slicers.add("slicer1",table.name(),"Name"); * //change the slicer properties. * slicer.position(new GC.Spread.Sheets.Point(100, 200)); * slicer.style(style1); * ``` */ hoveredSelectedItemWithDataStyle(value?: GC.Spread.Sheets.Slicers.SlicerStyleInfo): any; /** * Gets or sets the style of the hovered selected item with no data. * @param {GC.Spread.Sheets.Slicers.SlicerStyleInfo} [value] The style of the hovered selected item with no data. * @returns {GC.Spread.Sheets.Slicers.SlicerStyleInfo | GC.Spread.Sheets.Slicers.SlicerStyle} If no value is set, returns the style of the hovered selected item with no data; otherwise, returns the slicer style. * @example * ```javascript * //This example uses the hoveredSelectedItemWithNoDataStyle method. * var spread = new GC.Spread.Sheets.Workbook(document.getElementById("ss"), { sheetCount: 2 }); * var activeSheet = spread.getActiveSheet(); * var datasource = [ * { Name: "Apple", Category: "Fruit" }, * { Name: "Orange", Category: "Fruit" }, * { Name: "Broccoli", Category: "Vegetable" }, * { Name: "Kiwi", Category: "Fruit" }, * { Name: "Rice", Category: "Cereal" }, * { Name: "Strawberry", Category: "Fruit" }, * { Name: "Yogurt", Category: "Dairy" }, * { Name: "Plum", Category: "Fruit" }, * { Name: "Celery", Category: "Vegetable" }, * { Name: "Grape", Category: "Fruit" }, * { Name: "Oats", Category: "Cereal" }, * { Name: "Quinoa", Category: "Cereal" }, * { Name: "Maize", Category: "Cereal" }, * { Name: "Okra", Category: "Vegetable" }, * { Name: "Corn", Category: "Vegetable" }, * { Name: "Wheat", Category: "Cereal" }, * { Name: "Barley", Category: "Cereal" }, * { Name: "Cream", Category: "Dairy" }, * { Name: "Millet", Category: "Cereal" }, * { Name: "Rye", Category: "Cereal" }, * { Name: "Artichoke", Category: "Vegetable" }, * { Name: "Buckwheat", Category: "Cereal" }, * { Name: "Gooseberry", Category: "Fruit" }, * { Name: "Amaranth", Category: "Cereal" }, * { Name: "Carrot", Category: "Vegetable" }, * { Name: "Cheese", Category: "Dairy" }, * { Name: "Fig", Category: "Fruit" }, * { Name: "Milk", Category: "Dairy" }, * { Name: "Butter", Category: "Dairy" }, * ]; * //add table * var table = activeSheet.tables.addFromDataSource("table1", 1, 1, datasource); * //add a slicer to the sheet and return the slicer instance. * var slicer = activeSheet.slicers.add("slicer1",table.name(),"Category"); * //change the slicer properties. * slicer.width(200); * slicer.height(200); * slicer.position(new GC.Spread.Sheets.Point(300, 50)); * var slicer2 = activeSheet.slicers.add("slicer2", table.name(), "Name"); * var hstyle = new GC.Spread.Sheets.Slicers.SlicerStyleInfo(); * hstyle.backColor("red"); * hstyle.borderBottom(new GC.Spread.Sheets.Slicers.SlicerBorder(3, "dashed", "green")); * var hstyle1 = new GC.Spread.Sheets.Slicers.SlicerStyleInfo(); * hstyle1.borderTop(new GC.Spread.Sheets.Slicers.SlicerBorder(2, "dashed", "blue")); * hstyle1.backColor("yellow"); * var hstyle2 = new GC.Spread.Sheets.Slicers.SlicerStyleInfo(); * hstyle2.backColor("green"); * var style1 = new GC.Spread.Sheets.Slicers.SlicerStyle(); * style1.hoveredSelectedItemWithDataStyle(hstyle); * style1.hoveredUnSelectedItemWithDataStyle(hstyle); * style1.unSelectedItemWithDataStyle(hstyle1); * style1.selectedItemWithDataStyle(hstyle2); * slicer.style(style1); * // slicer style * var hstyle2nd = new GC.Spread.Sheets.Slicers.SlicerStyleInfo(); * hstyle2nd.backColor("red"); * hstyle2nd.borderBottom(new GC.Spread.Sheets.Slicers.SlicerBorder(3, "double", "orange")); * var hstyle12nd = new GC.Spread.Sheets.Slicers.SlicerStyleInfo(); * hstyle12nd.borderTop(new GC.Spread.Sheets.Slicers.SlicerBorder(2, "double", "blue")); * hstyle12nd.backColor("yellow"); * var hstyle22nd = new GC.Spread.Sheets.Slicers.SlicerStyleInfo(); * hstyle22nd.backColor("magenta"); * var style1two = new GC.Spread.Sheets.Slicers.SlicerStyle(); * style1two.hoveredSelectedItemWithNoDataStyle(hstyle2nd); * style1two.hoveredUnSelectedItemWithNoDataStyle(hstyle2nd); * style1two.unSelectedItemWithNoDataStyle(hstyle12nd); * style1two.selectedItemWithNoDataStyle(hstyle22nd); * slicer2.style(style1two); * activeSheet.setColumnWidth(1, 100); * activeSheet.setColumnWidth(2, 100); * activeSheet.setColumnWidth(3, 100); * ``` */ hoveredSelectedItemWithNoDataStyle(value?: GC.Spread.Sheets.Slicers.SlicerStyleInfo): any; /** * Gets or sets the style of the hovered unselected item with data. * @param {GC.Spread.Sheets.Slicers.SlicerStyleInfo} [value] The style of the hovered unselected item with data. * @returns {GC.Spread.Sheets.Slicers.SlicerStyleInfo | GC.Spread.Sheets.Slicers.SlicerStyle} If no value is set, returns the style of the hovered unselected item with data; otherwise, returns the slicer style. * @example * ```javascript * //This example uses the hoveredUnSelectedItemWithDataStyle method. * //create a table * var spread = new GC.Spread.Sheets.Workbook(document.getElementById("ss"), { sheetCount: 2 }); * var activeSheet = spread.getActiveSheet(); * var datas = [ * ["1", "NewYork", "1968/6/8", "80", "180"], * ["4", "NewYork", "1972/7/3", "72", "168"], * ["4", "NewYork", "1964/3/2", "71", "179"], * ["5", "Washington", "1972/8/8","80", "171"], * ["6", "Washington", "1986/2/2", "89", "161"], * ["7", "Washington", "2012/2/15", "71", "240"]]; * var table = activeSheet.tables.addFromDataSource("table1", 2, 2, datas); * var dataColumns = ["Name", "City", "Birthday", "Weight", "Height"]; * table.setColumnName(0, dataColumns[0]); * table.setColumnName(1, dataColumns[1]); * table.setColumnName(2, dataColumns[2]); * table.setColumnName(3, dataColumns[3]); * table.setColumnName(4, dataColumns[4]); * // slicer style * var hstyle = new GC.Spread.Sheets.Slicers.SlicerStyleInfo(); * hstyle.backColor("red"); * var style1 = new GC.Spread.Sheets.Slicers.SlicerStyle(); * style1.hoveredUnSelectedItemWithDataStyle(hstyle); * //add a slicer to the sheet and return the slicer instance. * var slicer = activeSheet.slicers.add("slicer1",table.name(),"Name"); * //change the slicer properties. * slicer.position(new GC.Spread.Sheets.Point(100, 200)); * slicer.style(style1); * ``` */ hoveredUnSelectedItemWithDataStyle(value?: GC.Spread.Sheets.Slicers.SlicerStyleInfo): any; /** * Gets or sets the style of the hovered unselected item with no data. * @param {GC.Spread.Sheets.Slicers.SlicerStyleInfo} [value] The style of the hovered unselected item with no data. * @returns {GC.Spread.Sheets.Slicers.SlicerStyleInfo | GC.Spread.Sheets.Slicers.SlicerStyle} If no value is set, returns the style of the hovered unselected item with no data; otherwise, returns the slicer style. * @example * ```javascript * //This example uses the hoveredUnSelectedItemWithNoDataStyle method. * var spread = new GC.Spread.Sheets.Workbook(document.getElementById("ss"), { sheetCount: 2 }); * var activeSheet = spread.getActiveSheet(); * var datasource = [ * { Name: "Apple", Category: "Fruit" }, * { Name: "Orange", Category: "Fruit" }, * { Name: "Broccoli", Category: "Vegetable" }, * { Name: "Kiwi", Category: "Fruit" }, * { Name: "Rice", Category: "Cereal" }, * { Name: "Strawberry", Category: "Fruit" }, * { Name: "Yogurt", Category: "Dairy" }, * { Name: "Plum", Category: "Fruit" }, * { Name: "Celery", Category: "Vegetable" }, * { Name: "Grape", Category: "Fruit" }, * { Name: "Oats", Category: "Cereal" }, * { Name: "Quinoa", Category: "Cereal" }, * { Name: "Maize", Category: "Cereal" }, * { Name: "Okra", Category: "Vegetable" }, * { Name: "Corn", Category: "Vegetable" }, * { Name: "Wheat", Category: "Cereal" }, * { Name: "Barley", Category: "Cereal" }, * { Name: "Cream", Category: "Dairy" }, * { Name: "Millet", Category: "Cereal" }, * { Name: "Rye", Category: "Cereal" }, * { Name: "Artichoke", Category: "Vegetable" }, * { Name: "Buckwheat", Category: "Cereal" }, * { Name: "Gooseberry", Category: "Fruit" }, * { Name: "Amaranth", Category: "Cereal" }, * { Name: "Carrot", Category: "Vegetable" }, * { Name: "Cheese", Category: "Dairy" }, * { Name: "Fig", Category: "Fruit" }, * { Name: "Milk", Category: "Dairy" }, * { Name: "Butter", Category: "Dairy" }, * ]; * var table = activeSheet.tables.addFromDataSource("table1", 1, 1, datasource); * //add a slicer to the sheet and return the slicer instance. * var slicer = activeSheet.slicers.add("slicer1",table.name(),"Category"); * //change the slicer properties. * slicer.width(200); * slicer.height(200); * slicer.position(new GC.Spread.Sheets.Point(300, 50)); * var slicer2 = activeSheet.slicers.add("slicer2", table.name(), "Name"); * var hstyle = new GC.Spread.Sheets.Slicers.SlicerStyleInfo(); * hstyle.backColor("red"); * hstyle.borderBottom(new GC.Spread.Sheets.Slicers.SlicerBorder(3, "dashed", "green")); * var hstyle1 = new GC.Spread.Sheets.Slicers.SlicerStyleInfo(); * hstyle1.borderTop(new GC.Spread.Sheets.Slicers.SlicerBorder(2, "dashed", "blue")); * hstyle1.backColor("yellow"); * var hstyle2 = new GC.Spread.Sheets.Slicers.SlicerStyleInfo(); * hstyle2.backColor("green"); * var style1 = new GC.Spread.Sheets.Slicers.SlicerStyle(); * style1.hoveredSelectedItemWithDataStyle(hstyle); * style1.hoveredUnSelectedItemWithDataStyle(hstyle); * style1.unSelectedItemWithDataStyle(hstyle1); * style1.selectedItemWithDataStyle(hstyle2); * slicer.style(style1); * var hstyle2nd = new GC.Spread.Sheets.Slicers.SlicerStyleInfo(); * hstyle2nd.backColor("red"); * hstyle2nd.borderBottom(new GC.Spread.Sheets.Slicers.SlicerBorder(3, "double", "orange")); * var hstyle12nd = new GC.Spread.Sheets.Slicers.SlicerStyleInfo(); * hstyle12nd.borderTop(new GC.Spread.Sheets.Slicers.SlicerBorder(2, "double", "blue")); * hstyle12nd.backColor("yellow"); * var hstyle22nd = new GC.Spread.Sheets.Slicers.SlicerStyleInfo(); * hstyle22nd.backColor("magenta"); * var style1two = new GC.Spread.Sheets.Slicers.SlicerStyle(); * style1two.hoveredSelectedItemWithNoDataStyle(hstyle2nd); * style1two.hoveredUnSelectedItemWithNoDataStyle(hstyle2nd); * style1two.unSelectedItemWithNoDataStyle(hstyle12nd); * style1two.selectedItemWithNoDataStyle(hstyle22nd); * slicer2.style(style1two); * activeSheet.setColumnWidth(1, 100); * activeSheet.setColumnWidth(2, 100); * activeSheet.setColumnWidth(3, 100); * ``` */ hoveredUnSelectedItemWithNoDataStyle(value?: GC.Spread.Sheets.Slicers.SlicerStyleInfo): any; /** * Gets or sets the name of the style. * @param {string} [value] The slicer style name. * @returns {string | GC.Spread.Sheets.Slicers.SlicerStyle} If no value is set, returns the name of the style; otherwise, returns the slicer style. */ name(value?: string): any; /** * Gets or sets the style of the selected item with data. * @param {GC.Spread.Sheets.Slicers.SlicerStyleInfo} [value] The style of the selected item with data. * @returns {GC.Spread.Sheets.Slicers.SlicerStyleInfo | GC.Spread.Sheets.Slicers.SlicerStyle} If no value is set, returns the style of the selected item with data; otherwise, returns the slicer style. * @example * ```javascript * //This example uses the hoveredUnSelectedItemWithNoDataStyle method. * var spread = new GC.Spread.Sheets.Workbook(document.getElementById("ss"), { sheetCount: 2 }); * var activeSheet = spread.getActiveSheet(); * var datasource = [ * { Name: "Apple", Category: "Fruit" }, * { Name: "Orange", Category: "Fruit" }, * { Name: "Broccoli", Category: "Vegetable" }, * { Name: "Kiwi", Category: "Fruit" }, * { Name: "Rice", Category: "Cereal" }, * { Name: "Strawberry", Category: "Fruit" }, * { Name: "Yogurt", Category: "Dairy" }, * { Name: "Plum", Category: "Fruit" }, * { Name: "Celery", Category: "Vegetable" }, * { Name: "Grape", Category: "Fruit" }, * { Name: "Oats", Category: "Cereal" }, * { Name: "Quinoa", Category: "Cereal" }, * { Name: "Maize", Category: "Cereal" }, * { Name: "Okra", Category: "Vegetable" }, * { Name: "Corn", Category: "Vegetable" }, * { Name: "Wheat", Category: "Cereal" }, * { Name: "Barley", Category: "Cereal" }, * { Name: "Cream", Category: "Dairy" }, * { Name: "Millet", Category: "Cereal" }, * { Name: "Rye", Category: "Cereal" }, * { Name: "Artichoke", Category: "Vegetable" }, * { Name: "Buckwheat", Category: "Cereal" }, * { Name: "Gooseberry", Category: "Fruit" }, * { Name: "Amaranth", Category: "Cereal" }, * { Name: "Carrot", Category: "Vegetable" }, * { Name: "Cheese", Category: "Dairy" }, * { Name: "Fig", Category: "Fruit" }, * { Name: "Milk", Category: "Dairy" }, * { Name: "Butter", Category: "Dairy" }, * ]; * var table = activeSheet.tables.addFromDataSource("table1", 1, 1, datasource); * //add a slicer to the sheet and return the slicer instance. * var slicer = activeSheet.slicers.add("slicer1",table.name(),"Category"); * //change the slicer properties. * slicer.width(200); * slicer.height(200); * slicer.position(new GC.Spread.Sheets.Point(300, 50)); * var slicer2 = activeSheet.slicers.add("slicer2", table.name(), "Name"); * var hstyle = new GC.Spread.Sheets.Slicers.SlicerStyleInfo(); * hstyle.backColor("red"); * hstyle.borderBottom(new GC.Spread.Sheets.Slicers.SlicerBorder(3, "dashed", "green")); * var hstyle1 = new GC.Spread.Sheets.Slicers.SlicerStyleInfo(); * hstyle1.borderTop(new GC.Spread.Sheets.Slicers.SlicerBorder(2, "dashed", "blue")); * hstyle1.backColor("yellow"); * var hstyle2 = new GC.Spread.Sheets.Slicers.SlicerStyleInfo(); * hstyle2.backColor("green"); * var style1 = new GC.Spread.Sheets.Slicers.SlicerStyle(); * style1.hoveredSelectedItemWithDataStyle(hstyle); * style1.hoveredUnSelectedItemWithDataStyle(hstyle); * style1.unSelectedItemWithDataStyle(hstyle1); * style1.selectedItemWithDataStyle(hstyle2); * slicer.style(style1); * var hstyle2nd = new GC.Spread.Sheets.Slicers.SlicerStyleInfo(); * hstyle2nd.backColor("red"); * hstyle2nd.borderBottom(new GC.Spread.Sheets.Slicers.SlicerBorder(3, "double", "orange")); * var hstyle12nd = new GC.Spread.Sheets.Slicers.SlicerStyleInfo(); * hstyle12nd.borderTop(new GC.Spread.Sheets.Slicers.SlicerBorder(2, "double", "blue")); * hstyle12nd.backColor("yellow"); * var hstyle22nd = new GC.Spread.Sheets.Slicers.SlicerStyleInfo(); * hstyle22nd.backColor("magenta"); * var style1two = new GC.Spread.Sheets.Slicers.SlicerStyle(); * style1two.hoveredSelectedItemWithNoDataStyle(hstyle2nd); * style1two.hoveredUnSelectedItemWithNoDataStyle(hstyle2nd); * style1two.unSelectedItemWithNoDataStyle(hstyle12nd); * style1two.selectedItemWithNoDataStyle(hstyle22nd); * slicer2.style(style1two); * activeSheet.setColumnWidth(1, 100); * activeSheet.setColumnWidth(2, 100); * activeSheet.setColumnWidth(3, 100); * ``` */ selectedItemWithDataStyle(value?: GC.Spread.Sheets.Slicers.SlicerStyleInfo): any; /** * Gets or sets the style of the selected item with no data. * @param {GC.Spread.Sheets.Slicers.SlicerStyleInfo} [value] The style of the selected item with no data. * @returns {GC.Spread.Sheets.Slicers.SlicerStyleInfo | GC.Spread.Sheets.Slicers.SlicerStyle} If no value is set, returns the style of the selected item with no data; otherwise, returns the slicer style. * @example * ```javascript * //This example uses the hoveredUnSelectedItemWithNoDataStyle method. * var spread = new GC.Spread.Sheets.Workbook(document.getElementById("ss"), { sheetCount: 2 }); * var activeSheet = spread.getActiveSheet(); * var datasource = [ * { Name: "Apple", Category: "Fruit" }, * { Name: "Orange", Category: "Fruit" }, * { Name: "Broccoli", Category: "Vegetable" }, * { Name: "Kiwi", Category: "Fruit" }, * { Name: "Rice", Category: "Cereal" }, * { Name: "Strawberry", Category: "Fruit" }, * { Name: "Yogurt", Category: "Dairy" }, * { Name: "Plum", Category: "Fruit" }, * { Name: "Celery", Category: "Vegetable" }, * { Name: "Grape", Category: "Fruit" }, * { Name: "Oats", Category: "Cereal" }, * { Name: "Quinoa", Category: "Cereal" }, * { Name: "Maize", Category: "Cereal" }, * { Name: "Okra", Category: "Vegetable" }, * { Name: "Corn", Category: "Vegetable" }, * { Name: "Wheat", Category: "Cereal" }, * { Name: "Barley", Category: "Cereal" }, * { Name: "Cream", Category: "Dairy" }, * { Name: "Millet", Category: "Cereal" }, * { Name: "Rye", Category: "Cereal" }, * { Name: "Artichoke", Category: "Vegetable" }, * { Name: "Buckwheat", Category: "Cereal" }, * { Name: "Gooseberry", Category: "Fruit" }, * { Name: "Amaranth", Category: "Cereal" }, * { Name: "Carrot", Category: "Vegetable" }, * { Name: "Cheese", Category: "Dairy" }, * { Name: "Fig", Category: "Fruit" }, * { Name: "Milk", Category: "Dairy" }, * { Name: "Butter", Category: "Dairy" }, * ]; * var table = activeSheet.tables.addFromDataSource("table1", 1, 1, datasource); * //add a slicer to the sheet and return the slicer instance. * var slicer = activeSheet.slicers.add("slicer1",table.name(),"Category"); * //change the slicer properties. * slicer.width(200); * slicer.height(200); * slicer.position(new GC.Spread.Sheets.Point(300, 50)); * var slicer2 = activeSheet.slicers.add("slicer2", table.name(), "Name"); * var hstyle = new GC.Spread.Sheets.Slicers.SlicerStyleInfo(); * hstyle.backColor("red"); * hstyle.borderBottom(new GC.Spread.Sheets.Slicers.SlicerBorder(3, "dashed", "green")); * var hstyle1 = new GC.Spread.Sheets.Slicers.SlicerStyleInfo(); * hstyle1.borderTop(new GC.Spread.Sheets.Slicers.SlicerBorder(2, "dashed", "blue")); * hstyle1.backColor("yellow"); * var hstyle2 = new GC.Spread.Sheets.Slicers.SlicerStyleInfo(); * hstyle2.backColor("green"); * var style1 = new GC.Spread.Sheets.Slicers.SlicerStyle(); * style1.hoveredSelectedItemWithDataStyle(hstyle); * style1.hoveredUnSelectedItemWithDataStyle(hstyle); * style1.unSelectedItemWithDataStyle(hstyle1); * style1.selectedItemWithDataStyle(hstyle2); * slicer.style(style1); * var hstyle2nd = new GC.Spread.Sheets.Slicers.SlicerStyleInfo(); * hstyle2nd.backColor("red"); * hstyle2nd.borderBottom(new GC.Spread.Sheets.Slicers.SlicerBorder(3, "double", "orange")); * var hstyle12nd = new GC.Spread.Sheets.Slicers.SlicerStyleInfo(); * hstyle12nd.borderTop(new GC.Spread.Sheets.Slicers.SlicerBorder(2, "double", "blue")); * hstyle12nd.backColor("yellow"); * var hstyle22nd = new GC.Spread.Sheets.Slicers.SlicerStyleInfo(); * hstyle22nd.backColor("magenta"); * var style1two = new GC.Spread.Sheets.Slicers.SlicerStyle(); * style1two.hoveredSelectedItemWithNoDataStyle(hstyle2nd); * style1two.hoveredUnSelectedItemWithNoDataStyle(hstyle2nd); * style1two.unSelectedItemWithNoDataStyle(hstyle12nd); * style1two.selectedItemWithNoDataStyle(hstyle22nd); * slicer2.style(style1two); * activeSheet.setColumnWidth(1, 100); * activeSheet.setColumnWidth(2, 100); * activeSheet.setColumnWidth(3, 100); * ``` */ selectedItemWithNoDataStyle(value?: GC.Spread.Sheets.Slicers.SlicerStyleInfo): any; /** * Saves the object state to a JSON string. * @returns {Object} The item slicer theme data. * @example * ```javascript * //This example uses the toJSON method. * const light1 = GC.Spread.Sheets.Slicers.SlicerStyles.light1(); * //export * const jsonStr = JSON.stringify(light1.toJSON()); * //import * const newTheme = new GC.Spread.Sheets.Slicers.SlicerStyle(); * newTheme.fromJSON(JSON.parse(jsonStr)); * newTheme.name('custom1'); * alert(jsonStr); * ``` */ toJSON(): Object; /** * Gets or sets the style of the unselected item with data. * @param {GC.Spread.Sheets.Slicers.SlicerStyleInfo} [value] The style of the unselected item with data. * @returns {GC.Spread.Sheets.Slicers.SlicerStyleInfo | GC.Spread.Sheets.Slicers.SlicerStyle} If no value is set, returns the style of the unselected item with data; otherwise, returns the slicer style. * @example * ```javascript * //This example uses the hoveredUnSelectedItemWithNoDataStyle method. * var spread = new GC.Spread.Sheets.Workbook(document.getElementById("ss"), { sheetCount: 2 }); * var activeSheet = spread.getActiveSheet(); * var datasource = [ * { Name: "Apple", Category: "Fruit" }, * { Name: "Orange", Category: "Fruit" }, * { Name: "Broccoli", Category: "Vegetable" }, * { Name: "Kiwi", Category: "Fruit" }, * { Name: "Rice", Category: "Cereal" }, * { Name: "Strawberry", Category: "Fruit" }, * { Name: "Yogurt", Category: "Dairy" }, * { Name: "Plum", Category: "Fruit" }, * { Name: "Celery", Category: "Vegetable" }, * { Name: "Grape", Category: "Fruit" }, * { Name: "Oats", Category: "Cereal" }, * { Name: "Quinoa", Category: "Cereal" }, * { Name: "Maize", Category: "Cereal" }, * { Name: "Okra", Category: "Vegetable" }, * { Name: "Corn", Category: "Vegetable" }, * { Name: "Wheat", Category: "Cereal" }, * { Name: "Barley", Category: "Cereal" }, * { Name: "Cream", Category: "Dairy" }, * { Name: "Millet", Category: "Cereal" }, * { Name: "Rye", Category: "Cereal" }, * { Name: "Artichoke", Category: "Vegetable" }, * { Name: "Buckwheat", Category: "Cereal" }, * { Name: "Gooseberry", Category: "Fruit" }, * { Name: "Amaranth", Category: "Cereal" }, * { Name: "Carrot", Category: "Vegetable" }, * { Name: "Cheese", Category: "Dairy" }, * { Name: "Fig", Category: "Fruit" }, * { Name: "Milk", Category: "Dairy" }, * { Name: "Butter", Category: "Dairy" }, * ]; * var table = activeSheet.tables.addFromDataSource("table1", 1, 1, datasource); * //add a slicer to the sheet and return the slicer instance. * var slicer = activeSheet.slicers.add("slicer1",table.name(),"Category"); * //change the slicer properties. * slicer.width(200); * slicer.height(200); * slicer.position(new GC.Spread.Sheets.Point(300, 50)); * var slicer2 = activeSheet.slicers.add("slicer2", table.name(), "Name"); * var hstyle = new GC.Spread.Sheets.Slicers.SlicerStyleInfo(); * hstyle.backColor("red"); * hstyle.borderBottom(new GC.Spread.Sheets.Slicers.SlicerBorder(3, "dashed", "green")); * var hstyle1 = new GC.Spread.Sheets.Slicers.SlicerStyleInfo(); * hstyle1.borderTop(new GC.Spread.Sheets.Slicers.SlicerBorder(2, "dashed", "blue")); * hstyle1.backColor("yellow"); * var hstyle2 = new GC.Spread.Sheets.Slicers.SlicerStyleInfo(); * hstyle2.backColor("green"); * var style1 = new GC.Spread.Sheets.Slicers.SlicerStyle(); * style1.hoveredSelectedItemWithDataStyle(hstyle); * style1.hoveredUnSelectedItemWithDataStyle(hstyle); * style1.unSelectedItemWithDataStyle(hstyle1); * style1.selectedItemWithDataStyle(hstyle2); * slicer.style(style1); * var hstyle2nd = new GC.Spread.Sheets.Slicers.SlicerStyleInfo(); * hstyle2nd.backColor("red"); * hstyle2nd.borderBottom(new GC.Spread.Sheets.Slicers.SlicerBorder(3, "double", "orange")); * var hstyle12nd = new GC.Spread.Sheets.Slicers.SlicerStyleInfo(); * hstyle12nd.borderTop(new GC.Spread.Sheets.Slicers.SlicerBorder(2, "double", "blue")); * hstyle12nd.backColor("yellow"); * var hstyle22nd = new GC.Spread.Sheets.Slicers.SlicerStyleInfo(); * hstyle22nd.backColor("magenta"); * var style1two = new GC.Spread.Sheets.Slicers.SlicerStyle(); * style1two.hoveredSelectedItemWithNoDataStyle(hstyle2nd); * style1two.hoveredUnSelectedItemWithNoDataStyle(hstyle2nd); * style1two.unSelectedItemWithNoDataStyle(hstyle12nd); * style1two.selectedItemWithNoDataStyle(hstyle22nd); * slicer2.style(style1two); * activeSheet.setColumnWidth(1, 100); * activeSheet.setColumnWidth(2, 100); * activeSheet.setColumnWidth(3, 100); * ``` */ unSelectedItemWithDataStyle(value?: GC.Spread.Sheets.Slicers.SlicerStyleInfo): any; /** * Gets or sets the style of the unselected item with no data. * @param {GC.Spread.Sheets.Slicers.SlicerStyleInfo} [value] The style of the unselected item with no data. * @returns {GC.Spread.Sheets.Slicers.SlicerStyleInfo | GC.Spread.Sheets.Slicers.SlicerStyle} If no value is set, returns the style of the unselected item with no data; otherwise, returns the slicer style. * @example * ```javascript * //This example uses the hoveredUnSelectedItemWithNoDataStyle method. * var spread = new GC.Spread.Sheets.Workbook(document.getElementById("ss"), { sheetCount: 2 }); * var activeSheet = spread.getActiveSheet(); * var datasource = [ * { Name: "Apple", Category: "Fruit" }, * { Name: "Orange", Category: "Fruit" }, * { Name: "Broccoli", Category: "Vegetable" }, * { Name: "Kiwi", Category: "Fruit" }, * { Name: "Rice", Category: "Cereal" }, * { Name: "Strawberry", Category: "Fruit" }, * { Name: "Yogurt", Category: "Dairy" }, * { Name: "Plum", Category: "Fruit" }, * { Name: "Celery", Category: "Vegetable" }, * { Name: "Grape", Category: "Fruit" }, * { Name: "Oats", Category: "Cereal" }, * { Name: "Quinoa", Category: "Cereal" }, * { Name: "Maize", Category: "Cereal" }, * { Name: "Okra", Category: "Vegetable" }, * { Name: "Corn", Category: "Vegetable" }, * { Name: "Wheat", Category: "Cereal" }, * { Name: "Barley", Category: "Cereal" }, * { Name: "Cream", Category: "Dairy" }, * { Name: "Millet", Category: "Cereal" }, * { Name: "Rye", Category: "Cereal" }, * { Name: "Artichoke", Category: "Vegetable" }, * { Name: "Buckwheat", Category: "Cereal" }, * { Name: "Gooseberry", Category: "Fruit" }, * { Name: "Amaranth", Category: "Cereal" }, * { Name: "Carrot", Category: "Vegetable" }, * { Name: "Cheese", Category: "Dairy" }, * { Name: "Fig", Category: "Fruit" }, * { Name: "Milk", Category: "Dairy" }, * { Name: "Butter", Category: "Dairy" }, * ]; * var table = activeSheet.tables.addFromDataSource("table1", 1, 1, datasource); * //add a slicer to the sheet and return the slicer instance. * var slicer = activeSheet.slicers.add("slicer1",table.name(),"Category"); * //change the slicer properties. * slicer.width(200); * slicer.height(200); * slicer.position(new GC.Spread.Sheets.Point(300, 50)); * var slicer2 = activeSheet.slicers.add("slicer2", table.name(), "Name"); * var hstyle = new GC.Spread.Sheets.Slicers.SlicerStyleInfo(); * hstyle.backColor("red"); * hstyle.borderBottom(new GC.Spread.Sheets.Slicers.SlicerBorder(3, "dashed", "green")); * var hstyle1 = new GC.Spread.Sheets.Slicers.SlicerStyleInfo(); * hstyle1.borderTop(new GC.Spread.Sheets.Slicers.SlicerBorder(2, "dashed", "blue")); * hstyle1.backColor("yellow"); * var hstyle2 = new GC.Spread.Sheets.Slicers.SlicerStyleInfo(); * hstyle2.backColor("green"); * var style1 = new GC.Spread.Sheets.Slicers.SlicerStyle(); * style1.hoveredSelectedItemWithDataStyle(hstyle); * style1.hoveredUnSelectedItemWithDataStyle(hstyle); * style1.unSelectedItemWithDataStyle(hstyle1); * style1.selectedItemWithDataStyle(hstyle2); * slicer.style(style1); * var hstyle2nd = new GC.Spread.Sheets.Slicers.SlicerStyleInfo(); * hstyle2nd.backColor("red"); * hstyle2nd.borderBottom(new GC.Spread.Sheets.Slicers.SlicerBorder(3, "double", "orange")); * var hstyle12nd = new GC.Spread.Sheets.Slicers.SlicerStyleInfo(); * hstyle12nd.borderTop(new GC.Spread.Sheets.Slicers.SlicerBorder(2, "double", "blue")); * hstyle12nd.backColor("yellow"); * var hstyle22nd = new GC.Spread.Sheets.Slicers.SlicerStyleInfo(); * hstyle22nd.backColor("magenta"); * var style1two = new GC.Spread.Sheets.Slicers.SlicerStyle(); * style1two.hoveredSelectedItemWithNoDataStyle(hstyle2nd); * style1two.hoveredUnSelectedItemWithNoDataStyle(hstyle2nd); * style1two.unSelectedItemWithNoDataStyle(hstyle12nd); * style1two.selectedItemWithNoDataStyle(hstyle22nd); * slicer2.style(style1two); * activeSheet.setColumnWidth(1, 100); * activeSheet.setColumnWidth(2, 100); * activeSheet.setColumnWidth(3, 100); * ``` */ unSelectedItemWithNoDataStyle(value?: GC.Spread.Sheets.Slicers.SlicerStyleInfo): any; /** * Gets or sets the style of the whole slicer. * @param {GC.Spread.Sheets.Slicers.SlicerStyleInfo} [value] The style of the whole slicer. * @returns {GC.Spread.Sheets.Slicers.SlicerStyleInfo | GC.Spread.Sheets.Slicers.SlicerStyle} If no value is set, returns the style of the whole slicer; otherwise, returns the slicer style. * @example * ```javascript * //create a table * var spread = new GC.Spread.Sheets.Workbook(document.getElementById("ss"), { sheetCount: 2 }); * var activeSheet = spread.getActiveSheet(); * var datas = [ * ["1", "NewYork", "1968/6/8", "80", "180"], * ["4", "NewYork", "1972/7/3", "72", "168"], * ["4", "NewYork", "1964/3/2", "71", "179"], * ["5", "Washington", "1972/8/8","80", "171"], * ["6", "Washington", "1986/2/2", "89", "161"], * ["7", "Washington", "2012/2/15", "71", "240"]]; * var table = activeSheet.tables.addFromDataSource("table1", 2, 2, datas); * var dataColumns = ["Name", "City", "Birthday", "Weight", "Height"]; * table.setColumnName(0, dataColumns[0]); * table.setColumnName(1, dataColumns[1]); * table.setColumnName(2, dataColumns[2]); * table.setColumnName(3, dataColumns[3]); * table.setColumnName(4, dataColumns[4]); * //add a slicer to the sheet and return the slicer instance. * var slicer = activeSheet.slicers.add("slicer1",table.name(),"Height"); * slicer.position(new GC.Spread.Sheets.Point(100, 200)); * //set customized style * var style = new GC.Spread.Sheets.Slicers.SlicerStyle(); * var styleInfo1 = new GC.Spread.Sheets.Slicers.SlicerStyleInfo(); * styleInfo1.backColor("orange"); * styleInfo1.borderBottom(new GC.Spread.Sheets.Slicers.SlicerBorder(2,"solid","green")); * style.wholeSlicerStyle(styleInfo1); * var styleInfo2 = new GC.Spread.Sheets.Slicers.SlicerStyleInfo(); * styleInfo2.backColor("red"); * styleInfo2.borderBottom(new GC.Spread.Sheets.Slicers.SlicerBorder(4,"solid","gray")); * style.hoveredSelectedItemWithDataStyle(styleInfo2); * slicer.style(style); * ``` */ wholeSlicerStyle(value?: GC.Spread.Sheets.Slicers.SlicerStyleInfo): any; } export class SlicerStyleInfo{ /** * Represents slicer style information. * @class * @param {string} [backColor] The background color of the style information. * @param {string} [foreColor] The foreground color of the style information. * @param {string} [font] The font of the style information. * @param {GC.Spread.Sheets.Slicers.SlicerBorder} [borderLeft] The left border of the style information. * @param {GC.Spread.Sheets.Slicers.SlicerBorder} [borderTop] The top border of the slicer information. * @param {GC.Spread.Sheets.Slicers.SlicerBorder} [borderRight] The right border of the style information. * @param {GC.Spread.Sheets.Slicers.SlicerBorder} [borderBottom] The bottom border of the style information. * @param {GC.Spread.Sheets.TextDecorationType} [textDecoration] The text decoration of the style information. * @param {string} [fontStyle] The font style of the style information. * @param {string} [fontWeight] The font weight of the style information. * @param {string} [fontSize] The font size of the style information. * @param {string} [fontFamily] The font family of the style information. */ constructor(backColor?: string, foreColor?: string, font?: string, borderLeft?: GC.Spread.Sheets.Slicers.SlicerBorder, borderTop?: GC.Spread.Sheets.Slicers.SlicerBorder, borderRight?: GC.Spread.Sheets.Slicers.SlicerBorder, borderBottom?: GC.Spread.Sheets.Slicers.SlicerBorder, textDecoration?: GC.Spread.Sheets.TextDecorationType, fontStyle?: string, fontWeight?: string, fontSize?: string, fontFamily?: string); /** * Gets or sets the background color of the style information. * @param {string} [value] The background color of the style information. * @returns {string | GC.Spread.Sheets.Slicers.SlicerStyleInfo} If no value is set, returns the background color of the style information; otherwise, returns the slicer style information. * @example * ```javascript * //This example sets the header backcolor. * //create a table * var spread = new GC.Spread.Sheets.Workbook(document.getElementById("ss"), { sheetCount: 2 }); * var activeSheet = spread.getActiveSheet(); * var datas = [ * ["1", "NewYork", "1968/6/8", "80", "180"], * ["4", "NewYork", "1972/7/3", "72", "168"], * ["4", "NewYork", "1964/3/2", "71", "179"], * ["5", "Washington", "1972/8/8","80", "171"], * ["6", "Washington", "1986/2/2", "89", "161"], * ["7", "Washington", "2012/2/15", "71", "240"]]; * var table = activeSheet.tables.addFromDataSource("table1", 2, 2, datas); * var dataColumns = ["Name", "City", "Birthday", "Weight", "Height"]; * table.setColumnName(0, dataColumns[0]); * table.setColumnName(1, dataColumns[1]); * table.setColumnName(2, dataColumns[2]); * table.setColumnName(3, dataColumns[3]); * table.setColumnName(4, dataColumns[4]); * //style * var hstyle = new GC.Spread.Sheets.Slicers.SlicerStyleInfo(); * hstyle.backColor("red"); * var style1 = new GC.Spread.Sheets.Slicers.SlicerStyle(); * style1.headerStyle(hstyle); * //add a slicer to the sheet and return the slicer instance. * var slicer = activeSheet.slicers.add("slicer1",table.name(),"Name"); * //change the slicer properties. * slicer.position(new GC.Spread.Sheets.Point(100, 200)); * slicer.style(style1); * ``` */ backColor(value?: string): any; /** * Gets or sets the bottom border of the style information. * @param {GC.Spread.Sheets.Slicers.SlicerBorder} [value] The bottom border of the style information. * @returns {GC.Spread.Sheets.Slicers.SlicerBorder | GC.Spread.Sheets.Slicers.SlicerStyleInfo} If no value is set, returns the bottom border of the style information; otherwise, returns the slicer style information. * @example * ```javascript * //This example sets a border style. * //create a table * var spread = new GC.Spread.Sheets.Workbook(document.getElementById("ss"), { sheetCount: 2 }); * var activeSheet = spread.getActiveSheet(); * var datas = [ * ["1", "NewYork", "1968/6/8", "80", "180"], * ["4", "NewYork", "1972/7/3", "72", "168"], * ["4", "NewYork", "1964/3/2", "71", "179"], * ["5", "Washington", "1972/8/8","80", "171"], * ["6", "Washington", "1986/2/2", "89", "161"], * ["7", "Washington", "2012/2/15", "71", "240"]]; * var table = activeSheet.tables.addFromDataSource("table1", 2, 2, datas); * var dataColumns = ["Name", "City", "Birthday", "Weight", "Height"]; * table.setColumnName(0, dataColumns[0]); * table.setColumnName(1, dataColumns[1]); * table.setColumnName(2, dataColumns[2]); * table.setColumnName(3, dataColumns[3]); * table.setColumnName(4, dataColumns[4]); * //style * var hstyle = new GC.Spread.Sheets.Slicers.SlicerStyleInfo(); * hstyle.backColor("red"); * hstyle.borderBottom(new GC.Spread.Sheets.Slicers.SlicerBorder(3, "dashed", "green")); * var style1 = new GC.Spread.Sheets.Slicers.SlicerStyle(); * style1.hoveredSelectedItemWithDataStyle(hstyle); * //add a slicer to the sheet and return the slicer instance. * var slicer = activeSheet.slicers.add("slicer1",table.name(),"Name"); * //change the slicer properties. * slicer.position(new GC.Spread.Sheets.Point(100, 200)); * slicer.style(style1); * ``` */ borderBottom(value?: GC.Spread.Sheets.Slicers.SlicerBorder): any; /** * Gets or sets the left border of the style information. * @param {GC.Spread.Sheets.Slicers.SlicerBorder} [value] The left border of the style information. * @returns {GC.Spread.Sheets.Slicers.SlicerBorder | GC.Spread.Sheets.Slicers.SlicerStyleInfo} If no value is set, returns the left border of the style information; otherwise, returns the slicer style information. * @example * ```javascript * //This example sets the left border. * //create a table * var spread = new GC.Spread.Sheets.Workbook(document.getElementById("ss"), { sheetCount: 2 }); * var activeSheet = spread.getActiveSheet(); * var datas = [ * ["1", "NewYork", "1968/6/8", "80", "180"], * ["4", "NewYork", "1972/7/3", "72", "168"], * ["4", "NewYork", "1964/3/2", "71", "179"], * ["5", "Washington", "1972/8/8","80", "171"], * ["6", "Washington", "1986/2/2", "89", "161"], * ["7", "Washington", "2012/2/15", "71", "240"]]; * var table = activeSheet.tables.addFromDataSource("table1", 2, 2, datas); * var dataColumns = ["Name", "City", "Birthday", "Weight", "Height"]; * table.setColumnName(0, dataColumns[0]); * table.setColumnName(1, dataColumns[1]); * table.setColumnName(2, dataColumns[2]); * table.setColumnName(3, dataColumns[3]); * table.setColumnName(4, dataColumns[4]); * //style * var hstyle = new GC.Spread.Sheets.Slicers.SlicerStyleInfo(); * hstyle.backColor("red"); * hstyle.borderLeft(new GC.Spread.Sheets.Slicers.SlicerBorder(3, "dashed", "green")); * hstyle.borderRight(new GC.Spread.Sheets.Slicers.SlicerBorder(3, "dashed", "green")); * var hstyle1 = new GC.Spread.Sheets.Slicers.SlicerStyleInfo(); * hstyle1.borderTop(new GC.Spread.Sheets.Slicers.SlicerBorder(2, "dashed", "blue")); * var style1 = new GC.Spread.Sheets.Slicers.SlicerStyle(); * style1.hoveredSelectedItemWithDataStyle(hstyle); * style1.unSelectedItemWithDataStyle(hstyle1); * //add a slicer to the sheet and return the slicer instance. * var slicer = activeSheet.slicers.add("slicer1",table.name(),"Name"); * //change the slicer properties. * slicer.position(new GC.Spread.Sheets.Point(100, 200)); * slicer.style(style1); * ``` */ borderLeft(value?: GC.Spread.Sheets.Slicers.SlicerBorder): any; /** * Gets or sets the right border of the style information. * @param {GC.Spread.Sheets.Slicers.SlicerBorder} [value] The right border of the style information. * @returns {GC.Spread.Sheets.Slicers.SlicerBorder | GC.Spread.Sheets.Slicers.SlicerStyleInfo} If no value is set, returns the right border of the style information; otherwise, returns the slicer style information. * @example * ```javascript * //This example sets the border. * //create a table * var spread = new GC.Spread.Sheets.Workbook(document.getElementById("ss"), { sheetCount: 2 }); * var activeSheet = spread.getActiveSheet(); * var datas = [ * ["1", "NewYork", "1968/6/8", "80", "180"], * ["4", "NewYork", "1972/7/3", "72", "168"], * ["4", "NewYork", "1964/3/2", "71", "179"], * ["5", "Washington", "1972/8/8","80", "171"], * ["6", "Washington", "1986/2/2", "89", "161"], * ["7", "Washington", "2012/2/15", "71", "240"]]; * var table = activeSheet.tables.addFromDataSource("table1", 2, 2, datas); * var dataColumns = ["Name", "City", "Birthday", "Weight", "Height"]; * table.setColumnName(0, dataColumns[0]); * table.setColumnName(1, dataColumns[1]); * table.setColumnName(2, dataColumns[2]); * table.setColumnName(3, dataColumns[3]); * table.setColumnName(4, dataColumns[4]); * //style * var hstyle = new GC.Spread.Sheets.Slicers.SlicerStyleInfo(); * hstyle.backColor("red"); * hstyle.borderLeft(new GC.Spread.Sheets.Slicers.SlicerBorder(3, "dashed", "green")); * hstyle.borderRight(new GC.Spread.Sheets.Slicers.SlicerBorder(3, "dashed", "green")); * var hstyle1 = new GC.Spread.Sheets.Slicers.SlicerStyleInfo(); * hstyle1.borderTop(new GC.Spread.Sheets.Slicers.SlicerBorder(2, "dashed", "blue")); * var style1 = new GC.Spread.Sheets.Slicers.SlicerStyle(); * style1.hoveredSelectedItemWithDataStyle(hstyle); * style1.unSelectedItemWithDataStyle(hstyle1); * //add a slicer to the sheet and return the slicer instance. * var slicer = activeSheet.slicers.add("slicer1",table.name(),"Name"); * //change the slicer properties. * slicer.position(new GC.Spread.Sheets.Point(100, 200)); * slicer.style(style1); * ``` */ borderRight(value?: GC.Spread.Sheets.Slicers.SlicerBorder): any; /** * Gets or sets the top border of the style information. * @param {GC.Spread.Sheets.Slicers.SlicerBorder} [value] The top border of the style information. * @returns {GC.Spread.Sheets.Slicers.SlicerBorder | GC.Spread.Sheets.Slicers.SlicerStyleInfo} If no value is set, returns the top border of the style information; otherwise, returns the slicer style information. * @example * ```javascript * //This example sets the border. * //create a table * var spread = new GC.Spread.Sheets.Workbook(document.getElementById("ss"), { sheetCount: 2 }); * var activeSheet = spread.getActiveSheet(); * var datas = [ * ["1", "NewYork", "1968/6/8", "80", "180"], * ["4", "NewYork", "1972/7/3", "72", "168"], * ["4", "NewYork", "1964/3/2", "71", "179"], * ["5", "Washington", "1972/8/8","80", "171"], * ["6", "Washington", "1986/2/2", "89", "161"], * ["7", "Washington", "2012/2/15", "71", "240"]]; * var table = activeSheet.tables.addFromDataSource("table1", 2, 2, datas); * var dataColumns = ["Name", "City", "Birthday", "Weight", "Height"]; * table.setColumnName(0, dataColumns[0]); * table.setColumnName(1, dataColumns[1]); * table.setColumnName(2, dataColumns[2]); * table.setColumnName(3, dataColumns[3]); * table.setColumnName(4, dataColumns[4]); * //style * var hstyle = new GC.Spread.Sheets.Slicers.SlicerStyleInfo(); * hstyle.backColor("red"); * hstyle.borderLeft(new GC.Spread.Sheets.Slicers.SlicerBorder(3, "dashed", "green")); * hstyle.borderRight(new GC.Spread.Sheets.Slicers.SlicerBorder(3, "dashed", "green")); * var hstyle1 = new GC.Spread.Sheets.Slicers.SlicerStyleInfo(); * hstyle1.borderTop(new GC.Spread.Sheets.Slicers.SlicerBorder(2, "dashed", "blue")); * var style1 = new GC.Spread.Sheets.Slicers.SlicerStyle(); * style1.hoveredSelectedItemWithDataStyle(hstyle); * style1.unSelectedItemWithDataStyle(hstyle1); * //add a slicer to the sheet and return the slicer instance. * var slicer = activeSheet.slicers.add("slicer1",table.name(),"Name"); * //change the slicer properties. * slicer.position(new GC.Spread.Sheets.Point(100, 200)); * slicer.style(style1); * ``` */ borderTop(value?: GC.Spread.Sheets.Slicers.SlicerBorder): any; /** * Gets or sets the font of the style information. * @param {string} [value] The font of the style information. * @returns {string | GC.Spread.Sheets.Slicers.SlicerStyleInfo} If no value is set, returns the font of the style information; otherwise, returns the slicer style information. * @example * ```javascript * //This example sets the font. * //create a table * var spread = new GC.Spread.Sheets.Workbook(document.getElementById("ss"), { sheetCount: 2 }); * var activeSheet = spread.getActiveSheet(); * var datas = [ * ["1", "NewYork", "1968/6/8", "80", "180"], * ["4", "NewYork", "1972/7/3", "72", "168"], * ["4", "NewYork", "1964/3/2", "71", "179"], * ["5", "Washington", "1972/8/8","80", "171"], * ["6", "Washington", "1986/2/2", "89", "161"], * ["7", "Washington", "2012/2/15", "71", "240"]]; * var table = activeSheet.tables.addFromDataSource("table1", 2, 2, datas); * var dataColumns = ["Name", "City", "Birthday", "Weight", "Height"]; * table.setColumnName(0, dataColumns[0]); * table.setColumnName(1, dataColumns[1]); * table.setColumnName(2, dataColumns[2]); * table.setColumnName(3, dataColumns[3]); * table.setColumnName(4, dataColumns[4]); * //style * var hstyle = new GC.Spread.Sheets.Slicers.SlicerStyleInfo(); * hstyle.backColor("red"); * hstyle.borderBottom(new GC.Spread.Sheets.Slicers.SlicerBorder(3, "dashed", "green")); * hstyle.font("8pt Arial"); * hstyle.textDecoration(GC.Spread.Sheets.TextDecorationType.underline); * var hstyle1 = new GC.Spread.Sheets.Slicers.SlicerStyleInfo(); * hstyle1.borderTop(new GC.Spread.Sheets.Slicers.SlicerBorder(2, "dashed", "blue")); * var style1 = new GC.Spread.Sheets.Slicers.SlicerStyle(); * style1.hoveredSelectedItemWithDataStyle(hstyle); * style1.unSelectedItemWithDataStyle(hstyle1); * //add a slicer to the sheet and return the slicer instance. * var slicer = activeSheet.slicers.add("slicer1",table.name(),"Name"); * //change the slicer properties. * slicer.position(new GC.Spread.Sheets.Point(100, 200)); * slicer.style(style1); * ``` */ font(value?: string): any; /** * Gets or sets the font family. * @param {string} [value] The font family of the style information. * @returns {string | GC.Spread.Sheets.Slicers.SlicerStyleInfo} If no value is set, returns the font family of the style information; otherwise, returns the slicer style information. * @example * ```javascript * //This example sets a font family. * //create a table * var spread = new GC.Spread.Sheets.Workbook(document.getElementById("ss"), { sheetCount: 2 }); * var activeSheet = spread.getActiveSheet(); * var datas = [ * ["1", "NewYork", "1968/6/8", "80", "180"], * ["4", "NewYork", "1972/7/3", "72", "168"], * ["4", "NewYork", "1964/3/2", "71", "179"], * ["5", "Washington", "1972/8/8","80", "171"], * ["6", "Washington", "1986/2/2", "89", "161"], * ["7", "Washington", "2012/2/15", "71", "240"]]; * var table = activeSheet.tables.addFromDataSource("table1", 2, 2, datas); * var dataColumns = ["Name", "City", "Birthday", "Weight", "Height"]; * table.setColumnName(0, dataColumns[0]); * table.setColumnName(1, dataColumns[1]); * table.setColumnName(2, dataColumns[2]); * table.setColumnName(3, dataColumns[3]); * table.setColumnName(4, dataColumns[4]); * //style * var hstyle = new GC.Spread.Sheets.Slicers.SlicerStyleInfo(); * hstyle.fontFamily("Arial Black"); * var style1 = new GC.Spread.Sheets.Slicers.SlicerStyle(); * style1.hoveredSelectedItemWithDataStyle(hstyle); * //add a slicer to the sheet and return the slicer instance. * var slicer = activeSheet.slicers.add("slicer1",table.name(),"Name"); * //change the slicer properties. * slicer.position(new GC.Spread.Sheets.Point(100, 200)); * slicer.style(style1); * ``` */ fontFamily(value?: string): any; /** * Gets or sets the font size. * @param {string} [value] The font size of the style information. * @returns {string | GC.Spread.Sheets.Slicers.SlicerStyleInfo} If no value is set, returns the font size of the style information; otherwise, returns the slicer style information. * @example * ```javascript * //This example sets a font size. * //create a table * var spread = new GC.Spread.Sheets.Workbook(document.getElementById("ss"), { sheetCount: 2 }); * var activeSheet = spread.getActiveSheet(); * var datas = [ * ["1", "NewYork", "1968/6/8", "80", "180"], * ["4", "NewYork", "1972/7/3", "72", "168"], * ["4", "NewYork", "1964/3/2", "71", "179"], * ["5", "Washington", "1972/8/8","80", "171"], * ["6", "Washington", "1986/2/2", "89", "161"], * ["7", "Washington", "2012/2/15", "71", "240"]]; * var table = activeSheet.tables.addFromDataSource("table1", 2, 2, datas); * var dataColumns = ["Name", "City", "Birthday", "Weight", "Height"]; * table.setColumnName(0, dataColumns[0]); * table.setColumnName(1, dataColumns[1]); * table.setColumnName(2, dataColumns[2]); * table.setColumnName(3, dataColumns[3]); * table.setColumnName(4, dataColumns[4]); * //style * var hstyle = new GC.Spread.Sheets.Slicers.SlicerStyleInfo(); * hstyle.fontSize("18pt"); * var style1 = new GC.Spread.Sheets.Slicers.SlicerStyle(); * style1.hoveredSelectedItemWithDataStyle(hstyle); * //add a slicer to the sheet and return the slicer instance. * var slicer = activeSheet.slicers.add("slicer1",table.name(),"Name"); * //change the slicer properties. * slicer.position(new GC.Spread.Sheets.Point(100, 200)); * slicer.style(style1); * ``` */ fontSize(value?: string): any; /** * Gets or sets the font style. * @param {string} [value] The font style of the style information. * @returns {string | GC.Spread.Sheets.Slicers.SlicerStyleInfo} If no value is set, returns the font style of the style information; otherwise, returns the slicer style information. * @example * ```javascript * //This example sets a font style. * //create a table * var spread = new GC.Spread.Sheets.Workbook(document.getElementById("ss"), { sheetCount: 2 }); * var activeSheet = spread.getActiveSheet(); * var datas = [ * ["1", "NewYork", "1968/6/8", "80", "180"], * ["4", "NewYork", "1972/7/3", "72", "168"], * ["4", "NewYork", "1964/3/2", "71", "179"], * ["5", "Washington", "1972/8/8","80", "171"], * ["6", "Washington", "1986/2/2", "89", "161"], * ["7", "Washington", "2012/2/15", "71", "240"]]; * var table = activeSheet.tables.addFromDataSource("table1", 2, 2, datas); * var dataColumns = ["Name", "City", "Birthday", "Weight", "Height"]; * table.setColumnName(0, dataColumns[0]); * table.setColumnName(1, dataColumns[1]); * table.setColumnName(2, dataColumns[2]); * table.setColumnName(3, dataColumns[3]); * table.setColumnName(4, dataColumns[4]); * //style * var hstyle = new GC.Spread.Sheets.Slicers.SlicerStyleInfo(); * hstyle.fontStyle("italic"); * var style1 = new GC.Spread.Sheets.Slicers.SlicerStyle(); * style1.hoveredSelectedItemWithDataStyle(hstyle); * //add a slicer to the sheet and return the slicer instance. * var slicer = activeSheet.slicers.add("slicer1",table.name(),"Name"); * //change the slicer properties. * slicer.position(new GC.Spread.Sheets.Point(100, 200)); * slicer.style(style1); * ``` */ fontStyle(value?: string): any; /** * Gets or sets the font weight. * @param {string} [value] The font weight of the style information. * @returns {string | GC.Spread.Sheets.Slicers.SlicerStyleInfo} If no value is set, returns the font weight of the style information; otherwise, returns the slicer style information. * @example * ```javascript * //This example sets a font weight. * //create a table * var spread = new GC.Spread.Sheets.Workbook(document.getElementById("ss"), { sheetCount: 2 }); * var activeSheet = spread.getActiveSheet(); * var datas = [ * ["1", "NewYork", "1968/6/8", "80", "180"], * ["4", "NewYork", "1972/7/3", "72", "168"], * ["4", "NewYork", "1964/3/2", "71", "179"], * ["5", "Washington", "1972/8/8","80", "171"], * ["6", "Washington", "1986/2/2", "89", "161"], * ["7", "Washington", "2012/2/15", "71", "240"]]; * var table = activeSheet.tables.addFromDataSource("table1", 2, 2, datas); * var dataColumns = ["Name", "City", "Birthday", "Weight", "Height"]; * table.setColumnName(0, dataColumns[0]); * table.setColumnName(1, dataColumns[1]); * table.setColumnName(2, dataColumns[2]); * table.setColumnName(3, dataColumns[3]); * table.setColumnName(4, dataColumns[4]); * //style * var hstyle = new GC.Spread.Sheets.Slicers.SlicerStyleInfo(); * hstyle.fontWeight("bold"); * var style1 = new GC.Spread.Sheets.Slicers.SlicerStyle(); * style1.hoveredSelectedItemWithDataStyle(hstyle); * //add a slicer to the sheet and return the slicer instance. * var slicer = activeSheet.slicers.add("slicer1",table.name(),"Name"); * //change the slicer properties. * slicer.position(new GC.Spread.Sheets.Point(100, 200)); * slicer.style(style1); * ``` */ fontWeight(value?: string): any; /** * Gets or sets the foreground color of the style information. * @param {string} [value] The foreground color of the style information. * @returns {string | GC.Spread.Sheets.Slicers.SlicerStyleInfo} If no value is set, returns the foreground color of the style information; otherwise, returns the slicer style information. * @example * ```javascript * //This example sets a header style for the slicer. * //create a table * var spread = new GC.Spread.Sheets.Workbook(document.getElementById("ss"), { sheetCount: 2 }); * var activeSheet = spread.getActiveSheet(); * var datas = [ * ["1", "NewYork", "1968/6/8", "80", "180"], * ["4", "NewYork", "1972/7/3", "72", "168"], * ["4", "NewYork", "1964/3/2", "71", "179"], * ["5", "Washington", "1972/8/8","80", "171"], * ["6", "Washington", "1986/2/2", "89", "161"], * ["7", "Washington", "2012/2/15", "71", "240"]]; * var table = activeSheet.tables.addFromDataSource("table1", 2, 2, datas); * var dataColumns = ["Name", "City", "Birthday", "Weight", "Height"]; * table.setColumnName(0, dataColumns[0]); * table.setColumnName(1, dataColumns[1]); * table.setColumnName(2, dataColumns[2]); * table.setColumnName(3, dataColumns[3]); * table.setColumnName(4, dataColumns[4]); * //style * var hstyle = new GC.Spread.Sheets.Slicers.SlicerStyleInfo(); * hstyle.foreColor("white"); * hstyle.backColor("black"); * var style1 = new GC.Spread.Sheets.Slicers.SlicerStyle(); * style1.headerStyle(hstyle); * //add a slicer to the sheet and return the slicer instance. * var slicer = activeSheet.slicers.add("slicer1",table.name(),"Name"); * //change the slicer properties. * slicer.position(new GC.Spread.Sheets.Point(100, 200)); * slicer.style(style1); * ``` */ foreColor(value?: string): any; /** * Sets every border of the style information. * @param {GC.Spread.Sheets.Slicers.SlicerBorder} value The border setting. */ setBorders(value: GC.Spread.Sheets.Slicers.SlicerBorder): void; /** * Gets or sets the text decoration of the style information. * @param {GC.Spread.Sheets.TextDecorationType} [value] The text decoration of the style information. * @returns {GC.Spread.Sheets.TextDecorationType | GC.Spread.Sheets.Slicers.SlicerStyleInfo} If no value is set, returns the text decoration of the style information; otherwise, returns the slicer style information. * @example * ```javascript * //This example underlines the text. * //create a table * var spread = new GC.Spread.Sheets.Workbook(document.getElementById("ss"), { sheetCount: 2 }); * var activeSheet = spread.getActiveSheet(); * var datas = [ * ["1", "NewYork", "1968/6/8", "80", "180"], * ["4", "NewYork", "1972/7/3", "72", "168"], * ["4", "NewYork", "1964/3/2", "71", "179"], * ["5", "Washington", "1972/8/8","80", "171"], * ["6", "Washington", "1986/2/2", "89", "161"], * ["7", "Washington", "2012/2/15", "71", "240"]]; * var table = activeSheet.tables.addFromDataSource("table1", 2, 2, datas); * var dataColumns = ["Name", "City", "Birthday", "Weight", "Height"]; * table.setColumnName(0, dataColumns[0]); * table.setColumnName(1, dataColumns[1]); * table.setColumnName(2, dataColumns[2]); * table.setColumnName(3, dataColumns[3]); * table.setColumnName(4, dataColumns[4]); * //style * var hstyle = new GC.Spread.Sheets.Slicers.SlicerStyleInfo(); * hstyle.backColor("red"); * hstyle.borderBottom(new GC.Spread.Sheets.Slicers.SlicerBorder(3, "dashed", "green")); * hstyle.font("8pt Arial"); * hstyle.textDecoration(GC.Spread.Sheets.TextDecorationType.underline); * var hstyle1 = new GC.Spread.Sheets.Slicers.SlicerStyleInfo(); * hstyle1.borderTop(new GC.Spread.Sheets.Slicers.SlicerBorder(2, "dashed", "blue")); * var style1 = new GC.Spread.Sheets.Slicers.SlicerStyle(); * style1.hoveredSelectedItemWithDataStyle(hstyle); * style1.unSelectedItemWithDataStyle(hstyle1); * //add a slicer to the sheet and return the slicer instance. * var slicer = activeSheet.slicers.add("slicer1",table.name(),"Name"); * //change the slicer properties. * slicer.position(new GC.Spread.Sheets.Point(100, 200)); * slicer.style(style1); * ``` */ textDecoration(value?: GC.Spread.Sheets.TextDecorationType): any; } export class SlicerStyles{ /** * Represents a built-in slicer style collection. * @class * @example * ```javascript * //This example uses a built-in style. * //create a table * var spread = new GC.Spread.Sheets.Workbook(document.getElementById("ss"), { sheetCount: 2 }); * var activeSheet = spread.getActiveSheet(); * var datas = [ * ["1", "NewYork", "1968/6/8", "80", "180"], * ["4", "NewYork", "1972/7/3", "72", "168"], * ["4", "NewYork", "1964/3/2", "71", "179"], * ["5", "Washington", "1972/8/8","80", "171"], * ["6", "Washington", "1986/2/2", "89", "161"], * ["7", "Washington", "2012/2/15", "71", "240"]]; * var table = activeSheet.tables.addFromDataSource("table1", 2, 2, datas); * var dataColumns = ["Name", "City", "Birthday", "Weight", "Height"]; * table.setColumnName(0, dataColumns[0]); * table.setColumnName(1, dataColumns[1]); * table.setColumnName(2, dataColumns[2]); * table.setColumnName(3, dataColumns[3]); * table.setColumnName(4, dataColumns[4]); * var style1 = new GC.Spread.Sheets.Slicers.SlicerStyles.light4(); * //add a slicer to the sheet and return the slicer instance. * var slicer = activeSheet.slicers.add("slicer1",table.name(),"Name"); * //change the slicer properties. * slicer.position(new GC.Spread.Sheets.Point(100, 200)); * slicer.style(style1); * ``` */ constructor(); /** * Gets the dark1 style. * @returns {GC.Spread.Sheets.Slicers.SlicerStyle} * @example * ```javascript * //This example uses a built-in style. * //create a table * var spread = new GC.Spread.Sheets.Workbook(document.getElementById("ss"), { sheetCount: 2 }); * var activeSheet = spread.getActiveSheet(); * var datas = [ * ["1", "NewYork", "1968/6/8", "80", "180"], * ["4", "NewYork", "1972/7/3", "72", "168"], * ["4", "NewYork", "1964/3/2", "71", "179"], * ["5", "Washington", "1972/8/8","80", "171"], * ["6", "Washington", "1986/2/2", "89", "161"], * ["7", "Washington", "2012/2/15", "71", "240"]]; * var table = activeSheet.tables.addFromDataSource("table1", 2, 2, datas); * var dataColumns = ["Name", "City", "Birthday", "Weight", "Height"]; * table.setColumnName(0, dataColumns[0]); * table.setColumnName(1, dataColumns[1]); * table.setColumnName(2, dataColumns[2]); * table.setColumnName(3, dataColumns[3]); * table.setColumnName(4, dataColumns[4]); * var style1 = new GC.Spread.Sheets.Slicers.SlicerStyles.dark1(); * //create a slicer * //add the slicer to the sheet * var slicer = activeSheet.slicers.add("slicer1", table.name(),"Height"); * slicer.position(new GC.Spread.Sheets.Point(100, 200)); * slicer.style(style1); * ``` */ static dark1(): GC.Spread.Sheets.Slicers.SlicerStyle; /** * Gets the dark2 style. * @returns {GC.Spread.Sheets.Slicers.SlicerStyle} * @example * ```javascript * //This example uses a built-in style. * //create a table * var spread = new GC.Spread.Sheets.Workbook(document.getElementById("ss"), { sheetCount: 2 }); * var activeSheet = spread.getActiveSheet(); * var datas = [ * ["1", "NewYork", "1968/6/8", "80", "180"], * ["4", "NewYork", "1972/7/3", "72", "168"], * ["4", "NewYork", "1964/3/2", "71", "179"], * ["5", "Washington", "1972/8/8","80", "171"], * ["6", "Washington", "1986/2/2", "89", "161"], * ["7", "Washington", "2012/2/15", "71", "240"]]; * var table = activeSheet.tables.addFromDataSource("table1", 2, 2, datas); * var dataColumns = ["Name", "City", "Birthday", "Weight", "Height"]; * table.setColumnName(0, dataColumns[0]); * table.setColumnName(1, dataColumns[1]); * table.setColumnName(2, dataColumns[2]); * table.setColumnName(3, dataColumns[3]); * table.setColumnName(4, dataColumns[4]); * var style1 = new GC.Spread.Sheets.Slicers.SlicerStyles.dark2(); * //create a slicer * //add the slicer to the sheet * var slicer = activeSheet.slicers.add("slicer1", table.name(),"Height"); * slicer.position(new GC.Spread.Sheets.Point(100, 200)); * slicer.style(style1); * ``` */ static dark2(): GC.Spread.Sheets.Slicers.SlicerStyle; /** * Gets the dark3 style. * @returns {GC.Spread.Sheets.Slicers.SlicerStyle} * @example * ```javascript * //This example uses a built-in style. * //create a table * var spread = new GC.Spread.Sheets.Workbook(document.getElementById("ss"), { sheetCount: 2 }); * var activeSheet = spread.getActiveSheet(); * var datas = [ * ["1", "NewYork", "1968/6/8", "80", "180"], * ["4", "NewYork", "1972/7/3", "72", "168"], * ["4", "NewYork", "1964/3/2", "71", "179"], * ["5", "Washington", "1972/8/8","80", "171"], * ["6", "Washington", "1986/2/2", "89", "161"], * ["7", "Washington", "2012/2/15", "71", "240"]]; * var table = activeSheet.tables.addFromDataSource("table1", 2, 2, datas); * var dataColumns = ["Name", "City", "Birthday", "Weight", "Height"]; * table.setColumnName(0, dataColumns[0]); * table.setColumnName(1, dataColumns[1]); * table.setColumnName(2, dataColumns[2]); * table.setColumnName(3, dataColumns[3]); * table.setColumnName(4, dataColumns[4]); * var style1 = new GC.Spread.Sheets.Slicers.SlicerStyles.dark3(); * //create a slicer * //add the slicer to the sheet * var slicer = activeSheet.slicers.add("slicer1", table.name(),"Height"); * slicer.position(new GC.Spread.Sheets.Point(100, 200)); * slicer.style(style1); * ``` */ static dark3(): GC.Spread.Sheets.Slicers.SlicerStyle; /** * Gets the dark4 style. * @returns {GC.Spread.Sheets.Slicers.SlicerStyle} * @example * ```javascript * //This example uses a built-in style. * //create a table * var spread = new GC.Spread.Sheets.Workbook(document.getElementById("ss"), { sheetCount: 2 }); * var activeSheet = spread.getActiveSheet(); * var datas = [ * ["1", "NewYork", "1968/6/8", "80", "180"], * ["4", "NewYork", "1972/7/3", "72", "168"], * ["4", "NewYork", "1964/3/2", "71", "179"], * ["5", "Washington", "1972/8/8","80", "171"], * ["6", "Washington", "1986/2/2", "89", "161"], * ["7", "Washington", "2012/2/15", "71", "240"]]; * var table = activeSheet.tables.addFromDataSource("table1", 2, 2, datas); * var dataColumns = ["Name", "City", "Birthday", "Weight", "Height"]; * table.setColumnName(0, dataColumns[0]); * table.setColumnName(1, dataColumns[1]); * table.setColumnName(2, dataColumns[2]); * table.setColumnName(3, dataColumns[3]); * table.setColumnName(4, dataColumns[4]); * var style1 = new GC.Spread.Sheets.Slicers.SlicerStyles.dark4(); * //create a slicer * //add the slicer to the sheet * var slicer = activeSheet.slicers.add("slicer1", table.name(),"Height"); * slicer.position(new GC.Spread.Sheets.Point(100, 200)); * slicer.style(style1); * ``` */ static dark4(): GC.Spread.Sheets.Slicers.SlicerStyle; /** * Gets the dark5 style. * @returns {GC.Spread.Sheets.Slicers.SlicerStyle} * @example * ```javascript * //This example uses a built-in style. * //create a table * var spread = new GC.Spread.Sheets.Workbook(document.getElementById("ss"), { sheetCount: 2 }); * var activeSheet = spread.getActiveSheet(); * var datas = [ * ["1", "NewYork", "1968/6/8", "80", "180"], * ["4", "NewYork", "1972/7/3", "72", "168"], * ["4", "NewYork", "1964/3/2", "71", "179"], * ["5", "Washington", "1972/8/8","80", "171"], * ["6", "Washington", "1986/2/2", "89", "161"], * ["7", "Washington", "2012/2/15", "71", "240"]]; * var table = activeSheet.tables.addFromDataSource("table1", 2, 2, datas); * var dataColumns = ["Name", "City", "Birthday", "Weight", "Height"]; * table.setColumnName(0, dataColumns[0]); * table.setColumnName(1, dataColumns[1]); * table.setColumnName(2, dataColumns[2]); * table.setColumnName(3, dataColumns[3]); * table.setColumnName(4, dataColumns[4]); * var style1 = new GC.Spread.Sheets.Slicers.SlicerStyles.dark5(); * //create a slicer * //add the slicer to the sheet * var slicer = activeSheet.slicers.add("slicer1", table.name(),"Height"); * slicer.position(new GC.Spread.Sheets.Point(100, 200)); * slicer.style(style1); * ``` */ static dark5(): GC.Spread.Sheets.Slicers.SlicerStyle; /** * Gets the dark6 style. * @returns {GC.Spread.Sheets.Slicers.SlicerStyle} * @example * ```javascript * //This example uses a built-in style. * //create a table * var spread = new GC.Spread.Sheets.Workbook(document.getElementById("ss"), { sheetCount: 2 }); * var activeSheet = spread.getActiveSheet(); * var datas = [ * ["1", "NewYork", "1968/6/8", "80", "180"], * ["4", "NewYork", "1972/7/3", "72", "168"], * ["4", "NewYork", "1964/3/2", "71", "179"], * ["5", "Washington", "1972/8/8","80", "171"], * ["6", "Washington", "1986/2/2", "89", "161"], * ["7", "Washington", "2012/2/15", "71", "240"]]; * var table = activeSheet.tables.addFromDataSource("table1", 2, 2, datas); * var dataColumns = ["Name", "City", "Birthday", "Weight", "Height"]; * table.setColumnName(0, dataColumns[0]); * table.setColumnName(1, dataColumns[1]); * table.setColumnName(2, dataColumns[2]); * table.setColumnName(3, dataColumns[3]); * table.setColumnName(4, dataColumns[4]); * var style1 = new GC.Spread.Sheets.Slicers.SlicerStyles.dark6(); * //create a slicer * //add the slicer to the sheet * var slicer = activeSheet.slicers.add("slicer1", table.name(),"Height"); * slicer.position(new GC.Spread.Sheets.Point(100, 200)); * slicer.style(style1); * ``` */ static dark6(): GC.Spread.Sheets.Slicers.SlicerStyle; /** * Gets the light1 style. * @returns {GC.Spread.Sheets.Slicers.SlicerStyle} * @example * ```javascript * //This example uses a built-in style. * //create a table * var spread = new GC.Spread.Sheets.Workbook(document.getElementById("ss"), { sheetCount: 2 }); * var activeSheet = spread.getActiveSheet(); * var datas = [ * ["1", "NewYork", "1968/6/8", "80", "180"], * ["4", "NewYork", "1972/7/3", "72", "168"], * ["4", "NewYork", "1964/3/2", "71", "179"], * ["5", "Washington", "1972/8/8","80", "171"], * ["6", "Washington", "1986/2/2", "89", "161"], * ["7", "Washington", "2012/2/15", "71", "240"]]; * var table = activeSheet.tables.addFromDataSource("table1", 2, 2, datas); * var dataColumns = ["Name", "City", "Birthday", "Weight", "Height"]; * table.setColumnName(0, dataColumns[0]); * table.setColumnName(1, dataColumns[1]); * table.setColumnName(2, dataColumns[2]); * table.setColumnName(3, dataColumns[3]); * table.setColumnName(4, dataColumns[4]); * var style1 = new GC.Spread.Sheets.Slicers.SlicerStyles.light1(); * //create a slicer * //add the slicer to the sheet * var slicer = activeSheet.slicers.add("slicer1", table.name(),"Height"); * slicer.position(new GC.Spread.Sheets.Point(100, 200)); * slicer.style(style1); * ``` */ static light1(): GC.Spread.Sheets.Slicers.SlicerStyle; /** * Gets the light2 style. * @returns {GC.Spread.Sheets.Slicers.SlicerStyle} * @example * ```javascript * //This example uses a built-in style. * //create a table * var spread = new GC.Spread.Sheets.Workbook(document.getElementById("ss"), { sheetCount: 2 }); * var activeSheet = spread.getActiveSheet(); * var datas = [ * ["1", "NewYork", "1968/6/8", "80", "180"], * ["4", "NewYork", "1972/7/3", "72", "168"], * ["4", "NewYork", "1964/3/2", "71", "179"], * ["5", "Washington", "1972/8/8","80", "171"], * ["6", "Washington", "1986/2/2", "89", "161"], * ["7", "Washington", "2012/2/15", "71", "240"]]; * var table = activeSheet.tables.addFromDataSource("table1", 2, 2, datas); * var dataColumns = ["Name", "City", "Birthday", "Weight", "Height"]; * table.setColumnName(0, dataColumns[0]); * table.setColumnName(1, dataColumns[1]); * table.setColumnName(2, dataColumns[2]); * table.setColumnName(3, dataColumns[3]); * table.setColumnName(4, dataColumns[4]); * var style1 = new GC.Spread.Sheets.Slicers.SlicerStyles.light2(); * //create a slicer * //add the slicer to the sheet * var slicer = activeSheet.slicers.add("slicer1", table.name(),"Height"); * slicer.position(new GC.Spread.Sheets.Point(100, 200)); * slicer.style(style1); * ``` */ static light2(): GC.Spread.Sheets.Slicers.SlicerStyle; /** * Gets the light3 style. * @returns {GC.Spread.Sheets.Slicers.SlicerStyle} * @example * ```javascript * //This example uses a built-in style. * //create a table * var spread = new GC.Spread.Sheets.Workbook(document.getElementById("ss"), { sheetCount: 2 }); * var activeSheet = spread.getActiveSheet(); * var datas = [ * ["1", "NewYork", "1968/6/8", "80", "180"], * ["4", "NewYork", "1972/7/3", "72", "168"], * ["4", "NewYork", "1964/3/2", "71", "179"], * ["5", "Washington", "1972/8/8","80", "171"], * ["6", "Washington", "1986/2/2", "89", "161"], * ["7", "Washington", "2012/2/15", "71", "240"]]; * var table = activeSheet.tables.addFromDataSource("table1", 2, 2, datas); * var dataColumns = ["Name", "City", "Birthday", "Weight", "Height"]; * table.setColumnName(0, dataColumns[0]); * table.setColumnName(1, dataColumns[1]); * table.setColumnName(2, dataColumns[2]); * table.setColumnName(3, dataColumns[3]); * table.setColumnName(4, dataColumns[4]); * var style1 = new GC.Spread.Sheets.Slicers.SlicerStyles.light3(); * //create a slicer * //add the slicer to the sheet * var slicer = activeSheet.slicers.add("slicer1", table.name(),"Height"); * slicer.position(new GC.Spread.Sheets.Point(100, 200)); * slicer.style(style1); * ``` */ static light3(): GC.Spread.Sheets.Slicers.SlicerStyle; /** * Gets the light4 style. * @returns {GC.Spread.Sheets.Slicers.SlicerStyle} * @example * ```javascript * //This example uses a built-in style. * //create a table * var spread = new GC.Spread.Sheets.Workbook(document.getElementById("ss"), { sheetCount: 2 }); * var activeSheet = spread.getActiveSheet(); * var datas = [ * ["1", "NewYork", "1968/6/8", "80", "180"], * ["4", "NewYork", "1972/7/3", "72", "168"], * ["4", "NewYork", "1964/3/2", "71", "179"], * ["5", "Washington", "1972/8/8","80", "171"], * ["6", "Washington", "1986/2/2", "89", "161"], * ["7", "Washington", "2012/2/15", "71", "240"]]; * var table = activeSheet.tables.addFromDataSource("table1", 2, 2, datas); * var dataColumns = ["Name", "City", "Birthday", "Weight", "Height"]; * table.setColumnName(0, dataColumns[0]); * table.setColumnName(1, dataColumns[1]); * table.setColumnName(2, dataColumns[2]); * table.setColumnName(3, dataColumns[3]); * table.setColumnName(4, dataColumns[4]); * var style1 = new GC.Spread.Sheets.Slicers.SlicerStyles.light4(); * //create a slicer * //add the slicer to the sheet * var slicer = activeSheet.slicers.add("slicer1", table.name(),"Height"); * slicer.position(new GC.Spread.Sheets.Point(100, 200)); * slicer.style(style1); * ``` */ static light4(): GC.Spread.Sheets.Slicers.SlicerStyle; /** * Gets the light5 style. * @returns {GC.Spread.Sheets.Slicers.SlicerStyle} * @example * ```javascript * //This example uses a built-in style. * //create a table * var spread = new GC.Spread.Sheets.Workbook(document.getElementById("ss"), { sheetCount: 2 }); * var activeSheet = spread.getActiveSheet(); * var datas = [ * ["1", "NewYork", "1968/6/8", "80", "180"], * ["4", "NewYork", "1972/7/3", "72", "168"], * ["4", "NewYork", "1964/3/2", "71", "179"], * ["5", "Washington", "1972/8/8","80", "171"], * ["6", "Washington", "1986/2/2", "89", "161"], * ["7", "Washington", "2012/2/15", "71", "240"]]; * var table = activeSheet.tables.addFromDataSource("table1", 2, 2, datas); * var dataColumns = ["Name", "City", "Birthday", "Weight", "Height"]; * table.setColumnName(0, dataColumns[0]); * table.setColumnName(1, dataColumns[1]); * table.setColumnName(2, dataColumns[2]); * table.setColumnName(3, dataColumns[3]); * table.setColumnName(4, dataColumns[4]); * var style1 = new GC.Spread.Sheets.Slicers.SlicerStyles.light5(); * //create a slicer * //add the slicer to the sheet * var slicer = activeSheet.slicers.add("slicer1", table.name(),"Height"); * slicer.position(new GC.Spread.Sheets.Point(100, 200)); * slicer.style(style1); * ``` */ static light5(): GC.Spread.Sheets.Slicers.SlicerStyle; /** * Gets the light6 style. * @returns {GC.Spread.Sheets.Slicers.SlicerStyle} * @example * ```javascript * //This example uses a built-in style. * //create a table * var spread = new GC.Spread.Sheets.Workbook(document.getElementById("ss"), { sheetCount: 2 }); * var activeSheet = spread.getActiveSheet(); * var datas = [ * ["1", "NewYork", "1968/6/8", "80", "180"], * ["4", "NewYork", "1972/7/3", "72", "168"], * ["4", "NewYork", "1964/3/2", "71", "179"], * ["5", "Washington", "1972/8/8","80", "171"], * ["6", "Washington", "1986/2/2", "89", "161"], * ["7", "Washington", "2012/2/15", "71", "240"]]; * var table = activeSheet.tables.addFromDataSource("table1", 2, 2, datas); * var dataColumns = ["Name", "City", "Birthday", "Weight", "Height"]; * table.setColumnName(0, dataColumns[0]); * table.setColumnName(1, dataColumns[1]); * table.setColumnName(2, dataColumns[2]); * table.setColumnName(3, dataColumns[3]); * table.setColumnName(4, dataColumns[4]); * var style1 = new GC.Spread.Sheets.Slicers.SlicerStyles.light6(); * //create a slicer * //add the slicer to the sheet * var slicer = activeSheet.slicers.add("slicer1", table.name(),"Height"); * slicer.position(new GC.Spread.Sheets.Point(100, 200)); * slicer.style(style1); * ``` */ static light6(): GC.Spread.Sheets.Slicers.SlicerStyle; /** * Gets the other1 style. * @returns {GC.Spread.Sheets.Slicers.SlicerStyle} * @example * ```javascript * //This example uses a built-in style. * //create a table * var spread = new GC.Spread.Sheets.Workbook(document.getElementById("ss"), { sheetCount: 2 }); * var activeSheet = spread.getActiveSheet(); * var datas = [ * ["1", "NewYork", "1968/6/8", "80", "180"], * ["4", "NewYork", "1972/7/3", "72", "168"], * ["4", "NewYork", "1964/3/2", "71", "179"], * ["5", "Washington", "1972/8/8","80", "171"], * ["6", "Washington", "1986/2/2", "89", "161"], * ["7", "Washington", "2012/2/15", "71", "240"]]; * var table = activeSheet.tables.addFromDataSource("table1", 2, 2, datas); * var dataColumns = ["Name", "City", "Birthday", "Weight", "Height"]; * table.setColumnName(0, dataColumns[0]); * table.setColumnName(1, dataColumns[1]); * table.setColumnName(2, dataColumns[2]); * table.setColumnName(3, dataColumns[3]); * table.setColumnName(4, dataColumns[4]); * var style1 = new GC.Spread.Sheets.Slicers.SlicerStyles.other1(); * //create a slicer * //add the slicer to the sheet * var slicer = activeSheet.slicers.add("slicer1", table.name(),"Height"); * slicer.position(new GC.Spread.Sheets.Point(100, 200)); * slicer.style(style1); * ``` */ static other1(): GC.Spread.Sheets.Slicers.SlicerStyle; /** * Gets the other2 style. * @returns {GC.Spread.Sheets.Slicers.SlicerStyle} * @example * ```javascript * //This example uses a built-in style. * //create a table * var spread = new GC.Spread.Sheets.Workbook(document.getElementById("ss"), { sheetCount: 2 }); * var activeSheet = spread.getActiveSheet(); * var datas = [ * ["1", "NewYork", "1968/6/8", "80", "180"], * ["4", "NewYork", "1972/7/3", "72", "168"], * ["4", "NewYork", "1964/3/2", "71", "179"], * ["5", "Washington", "1972/8/8","80", "171"], * ["6", "Washington", "1986/2/2", "89", "161"], * ["7", "Washington", "2012/2/15", "71", "240"]]; * var table = activeSheet.tables.addFromDataSource("table1", 2, 2, datas); * var dataColumns = ["Name", "City", "Birthday", "Weight", "Height"]; * table.setColumnName(0, dataColumns[0]); * table.setColumnName(1, dataColumns[1]); * table.setColumnName(2, dataColumns[2]); * table.setColumnName(3, dataColumns[3]); * table.setColumnName(4, dataColumns[4]); * var style1 = new GC.Spread.Sheets.Slicers.SlicerStyles.other2(); * //create a slicer * //add the slicer to the sheet * var slicer = activeSheet.slicers.add("slicer1", table.name(),"Height"); * slicer.position(new GC.Spread.Sheets.Point(100, 200)); * slicer.style(style1); * ``` */ static other2(): GC.Spread.Sheets.Slicers.SlicerStyle; } export class TableSlicerData extends GC.Spread.Slicers.GeneralSlicerData{ /** * Represents table slicer data. * @extends GC.Spread.Slicers.GeneralSlicerData * @class GC.Spread.Sheets.TableSlicerData * @param {GC.Spread.Sheets.Tables.Table} table The table. * @example * ```javascript * //This example creates a slicer for the table. * //create table * var dataSource = [ * { Name: "Bob", City: "NewYork", Birthday: "1968/6/8" }, * { Name: "Betty", City: "NewYork", Birthday: "1972/7/3" }, * { Name: "Alice", City: "Washington", Birthday: "2012/2/15" }, * ]; * var table = activeSheet.tables.addFromDataSource("table1", 1, 1, dataSource); * var slicerData = new GC.Spread.Sheets.Slicers.TableSlicerData(table) * //Set slicer data to item slicer. * var slicer = new GC.Spread.Sheets.Slicers.ItemSlicer("slicer", slicerData, "Name"); * //Add the item slicer to the dom tree. * //The "slicerHost" is the div you want to add the slicer's dom to. * $("#slicerHost").append(slicer.getDOMElement()); * ``` */ constructor(table: GC.Spread.Sheets.Tables.Table); /** * Filters the data that corresponds to the specified column name and exclusive data indexes. * @param {string} columnName The column name. * @param {GC.Spread.Slicers.ISlicerConditional} conditional The filter conditional. * @param {boolean} [isPreview] Indicates whether filter is in preview mode. * @example * ```javascript * var spread = new GC.Spread.Sheets.Workbook('ss'); * var activeSheet = spread.getActiveSheet(); * var dataSource = [ * { Name: "Bob", City: "NewYork", Birthday: "1968/6/8" }, * { Name: "Betty", City: "NewYork", Birthday: "1972/7/3" }, * { Name: "Alice", City: "Washington", Birthday: "2012/2/15" }, * ]; * var table = activeSheet.tables.addFromDataSource("table1", 1, 1, dataSource); * var slicerData = new GC.Spread.Sheets.Slicers.TableSlicerData(table); * slicerData.getFilteredOutIndexes('Name', GC.Spread.Slicers.FilteredOutDataType.all); // [] * slicerData.doFilter('Name', {exclusiveRowIndexes: [0]}); * slicerData.getFilteredOutIndexes('Name', GC.Spread.Slicers.FilteredOutDataType.all); // [1, 2] * ``` */ doFilter(columnName: string, conditional: GC.Spread.Slicers.ISlicerConditional, isPreview?: boolean): void; /** * Unfilter the data that corresponds to the specified column name. * @param {string} columnName The column name. * @example * ```javascript * var spread = new GC.Spread.Sheets.Workbook('ss'); * var activeSheet = spread.getActiveSheet(); * var dataSource = [ * { Name: "Bob", City: "NewYork", Birthday: "1968/6/8" }, * { Name: "Betty", City: "NewYork", Birthday: "1972/7/3" }, * { Name: "Alice", City: "Washington", Birthday: "2012/2/15" }, * ]; * var table = activeSheet.tables.addFromDataSource("table1", 1, 1, dataSource); * var slicerData = new GC.Spread.Sheets.Slicers.TableSlicerData(table); * slicerData.getFilteredOutIndexes('Name', GC.Spread.Slicers.FilteredOutDataType.all); // [] * slicerData.doFilter('Name', {exclusiveRowIndexes: [0]}); * slicerData.getFilteredOutIndexes('Name', GC.Spread.Slicers.FilteredOutDataType.all); // [1, 2] * slicerData.doUnfilter('Name'); * slicerData.getFilteredOutIndexes('Name', GC.Spread.Slicers.FilteredOutDataType.all); // [] * ``` */ doUnfilter(columnName: string): void; /** * Gets the table of the table slicer data. * @returns {GC.Spread.Sheets.Tables.Table} The table of the table slicer data. * @example * ```javascript * var activeSheet = spread.getActiveSheet(); * var dataSource = [ * { Name: "Bob", City: "NewYork", Birthday: "1968/6/8" }, * { Name: "Betty", City: "NewYork", Birthday: "1972/7/3" }, * { Name: "Alice", City: "Washington", Birthday: "2012/2/15" }, * ]; * var table = activeSheet.tables.addFromDataSource("table1", 1, 1, dataSource); * var slicerData = table.getSlicerData(); // GC.Spread.Sheets.Slicers.TableSlicerData * console.log(slicerData.getTable() === table); // true * ``` */ getTable(): GC.Spread.Sheets.Tables.Table; /** * Refreshes the table slicer data. will rebuild data source of table slicer data. */ refresh(): void; } export class TimelineStyle{ /** * Represents the timeline style settings. * @class * @example * ```javascript * var spread = new GC.Spread.Sheets.Workbook(document.getElementById("ss"), { sheetCount: 2 }); * var activeSheet = spread.getActiveSheet(); * var datas = [ * ["1", "NewYork", new Date("1968/6/8")], * ["4", "NewYork", new Date("1972/7/3")], * ["4", "NewYork", new Date("1964/3/2")]]; * var table = activeSheet.tables.addFromDataSource("table1", 2, 2, datas); * var dataColumns = ["Name", "City", "Birthday"]; * table.setColumnName(0, dataColumns[0]); * table.setColumnName(1, dataColumns[1]); * table.setColumnName(2, dataColumns[2]); * * var pivotTable = sheet.pivotTables.add('pivotTable1', table.name(), 11, 1); * var timeline = sheet.slicers.add('timeline1', 'pivotTable1', 'Birthday', GC.Spread.Sheets.Slicers.TimelineStyles.dark1(), GC.Spread.Sheets.Slicers.SlicerType.pivotTimeline); * * var style = new GC.Spread.Sheets.Slicers.TimelineStyle() * style.wholeSlicerStyle(new GC.Spread.Sheets.Slicers.SlicerStyleInfo('red', 'blue', '12pt Calibri')); * style.headerStyle(new GC.Spread.Sheets.Slicers.SlicerStyleInfo(undefined, 'green', '14pt Calibri')); * style.timeLevelStyle(new GC.Spread.Sheets.Slicers.SlicerStyleInfo('yellow')); * * timeline.style(style); * ``` */ constructor(); /** * Loads the object state from the specified JSON string. * @param {Object} data The timeline slicer theme data from deserialization. * @example * ```javascript * //This example uses the fromJSON method. * const light1 = GC.Spread.Sheets.Slicers.TimelineStyles.light1(); * //export * const jsonStr = JSON.stringify(light1.toJSON()); * //import * const newTheme = new GC.Spread.Sheets.Slicers.TimelineStyle(); * newTheme.fromJSON(JSON.parse(jsonStr)); * newTheme.name('custom1'); * alert(jsonStr); * ``` */ fromJSON(data: Object): void; /** * Gets or sets the style of the slicer header. * @param {GC.Spread.Sheets.Slicers.SlicerStyleInfo} [value] The style of the slicer header. * @returns {GC.Spread.Sheets.Slicers.SlicerStyleInfo | GC.Spread.Sheets.Slicers.SlicerStyle} If no value is set, returns the style of the slicer header; otherwise, returns the slicer style. * @example * ```javascript * var spread = new GC.Spread.Sheets.Workbook(document.getElementById("ss"), { sheetCount: 2 }); * var activeSheet = spread.getActiveSheet(); * var datas = [ * ["1", "NewYork", new Date("1968/6/8"), "80", "180"], * ["4", "NewYork", new Date("1972/7/3"), "72", "168"], * ["4", "NewYork", new Date("1964/3/2"), "71", "179"], * ["5", "Washington", new Date("1972/8/8"),"80", "171"], * ["6", "Washington", new Date("1986/2/2"), "89", "161"], * ["7", "Washington", new Date("2012/2/15"), "71", "240"]]; * var table = activeSheet.tables.addFromDataSource("table1", 2, 2, datas); * var dataColumns = ["Name", "City", "Birthday", "Weight", "Height"]; * table.setColumnName(0, dataColumns[0]); * table.setColumnName(1, dataColumns[1]); * table.setColumnName(2, dataColumns[2]); * table.setColumnName(3, dataColumns[3]); * table.setColumnName(4, dataColumns[4]); * * var pivotTable = sheet.pivotTables.add('pivotTable1', table.name(), 11, 1); * var timeline = sheet.slicers.add('timeline1', 'pivotTable1', 'Birthday', GC.Spread.Sheets.Slicers.TimelineStyles.dark1(), GC.Spread.Sheets.Slicers.SlicerType.pivotTimeline); * * var style = new GC.Spread.Sheets.Slicers.TimelineStyle() * style.wholeSlicerStyle(new GC.Spread.Sheets.Slicers.SlicerStyleInfo('red', 'blue', '12pt Calibri')); * style.headerStyle(new GC.Spread.Sheets.Slicers.SlicerStyleInfo(undefined, 'green', '14pt Calibri')); * style.timeLevelStyle(new GC.Spread.Sheets.Slicers.SlicerStyleInfo('yellow')); * * timeline.style(style); * ``` */ headerStyle(value?: GC.Spread.Sheets.Slicers.SlicerStyleInfo): any; /** * Gets or sets the name of the style. * @param {string} [value] The slicer style name. * @returns {string | GC.Spread.Sheets.Slicers.TimelineStyle} If no value is set, returns the name of the style; otherwise, returns the slicer style. */ name(value?: string): any; /** * Gets or sets the style of the timeline period label 1. * @param {GC.Spread.Sheets.Slicers.SlicerStyleInfo} [value] The style of the timeline period label 1. * @returns {GC.Spread.Sheets.Slicers.SlicerStyleInfo | GC.Spread.Sheets.Slicers.SlicerStyle} If no value is set, returns the style of the timeline period label 1; otherwise, returns the slicer style. * @example * ```javascript * var spread = new GC.Spread.Sheets.Workbook(document.getElementById("ss"), { sheetCount: 2 }); * var activeSheet = spread.getActiveSheet(); * var datas = [ * ["1", "NewYork", new Date("1968/6/8"), "80", "180"], * ["4", "NewYork", new Date("1972/7/3"), "72", "168"], * ["4", "NewYork", new Date("1964/3/2"), "71", "179"], * ["5", "Washington", new Date("1972/8/8"),"80", "171"], * ["6", "Washington", new Date("1986/2/2"), "89", "161"], * ["7", "Washington", new Date("2012/2/15"), "71", "240"]]; * var table = activeSheet.tables.addFromDataSource("table1", 2, 2, datas); * var dataColumns = ["Name", "City", "Birthday", "Weight", "Height"]; * table.setColumnName(0, dataColumns[0]); * table.setColumnName(1, dataColumns[1]); * table.setColumnName(2, dataColumns[2]); * table.setColumnName(3, dataColumns[3]); * table.setColumnName(4, dataColumns[4]); * * var pivotTable = sheet.pivotTables.add('pivotTable1', table.name(), 11, 1); * var timeline = sheet.slicers.add('timeline1', 'pivotTable1', 'Birthday', GC.Spread.Sheets.Slicers.TimelineStyles.dark1(), GC.Spread.Sheets.Slicers.SlicerType.pivotTimeline); * * var style = new GC.Spread.Sheets.Slicers.TimelineStyle() * style.periodLabel1Style(new GC.Spread.Sheets.Slicers.SlicerStyleInfo('red', 'blue', '12pt Calibri')); * * timeline.style(style); * ``` */ periodLabel1Style(value?: GC.Spread.Sheets.Slicers.SlicerStyleInfo): any; /** * Gets or sets the style of the timeline period label 2. * @param {GC.Spread.Sheets.Slicers.SlicerStyleInfo} [value] The style of the timeline period label 2. * @returns {GC.Spread.Sheets.Slicers.SlicerStyleInfo | GC.Spread.Sheets.Slicers.SlicerStyle} If no value is set, returns the style of the timeline period label 2; otherwise, returns the slicer style. * @example * ```javascript * var spread = new GC.Spread.Sheets.Workbook(document.getElementById("ss"), { sheetCount: 2 }); * var activeSheet = spread.getActiveSheet(); * var datas = [ * ["1", "NewYork", new Date("1968/6/8"), "80", "180"], * ["4", "NewYork", new Date("1972/7/3"), "72", "168"], * ["4", "NewYork", new Date("1964/3/2"), "71", "179"], * ["5", "Washington", new Date("1972/8/8"),"80", "171"], * ["6", "Washington", new Date("1986/2/2"), "89", "161"], * ["7", "Washington", new Date("2012/2/15"), "71", "240"]]; * var table = activeSheet.tables.addFromDataSource("table1", 2, 2, datas); * var dataColumns = ["Name", "City", "Birthday", "Weight", "Height"]; * table.setColumnName(0, dataColumns[0]); * table.setColumnName(1, dataColumns[1]); * table.setColumnName(2, dataColumns[2]); * table.setColumnName(3, dataColumns[3]); * table.setColumnName(4, dataColumns[4]); * * var pivotTable = sheet.pivotTables.add('pivotTable1', table.name(), 11, 1); * var timeline = sheet.slicers.add('timeline1', 'pivotTable1', 'Birthday', GC.Spread.Sheets.Slicers.TimelineStyles.dark1(), GC.Spread.Sheets.Slicers.SlicerType.pivotTimeline); * * var style = new GC.Spread.Sheets.Slicers.TimelineStyle() * style.periodLabel2Style(new GC.Spread.Sheets.Slicers.SlicerStyleInfo('red', 'blue', '12pt Calibri')); * * timeline.style(style); * ``` */ periodLabel2Style(value?: GC.Spread.Sheets.Slicers.SlicerStyleInfo): any; /** * Gets or sets the style of the timeline selected time block space. * @param {GC.Spread.Sheets.Slicers.SlicerStyleInfo} [value] The style of the timeline selected time block space. * @returns {GC.Spread.Sheets.Slicers.SlicerStyleInfo | GC.Spread.Sheets.Slicers.SlicerStyle} If no value is set, returns the style of the timeline selected time block space; otherwise, returns the slicer style. * @example * ```javascript * var spread = new GC.Spread.Sheets.Workbook(document.getElementById("ss"), { sheetCount: 2 }); * var activeSheet = spread.getActiveSheet(); * var datas = [ * ["1", "NewYork", new Date("1968/6/8"), "80", "180"], * ["4", "NewYork", new Date("1972/7/3"), "72", "168"], * ["4", "NewYork", new Date("1964/3/2"), "71", "179"], * ["5", "Washington", new Date("1972/8/8"),"80", "171"], * ["6", "Washington", new Date("1986/2/2"), "89", "161"], * ["7", "Washington", new Date("2012/2/15"), "71", "240"]]; * var table = activeSheet.tables.addFromDataSource("table1", 2, 2, datas); * var dataColumns = ["Name", "City", "Birthday", "Weight", "Height"]; * table.setColumnName(0, dataColumns[0]); * table.setColumnName(1, dataColumns[1]); * table.setColumnName(2, dataColumns[2]); * table.setColumnName(3, dataColumns[3]); * table.setColumnName(4, dataColumns[4]); * * var pivotTable = sheet.pivotTables.add('pivotTable1', table.name(), 11, 1); * var timeline = sheet.slicers.add('timeline1', 'pivotTable1', 'Birthday', GC.Spread.Sheets.Slicers.TimelineStyles.dark1(), GC.Spread.Sheets.Slicers.SlicerType.pivotTimeline); * * var style = new GC.Spread.Sheets.Slicers.TimelineStyle() * style.selectedTimeBlockSpaceStyle(new GC.Spread.Sheets.Slicers.SlicerStyleInfo('red', 'blue', '12pt Calibri')); * * timeline.style(style); * ``` */ selectedTimeBlockSpaceStyle(value?: GC.Spread.Sheets.Slicers.SlicerStyleInfo): any; /** * Gets or sets the style of the selected time block. * @param {GC.Spread.Sheets.Slicers.SlicerStyleInfo} [value] The style of the selected time block. * @returns {GC.Spread.Sheets.Slicers.SlicerStyleInfo | GC.Spread.Sheets.Slicers.SlicerStyle} If no value is set, returns the style of the selected time block; otherwise, returns the slicer style. * @example * ```javascript * var spread = new GC.Spread.Sheets.Workbook(document.getElementById("ss"), { sheetCount: 2 }); * var activeSheet = spread.getActiveSheet(); * var datas = [ * ["1", "NewYork", new Date("1968/6/8"), "80", "180"], * ["4", "NewYork", new Date("1972/7/3"), "72", "168"], * ["4", "NewYork", new Date("1964/3/2"), "71", "179"], * ["5", "Washington", new Date("1972/8/8"),"80", "171"], * ["6", "Washington", new Date("1986/2/2"), "89", "161"], * ["7", "Washington", new Date("2012/2/15"), "71", "240"]]; * var table = activeSheet.tables.addFromDataSource("table1", 2, 2, datas); * var dataColumns = ["Name", "City", "Birthday", "Weight", "Height"]; * table.setColumnName(0, dataColumns[0]); * table.setColumnName(1, dataColumns[1]); * table.setColumnName(2, dataColumns[2]); * table.setColumnName(3, dataColumns[3]); * table.setColumnName(4, dataColumns[4]); * * var pivotTable = sheet.pivotTables.add('pivotTable1', table.name(), 11, 1); * var timeline = sheet.slicers.add('timeline1', 'pivotTable1', 'Birthday', GC.Spread.Sheets.Slicers.TimelineStyles.dark1(), GC.Spread.Sheets.Slicers.SlicerType.pivotTimeline); * * var style = new GC.Spread.Sheets.Slicers.TimelineStyle() * style.periodLabel2Style(new GC.Spread.Sheets.Slicers.SlicerStyleInfo('red', 'blue', '12pt Calibri')); * * timeline.style(style); * ``` */ selectedTimeBlockStyle(value?: GC.Spread.Sheets.Slicers.SlicerStyleInfo): any; /** * Gets or sets the style of the timeline selection label. * @param {GC.Spread.Sheets.Slicers.SlicerStyleInfo} [value] The style of the timeline selection label. * @returns {GC.Spread.Sheets.Slicers.SlicerStyleInfo | GC.Spread.Sheets.Slicers.SlicerStyle} If no value is set, returns the style of the timeline selection label; otherwise, returns the slicer style. * @example * ```javascript * var spread = new GC.Spread.Sheets.Workbook(document.getElementById("ss"), { sheetCount: 2 }); * var activeSheet = spread.getActiveSheet(); * var datas = [ * ["1", "NewYork", new Date("1968/6/8"), "80", "180"], * ["4", "NewYork", new Date("1972/7/3"), "72", "168"], * ["4", "NewYork", new Date("1964/3/2"), "71", "179"], * ["5", "Washington", new Date("1972/8/8"),"80", "171"], * ["6", "Washington", new Date("1986/2/2"), "89", "161"], * ["7", "Washington", new Date("2012/2/15"), "71", "240"]]; * var table = activeSheet.tables.addFromDataSource("table1", 2, 2, datas); * var dataColumns = ["Name", "City", "Birthday", "Weight", "Height"]; * table.setColumnName(0, dataColumns[0]); * table.setColumnName(1, dataColumns[1]); * table.setColumnName(2, dataColumns[2]); * table.setColumnName(3, dataColumns[3]); * table.setColumnName(4, dataColumns[4]); * * var pivotTable = sheet.pivotTables.add('pivotTable1', table.name(), 11, 1); * var timeline = sheet.slicers.add('timeline1', 'pivotTable1', 'Birthday', GC.Spread.Sheets.Slicers.TimelineStyles.dark1(), GC.Spread.Sheets.Slicers.SlicerType.pivotTimeline); * * var style = new GC.Spread.Sheets.Slicers.TimelineStyle() * style.selectionLabelStyle(new GC.Spread.Sheets.Slicers.SlicerStyleInfo('red', 'blue', '12pt Calibri')); * * timeline.style(style); * ``` */ selectionLabelStyle(value?: GC.Spread.Sheets.Slicers.SlicerStyleInfo): any; /** * Gets or sets the style of the timeline time level. * @param {GC.Spread.Sheets.Slicers.SlicerStyleInfo} [value] The style of the timeline time level. * @returns {GC.Spread.Sheets.Slicers.SlicerStyleInfo | GC.Spread.Sheets.Slicers.SlicerStyle} If no value is set, returns the style of the timeline time level; otherwise, returns the slicer style. * @example * ```javascript * var spread = new GC.Spread.Sheets.Workbook(document.getElementById("ss"), { sheetCount: 2 }); * var activeSheet = spread.getActiveSheet(); * var datas = [ * ["1", "NewYork", new Date("1968/6/8"), "80", "180"], * ["4", "NewYork", new Date("1972/7/3"), "72", "168"], * ["4", "NewYork", new Date("1964/3/2"), "71", "179"], * ["5", "Washington", new Date("1972/8/8"),"80", "171"], * ["6", "Washington", new Date("1986/2/2"), "89", "161"], * ["7", "Washington", new Date("2012/2/15"), "71", "240"]]; * var table = activeSheet.tables.addFromDataSource("table1", 2, 2, datas); * var dataColumns = ["Name", "City", "Birthday", "Weight", "Height"]; * table.setColumnName(0, dataColumns[0]); * table.setColumnName(1, dataColumns[1]); * table.setColumnName(2, dataColumns[2]); * table.setColumnName(3, dataColumns[3]); * table.setColumnName(4, dataColumns[4]); * * var pivotTable = sheet.pivotTables.add('pivotTable1', table.name(), 11, 1); * var timeline = sheet.slicers.add('timeline1', 'pivotTable1', 'Birthday', GC.Spread.Sheets.Slicers.TimelineStyles.dark1(), GC.Spread.Sheets.Slicers.SlicerType.pivotTimeline); * * var style = new GC.Spread.Sheets.Slicers.TimelineStyle() * style.timeLevelStyle(new GC.Spread.Sheets.Slicers.SlicerStyleInfo('red', 'blue', '12pt Calibri')); * * timeline.style(style); * ``` */ timeLevelStyle(value?: GC.Spread.Sheets.Slicers.SlicerStyleInfo): any; /** * Saves the object state to a JSON string. * @returns {Object} The timeline slicer theme data. * @example * ```javascript * //This example uses the toJSON method. * const light1 = GC.Spread.Sheets.Slicers.TimelineStyles.light1(); * //export * const jsonStr = JSON.stringify(light1.toJSON()); * //import * const newTheme = new GC.Spread.Sheets.Slicers.TimelineStyle(); * newTheme.fromJSON(JSON.parse(jsonStr)); * newTheme.name('custom1'); * alert(jsonStr); * ``` */ toJSON(): Object; /** * Gets or sets the style of the unselected time block. * @param {GC.Spread.Sheets.Slicers.SlicerStyleInfo} [value] The style of the unselected time block. * @returns {GC.Spread.Sheets.Slicers.SlicerStyleInfo | GC.Spread.Sheets.Slicers.SlicerStyle} If no value is set, returns the style of the unselected time block; otherwise, returns the slicer style. * @example * ```javascript * var spread = new GC.Spread.Sheets.Workbook(document.getElementById("ss"), { sheetCount: 2 }); * var activeSheet = spread.getActiveSheet(); * var datas = [ * ["1", "NewYork", new Date("1968/6/8"), "80", "180"], * ["4", "NewYork", new Date("1972/7/3"), "72", "168"], * ["4", "NewYork", new Date("1964/3/2"), "71", "179"], * ["5", "Washington", new Date("1972/8/8"),"80", "171"], * ["6", "Washington", new Date("1986/2/2"), "89", "161"], * ["7", "Washington", new Date("2012/2/15"), "71", "240"]]; * var table = activeSheet.tables.addFromDataSource("table1", 2, 2, datas); * var dataColumns = ["Name", "City", "Birthday", "Weight", "Height"]; * table.setColumnName(0, dataColumns[0]); * table.setColumnName(1, dataColumns[1]); * table.setColumnName(2, dataColumns[2]); * table.setColumnName(3, dataColumns[3]); * table.setColumnName(4, dataColumns[4]); * * var pivotTable = sheet.pivotTables.add('pivotTable1', table.name(), 11, 1); * var timeline = sheet.slicers.add('timeline1', 'pivotTable1', 'Birthday', GC.Spread.Sheets.Slicers.TimelineStyles.dark1(), GC.Spread.Sheets.Slicers.SlicerType.pivotTimeline); * * var style = new GC.Spread.Sheets.Slicers.TimelineStyle() * style.unselectedTimeBlockStyle(new GC.Spread.Sheets.Slicers.SlicerStyleInfo('red', 'blue', '12pt Calibri')); * * timeline.style(style); * ``` */ unselectedTimeBlockStyle(value?: GC.Spread.Sheets.Slicers.SlicerStyleInfo): any; /** * Gets or sets the style of the whole slicer. * @param {GC.Spread.Sheets.Slicers.SlicerStyleInfo} [value] The style of the whole slicer. * @returns {GC.Spread.Sheets.Slicers.SlicerStyleInfo | GC.Spread.Sheets.Slicers.TimelineStyle} If no value is set, returns the style of the whole slicer; otherwise, returns the slicer style. * @example * ```javascript * var spread = new GC.Spread.Sheets.Workbook(document.getElementById("ss"), { sheetCount: 2 }); * var activeSheet = spread.getActiveSheet(); * var datas = [ * ["1", "NewYork", new Date("1968/6/8"), "80", "180"], * ["4", "NewYork", new Date("1972/7/3"), "72", "168"], * ["4", "NewYork", new Date("1964/3/2"), "71", "179"], * ["5", "Washington", new Date("1972/8/8"),"80", "171"], * ["6", "Washington", new Date("1986/2/2"), "89", "161"], * ["7", "Washington", new Date("2012/2/15"), "71", "240"]]; * var table = activeSheet.tables.addFromDataSource("table1", 2, 2, datas); * var dataColumns = ["Name", "City", "Birthday", "Weight", "Height"]; * table.setColumnName(0, dataColumns[0]); * table.setColumnName(1, dataColumns[1]); * table.setColumnName(2, dataColumns[2]); * table.setColumnName(3, dataColumns[3]); * table.setColumnName(4, dataColumns[4]); * * var pivotTable = sheet.pivotTables.add('pivotTable1', table.name(), 11, 1); * var timeline = sheet.slicers.add('timeline1', 'pivotTable1', 'Birthday', GC.Spread.Sheets.Slicers.TimelineStyles.dark1(), GC.Spread.Sheets.Slicers.SlicerType.pivotTimeline); * * var style = new GC.Spread.Sheets.Slicers.TimelineStyle() * style.wholeSlicerStyle(new GC.Spread.Sheets.Slicers.SlicerStyleInfo('red', 'blue', '12pt Calibri')); * style.headerStyle(new GC.Spread.Sheets.Slicers.SlicerStyleInfo(undefined, 'green', '14pt Calibri')); * style.timeLevelStyle(new GC.Spread.Sheets.Slicers.SlicerStyleInfo('yellow')); * * timeline.style(style); * ``` */ wholeSlicerStyle(value?: GC.Spread.Sheets.Slicers.SlicerStyleInfo): any; } export class TimelineStyles{ /** * Represents a built-in timeline style collection. * @class */ constructor(); /** * Gets the dark1 style. * @returns {GC.Spread.Sheets.Slicers.TimelineStyle} * @example * ```javascript * var spread = new GC.Spread.Sheets.Workbook(document.getElementById("ss"), { sheetCount: 2 }); * var activeSheet = spread.getActiveSheet(); * var datas = [ * ["1", "NewYork", new Date("1968/6/8"), "80", "180"], * ["4", "NewYork", new Date("1972/7/3"), "72", "168"], * ["4", "NewYork", new Date("1964/3/2"), "71", "179"], * ["5", "Washington", new Date("1972/8/8"),"80", "171"], * ["6", "Washington", new Date("1986/2/2"), "89", "161"], * ["7", "Washington", new Date("2012/2/15"), "71", "240"]]; * var table = activeSheet.tables.addFromDataSource("table1", 2, 2, datas); * var dataColumns = ["Name", "City", "Birthday", "Weight", "Height"]; * table.setColumnName(0, dataColumns[0]); * table.setColumnName(1, dataColumns[1]); * table.setColumnName(2, dataColumns[2]); * table.setColumnName(3, dataColumns[3]); * table.setColumnName(4, dataColumns[4]); * * var pivotTable = sheet.pivotTables.add('pivotTable1', table.name(), 11, 1); * var timeline = sheet.slicers.add('timeline1', 'pivotTable1', 'Birthday', GC.Spread.Sheets.Slicers.TimelineStyles.light1(), GC.Spread.Sheets.Slicers.SlicerType.pivotTimeline); * var style = new GC.Spread.Sheets.Slicers.SlicerStyles.dark1(); * timeline.style(style); * ``` */ static dark1(): GC.Spread.Sheets.Slicers.TimelineStyle; /** * Gets the dark2 style. * @returns {GC.Spread.Sheets.Slicers.TimelineStyle} * @example * ```javascript * var spread = new GC.Spread.Sheets.Workbook(document.getElementById("ss"), { sheetCount: 2 }); * var activeSheet = spread.getActiveSheet(); * var datas = [ * ["1", "NewYork", new Date("1968/6/8"), "80", "180"], * ["4", "NewYork", new Date("1972/7/3"), "72", "168"], * ["4", "NewYork", new Date("1964/3/2"), "71", "179"], * ["5", "Washington", new Date("1972/8/8"),"80", "171"], * ["6", "Washington", new Date("1986/2/2"), "89", "161"], * ["7", "Washington", new Date("2012/2/15"), "71", "240"]]; * var table = activeSheet.tables.addFromDataSource("table1", 2, 2, datas); * var dataColumns = ["Name", "City", "Birthday", "Weight", "Height"]; * table.setColumnName(0, dataColumns[0]); * table.setColumnName(1, dataColumns[1]); * table.setColumnName(2, dataColumns[2]); * table.setColumnName(3, dataColumns[3]); * table.setColumnName(4, dataColumns[4]); * * var pivotTable = sheet.pivotTables.add('pivotTable1', table.name(), 11, 1); * var timeline = sheet.slicers.add('timeline1', 'pivotTable1', 'Birthday', GC.Spread.Sheets.Slicers.TimelineStyles.light1(), GC.Spread.Sheets.Slicers.SlicerType.pivotTimeline); * var style = new GC.Spread.Sheets.Slicers.SlicerStyles.dark2(); * timeline.style(style); * ``` */ static dark2(): GC.Spread.Sheets.Slicers.TimelineStyle; /** * Gets the dark3 style. * @returns {GC.Spread.Sheets.Slicers.TimelineStyle} * @example * ```javascript * var spread = new GC.Spread.Sheets.Workbook(document.getElementById("ss"), { sheetCount: 2 }); * var activeSheet = spread.getActiveSheet(); * var datas = [ * ["1", "NewYork", new Date("1968/6/8"), "80", "180"], * ["4", "NewYork", new Date("1972/7/3"), "72", "168"], * ["4", "NewYork", new Date("1964/3/2"), "71", "179"], * ["5", "Washington", new Date("1972/8/8"),"80", "171"], * ["6", "Washington", new Date("1986/2/2"), "89", "161"], * ["7", "Washington", new Date("2012/2/15"), "71", "240"]]; * var table = activeSheet.tables.addFromDataSource("table1", 2, 2, datas); * var dataColumns = ["Name", "City", "Birthday", "Weight", "Height"]; * table.setColumnName(0, dataColumns[0]); * table.setColumnName(1, dataColumns[1]); * table.setColumnName(2, dataColumns[2]); * table.setColumnName(3, dataColumns[3]); * table.setColumnName(4, dataColumns[4]); * * var pivotTable = sheet.pivotTables.add('pivotTable1', table.name(), 11, 1); * var timeline = sheet.slicers.add('timeline1', 'pivotTable1', 'Birthday', GC.Spread.Sheets.Slicers.TimelineStyles.light1(), GC.Spread.Sheets.Slicers.SlicerType.pivotTimeline); * var style = new GC.Spread.Sheets.Slicers.SlicerStyles.dark3(); * timeline.style(style); * ``` */ static dark3(): GC.Spread.Sheets.Slicers.TimelineStyle; /** * Gets the dark4 style. * @returns {GC.Spread.Sheets.Slicers.TimelineStyle} * @example * ```javascript * var spread = new GC.Spread.Sheets.Workbook(document.getElementById("ss"), { sheetCount: 2 }); * var activeSheet = spread.getActiveSheet(); * var datas = [ * ["1", "NewYork", new Date("1968/6/8"), "80", "180"], * ["4", "NewYork", new Date("1972/7/3"), "72", "168"], * ["4", "NewYork", new Date("1964/3/2"), "71", "179"], * ["5", "Washington", new Date("1972/8/8"),"80", "171"], * ["6", "Washington", new Date("1986/2/2"), "89", "161"], * ["7", "Washington", new Date("2012/2/15"), "71", "240"]]; * var table = activeSheet.tables.addFromDataSource("table1", 2, 2, datas); * var dataColumns = ["Name", "City", "Birthday", "Weight", "Height"]; * table.setColumnName(0, dataColumns[0]); * table.setColumnName(1, dataColumns[1]); * table.setColumnName(2, dataColumns[2]); * table.setColumnName(3, dataColumns[3]); * table.setColumnName(4, dataColumns[4]); * * var pivotTable = sheet.pivotTables.add('pivotTable1', table.name(), 11, 1); * var timeline = sheet.slicers.add('timeline1', 'pivotTable1', 'Birthday', GC.Spread.Sheets.Slicers.TimelineStyles.light1(), GC.Spread.Sheets.Slicers.SlicerType.pivotTimeline); * var style = new GC.Spread.Sheets.Slicers.SlicerStyles.dark4(); * timeline.style(style); * ``` */ static dark4(): GC.Spread.Sheets.Slicers.TimelineStyle; /** * Gets the dark5 style. * @returns {GC.Spread.Sheets.Slicers.TimelineStyle} * @example * ```javascript * var spread = new GC.Spread.Sheets.Workbook(document.getElementById("ss"), { sheetCount: 2 }); * var activeSheet = spread.getActiveSheet(); * var datas = [ * ["1", "NewYork", new Date("1968/6/8"), "80", "180"], * ["4", "NewYork", new Date("1972/7/3"), "72", "168"], * ["4", "NewYork", new Date("1964/3/2"), "71", "179"], * ["5", "Washington", new Date("1972/8/8"),"80", "171"], * ["6", "Washington", new Date("1986/2/2"), "89", "161"], * ["7", "Washington", new Date("2012/2/15"), "71", "240"]]; * var table = activeSheet.tables.addFromDataSource("table1", 2, 2, datas); * var dataColumns = ["Name", "City", "Birthday", "Weight", "Height"]; * table.setColumnName(0, dataColumns[0]); * table.setColumnName(1, dataColumns[1]); * table.setColumnName(2, dataColumns[2]); * table.setColumnName(3, dataColumns[3]); * table.setColumnName(4, dataColumns[4]); * * var pivotTable = sheet.pivotTables.add('pivotTable1', table.name(), 11, 1); * var timeline = sheet.slicers.add('timeline1', 'pivotTable1', 'Birthday', GC.Spread.Sheets.Slicers.TimelineStyles.light1(), GC.Spread.Sheets.Slicers.SlicerType.pivotTimeline); * var style = new GC.Spread.Sheets.Slicers.SlicerStyles.dark5(); * timeline.style(style); * ``` */ static dark5(): GC.Spread.Sheets.Slicers.TimelineStyle; /** * Gets the dark6 style. * @returns {GC.Spread.Sheets.Slicers.TimelineStyle} * @example * ```javascript * var spread = new GC.Spread.Sheets.Workbook(document.getElementById("ss"), { sheetCount: 2 }); * var activeSheet = spread.getActiveSheet(); * var datas = [ * ["1", "NewYork", new Date("1968/6/8"), "80", "180"], * ["4", "NewYork", new Date("1972/7/3"), "72", "168"], * ["4", "NewYork", new Date("1964/3/2"), "71", "179"], * ["5", "Washington", new Date("1972/8/8"),"80", "171"], * ["6", "Washington", new Date("1986/2/2"), "89", "161"], * ["7", "Washington", new Date("2012/2/15"), "71", "240"]]; * var table = activeSheet.tables.addFromDataSource("table1", 2, 2, datas); * var dataColumns = ["Name", "City", "Birthday", "Weight", "Height"]; * table.setColumnName(0, dataColumns[0]); * table.setColumnName(1, dataColumns[1]); * table.setColumnName(2, dataColumns[2]); * table.setColumnName(3, dataColumns[3]); * table.setColumnName(4, dataColumns[4]); * * var pivotTable = sheet.pivotTables.add('pivotTable1', table.name(), 11, 1); * var timeline = sheet.slicers.add('timeline1', 'pivotTable1', 'Birthday', GC.Spread.Sheets.Slicers.TimelineStyles.light1(), GC.Spread.Sheets.Slicers.SlicerType.pivotTimeline); * var style = new GC.Spread.Sheets.Slicers.SlicerStyles.dark6(); * timeline.style(style); * ``` */ static dark6(): GC.Spread.Sheets.Slicers.TimelineStyle; /** * Gets the light1 style. * @returns {GC.Spread.Sheets.Slicers.TimelineStyle} * @example * ```javascript * var spread = new GC.Spread.Sheets.Workbook(document.getElementById("ss"), { sheetCount: 2 }); * var activeSheet = spread.getActiveSheet(); * var datas = [ * ["1", "NewYork", new Date("1968/6/8"), "80", "180"], * ["4", "NewYork", new Date("1972/7/3"), "72", "168"], * ["4", "NewYork", new Date("1964/3/2"), "71", "179"], * ["5", "Washington", new Date("1972/8/8"),"80", "171"], * ["6", "Washington", new Date("1986/2/2"), "89", "161"], * ["7", "Washington", new Date("2012/2/15"), "71", "240"]]; * var table = activeSheet.tables.addFromDataSource("table1", 2, 2, datas); * var dataColumns = ["Name", "City", "Birthday", "Weight", "Height"]; * table.setColumnName(0, dataColumns[0]); * table.setColumnName(1, dataColumns[1]); * table.setColumnName(2, dataColumns[2]); * table.setColumnName(3, dataColumns[3]); * table.setColumnName(4, dataColumns[4]); * * var pivotTable = sheet.pivotTables.add('pivotTable1', table.name(), 11, 1); * var timeline = sheet.slicers.add('timeline1', 'pivotTable1', 'Birthday', GC.Spread.Sheets.Slicers.TimelineStyles.dark1(), GC.Spread.Sheets.Slicers.SlicerType.pivotTimeline); * var style = new GC.Spread.Sheets.Slicers.SlicerStyles.light1(); * timeline.style(style); * ``` */ static light1(): GC.Spread.Sheets.Slicers.TimelineStyle; /** * Gets the light2 style. * @returns {GC.Spread.Sheets.Slicers.TimelineStyle} * @example * ```javascript * var spread = new GC.Spread.Sheets.Workbook(document.getElementById("ss"), { sheetCount: 2 }); * var activeSheet = spread.getActiveSheet(); * var datas = [ * ["1", "NewYork", new Date("1968/6/8"), "80", "180"], * ["4", "NewYork", new Date("1972/7/3"), "72", "168"], * ["4", "NewYork", new Date("1964/3/2"), "71", "179"], * ["5", "Washington", new Date("1972/8/8"),"80", "171"], * ["6", "Washington", new Date("1986/2/2"), "89", "161"], * ["7", "Washington", new Date("2012/2/15"), "71", "240"]]; * var table = activeSheet.tables.addFromDataSource("table1", 2, 2, datas); * var dataColumns = ["Name", "City", "Birthday", "Weight", "Height"]; * table.setColumnName(0, dataColumns[0]); * table.setColumnName(1, dataColumns[1]); * table.setColumnName(2, dataColumns[2]); * table.setColumnName(3, dataColumns[3]); * table.setColumnName(4, dataColumns[4]); * * var pivotTable = sheet.pivotTables.add('pivotTable1', table.name(), 11, 1); * var timeline = sheet.slicers.add('timeline1', 'pivotTable1', 'Birthday', GC.Spread.Sheets.Slicers.TimelineStyles.dark1(), GC.Spread.Sheets.Slicers.SlicerType.pivotTimeline); * var style = new GC.Spread.Sheets.Slicers.SlicerStyles.light2(); * timeline.style(style); * ``` */ static light2(): GC.Spread.Sheets.Slicers.TimelineStyle; /** * Gets the light3 style. * @returns {GC.Spread.Sheets.Slicers.TimelineStyle} * @example * ```javascript * var spread = new GC.Spread.Sheets.Workbook(document.getElementById("ss"), { sheetCount: 2 }); * var activeSheet = spread.getActiveSheet(); * var datas = [ * ["1", "NewYork", new Date("1968/6/8"), "80", "180"], * ["4", "NewYork", new Date("1972/7/3"), "72", "168"], * ["4", "NewYork", new Date("1964/3/2"), "71", "179"], * ["5", "Washington", new Date("1972/8/8"),"80", "171"], * ["6", "Washington", new Date("1986/2/2"), "89", "161"], * ["7", "Washington", new Date("2012/2/15"), "71", "240"]]; * var table = activeSheet.tables.addFromDataSource("table1", 2, 2, datas); * var dataColumns = ["Name", "City", "Birthday", "Weight", "Height"]; * table.setColumnName(0, dataColumns[0]); * table.setColumnName(1, dataColumns[1]); * table.setColumnName(2, dataColumns[2]); * table.setColumnName(3, dataColumns[3]); * table.setColumnName(4, dataColumns[4]); * * var pivotTable = sheet.pivotTables.add('pivotTable1', table.name(), 11, 1); * var timeline = sheet.slicers.add('timeline1', 'pivotTable1', 'Birthday', GC.Spread.Sheets.Slicers.TimelineStyles.dark1(), GC.Spread.Sheets.Slicers.SlicerType.pivotTimeline); * var style = new GC.Spread.Sheets.Slicers.SlicerStyles.light3(); * timeline.style(style); * ``` */ static light3(): GC.Spread.Sheets.Slicers.TimelineStyle; /** * Gets the light4 style. * @returns {GC.Spread.Sheets.Slicers.TimelineStyle} * @example * ```javascript * var spread = new GC.Spread.Sheets.Workbook(document.getElementById("ss"), { sheetCount: 2 }); * var activeSheet = spread.getActiveSheet(); * var datas = [ * ["1", "NewYork", new Date("1968/6/8"), "80", "180"], * ["4", "NewYork", new Date("1972/7/3"), "72", "168"], * ["4", "NewYork", new Date("1964/3/2"), "71", "179"], * ["5", "Washington", new Date("1972/8/8"),"80", "171"], * ["6", "Washington", new Date("1986/2/2"), "89", "161"], * ["7", "Washington", new Date("2012/2/15"), "71", "240"]]; * var table = activeSheet.tables.addFromDataSource("table1", 2, 2, datas); * var dataColumns = ["Name", "City", "Birthday", "Weight", "Height"]; * table.setColumnName(0, dataColumns[0]); * table.setColumnName(1, dataColumns[1]); * table.setColumnName(2, dataColumns[2]); * table.setColumnName(3, dataColumns[3]); * table.setColumnName(4, dataColumns[4]); * * var pivotTable = sheet.pivotTables.add('pivotTable1', table.name(), 11, 1); * var timeline = sheet.slicers.add('timeline1', 'pivotTable1', 'Birthday', GC.Spread.Sheets.Slicers.TimelineStyles.dark1(), GC.Spread.Sheets.Slicers.SlicerType.pivotTimeline); * var style = new GC.Spread.Sheets.Slicers.SlicerStyles.light4(); * timeline.style(style); * ``` */ static light4(): GC.Spread.Sheets.Slicers.TimelineStyle; /** * Gets the light5 style. * @returns {GC.Spread.Sheets.Slicers.TimelineStyle} * @example * ```javascript * var spread = new GC.Spread.Sheets.Workbook(document.getElementById("ss"), { sheetCount: 2 }); * var activeSheet = spread.getActiveSheet(); * var datas = [ * ["1", "NewYork", new Date("1968/6/8"), "80", "180"], * ["4", "NewYork", new Date("1972/7/3"), "72", "168"], * ["4", "NewYork", new Date("1964/3/2"), "71", "179"], * ["5", "Washington", new Date("1972/8/8"),"80", "171"], * ["6", "Washington", new Date("1986/2/2"), "89", "161"], * ["7", "Washington", new Date("2012/2/15"), "71", "240"]]; * var table = activeSheet.tables.addFromDataSource("table1", 2, 2, datas); * var dataColumns = ["Name", "City", "Birthday", "Weight", "Height"]; * table.setColumnName(0, dataColumns[0]); * table.setColumnName(1, dataColumns[1]); * table.setColumnName(2, dataColumns[2]); * table.setColumnName(3, dataColumns[3]); * table.setColumnName(4, dataColumns[4]); * * var pivotTable = sheet.pivotTables.add('pivotTable1', table.name(), 11, 1); * var timeline = sheet.slicers.add('timeline1', 'pivotTable1', 'Birthday', GC.Spread.Sheets.Slicers.TimelineStyles.dark1(), GC.Spread.Sheets.Slicers.SlicerType.pivotTimeline); * var style = new GC.Spread.Sheets.Slicers.SlicerStyles.light5(); * timeline.style(style); * ``` */ static light5(): GC.Spread.Sheets.Slicers.TimelineStyle; /** * Gets the light6 style. * @returns {GC.Spread.Sheets.Slicers.TimelineStyle} * @example * ```javascript * var spread = new GC.Spread.Sheets.Workbook(document.getElementById("ss"), { sheetCount: 2 }); * var activeSheet = spread.getActiveSheet(); * var datas = [ * ["1", "NewYork", new Date("1968/6/8"), "80", "180"], * ["4", "NewYork", new Date("1972/7/3"), "72", "168"], * ["4", "NewYork", new Date("1964/3/2"), "71", "179"], * ["5", "Washington", new Date("1972/8/8"),"80", "171"], * ["6", "Washington", new Date("1986/2/2"), "89", "161"], * ["7", "Washington", new Date("2012/2/15"), "71", "240"]]; * var table = activeSheet.tables.addFromDataSource("table1", 2, 2, datas); * var dataColumns = ["Name", "City", "Birthday", "Weight", "Height"]; * table.setColumnName(0, dataColumns[0]); * table.setColumnName(1, dataColumns[1]); * table.setColumnName(2, dataColumns[2]); * table.setColumnName(3, dataColumns[3]); * table.setColumnName(4, dataColumns[4]); * * var pivotTable = sheet.pivotTables.add('pivotTable1', table.name(), 11, 1); * var timeline = sheet.slicers.add('timeline1', 'pivotTable1', 'Birthday', GC.Spread.Sheets.Slicers.TimelineStyles.dark1(), GC.Spread.Sheets.Slicers.SlicerType.pivotTimeline); * var style = new GC.Spread.Sheets.Slicers.SlicerStyles.light6(); * timeline.style(style); * ``` */ static light6(): GC.Spread.Sheets.Slicers.TimelineStyle; } } module Sparklines{ export interface ISparklineSetting{ /** * the color of the axis */ axisColor?: string; /** * the color of the first data point for each sparkline in this sparkline group */ firstMarkerColor?: string; /** * the color of the highest data point for each sparkline in this sparkline group */ highMarkerColor?: string; /** * the color of the last data point for each sparkline in this sparkline group */ lastMarkerColor?: string; /** * the color of the lowest data point for each sparkline in this sparkline group */ lowMarkerColor?: string; /** * a value that specifies the color of the data markers for each sparkline in this sparkline group */ markersColor?: string; /** * a value that specifies the color of the negative data points for each sparkline in this sparkline group */ negativeColor?: string; /** * a value that specifies the color for each sparkline in this sparkline group */ seriesColor?: string; /** * Indicates how to display the empty cells */ displayEmptyCellsAs?: EmptyValueStyle; /** * Indicates whether each sparkline in the sparkline group is displayed in a right-to-left manner */ rightToLeft?: boolean; /** * Indicates whether data in hidden cells is plotted for the sparklines in this sparkline group */ displayHidden?: boolean; /** * Indicates whether the horizontal axis is displayed for each sparkline in this sparkline group */ displayXAxis?: boolean; /** * a value that indicates whether the first data point is formatted differently for each sparkline in this sparkline group */ showFirst?: boolean; /** * a value that specifies whether the data points with the highest value are formatted differently for each sparkline in this sparkline group */ showHigh?: boolean; /** * a value that indicates whether the last data point is formatted differently for each sparkline in this sparkline group */ showLast?: boolean; /** * a value that specifies whether the data points with the lowest value are formatted differently for each sparkline in this sparkline group */ showLow?: boolean; /** * a value that specifies whether the negative data points are formatted differently for each sparkline in this sparkline group */ showNegative?: boolean; /** * a value that specifies whether data markers are displayed for each sparkline in this sparkline group */ showMarkers?: boolean; /** * Indicates the maximum for the vertical axis that is shared across all sparklines in this sparkline group. The axis is zero if maxAxisType does not equal custom */ manualMax?: number; /** * Indicates the minimum for the vertical axis that is shared across all sparklines in this sparkline group. The axis is zero if minAxisType does not equal custom */ manualMin?: number; /** * Indicates how the vertical axis maximum is calculated for the sparklines in this sparkline group */ maxAxisType?: SparklineAxisMinMax; /** * Indicates how the vertical axis minimum is calculated for the sparklines in this sparkline group */ minAxisType?: SparklineAxisMinMax; /** * Gets the maximum value of the sparkline group */ groupMaxValue?: number; /** * Gets the minimum value of the sparkline group */ groupMinValue?: number; /** * Indicates the line weight for each sparkline in the sparkline group, where the line weight is measured in points. The weight must be greater than or equal to zero, and must be less than or equal to 3 (LineSeries only supports line weight values in the range of 0.0-3.0) */ lineWeight?: number; } /** * Represents the orientation of the range. * @enum {number} * @example * ```javascript * //This example uses the DataOrientation enumeration. * activeSheet.setValue(0, 0, "Data Range is A2-A9"); * activeSheet.setValue(1, 0, 1); * activeSheet.setValue(2, 0, -2); * activeSheet.setValue(3, 0, -1); * activeSheet.setValue(4, 0, 6); * activeSheet.setValue(5, 0, 4); * activeSheet.setValue(6, 0, -4); * activeSheet.setValue(7, 0, 3); * activeSheet.setValue(8, 0, 8); * var data = new GC.Spread.Sheets.Range(1, 0, 8, 1); * var setting = new GC.Spread.Sheets.Sparklines.SparklineSetting(); * var s1= activeSheet.setSparkline(11, 0, data, GC.Spread.Sheets.Sparklines.DataOrientation.Vertical, GC.Spread.Sheets.Sparklines.SparklineType.line, setting); * var s2 =activeSheet.setSparkline(11, 3, data, GC.Spread.Sheets.Sparklines.DataOrientation.Vertical, GC.Spread.Sheets.Sparklines.SparklineType.column, setting); * var s3= activeSheet.setSparkline(11, 6, data, GC.Spread.Sheets.Sparklines.DataOrientation.Vertical, GC.Spread.Sheets.Sparklines.SparklineType.winloss, setting); * var group = activeSheet.groupSparkline([s1,s2,s3]); * ``` */ export enum DataOrientation{ /** Specifies the vertical orientation. * @type {number} */ vertical= 0, /** Specifies the horizontal orientation. * @type {number} */ horizontal= 1 } /** * Specifies how to show an empty value from a data series in the chart. * @enum {number} * @example * ```javascript * //This example uses the EmptyValueStyle enumeration. * var data = new GC.Spread.Sheets.Range(1, 0, 8, 1); * var setting = new GC.Spread.Sheets.Sparklines.SparklineSetting * setting.options.showMarkers = true; * setting.options.lineWeight = 3; * setting.options.displayXAxis = true; * setting.options.showFirst = true; * setting.options.showLast = true; * setting.options.showLow = true; * setting.options.showHigh = true; * setting.options.showNegative = true; * setting.options.seriesColor = "Text 2 1"; * setting.options.firstMarkerColor = "Text 2 3"; * setting.options.negativeColor = "Accent 2 1"; * setting.options.markersColor = "Accent 3 1"; * setting.options.lowMarkerColor = "Accent 4 1"; * setting.options.highMarkerColor = "Accent 6 1"; * setting.options.lastMarkerColor = "Accent 6 6"; * setting.options.axisColor = "Text 1 1"; * setting.options.displayEmptyCellsAs = GC.Spread.Sheets.Sparklines.EmptyValueStyle.Zero; * activeSheet.addSpan(13, 0, 4, 3, null); * activeSheet.setSparkline(13, 0, data, GC.Spread.Sheets.Sparklines.DataOrientation.vertical, GC.Spread.Sheets.Sparklines.SparklineType.line, setting); * activeSheet.setValue(1, 0, 1); * activeSheet.setValue(2, 0, -2); * activeSheet.setValue(3, 0, -1); * activeSheet.setValue(4, 0, 6); * activeSheet.setValue(5, 0, 4); * activeSheet.setValue(6, 0, -4); * activeSheet.setValue(7, 0, 3); * activeSheet.setValue(8, 0, 8); * ``` */ export enum EmptyValueStyle{ /** Leaves gaps for empty values in a data series, which results in a segmented line. * @type {number} */ gaps= 0, /** Handles empty values in a data series as zero values, so that the line drops to zero for zero-value data points. * @type {number} */ zero= 1, /** Fills gaps with a connecting element instead of leaving gaps for empty values in a data series. * @type {number} */ connect= 2 } /** * An enumeration that specifies information about how the vertical axis minimum or maximum is computed for this sparkline group. * @enum {number} * @example * ```javascript * //This example uses the SparklineAxisMinMax enumeration. * activeSheet.setValue(0, 0, "Data Range is A2-A9"); * activeSheet.setValue(1, 0, 1); * activeSheet.setValue(2, 0, -2); * activeSheet.setValue(3, 0, -1); * activeSheet.setValue(4, 0, 6); * activeSheet.setValue(5, 0, 4); * activeSheet.setValue(6, 0, -4); * activeSheet.setValue(7, 0, 3); * activeSheet.setValue(8, 0, 8); * var data = new GC.Spread.Sheets.Range(1, 0, 8, 1); * var setting = new GC.Spread.Sheets.Sparklines.SparklineSetting(); * setting.options.minAxisType = GC.Spread.Sheets.Sparklines.SparklineAxisMinMax.custom; * setting.options.manualMin = -2; * setting.options.maxAxisType = GC.Spread.Sheets.Sparklines.SparklineAxisMinMax.custom; * setting.options.manualMax = 10; * var s1= activeSheet.setSparkline(11, 0, data, GC.Spread.Sheets.Sparklines.DataOrientation.Vertical, GC.Spread.Sheets.Sparklines.SparklineType.line, setting); * var s2 =activeSheet.setSparkline(11, 3, data, GC.Spread.Sheets.Sparklines.DataOrientation.Vertical, GC.Spread.Sheets.Sparklines.SparklineType.column, setting); * var s3= activeSheet.setSparkline(11, 6, data, GC.Spread.Sheets.Sparklines.DataOrientation.Vertical, GC.Spread.Sheets.Sparklines.SparklineType.winloss, setting); * var group = activeSheet.groupSparkline([s1,s2,s3]); * ``` */ export enum SparklineAxisMinMax{ /** Specifies that the vertical axis minimum or maximum for each sparkline in this sparkline group is calculated automatically such that the data point with the minimum or maximum value can be displayed in the plot area. * @type {number} */ individual= 0, /** Specifies that the vertical axis minimum or maximum is shared across all sparklines in this sparkline group and is calculated automatically such that the data point with the minimum or maximum value can be displayed in the plot area. * @type {number} */ group= 1, /** Specifies that the vertical axis minimum or maximum for each sparkline in this sparkline group is specified by the manualMin attribute or the manualMax attribute of the sparkline group. * @type {number} */ custom= 2 } /** * Represents the sparkline type. * @enum {number} * @example * ```javascript * //This example uses the SparklineType enumeration. * activeSheet.setValue(0, 0, "Data Range is A2-A9"); * activeSheet.setValue(1, 0, 1); * activeSheet.setValue(2, 0, -2); * activeSheet.setValue(3, 0, -1); * activeSheet.setValue(4, 0, 6); * activeSheet.setValue(5, 0, 4); * activeSheet.setValue(6, 0, -4); * activeSheet.setValue(7, 0, 3); * activeSheet.setValue(8, 0, 8); * var data = new GC.Spread.Sheets.Range(1, 0, 8, 1); * var setting = new GC.Spread.Sheets.Sparklines.SparklineSetting(); * var s1= activeSheet.setSparkline(11, 0, data, GC.Spread.Sheets.Sparklines.DataOrientation.Vertical, GC.Spread.Sheets.Sparklines.SparklineType.line, setting); * var s2 =activeSheet.setSparkline(11, 3, data, GC.Spread.Sheets.Sparklines.DataOrientation.Vertical, GC.Spread.Sheets.Sparklines.SparklineType.column, setting); * var s3= activeSheet.setSparkline(11, 6, data, GC.Spread.Sheets.Sparklines.DataOrientation.Vertical, GC.Spread.Sheets.Sparklines.SparklineType.winloss, setting); * var group = activeSheet.groupSparkline([s1,s2,s3]); * ``` */ export enum SparklineType{ /** Specifies the line sparkline. * @type {number} */ line= 0, /** Specifies the column sparkline. * @type {number} */ column= 1, /** Specifies the win-loss sparkline. * @type {number} */ winloss= 2 } export class AreaSparkline extends SparklineEx{ /** * Represents the class for the area sparkline. * @extends GC.Spread.Sheets.Sparklines.SparklineEx * @class */ constructor(); } export class BoxPlotSparkline extends SparklineEx{ /** * Represents the class for the box plot sparkline. * @extends GC.Spread.Sheets.Sparklines.SparklineEx * @class */ constructor(); } export class BulletSparkline extends SparklineEx{ /** * Represents the class for the bullet sparkline. * @extends GC.Spread.Sheets.Sparklines.SparklineEx * @class */ constructor(); } export class CascadeSparkline extends SparklineEx{ /** * Represents the class for the cascade sparkline. * @extends GC.Spread.Sheets.Sparklines.SparklineEx * @class */ constructor(); } export class ColumnSparkline extends SparklineEx{ /** * Represents the class for the column sparkline. * @extends GC.Spread.Sheets.Sparklines.SparklineEx * @class */ constructor(); } export class GaugeKPISparkline extends SparklineEx{ /** * Represents the class for the gauge KPI sparkline. * @extends GC.Spread.Sheets.Sparklines.SparklineEx * @class */ constructor(); } export class HBarSparkline extends SparklineEx{ /** * Represents the class for the HBar sparkline. * @extends GC.Spread.Sheets.Sparklines.SparklineEx * @class */ constructor(); } export class HistogramSparkline extends SparklineEx{ /** * Represents the class for the histogram sparkline. * @extends GC.Spread.Sheets.Sparklines.HistogramSparkline * @class */ constructor(); } export class ImageSparkline extends SparklineEx{ /** * Represents the class for the image sparkline. * @extends GC.Spread.Sheets.Sparklines.ImageSparkline * @class */ constructor(); } export class LineSparkline extends SparklineEx{ /** * Represents the class for the line sparkline. * @extends GC.Spread.Sheets.Sparklines.SparklineEx * @class */ constructor(); } export class LollipopVariSparkline extends SparklineEx{ /** * Represents the class for the Lollipop variance sparkline. * @extends GC.Spread.Sheets.Sparklines.SparklineEx * @class */ constructor(); } export class MonthSparkline extends SparklineEx{ /** * Represents the class for the month sparkline. * @extends GC.Spread.Sheets.Sparklines.SparklineEx * @class */ constructor(); } export class ParetoSparkline extends SparklineEx{ /** * Represents the class for the pareto sparkline. * @extends GC.Spread.Sheets.Sparklines.SparklineEx * @class */ constructor(); } export class PieSparkline extends SparklineEx{ /** * Represents the class for the pie sparkline. * @extends GC.Spread.Sheets.Sparklines.SparklineEx * @class */ constructor(); } export class RangeBlockSparkline extends SparklineEx{ /** * Represents the class for the range block sparkline. * @extends GC.Spread.Sheets.Sparklines.SparklineEx * @class */ constructor(); } export class ScatterSparkline extends SparklineEx{ /** * Represents the class for the scatter sparkline. * @extends GC.Spread.Sheets.Sparklines.SparklineEx * @class */ constructor(); } export class Sparkline{ /** * Represents a Sparkline class. * @param {number} row The row index. * @param {number} column The column index. * @param {GC.Spread.Sheets.Range} dataReference The data range to which the sparkline refers. * @param {GC.Spread.Sheets.Sparklines.DataOrientation} dataOrientation The orientation of the data range. * @param {GC.Spread.Sheets.Sparklines.SparklineType} type The type of sparkline. * @param {GC.Spread.Sheets.Sparklines.SparklineSetting} setting The setting of the sparkline. * @class */ constructor(row?: number, column?: number, dataReference?: GC.Spread.Sheets.Range, dataOrientation?: GC.Spread.Sheets.Sparklines.DataOrientation, type?: GC.Spread.Sheets.Sparklines.SparklineType, setting?: GC.Spread.Sheets.Sparklines.SparklineSetting); /** Gets the column index. * @type {number} */ column: number; /** Gets the row index. * @type {number} */ row: number; /** * Clones a sparkline. * @returns {GC.Spread.Sheets.Sparklines.Sparkline} The cloned sparkline. * @example * ```javascript * let sheet = spread.getActiveSheet(); * sheet.setArray(0, 0, [-1,2,3,4,3,2,3,5]); * let dataRange = new GC.Spread.Sheets.Range(0, 0, 8, 1); * let sparkline = sheet.setSparkline(11, 0, dataRange, GC.Spread.Sheets.Sparklines.DataOrientation.Vertical, GC.Spread.Sheets.Sparklines.SparklineType.line, new GC.Spread.Sheets.Sparklines.SparklineSetting()); * * let sparkline2 = sparkline.clone(); * ``` */ clone(): GC.Spread.Sheets.Sparklines.Sparkline; /** * Gets or sets the data object. * @param {GC.Spread.Sheets.Range} value The sparkline data. * @returns {GC.Spread.Sheets.Range | GC.Spread.Sheets.Sparklines.Sparkline} If no value is set, returns the data object; otherwise, returns the sparkline. * @example * ```javascript * //This example uses the data method. * activeSheet.suspendPaint(); * activeSheet.setValue(1, 0, 10); * activeSheet.setValue(2, 0, 0); * activeSheet.setValue(3, 0, -3); * activeSheet.setValue(4, 0, -5); * activeSheet.setValue(0, 0, 1); * activeSheet.setValue(0, 1, 2); * activeSheet.setValue(0, 2, 4); * activeSheet.setValue(0, 3, 8); * activeSheet.setValue(0, 4, 6); * activeSheet.setValue(0, 5, new Date(2014, 1, 1)); * activeSheet.setValue(1, 5, new Date(2014, 9, 1)); * activeSheet.setValue(2, 5, new Date(2014, 7, 1)); * activeSheet.setValue(3, 5, new Date(2014, 5, 1)); * activeSheet.setValue(4, 5, new Date(2014, 3, 1)); * var sparkline = activeSheet.setSparkline(5, 0, new GC.Spread.Sheets.Range(0, 0, 5, 5), GC.Spread.Sheets.Sparklines.DataOrientation.horizontal, GC.Spread.Sheets.Sparklines.SparklineType.line, new GC.Spread.Sheets.Sparklines.SparklineSetting(), new GC.Spread.Sheets.Range(0, 5, 5, 1), GC.Spread.Sheets.Sparklines.DataOrientation.vertical); * sparkline.data(new GC.Spread.Sheets.Range(0, 0, 5, 5)); * sparkline.sparklineType(GC.Spread.Sheets.Sparklines.SparklineType.line); * sparkline.setting(new GC.Spread.Sheets.Sparklines.SparklineSetting()); * sparkline.dateAxisData(new GC.Spread.Sheets.Range(0, 5, 5, 1)); * sparkline.dataOrientation(GC.Spread.Sheets.Sparklines.DataOrientation.vertical); * sparkline.dateAxisOrientation(GC.Spread.Sheets.Sparklines.DataOrientation.vertical); * sparkline.row = 5; * sparkline.column = 0; * sparkline.displayDateAxis(true); * activeSheet.resumePaint(); * ``` */ data(value?: GC.Spread.Sheets.Range): any; /** * Gets or sets the data orientation. * @param {GC.Spread.Sheets.Sparklines.DataOrientation} value The sparkline data orientation. * @returns {GC.Spread.Sheets.Sparklines.DataOrientation | GC.Spread.Sheets.Sparklines.Sparkline} If no value is set, returns the sparkline data orientation; otherwise, returns the sparkline. * @example * ```javascript * //This example uses the vertical data and the date range to create the sparkline. * var setting = new GC.Spread.Sheets.Sparklines.SparklineSetting(); * setting.options.showMarkers = true; * setting.options.displayXAxis = true; * activeSheet.suspendPaint(); * activeSheet.setValue(1, 0, 10); * activeSheet.setValue(2, 0, 0); * activeSheet.setValue(3, 0, -3); * activeSheet.setValue(4, 0, -5); * activeSheet.setValue(0, 0, 1); * activeSheet.setValue(0, 1, 2); * activeSheet.setValue(0, 2, 4); * activeSheet.setValue(0, 3, 8); * activeSheet.setValue(0, 4, 6); * activeSheet.setValue(0, 5, new Date(2014, 1, 1)); * activeSheet.setValue(1, 5, new Date(2014, 9, 1)); * activeSheet.setValue(2, 5, new Date(2014, 7, 1)); * activeSheet.setValue(3, 5, new Date(2014, 5, 1)); * activeSheet.setValue(4, 5, new Date(2014, 3, 1)); * var sparkline = activeSheet.setSparkline(5, 0, new GC.Spread.Sheets.Range(0, 0, 5, 5), GC.Spread.Sheets.Sparklines.DataOrientation.horizontal, GC.Spread.Sheets.Sparklines.SparklineType.line, setting, new GC.Spread.Sheets.Range(0, 5, 5, 1), GC.Spread.Sheets.Sparklines.DataOrientation.vertical); * sparkline.dataOrientation(GC.Spread.Sheets.Sparklines.DataOrientation.vertical); * sparkline.displayDateAxis(true); * activeSheet.resumePaint(); * activeSheet.addSpan(5, 0, 4, 3, null); * ``` */ dataOrientation(value?: GC.Spread.Sheets.Sparklines.DataOrientation): any; /** * Gets or sets the date axis data object. * @param {GC.Spread.Sheets.Range} value The sparkline date axis data. * @returns {GC.Spread.Sheets.Range | GC.Spread.Sheets.Sparklines.Sparkline} If no value is set, returns the sparkline date axis data; otherwise, returns the sparkline. * @example * ```javascript * //This example uses the dateAxisData method. * activeSheet.suspendPaint(); * activeSheet.setValue(1, 0, 10); * activeSheet.setValue(2, 0, 0); * activeSheet.setValue(3, 0, -3); * activeSheet.setValue(4, 0, -5); * activeSheet.setValue(0, 0, 1); * activeSheet.setValue(0, 1, 2); * activeSheet.setValue(0, 2, 4); * activeSheet.setValue(0, 3, 8); * activeSheet.setValue(0, 4, 6); * activeSheet.setValue(0, 5, new Date(2014, 1, 1)); * activeSheet.setValue(1, 5, new Date(2014, 9, 1)); * activeSheet.setValue(2, 5, new Date(2014, 7, 1)); * activeSheet.setValue(3, 5, new Date(2014, 5, 1)); * activeSheet.setValue(4, 5, new Date(2014, 3, 1)); * var sparkline = activeSheet.setSparkline(5, 0, new GC.Spread.Sheets.Range(0, 0, 5, 5), GC.Spread.Sheets.Sparklines.DataOrientation.horizontal, GC.Spread.Sheets.Sparklines.SparklineType.line, new GC.Spread.Sheets.Sparklines.SparklineSetting(), new GC.Spread.Sheets.Range(0, 5, 5, 1), GC.Spread.Sheets.Sparklines.DataOrientation.vertical); * sparkline.data(new GC.Spread.Sheets.Range(0, 0, 5, 5)); * sparkline.sparklineType(GC.Spread.Sheets.Sparklines.SparklineType.line); * sparkline.setting(new GC.Spread.Sheets.Sparklines.SparklineSetting()); * sparkline.dateAxisData(new GC.Spread.Sheets.Range(0, 5, 5, 1)); * sparkline.dataOrientation(GC.Spread.Sheets.Sparklines.DataOrientation.vertical); * sparkline.dateAxisOrientation(GC.Spread.Sheets.Sparklines.DataOrientation.vertical); * sparkline.row = 5; * sparkline.column = 0; * sparkline.displayDateAxis(true); * activeSheet.resumePaint(); * ``` */ dateAxisData(value?: GC.Spread.Sheets.Range): any; /** * Gets or sets the date axis orientation. * @param {GC.Spread.Sheets.Sparklines.DataOrientation} value The sparkline date axis orientation. * @returns {GC.Spread.Sheets.Sparklines.DataOrientation | GC.Spread.Sheets.Sparklines.Sparkline} If no value is set, returns the sparkline date axis orientation; otherwise, returns the sparkline. * @example * ```javascript * //This example uses vertical data with horizontal dates to create a sparkline. * var setting = new GC.Spread.Sheets.Sparklines.SparklineSetting(); * setting.options.showMarkers = true; * setting.options.displayXAxis = true; * activeSheet.suspendPaint(); * activeSheet.setValue(1, 0, 10); * activeSheet.setValue(2, 0, 0); * activeSheet.setValue(3, 0, -3); * activeSheet.setValue(4, 0, -5); * activeSheet.setValue(0, 0, 1); * activeSheet.setValue(0, 1, 2); * activeSheet.setValue(0, 2, 4); * activeSheet.setValue(0, 3, 8); * activeSheet.setValue(0, 4, 6); * activeSheet.setValue(0, 5, new Date(2014, 1, 1)); * activeSheet.setValue(1, 5, new Date(2014, 9, 1)); * activeSheet.setValue(2, 5, new Date(2014, 7, 1)); * activeSheet.setValue(3, 5, new Date(2014, 5, 1)); * activeSheet.setValue(4, 5, new Date(2014, 3, 1)); * activeSheet.setValue(11, 0, new Date(2014, 1, 1)); * activeSheet.setValue(11, 1, new Date(2014, 9, 1)); * activeSheet.setValue(11, 2, new Date(2014, 7, 1)); * activeSheet.setValue(11, 3, new Date(2014, 5, 1)); * activeSheet.setValue(11, 4, new Date(2014, 3, 1)); * var sparkline = activeSheet.setSparkline(5, 0, new GC.Spread.Sheets.Range(0, 0, 5, 5), GC.Spread.Sheets.Sparklines.DataOrientation.vertical, GC.Spread.Sheets.Sparklines.SparklineType.line, setting, new GC.Spread.Sheets.Range(11, 0, 1, 5), GC.Spread.Sheets.Sparklines.DataOrientation.horizontal); * sparkline.dataOrientation(GC.Spread.Sheets.Sparklines.DataOrientation.vertical); * sparkline.dateAxisOrientation(GC.Spread.Sheets.Sparklines.DataOrientation.horizontal); * sparkline.displayDateAxis(true); * activeSheet.resumePaint(); * activeSheet.addSpan(5, 0, 4, 3, null); * ``` */ dateAxisOrientation(value?: GC.Spread.Sheets.Sparklines.DataOrientation): any; /** * Gets or sets a value that indicates whether to display the date axis. * @param {boolean} value Whether to display the date axis. * @returns {boolean | GC.Spread.Sheets.Sparklines.Sparkline} If no value is set, returns whether to display the date axis; otherwise, returns the sparkline. * @example * ```javascript * //This example uses the vertical data and the date range to create the sparkline. * var setting = new GC.Spread.Sheets.Sparklines.SparklineSetting(); * setting.options.showMarkers = true; * setting.options.displayXAxis = true; * activeSheet.suspendPaint(); * activeSheet.setValue(1, 0, 10); * activeSheet.setValue(2, 0, 0); * activeSheet.setValue(3, 0, -3); * activeSheet.setValue(4, 0, -5); * activeSheet.setValue(0, 0, 1); * activeSheet.setValue(0, 1, 2); * activeSheet.setValue(0, 2, 4); * activeSheet.setValue(0, 3, 8); * activeSheet.setValue(0, 4, 6); * activeSheet.setValue(0, 5, new Date(2014, 1, 1)); * activeSheet.setValue(1, 5, new Date(2014, 9, 1)); * activeSheet.setValue(2, 5, new Date(2014, 7, 1)); * activeSheet.setValue(3, 5, new Date(2014, 5, 1)); * activeSheet.setValue(4, 5, new Date(2014, 3, 1)); * var sparkline = activeSheet.setSparkline(5, 0, new GC.Spread.Sheets.Range(0, 0, 5, 5), GC.Spread.Sheets.Sparklines.DataOrientation.horizontal, GC.Spread.Sheets.Sparklines.SparklineType.line, setting, new GC.Spread.Sheets.Range(0, 5, 5, 1), GC.Spread.Sheets.Sparklines.DataOrientation.vertical); * sparkline.dataOrientation(GC.Spread.Sheets.Sparklines.DataOrientation.vertical); * sparkline.displayDateAxis(true); * activeSheet.resumePaint(); * activeSheet.addSpan(5, 0, 4, 3, null); * ``` */ displayDateAxis(value?: boolean): any; /** * Gets or sets the sparkline group. * @param {GC.Spread.Sheets.Sparklines.SparklineGroup} [value] The sparkline group. * @returns {GC.Spread.Sheets.Sparklines.SparklineGroup | GC.Spread.Sheets.Sparklines.Sparkline} If no value is set, returns the sparkline group; otherwise, returns the sparkline. * @example * ```javascript * let sheet = spread.getActiveSheet(); * sheet.setArray(0, 0, [1,2,3,4,3,2,3,5]); * let dataRange = new GC.Spread.Sheets.Range(0, 0, 8, 1); * let setting = new GC.Spread.Sheets.Sparklines.SparklineSetting(); * let sparkline1 = sheet.setSparkline(11, 0, dataRange, GC.Spread.Sheets.Sparklines.DataOrientation.Vertical, GC.Spread.Sheets.Sparklines.SparklineType.line, setting); * let sparkline2 = sheet.setSparkline(11, 3, dataRange, GC.Spread.Sheets.Sparklines.DataOrientation.Vertical, GC.Spread.Sheets.Sparklines.SparklineType.line, setting); * sheet.groupSparkline([sparkline1,sparkline2]); * * let sparklineGroup = sparkline1.group(); * console.log(sparklineGroup.count()) // 2 * ``` */ group(value?: GC.Spread.Sheets.Sparklines.SparklineGroup): any; /** * Paints the sparkline in the specified area. * @param {CanvasRenderingContext2D} ctx The canvas's two-dimensional context. * @param {number} x x-coordinate relative to the canvas. * @param {number} y y-coordinate relative to the canvas. * @param {number} w The width of the cell that contains the sparkline. * @param {number} h The height of the cell that contains the sparkline. */ paintSparkline(ctx: CanvasRenderingContext2D, x: number, y: number, w: number, h: number): void; /** * Gets or sets the sparkline setting of the cell. * @param {GC.Spread.Sheets.Sparklines.SparklineSetting} [value] The sparkline setting. * @returns {GC.Spread.Sheets.Sparklines.SparklineSetting | GC.Spread.Sheets.Sparklines.Sparkline} If no value is set, returns the sparkline setting; otherwise, returns the sparkline. * @example * ```javascript * let sheet = spread.getActiveSheet(); * sheet.setArray(0, 0, [-1,2,3,4,3,2,3,5]); * let dataRange = new GC.Spread.Sheets.Range(0, 0, 8, 1); * let sparkline = sheet.setSparkline(11, 0, dataRange, GC.Spread.Sheets.Sparklines.DataOrientation.Vertical, GC.Spread.Sheets.Sparklines.SparklineType.line, new GC.Spread.Sheets.Sparklines.SparklineSetting()); * * let setting = new GC.Spread.Sheets.Sparklines.SparklineSetting(); * setting.options.showMarkers = true; * setting.options.displayXAxis = true; * setting.options.seriesColor = "Text 2 1"; * setting.options.firstMarkerColor = "Text 2 3"; * setting.options.axisColor ="Text 1 1"; * * sparkline.setting(setting); * ``` */ setting(value?: GC.Spread.Sheets.Sparklines.SparklineSetting): any; /** * Gets or sets the type of the sparkline. * @param {GC.Spread.Sheets.Sparklines.SparklineType} [value] The sparkline type. * @returns {GC.Spread.Sheets.Sparklines.SparklineType | GC.Spread.Sheets.Sparklines.Sparkline} If no value is set, returns the sparkline type; otherwise, returns the sparkline. * @example * ```javascript * let sheet = spread.getActiveSheet(); * sheet.setArray(0, 0, [-1,2,3,4,3,2,3,5]); * let dataRange = new GC.Spread.Sheets.Range(0, 0, 8, 1); * let sparkline = sheet.setSparkline(11, 0, dataRange, GC.Spread.Sheets.Sparklines.DataOrientation.Vertical, GC.Spread.Sheets.Sparklines.SparklineType.line, new GC.Spread.Sheets.Sparklines.SparklineSetting()); * * sparkline.sparklineType(GC.Spread.Sheets.Sparklines.SparklineType.column); * ``` */ sparklineType(value?: GC.Spread.Sheets.Sparklines.SparklineType): any; } export class SparklineEx{ /** * Represents the base class for the other SparklineEx classes. * @class */ constructor(); /** * Represents the type name string used for supporting serialization. * @type {string} */ typeName: string; /** * Creates a custom function used to provide data and settings for SparklineEx. * @returns {GC.Spread.CalcEngine.Functions.Function} The created custom function. */ createFunction(): GC.Spread.CalcEngine.Functions.Function; /** * Loads the object state from the specified JSON string. * @param {Object} settings The sparklineEx data from deserialization. */ fromJSON(settings: Object): void; /** * Gets the name of SparklineEx. * @returns {string} The SparklineEx's name. */ name(): string; /** * Paints the SparklineEx on the canvas. * @param {CanvasRenderingContext2D} context The canvas's two-dimensional context. * @param {object} value The value evaluated by the custom function. * @param {number} x x-coordinate relative to the canvas. * @param {number} y y-coordinate relative to the canvas. * @param {number} width The cell's width. * @param {number} height The cell's height. */ paint(context: CanvasRenderingContext2D, value: any, x: number, y: number, width: number, height: number): void; /** * Saves the object state to a JSON string. * @returns {Object} The sparklineEx data. */ toJSON(): Object; } export class SparklineGroup{ /** * Represents a sparkline group. * @param {GC.Spread.Sheets.Sparklines.SparklineType} type The type of sparkline. * @param {GC.Spread.Sheets.Sparklines.SparklineSetting} setting The setting of the sparkline group. * @class */ constructor(type: GC.Spread.Sheets.Sparklines.SparklineType, setting: GC.Spread.Sheets.Sparklines.SparklineSetting); /** Indicates the sparkline settings. * @type {GC.Spread.Sheets.Sparklines.SparklineSetting} */ setting: GC.Spread.Sheets.Sparklines.SparklineSetting; /** Indicates the sparkline type. * @type {GC.Spread.Sheets.Sparklines.SparklineType} */ sparklineType: GC.Spread.Sheets.Sparklines.SparklineType; /** * Adds a sparkline to the group. * @param {GC.Spread.Sheets.Sparklines.Sparkline} item The sparkline item. * @example * ```javascript * let sheet = spread.getActiveSheet(); * sheet.setArray(0, 0, [1,2,3,4,3,2,3,5]); * let dataRange = new GC.Spread.Sheets.Range(0, 0, 8, 1); * let setting = new GC.Spread.Sheets.Sparklines.SparklineSetting(); * let sparkline1 = sheet.setSparkline(11, 0, dataRange, GC.Spread.Sheets.Sparklines.DataOrientation.Vertical, GC.Spread.Sheets.Sparklines.SparklineType.line, setting); * let sparkline2 = sheet.setSparkline(11, 3, dataRange, GC.Spread.Sheets.Sparklines.DataOrientation.Vertical, GC.Spread.Sheets.Sparklines.SparklineType.line, setting); * let sparkline3 = sheet.setSparkline(11, 6, dataRange, GC.Spread.Sheets.Sparklines.DataOrientation.Vertical, GC.Spread.Sheets.Sparklines.SparklineType.column, setting); * let sparklineGroup = sheet.groupSparkline([sparkline1,sparkline2]); * // add a sparkline to sparkline group * sparklineGroup.add(sparkline3); * ``` */ add(item: GC.Spread.Sheets.Sparklines.Sparkline): void; /** * Clones the current sparkline group. * @returns {GC.Spread.Sheets.Sparklines.SparklineGroup} The cloned sparkline group. * @example * ```javascript * let sheet = spread.getActiveSheet(); * sheet.setArray(0, 0, [1,2,3,4,3,2,3,5]); * let dataRange = new GC.Spread.Sheets.Range(0, 0, 8, 1); * let setting = new GC.Spread.Sheets.Sparklines.SparklineSetting(); * let sparkline1 = sheet.setSparkline(11, 0, dataRange, GC.Spread.Sheets.Sparklines.DataOrientation.Vertical, GC.Spread.Sheets.Sparklines.SparklineType.line, setting); * let sparkline2 = sheet.setSparkline(11, 3, dataRange, GC.Spread.Sheets.Sparklines.DataOrientation.Vertical, GC.Spread.Sheets.Sparklines.SparklineType.line, setting); * let sparklineGroup = sheet.groupSparkline([sparkline1,sparkline2] * * let sparklineGroup2 = sparklineGroup.clone(); * ``` */ clone(): GC.Spread.Sheets.Sparklines.SparklineGroup; /** * Determines whether the group contains a specific value. * @param {GC.Spread.Sheets.Sparklines.Sparkline} item The object to locate in the group. * @returns {boolean} `true` if the item is found in the group; otherwise, `false`. * @example * ```javascript * let sheet = spread.getActiveSheet(); * sheet.setArray(0, 0, [1,2,3,4,3,2,3,5]); * let dataRange = new GC.Spread.Sheets.Range(0, 0, 8, 1); * let setting = new GC.Spread.Sheets.Sparklines.SparklineSetting(); * let sparkline1 = sheet.setSparkline(11, 0, dataRange, GC.Spread.Sheets.Sparklines.DataOrientation.Vertical, GC.Spread.Sheets.Sparklines.SparklineType.line, setting); * let sparkline2 = sheet.setSparkline(11, 3, dataRange, GC.Spread.Sheets.Sparklines.DataOrientation.Vertical, GC.Spread.Sheets.Sparklines.SparklineType.line, setting); * let sparkline3 = sheet.setSparkline(11, 6, dataRange, GC.Spread.Sheets.Sparklines.DataOrientation.Vertical, GC.Spread.Sheets.Sparklines.SparklineType.line, setting); * let sparklineGroup = sheet.groupSparkline([sparkline1,sparkline2]); * * console.log(sparklineGroup.contains(sparkline1)); // true * console.log(sparklineGroup.contains(sparkline3)); // false * ``` */ contains(item: GC.Spread.Sheets.Sparklines.Sparkline): boolean; /** * Represents the count of the sparkline group innerlist. * @returns {number} The sparkline count in the group. * @example * ```javascript * let sheet = spread.getActiveSheet(); * sheet.setArray(0, 0, [1,2,3,4,3,2,3,5]); * let dataRange = new GC.Spread.Sheets.Range(0, 0, 8, 1); * let setting = new GC.Spread.Sheets.Sparklines.SparklineSetting(); * let sparkline1 = sheet.setSparkline(11, 0, dataRange, GC.Spread.Sheets.Sparklines.DataOrientation.Vertical, GC.Spread.Sheets.Sparklines.SparklineType.line, setting); * let sparkline2 = sheet.setSparkline(11, 3, dataRange, GC.Spread.Sheets.Sparklines.DataOrientation.Vertical, GC.Spread.Sheets.Sparklines.SparklineType.line, setting); * let sparklineGroup = sheet.groupSparkline([sparkline1,sparkline2]); * * console.log(sparklineGroup.count()); // 2 * ``` */ count(): number; /** * Represents the date axis data. * @param {GC.Spread.Sheets.Range} [value] The date axis data. * @returns {GC.Spread.Sheets.Range | undefined} If no value is set, returns the date axis data; otherwise, returns undefined. * @example * ```javascript * let sheet = spread.getActiveSheet(); * sheet.setArray(0, 0, [-1,2,3,4,3,2,3,5]); * let dataRange = new GC.Spread.Sheets.Range(0, 0, 8, 1); * let setting = new GC.Spread.Sheets.Sparklines.SparklineSetting(); * let sparkline1 = sheet.setSparkline(11, 0, dataRange, GC.Spread.Sheets.Sparklines.DataOrientation.Vertical, GC.Spread.Sheets.Sparklines.SparklineType.line, setting); * let sparkline2 = sheet.setSparkline(11, 3, dataRange, GC.Spread.Sheets.Sparklines.DataOrientation.Vertical, GC.Spread.Sheets.Sparklines.SparklineType.line, setting); * let sparklineGroup = sheet.groupSparkline([sparkline1,sparkline2]); * * sheet.setArray(0, 1, [1,4,6,5,3,6,10,2]); * sparklineGroup.dateAxisData(new GC.Spread.Sheets.Range(0, 1, 8, 1)); * console.log(sparklineGroup.dateAxisData()); * ``` */ dateAxisData(value?: GC.Spread.Sheets.Range): any; /** * Represents the date axis orientation. * @param {GC.Spread.Sheets.Sparklines.DataOrientation} [value] The date axis orientation. * @returns {GC.Spread.Sheets.Sparklines.DataOrientation | undefined} If no value is set, returns the date axis orientation; otherwise, returns undefined. * @example * ```javascript * let sheet = spread.getActiveSheet(); * sheet.setArray(0, 0, [-1,2,3,4,3,2,3,5]); * let dataRange = new GC.Spread.Sheets.Range(0, 0, 8, 1); * let setting = new GC.Spread.Sheets.Sparklines.SparklineSetting(); * let sparkline1 = sheet.setSparkline(11, 0, dataRange, GC.Spread.Sheets.Sparklines.DataOrientation.Vertical, GC.Spread.Sheets.Sparklines.SparklineType.line, setting); * let sparkline2 = sheet.setSparkline(11, 3, dataRange, GC.Spread.Sheets.Sparklines.DataOrientation.Vertical, GC.Spread.Sheets.Sparklines.SparklineType.line, setting); * let sparklineGroup = sheet.groupSparkline([sparkline1,sparkline2]); * * sheet.setArray(0, 1, [1,4,6,5,3,6,10,2]); * sparklineGroup.dateAxisData(new GC.Spread.Sheets.Range(0, 1, 8, 1)); * sparklineGroup.dateAxisOrientation(GC.Spread.Sheets.Sparklines.DataOrientation.Vertical); * ``` */ dateAxisOrientation(value: GC.Spread.Sheets.Sparklines.DataOrientation): any; /** * Removes the first occurrence of a specific object from the group. * @param {GC.Spread.Sheets.Sparklines.Sparkline} item The sparkline item. * @returns {GC.Spread.Sheets.Sparklines.Sparkline[]} The GC.Spread.Sheets.Sparklines.Sparkline array. * @example * ```javascript * let sheet = spread.getActiveSheet(); * sheet.setArray(0, 0, [-1,2,3,4,3,2,3,5]); * let dataRange = new GC.Spread.Sheets.Range(0, 0, 8, 1); * let setting = new GC.Spread.Sheets.Sparklines.SparklineSetting(); * let sparkline1 = sheet.setSparkline(11, 0, dataRange, GC.Spread.Sheets.Sparklines.DataOrientation.Vertical, GC.Spread.Sheets.Sparklines.SparklineType.line, setting); * let sparkline2 = sheet.setSparkline(11, 3, dataRange, GC.Spread.Sheets.Sparklines.DataOrientation.Vertical, GC.Spread.Sheets.Sparklines.SparklineType.line, setting); * let sparklineGroup = sheet.groupSparkline([sparkline1,sparkline2]); * * console.log(sparklineGroup.count()) // 2 * sparklineGroup.remove(sparkline1); * console.log(sparklineGroup.count()) // 1 * ``` */ remove(item: GC.Spread.Sheets.Sparklines.Sparkline): GC.Spread.Sheets.Sparklines.Sparkline[]; } export class SparklineSetting{ /** * Creates the sparkline settings. * @param {GC.Spread.Sheets.Sparklines.ISparklineSetting} setting The settings. * @class */ constructor(setting?: GC.Spread.Sheets.Sparklines.ISparklineSetting); /** * Indicates the options for the sparkline. * @example * ```javascript * var data = new GC.Spread.Sheets.Range(1, 0, 8, 1); * var setting = new GC.Spread.Sheets.Sparklines.SparklineSetting(); * setting.options.showMarkers = true; * setting.options.lineWeight = 3; * setting.options.displayXAxis = true; * setting.options.showFirst = true; * setting.options.showLast = true; * setting.options.showLow = true; * setting.options.showHigh = true; * setting.options.showNegative = true; * setting.options.seriesColor = "Text 2 1"; * setting.options.firstMarkerColor = "Text 2 3"; * setting.options.negativeColor = "Accent 2 1"; * setting.options.markersColor = "Accent 3 1"; * setting.options.lowMarkerColor = "Accent 4 1"; * setting.options.highMarkerColor = "Accent 6 1"; * setting.options.lastMarkerColor = "Accent 6 6"; * setting.options.axisColor ="Text 1 1"; * sheet.addSpan(13, 0, 4, 3, null); * sheet.setSparkline(13, 0, data, GC.Spread.Sheets.Sparklines.DataOrientation.Vertical, GC.Spread.Sheets.Sparklines.SparklineType.line, setting); * sheet.setValue(1, 0, 1); * sheet.setValue(2, 0, -2); * sheet.setValue(3, 0, -1); * sheet.setValue(4, 0, 6); * sheet.setValue(5, 0, 4); * sheet.setValue(6, 0, -4); * sheet.setValue(7, 0, 3); * ``` */ options: GC.Spread.Sheets.Sparklines.ISparklineSetting; /** * Clones sparkline settings. * @returns {GC.Spread.Sheets.Sparklines.SparklineSetting} The cloned sparkline setting. */ clone(): GC.Spread.Sheets.Sparklines.SparklineSetting; } export class SpreadSparkline extends SparklineEx{ /** * Represents the class for the Spread sparkline. * @extends GC.Spread.Sheets.Sparklines.SparklineEx * @class */ constructor(); } export class StackedSparkline extends SparklineEx{ /** * Represents the class for the stacked sparkline. * @extends GC.Spread.Sheets.Sparklines.SparklineEx * @class */ constructor(); } export class VariSparkline extends SparklineEx{ /** * Represents the class for the variance sparkline. * @extends GC.Spread.Sheets.Sparklines.SparklineEx * @class */ constructor(); } export class VBarSparkline extends SparklineEx{ /** * Represents the class for the VBar sparkline. * @extends GC.Spread.Sheets.Sparklines.SparklineEx * @class */ constructor(); } export class WinlossSparkline extends SparklineEx{ /** * Represents the class for the winloss sparkline. * @extends GC.Spread.Sheets.Sparklines.SparklineEx * @class */ constructor(); } export class YearSparkline extends SparklineEx{ /** * Represents the class for the year sparkline. * @extends GC.Spread.Sheets.Sparklines.SparklineEx * @class */ constructor(); } } module StatusBar{ /** * Gets the StatusBar instance by the host element. * @param {HTMLElement|string} host The host element or the host element id. * @returns {GC.Spread.Sheets.StatusBar.StatusBar} The StatusBar instance. * @example * ```javascript * var spread = new GC.Spread.Sheets.Workbook(document.getElementById("ss")); * var spanItem = new GC.Spread.Sheets.StatusBar.StatusItem('spanItem', {menuContent: 'current span', value: 'span test'}); * var statusBar = new GC.Spread.Sheets.StatusBar.StatusBar( * document.getElementById('statusBar'), * { items: [spanItem] } * ); * statusBar.bind(spread); * var statusBarInstance = GC.Spread.Sheets.StatusBar.findControl('statusBar'); * ``` */ function findControl(host: HTMLElement|string): GC.Spread.Sheets.StatusBar.StatusBar; export interface IStatusBarOptions{ items: GC.Spread.Sheets.StatusBar.StatusItem[]; } export class StatusBar{ /** * Represents status bar. * @class * @param {HTMLElement} host The DOM Element. * @param {GC.Spread.Sheets.StatusBar.IStatusBarOptions} [options] The options to config statusbar. * @example * ```javascript * let statusBar = new GC.Spread.Sheets.StatusBar.StatusBar(document.getElementById('statusBar'), * {items: [new GC.Spread.Sheets.StatusBar.StatusItem('labelItem', {menuContent: 'label'})]}); * ``` */ constructor(host: HTMLElement, options?: GC.Spread.Sheets.StatusBar.IStatusBarOptions); /** * Add the item instance to the StatusBar. * @param {GC.Spread.Sheets.StatusBar.StatusItem} item The instance of the child of StatusItem. The child extends from StatusItem. * @param {number} position The position is items index in all items array. Start from 0. Items display position is also related to align. If position is invalid or undefine, place it by default. * @returns {boolean} Add item result. If add success return true, else failed. * @example * ```javascript * let StatusItem = GC.Spread.Sheets.StatusBar.StatusItem; * let spanItem = new StatusItem('spanItemName', {menuContent: 'span', value: 'spanValue'}); * let spread = new GC.Spread.Sheets.Workbook(document.getElementById("ss")); * let statusBar = new GC.Spread.Sheets.StatusBar.StatusBar(document.getElementById('statusBar')); * statusBar.bind(spread); * statusBar.add(spanItem); * ``` */ add(item: GC.Spread.Sheets.StatusBar.StatusItem, position: number): boolean; /** * Get all item list. * @return {GC.Spread.Sheets.StatusBar.StatusItem[]} The item list on statusbar. * @example * ```javascript * let spread = new GC.Spread.Sheets.Workbook(document.getElementById("ss")); * let statusBar = new GC.Spread.Sheets.StatusBar.StatusBar(document.getElementById('statusBar')); * statusBar.bind(spread); * let itemList = statusBar.all(); * statusBar.remove(itemList[0]); * ``` */ all(): GC.Spread.Sheets.StatusBar.StatusItem[]; /** * Bind the context of the StatusBar. * @param {GC.Spread.Sheets.Workbook} context The context of the StatusBar. The context can trigger the status change of StatusBar. Here the context is the instance of GC.Spread.Sheets.Workbook. * @example * ```javascript * let spread = new GC.Spread.Sheets.Workbook(document.getElementById("ss")); * let statusBar = new GC.Spread.Sheets.StatusBar.StatusBar(document.getElementById('statusBar')); * statusBar.bind(spread); * ``` */ bind(context: GC.Spread.Sheets.Workbook): void; /** * Dispose the StatusBar and unbind all events. * @example * ```javascript * let spread = new GC.Spread.Sheets.Workbook(document.getElementById("ss")); * let statusBar = new GC.Spread.Sheets.StatusBar.StatusBar(document.getElementById('statusBar')); * statusBar.bind(spread); * // do something * statusBar.dispose(); * ``` */ dispose(): void; /** * Get the item by item name. * @param {string} itemName * @returns {GC.Spread.Sheets.StatusBar.StatusItem} The StatusItem whose itemName is specified. * @example * ```javascript * let StatusItem = GC.Spread.Sheets.StatusBar.StatusItem; * let spanItemName = 'spanItemName'; * let spanItem = new StatusItem(spanItemName, {menuContent: 'span', value: 'spanValue'}); * let spread = new GC.Spread.Sheets.Workbook(document.getElementById("ss")); * let statusBar = new GC.Spread.Sheets.StatusBar.StatusBar(document.getElementById('statusBar')); * statusBar.bind(spread); * statusBar.add(spanItem); * let spanItemInstance = statusBar.get(spanItemName); * ``` */ get(itemName: string): GC.Spread.Sheets.StatusBar.StatusItem; /** * Remove the item from the StatusBar. * @param {string} itemName The name of the StatusItem. * @returns {boolean} If true means remove success, else failed. * @example * ```javascript * let StatusItem = GC.Spread.Sheets.StatusBar.StatusItem; * let spanItemName = 'spanItemName'; * let spanItem = new StatusItem(spanItemName, {menuContent: 'span', value: 'spanValue'}); * let spread = new GC.Spread.Sheets.Workbook(document.getElementById("ss")); * let statusBar = new GC.Spread.Sheets.StatusBar.StatusBar(document.getElementById('statusBar')); * statusBar.bind(spread); * statusBar.add(spanItem); * // do something * statusBar.remove(spanItemName); * ``` */ remove(itemName: string): boolean; /** * Unbind the context of the StatusBar. * @example * ```javascript * let spread = new GC.Spread.Sheets.Workbook(document.getElementById("ss")); * let statusBar = new GC.Spread.Sheets.StatusBar.StatusBar(document.getElementById('statusBar')); * statusBar.bind(spread); * // do something * statusBar.unbind(); * ``` */ unbind(): void; /** * Update the StatusBar. * @example * ```javascript * let spread = new GC.Spread.Sheets.Workbook(document.getElementById("ss")); * let statusBar = new GC.Spread.Sheets.StatusBar.StatusBar(document.getElementById('statusBar')); * statusBar.update(); * ``` */ update(): void; } export class StatusItem{ /** * The base class of status item provides basic value display and related context menu item function. * @class * @param {string} name - The name is the Unique identifier and needed in context menu and statusbar. * @param {GC.Spread.Sheets.StatusBar.StatusItem.IStatusItemOptions} [options] - The object of status item options. * @example * ```javascript * let StatusItem = GC.Spread.Sheets.StatusBar.StatusItem; * let labelItem = new StatusItem('labelItem', {menuContent: 'label', value: 'text'}); * ``` */ constructor(name: string, options?: GC.Spread.Sheets.StatusBar.StatusItem.IStatusItemOptions); /** * Bind the Context. Can override to add context related event listener. * @override * @param {GC.Spread.Sheets.Workbook} context The excute context for the statusbar item. * @example * ```javascript * LabelItem.prototype.onBind = function (context) { * // do something about context. * } * ``` */ onBind(context: GC.Spread.Sheets.Workbook): void; /** * Create the item element on statusbar. Can override for customize item. * @override * @param {HTMLElement} container * @example * ```javascript * let StatusItem = GC.Spread.Sheets.StatusBar.StatusItem; * function LabelItem (name, options) { * StatusItem.call(this, name, options); * } * LabelItem.prototype = new StatusItem(); * LabelItem.prototype.onCreateItemView = function (container) { * let item = document.createElement('div'); * item.innerText = this.value; * container.appendChild(item); * // add event listener for container * } * statusBar.add(new LabelItem('labelItem', {menuContent: 'label', value: 'options test'})); * ``` */ onCreateItemView(container: HTMLElement): void; /** * Dispose the statusbar to unbind context, remove all listener and dispose all element. * @override * @example * ```javascript * let StatusItem = GC.Spread.Sheets.StatusBar.StatusItem; * function LabelItem (name, options) { * StatusItem.call(this, name, options); * } * LabelItem.prototype = new StatusItem(); * LabelItem.prototype.onDispose = function () { * // dispose current item. * // then call super dispose. * StatusItem.prototype.onDispose.call(this); * } * ``` */ onDispose(): void; /** * Unbind the Context. Can override to remove context related event listener. * @override * @example * ```javascript * LabelItem.prototype.onUnbind = function () { * // remove event listener related to context. * } * ``` */ onUnbind(): void; /** * The callback for status bar update. Called when status bar bind or update function, or status bar check changed in context menu. * The update related operations can realize in it. Users also should call onUpdate when current item need update. * The default operations in super is update current item by visible. * @override * @param {string} content The string content to be displayed on the StatusItem. * @example * ```javascript * let StatusItem = GC.Spread.Sheets.StatusBar.StatusItem; * function LabelItem (name, options) { * StatusItem.call(this, name, options); * } * LabelItem.prototype = new StatusItem(); * LabelItem.prototype.onUpdate = function () { * StatusItem.prototype.onUpdate.call(this); * // update item. * } * ``` */ onUpdate(content?: string): void; } module StatusItem{ export interface IStatusItemOptions{ /** * The menuContent displayed left on context menu which represent current item. */ menuContent?: string; /** * Control the item alignment on statusbar. The value is 'left' or 'right'. */ align?: AlignType; /** * The tip text displayed when mouse over the item. Show the description for the item. */ tipText?: string; /** * 1.The visibility of current item on statusbar. 2.The checked status of current item on context menu. */ visible?: boolean; /** * Whether show the status on right of context menu. */ showStatusInContexMenu?: boolean; /** * The value displayed on status bar and on right of context menu to represent the status of current item. */ value?: any; } /** * @typedef GC.Spread.Sheets.StatusBar.StatusItem.AlignType * @type {'left' | 'right'} * @description The align type of statusItem. */ export type AlignType = 'left' | 'right' } } module Tables{ export interface IRowState{ row: number; item?: any; originalItem?: any; } export interface ITableLayoutStyle{ header?: string | GC.Spread.Sheets.Style; data?: string | GC.Spread.Sheets.Style; footer?: string | GC.Spread.Sheets.Style; } export interface ITableOptions{ /** * Whether to display the table header. */ showHeader?: boolean; /** * Whether to display the table footer. */ showFooter?: boolean; /** * Whether to show dropDownList for footer. */ useFooterDropDownList?: boolean; /** * Whether to show table resizeHandler. */ showResizeHandle?: boolean; } /** * Specifies how to remove the table, whether keep data and style. * @enum {number} * @example * ```javascript * activeSheet.tables.add("Table1", 0, 0, 3, 3, GC.Spread.Sheets.Tables.TableThemes.dark1); * activeSheet.getCell(0,0).text("Name"); * activeSheet.getCell(0,1).text("Value"); * activeSheet.getCell(0,2).text("T/F"); * activeSheet.getCell(1,0).text("AW"); * activeSheet.getCell(1,1).text("5"); * activeSheet.getCell(1,2).text("T"); * //button click * $("#button1").click(function () { * var table = activeSheet.tables.find(0,0); * activeSheet.tables.remove(table, GC.Spread.Sheets.Tables.TableRemoveOptions.keepData); * }); * ``` */ export enum TableRemoveOptions{ /** * Remove table, keep nothing. */ none= 0, /** * Remove table, keep table data. */ keepData= 1, /** * Remove table, keep table style. */ keepStyle= 2 } export class CustomTableThemeManager extends GC.Spread.Sheets.CustomThemeManagerBase{ /** * Represents a custom table theme manager that can manage all custom table themes. * @class * @param {GC.Spread.Sheets.Workbook} workbook The workbook. * @extends GC.Spread.Sheets.CustomThemeManagerBase */ constructor(workbook: GC.Spread.Sheets.Workbook); /** * add a new table theme. * @param {string | GC.Spread.Sheets.Tables.TableTheme} theme the new table theme or just a new table theme name you want to add * @returns {GC.Spread.Sheets.Tables.TableTheme | undefined} return the newly added table theme, if the named table theme is existed, failed to add table theme and return undefined * @example * ```javascript * // add a new table theme named "custom0" * var spread = new GC.Spread.Sheets.Workbook(document.getElementById("ss")); * let tableStyle = spread.customTableThemes.add("custom0"); * let firstColumnStripStyle = new GC.Spread.Sheets.Tables.TableStyle(); * firstColumnStripStyle.backColor = "#0C66E4"; * tableStyle.firstColumnStripStyle(firstColumnStripStyle); * ``` */ add(theme: string | GC.Spread.Sheets.Tables.TableTheme): GC.Spread.Sheets.Tables.TableTheme | undefined; /** * get the table themes collection. * @returns Array * @example * ```javascript * // get all table table themes * let tableStylesCollection = spread.customTableThemes.all(); * ``` */ all(): Array; /** * get the table theme by name. * @param {string} name the specific name of the table theme to get * @returns {GC.Spread.Sheets.Tables.TableTheme | undefined} If the corresponding table theme with the spefic name is found, return the theme; otherwise, return undefined. * @example * ```javascript * // get table theme * tableStyle = spread.customTableThemes.get("custom0"); * ``` */ get(name: string): GC.Spread.Sheets.Tables.TableTheme | undefined; /** * remove the table theme by name. * @param {string} name the specific name of the table theme to remove * @returns {void} * @example * ```javascript * // delete table theme * spread.customTableThemes.remove("custom0"); * ``` */ remove(name: string): void; /** * update the table theme. * @param {string} oldThemeName the specific name of the table theme to update * @param {GC.Spread.Sheets.Tables.TableTheme} newTheme the specific name of the table theme to update * @returns {void} * @example * ```javascript * // update table theme * tableStyle = spread.customTableThemes.update("custom0", new GC.Spread.Sheets.Tables.TableTheme()); * ``` */ update(oldThemeName: string, newTheme: GC.Spread.Sheets.Tables.TableTheme): void; } export class Table{ /** * Represents a table that can be added in a sheet. * @class * @param {string} name The table name. * @param {number} row The table row index. * @param {number} col The table column index. * @param {number} rowCount The table row count. * @param {number} colCount The table column count. * @param {string | GC.Spread.Sheets.Tables.TableTheme} style The table style or style name. * @param {Object} options The initialization options of the table. * @param {boolean} [options.showHeader] - Whether to display the table header. * @param {boolean} [options.showFooter] - Whether to display a footer. * @param {boolean} [options.useFooterDropDownList] - whether to use the footer dropdown list for a total row. * @param {boolean} [options.showResizeHandle] - Whether to display the resize handle for table. */ constructor(name?: string, row?: number, col?: number, rowCount?: number, colCount?: number, style?: string | GC.Spread.Sheets.Tables.TableTheme); /** * Gets or sets the allowAutoExpandState of the table. * @param {boolean} [allowAutoExpandState] The allowAutoExpandState of the table. * @returns {boolean|GC.Spread.Sheets.Tables.Table} If there is no allowAutoExpandState set, returns the table allowAutoExpandState; otherwise, returns the table. * @example * ```javascript * console.log(table.allowAutoExpand()); * table.allowAutoExpand(true); * ``` */ allowAutoExpand(allowAutoExpandState?: boolean): boolean | GC.Spread.Sheets.Tables.Table; /** * Gets or sets whether to generate columns automatically while binding to a data source. * @param {boolean} [value] Whether to generate columns automatically while binding to a data source. * @returns {boolean | GC.Spread.Sheets.Tables.Table} If no value is set, returns whether to generate columns automatically while binding to a data source; otherwise, returns the table. * @example * ```javascript * var data = { * sales: [ * {orderDate: '1/6/2013', item: 'Pencil', units: 95}, * {orderDate: '4/1/2013', item: 'Binder', units: 60}, * {orderDate: '6/8/2013', item: 'Pen Set', units: 16} * ] * }; * var table = sheet.tables.add('tableSales', 0, 0, 5, 1); // only 1 column * var tableColumn1 = new GC.Spread.Sheets.Tables.TableColumn(1, "orderDate", "Order Date", "d/M/yy"); * var tableColumn2 = new GC.Spread.Sheets.Tables.TableColumn(2, "item", "Item"); * var tableColumn3 = new GC.Spread.Sheets.Tables.TableColumn(3, "units", "Units"); * * table.autoGenerateColumns(false); * table.bind([tableColumn1, tableColumn2, tableColumn3], 'sales', data); * console.log(table.dataRange().colCount); // 1 * * table.autoGenerateColumns(true); * table.bind([tableColumn1, tableColumn2, tableColumn3], 'sales', data); * console.log(table.dataRange().colCount); // 3 * ``` */ autoGenerateColumns(value?: boolean): any; /** * Gets or sets a value that indicates whether to display an alternating column style. * @param {boolean} value Whether to display an alternating column style. * @returns {boolean | GC.Spread.Sheets.Tables.Table} If no value is set, returns whether to display an alternating column style; otherwise, returns the table. * @example * ```javascript * var sTable = activeSheet.tables.add("table1", 1, 1, 10, 5, GC.Spread.Sheets.Tables.TableThemes.medium2); * sTable.bandColumns(true); * sTable.bandRows(true); * ``` */ bandColumns(value?: boolean): any; /** * Gets or sets a value that indicates whether to display an alternating row style. * @param {boolean} value Whether to display an alternating row style. * @returns {boolean | GC.Spread.Sheets.Tables.Table} If no value is set, returns whether to display an alternating row style; otherwise, returns the table. * @example * ```javascript * var sTable = activeSheet.tables.add("table1", 1, 1, 10, 5, GC.Spread.Sheets.Tables.TableThemes.medium2); * sTable.bandColumns(true); * sTable.bandRows(true); * ``` */ bandRows(value?: boolean): any; /** * Gets or sets the dataSource and binding columns and path for the table. * @param {GC.Spread.Sheets.Tables.TableColumn[]} columns The array of table column information with data fields and names. Each item is GC.Spread.Sheets.Tables.TableColumn. * @param {string} [path] The binding path for binding in the table. * @param {object | string | GC.Data.Table} [dataSource] The data source for the table. * @returns {GC.Spread.Sheets.Tables.Table | Promise} returns the table. * @example * ```javascript * var data = { * name: 'Jones', region: 'East', * sales: [ * {orderDate: '1/6/2013', item: 'Pencil', units: 95, cost: 1.99, isMakeMoney: true}, * {orderDate: '4/1/2013', item: 'Binder', units: 60, cost: 4.99, isMakeMoney: false}, * {orderDate: '6/8/2013', item: 'Pen Set', units: 16, cost: 15.99, isMakeMoney: false} * ] * }; * var convert = function (item) { * return item['cost'] + '$'; * } * var table = sheet.tables.add('tableSales', 0, 0, 5, 5); * var tableColumn1 = new GC.Spread.Sheets.Tables.TableColumn(1, "orderDate", "Order Date", "d/M/yy"); * var tableColumn2 = new GC.Spread.Sheets.Tables.TableColumn(2, "item", "Item"); * var tableColumn3 = new GC.Spread.Sheets.Tables.TableColumn(3, "units", "Units"); * var tableColumn4 = new GC.Spread.Sheets.Tables.TableColumn(4, "cost", "Cost", null, null, convert); * var tableColumn5 = new GC.Spread.Sheets.Tables.TableColumn(5, "isMakeMoney", "IsMakeMoney", null, new GC.Spread.Sheets.CellTypes.CheckBox()); * table.autoGenerateColumns(false); * * table.bind([tableColumn1, tableColumn2, tableColumn3, tableColumn4, tableColumn5], 'sales', data); * ``` */ bind(columns: TableColumn[], path?: string, dataSource?: object | string | GC.Data.Table): GC.Spread.Sheets.Tables.Table | Promise; /** * Binds the columns using the specified data fields. * @param {GC.Spread.Sheets.Tables.TableColumn[]} columns The array of table column information with data fields and names. Each item is GC.Spread.Sheets.Tables.TableColumn. * @example * ```javascript * var table = sheet.tables.add('tableSales', 0, 0, 5, 2); * var tableColumn1 = new GC.Spread.Sheets.Tables.TableColumn(1, "orderDate", "Order Date", "d/M/yy"); * var tableColumn2 = new GC.Spread.Sheets.Tables.TableColumn(2, "item", "Item"); * table.bindColumns([tableColumn1, tableColumn2]); * ``` */ bindColumns(columns: GC.Spread.Sheets.Tables.TableColumn[]): void; /** * Gets or sets the binding path for cell-level binding in the table. * @param {string} [value] The binding path for cell-level binding in the table. * @returns {string | GC.Spread.Sheets.Tables.Table} If no value is set, returns the binding path for cell-level binding in the table; otherwise, returns the table. */ bindingPath(value?: string): any; /** * Clears the dirty status from the current table. * @example * ```javascript * // table bind data * var data = { * sales: [ * {orderDate: '1/6/2013', item: 'Pencil'}, * {orderDate: '4/1/2013', item: 'Binder'}, * {orderDate: '6/8/2013', item: 'Pen Set'} * ] * }; * var table = sheet.tables.add('tableSales', 0, 0, 5, 5); * var tableColumn1 = new GC.Spread.Sheets.Tables.TableColumn(1, "orderDate", "Order Date", "d/M/yy"); * var tableColumn2 = new GC.Spread.Sheets.Tables.TableColumn(2, "item", "Item"); * table.bind([tableColumn1, tableColumn2], 'sales', data); * sheet.setValue(1, 1, 'dirty data'); * console.log(table.getDirtyRows()); // [{row:0, item: ..., originalItem: ...}] * table.clearPendingChanges(); * console.log(table.getDirtyRows()); // [ ] * ``` */ clearPendingChanges(): void; /** * Gets or sets the layout style to the table column. * @param {number} tableColumnIndex The column index of the table column. The index is zero-based. * @param {GC.Spread.Sheets.Tables.ITableLayoutStyle} [value] The layout style. * @returns {GC.Spread.Sheets.Tables.ITableLayoutStyle | GC.Spread.Sheets.Tables.Table} If no value is set, returns the layout style of the table column. otherwise return table. * @example * ```javascript * var table = activeSheet.tables.find(0,0); * var dataStyle = new GC.Spread.Sheets.Style(); * dataStyle.backColor = "red"; * var footerStyle = new GC.Spread.Sheets.Style(); * footerStyle.backColor = "green"; * var layoutStyle = {}; * layoutStyle.data = dataStyle; * layoutStyle.footer = footerStyle; * table.columnLayoutStyle(1, layoutStyle); * ``` */ columnLayoutStyle(tableColumnIndex: number, value?: GC.Spread.Sheets.Tables.ITableLayoutStyle): GC.Spread.Sheets.Tables.ITableLayoutStyle | GC.Spread.Sheets.Tables.Table; /** * Gets the cell range for the table data area. * @returns {GC.Spread.Sheets.Range} The table data range. * @example * ```javascript * var sTable = activeSheet.tables.add("table1", 1, 1, 10, 5, GC.Spread.Sheets.Tables.TableThemes.medium2); * var drange = sTable.dataRange(); * alert(drange.row); * ``` */ dataRange(): GC.Spread.Sheets.Range; /** * Delete count number columns in the table at the specified table col index. * @param {number} col The index of the first column to delete, based on table index. * @param {number} count The number of columns to delete. * @returns {void} * @example * ```javascript * var table = activeSheet.tables.add("table1", 1, 1, 10, 5, GC.Spread.Sheets.Tables.TableThemes.medium2); * table.deleteColumns(3, 1); * ``` */ deleteColumns(col: number, count: number): void; /** * Deletes the rows in this table at the specified table row index. * @param {number} row The index of the first row to delete, based on table index. * @param {number} count The number of rows to delete. * @returns {void} * @example * ```javascript * var table = activeSheet.tables.add("table1", 1, 1, 10, 5, GC.Spread.Sheets.Tables.TableThemes.medium2); * table.deleteRows(3, 1); * ``` */ deleteRows(row: number, count: number): void; /** * Gets or sets a value that table expand rows mode in binding case. * @param {boolean} [value] Whether to expand by sheet or table insert/delete rows. * @returns {boolean | GC.Spread.Sheets.Tables.Table} If no value is set, returns whether to expand by sheet or table insert/delete rows; otherwise, returns the table. * @example * ```javascript * var spread = GC.Spread.Sheets.findControl("ss") || GC.Spread.Sheets.findControl("sampleDiv"); * var sheet = spread.getActiveSheet(); * var data = { * name: 'Jones', region: 'East', * sales: [ * { orderDate: '1/6/2013', item: 'Pencil', units: 95, cost: 1.99 }, * { orderDate: '4/1/2013', item: 'Binder', units: 60, cost: 4.99 }, * { orderDate: '6/8/2013', item: 'Pen Set', units: 16, cost: 15.99 }, * { orderDate: '8/1/2013', item: 'Pencil', units: 20, cost: 24.99 }, * { orderDate: '10/8/2013', item: 'Binder', units: 31, cost: 16.99 } * ] * }; * var table1 = sheet.tables.add('tableRecords', 0, 0, 4, 4); * var table2 = sheet.tables.add('tableBelow', 4, 0, 4, 7); * table1.bindingPath('sales'); * var dataSource = new GC.Spread.Sheets.Bindings.CellBindingSource(data); * table1.expandBoundRows(true); * sheet.setDataSource(dataSource); * ``` */ expandBoundRows(value?: boolean): any; /** * Gets or sets whether the table column's filter button is displayed. * @param {number|boolean} [tableColumnIndex] The table column index of the filter button. * @param {boolean} [value] Whether the table column's filter button is displayed. * @returns {boolean | GC.Spread.Sheets.Tables.Table} The table column's filter button display state. * If no parameter is set, returns `false` if all filter buttons are invisible, otherwise, `true`. * If only a number is set, returns whether the specified table column' filter button is displayed. * If only a boolean that indicates whether to display filter buttons is set, applies to all filter buttons and returns the table. * If two parameters are provided, applies to the specified table columns' filter button and returns the table. * @example * ```javascript * var sTable = activeSheet.tables.add("table1", 1, 1, 10, 5, GC.Spread.Sheets.Tables.TableThemes.medium2); * sTable.bandColumns(true); * sTable.bandRows(true); * sTable.filterButtonVisible(2, false); * alert(sTable.filterButtonVisible(2)); * ``` */ filterButtonVisible(tableColumnIndex?: number | boolean, value?: boolean): any; /** * Gets the footer index in the sheet. * @returns {number} The footer index. * @example * ```javascript * var sTable = sheet.tables.add("table1", 0, 0, 10, 5, GC.Spread.Sheets.Tables.TableThemes.medium2); * sTable.showFooter(true); * * var footerIndex = sTable.footerIndex(); * console.log(footerIndex) // 10 * // Cause the table's footer is on row 11. * ``` */ footerIndex(): number; /** * Gets the table binding source if it bound. * @returns {object | GC.Data.Table | null} The table binding source. * @example * ```javascript * // if binding an object * const source = [ * { LastName: "Freehafer", FirstName: "Nancy", Title: "Sales Representative", Phone: "(123)555-0100"}, * { LastName: "Cencini", FirstName: "Andrew", Title: "Vice President, Sales", Phone: "(123)555-0101"}, * { LastName: "Kotas", FirstName: "Jan", Title: "Sales Representative", Phone: "(123)555-0102"}, * { LastName: "Sergienko", FirstName: "Mariya", Title: "Sales Representative", Phone: "(123)555-0103"}, * ]; * const table = activeSheet.tables.addFromDataSource("Table1", 5, 2, source, GC.Spread.Sheets.Tables.TableThemes.dark1); * // the bindingSource will be the source * const bindingSource = table.getBindingSource(); * // if binding a data manager table, it will return the table * const table = activeSheet.tables.addFromDataSource("Table1", 5, 2, "products", GC.Spread.Sheets.Tables.TableThemes.dark1); * // the bindingTable will be the data manager table * const bindingTable = table.getBindingSource(); * ``` */ getBindingSource(): object | GC.Data.Table | null; /** * Gets the table column data field with the specified table column index. * @param {number} tableColumnIndex - The column index of the table. The index is zero-based. * @returns {string} The data filed of the specified table column. * @example * ```javascript * table.setColumnDataField(3, "name"); * const dataField = table.getColumnDataField(3); // "name" * ``` */ getColumnDataField(tableColumnIndex: number): string; /** * Gets the table footer formula with the specified index. * @param {number} tableColumnIndex The column index of the table footer. The index is zero-based. * @returns {string} The table footer formula. * @example * ```javascript * var sTable = sheet.tables.add("table1", 1, 1, 10, 5, GC.Spread.Sheets.Tables.TableThemes.medium2); * //set footer formula * sTable.setColumnFormula(4, "SUM(F3:F11)"); * * //get footer formula * var columnFormula = sTable.getColumnFormula(4); * console.log(columnFormula); // "SUM(F3:F11)" * ``` */ getColumnFormula(tableColumnIndex: number): string; /** * Gets the table header text with the specified table index. * @param {number} tableColumnIndex The column index of the table header. The index is zero-based. * @returns {string} The header text of the specified column by index. * @example * ```javascript * var sTable = sheet.tables.add("table1", 1, 1, 10, 5, GC.Spread.Sheets.Tables.TableThemes.medium2); * sTable.setColumnName(4, "SUM"); * * var value = sTable.getColumnName(4); * console.log(value); // "SUM" * ``` */ getColumnName(tableColumnIndex: number): string; /** * Gets the table footer value with the specified index. * @param {number} tableColumnIndex The column index of the table footer. The index is zero-based. * @returns {string} The table footer value. * @example * ```javascript * var sTable = sheet.tables.add("table1", 1, 1, 10, 5, GC.Spread.Sheets.Tables.TableThemes.medium2); * // set footer value * sTable.setColumnValue(0, "Total"); * * // get footer value * var value = sTable.getColumnValue(0); * console.log(value) // "Total" * ``` */ getColumnValue(tableColumnIndex: number): string; /** * Get array of dirty rows. * @returns {GC.Spread.Sheets.Tables.IRowState[]} The dirty rows collection. The item in array contains three properties, row: specifies table row index, item: specifies data item of current row, originalItem: specifies original data item of the row. * @example * ```javascript * // table bind data * var data = { * sales: [ * {orderDate: '1/6/2013', item: 'Pencil'}, * {orderDate: '4/1/2013', item: 'Binder'}, * {orderDate: '6/8/2013', item: 'Pen Set'} * ] * }; * var table = sheet.tables.add('tableSales', 0, 0, 5, 5); * var tableColumn1 = new GC.Spread.Sheets.Tables.TableColumn(1, "orderDate", "Order Date", "d/M/yy"); * var tableColumn2 = new GC.Spread.Sheets.Tables.TableColumn(2, "item", "Item"); * table.bind([tableColumn1, tableColumn2], 'sales', data); * * console.log(table.getDirtyRows()); // [ ] * * sheet.setValue(1, 1, 'dirty data'); * console.log(table.getDirtyRows()); // [{row:0, item: ..., originalItem: ...}] * ``` */ getDirtyRows(): GC.Spread.Sheets.Tables.IRowState[]; /** * Gets the slicer data of the table. * @returns {GC.Spread.Sheets.Slicers.TableSlicerData} The slicer data of the table. * @example * ```javascript * var activeSheet = spread.getActiveSheet(); * var dataSource = [ * { Name: "Bob", City: "NewYork", Birthday: "1968/6/8" }, * { Name: "Betty", City: "NewYork", Birthday: "1972/7/3" }, * { Name: "Alice", City: "Washington", Birthday: "2012/2/15" }, * ]; * var table = activeSheet.tables.addFromDataSource("table1", 1, 1, dataSource); * var slicerData = table.getSlicerData(); * console.log(slicerData instanceof GC.Spread.Sheets.Slicers.TableSlicerData); // true * console.log(table.getSlicerData() === slicerData); // true * ``` */ getSlicerData(): GC.Spread.Sheets.Slicers.TableSlicerData; /** * Gets or sets a style name for the table. * @returns {string} returns the table style name. */ getStyleName(): string | undefined; /** * Gets the header index in the sheet. * @returns {number} The header index. * @example * ```javascript * var sTable = activeSheet.tables.add("table1", 1, 1, 10, 5, GC.Spread.Sheets.Tables.TableThemes.medium2); * var hindex = sTable.headerIndex(); * alert(hindex); * ``` */ headerIndex(): number; /** * Gets or sets a value that indicates whether to highlight the first column. * @param {boolean} value Whether to highlight the first column. * @returns {boolean | GC.Spread.Sheets.Tables.Table} If no value is set, returns whether to highlight the first column; otherwise, returns the table. * @example * ```javascript * var sTable = activeSheet.tables.add("table1", 1, 1, 10, 5, GC.Spread.Sheets.Tables.TableThemes.medium2); * sTable.highlightFirstColumn(true); * sTable.highlightLastColumn(true); * ``` */ highlightFirstColumn(value?: boolean): any; /** * Gets or sets a value that indicates whether to highlight the last column. * @param {boolean} value Whether to highlight the last column. * @returns {boolean | GC.Spread.Sheets.Tables.Table} If no value is set, returns whether to highlight the last column; otherwise, returns the table. * @example * ```javascript * var sTable = activeSheet.tables.add("table1", 1, 1, 10, 5, GC.Spread.Sheets.Tables.TableThemes.medium2); * sTable.highlightFirstColumn(true); * sTable.highlightLastColumn(true); * ``` */ highlightLastColumn(value?: boolean): any; /** * Insert count number columns in this table before the specified table col index. * @param {number} col Column index at which to add the new columns, based on table index. * @param {number} count The number of columns to add. * @param {boolean} [isInsertAfter] Whether insert columns before the specified column index or after. By default, insert before. * @returns {void} * @example * ```javascript * var table = activeSheet.tables.add("table1", 1, 1, 10, 5, GC.Spread.Sheets.Tables.TableThemes.medium2); * table.insertColumns(3, 1); * ``` */ insertColumns(col: number, count: number, isInsertAfter?: boolean): void; /** * Insert rows in this table before the specified table row index. * @param {number} row The index of the starting row to insert, based on table index. * @param {number} count The number of rows to add. * @param {boolean} [isInsertAfter] Whether insert rows before the specified row index or after. By default, insert before. * @returns {void} * @example * ```javascript * var table = activeSheet.tables.add("table1", 1, 1, 10, 5, GC.Spread.Sheets.Tables.TableThemes.medium2); * table.insertRows(3, 1); * ``` */ insertRows(row: number, count: number, isInsertAfter?: boolean): void; /** * Gets or sets a style to the table's data area. * @param {GC.Spread.Sheets.Tables.ITableLayoutStyle} [value] a named style or style instance. * @returns {GC.Spread.Sheets.Tables.ITableLayoutStyle | GC.Spread.Sheets.Tables.Table} If no value is set, returns the style of the table's data area; otherwise, returns the table. * @example * ```javascript * var sTable = activeSheet.tables.add("table1", 1, 1, 10, 5, GC.Spread.Sheets.Tables.TableThemes.medium2); * var dataStyle = new GC.Spread.Sheets.Style(); * dataStyle.backColor = "red"; * var footerStyle = new GC.Spread.Sheets.Style(); * footerStyle.backColor = "green"; * var layoutStyle = {}; * layoutStyle.data = dataStyle; * layoutStyle.footer = footerStyle; * table.layoutStyle(layoutStyle); * ``` */ layoutStyle(value?: GC.Spread.Sheets.Tables.ITableLayoutStyle): GC.Spread.Sheets.Tables.ITableLayoutStyle | GC.Spread.Sheets.Tables.Table; /** * Gets or sets the table name. * @param {string} value The table name. * @returns {string | GC.Spread.Sheets.Tables.Table} If no value is set, returns the table name; otherwise, returns the table. * @example * ```javascript * var sTable = activeSheet.tables.add("table1", 1, 1, 10, 5, GC.Spread.Sheets.Tables.TableThemes.medium2); * var tname = sTable.name(); * alert(tname); * ``` */ name(value?: string): any; /** * Gets the range for the entire table. * @returns {GC.Spread.Sheets.Range} The whole table range. * @example * ```javascript * var sTable = activeSheet.tables.add("table1", 1, 1, 10, 5, GC.Spread.Sheets.Tables.TableThemes.medium2); * var drange = sTable.range(); * alert(drange.row); * ``` */ range(): GC.Spread.Sheets.Range; /** * Gets the row filter for the table. * @returns {GC.Spread.Sheets.Filter.HideRowFilter} The row filter. * @example * ```javascript * var table = sheet.tables.add('table1', 0, 0, 5, 5); * * let rowFilter = table.rowFilter(); * console.log(rowFilter.range); * ``` */ rowFilter(): GC.Spread.Sheets.Filter.HideRowFilter; /** * Sets the table column data field with the specified table column index. * @param {number} tableColumnIndex - The column index of the table. The index is zero-based. * @param {string} dataField - The table column data field. * @returns {GC.Spread.Sheets.Tables.Table} The table. * @example * ```javascript * let data = { * name: 'Jones', region: 'East', * sales: [ * {orderDate: '1/6/2013', item: 'Pencil', units: 95, cost: 1.99, isMakeMoney: true}, * {orderDate: '4/1/2013', item: 'Binder', units: 60, cost: 4.99, isMakeMoney: false}, * {orderDate: '6/8/2013', item: 'Pen Set', units: 16, cost: 15.99, isMakeMoney: false} * ] * }; * let spreadNS = GC.Spread.Sheets; * let table = sheet.tables.add('tableSales', 0, 0, 4, 2); * let tableColumn1 = new spreadNS.Tables.TableColumn(1); * tableColumn1.name("OrderDate"); * tableColumn1.dataField("orderDate"); * tableColumn1.formatter("d/M/yy"); * let tableColumn2 = new spreadNS.Tables.TableColumn(2); * tableColumn2.name("Item"); * tableColumn2.dataField("item"); * table.bind([tableColumn1, tableColumn2], 'sales', data); * * // to update the name and dataField of tableColumn2 * table.setColumnName(1, 'Cost'); * table.setColumnDataField(1, 'cost'); * ``` */ setColumnDataField(tableColumnIndex: number, dataField: string): GC.Spread.Sheets.Tables.Table; /** * Sets a formula to the table's data range with the specified index. * @param {number} tableColumnIndex The column index of the table. The index is zero-based. * @param {string|null} formula The data range formula. * @returns {GC.Spread.Sheets.Tables.Table} The table. * @example * ```javascript * //This example uses a structured reference formula in the table. * activeSheet.tables.add("Table1", 0, 0, 4, 3, GC.Spread.Sheets.Tables.TableThemes.dark1); * activeSheet.getCell(0,0).text("Value1"); * activeSheet.getCell(0,1).text("Value2"); * activeSheet.getCell(0,2).text("Total"); * activeSheet.getCell(1,0).text("1"); * activeSheet.getCell(2,0).text("2"); * activeSheet.getCell(3,0).text("3"); * activeSheet.getCell(1,1).text("5"); * activeSheet.getCell(2,1).text("5"); * activeSheet.getCell(3,1).text("5"); * activeSheet.tables.findByName("Table1").setColumnDataFormula(2, "=[Value1]*[Value2]"); * activeSheet.tables.findByName("Table1").setColumnDataFormula(2, null); // to clear the column data formula * ``` */ setColumnDataFormula(tableColumnIndex: number, formula: string | null): GC.Spread.Sheets.Tables.Table; /** * Sets the table footer formula with the specified index. * @param {number} tableColumnIndex The column index of the table footer. The index is zero-based. * @param {string} formula The table footer formula. * @returns {GC.Spread.Sheets.Tables.Table} The table. * @example * ```javascript * var sTable = activeSheet.tables.add("table1", 1, 1, 10, 5, GC.Spread.Sheets.Tables.TableThemes.medium2); * sTable.showFooter(true); * //set footer value * sTable.setColumnValue(0, "Total"); * //set footer formula * sTable.setColumnFormula(4, "SUM(F3:F11)"); * ``` */ setColumnFormula(tableColumnIndex: number, formula: string): GC.Spread.Sheets.Tables.Table; /** * Sets the table header text with the specified table index. * @param {number} tableColumnIndex The column index of the table header. The index is zero-based. * @param {string} name The header text. * @returns {GC.Spread.Sheets.Tables.Table} The table. * @example * ```javascript * var sTable = activeSheet.tables.add("table1", 1, 1, 10, 5, GC.Spread.Sheets.Tables.TableThemes.medium2); * sTable.showFooter(true); * sTable.setColumnName(4, "SUM"); * //set footer value * sTable.setColumnValue(0, "Total"); * //set footer formula * sTable.setColumnFormula(4, "SUM(F3:F11)"); * ``` */ setColumnName(tableColumnIndex: number, name: string): GC.Spread.Sheets.Tables.Table; /** * Sets the table footer value with the specified index. * @param {number} tableColumnIndex The column index of the table footer. The index is zero-based. * @param {Object} value The table footer value. * @returns {GC.Spread.Sheets.Tables.Table} The table. * @example * ```javascript * var sTable = activeSheet.tables.add("table1", 1, 1, 10, 5, GC.Spread.Sheets.Tables.TableThemes.medium2); * sTable.showFooter(true); * //set footer value * sTable.setColumnValue(0, "Total"); * //set footer formula * sTable.setColumnFormula(4, "SUM(F3:F11)"); * ``` */ setColumnValue(tableColumnIndex: number, value: Object): GC.Spread.Sheets.Tables.Table; /** * Gets whether table footer is show. Or sets whether show table footer with insert mode or override mode. * @param {boolean} [value] Whether to display a footer. * @param {boolean} [isFooterInserted] The value decides the way to show footer, whether insert total row or just override the next row. Remove footer is same. * @returns {boolean | GC.Spread.Sheets.Tables.Table} If no value is set, returns whether to display a footer; otherwise, returns the table. * @example * ```javascript * var sTable = activeSheet.tables.add("table1", 1, 1, 10, 5, GC.Spread.Sheets.Tables.TableThemes.medium2); * sTable.showFooter(true); * //set footer value * sTable.setColumnValue(0, "Total"); * //set footer formula * sTable.setColumnFormula(4, "SUM(F3:F11)"); * ``` */ showFooter(value?: boolean, isFooterInserted?: boolean): any; /** * Gets or sets whether to display table header. * @param {boolean} [value] Whether to display the table header. * @returns {boolean | GC.Spread.Sheets.Tables.Table} If no value is set, returns whether to display a header; otherwise, returns the table. * @example * ```javascript * var sTable = activeSheet.tables.add("table1", 1, 1, 10, 5, GC.Spread.Sheets.Tables.TableThemes.medium2); * sTable.showHeader(true); * ``` */ showHeader(value?: boolean): any; /** * Gets or sets a value that indicates whether to display the resize handle for table. * @param {boolean} [value] Whether to display the resize handle for table. * @returns {boolean | GC.Spread.Sheets.Tables.Table} If no value is set, returns whether to display the resize handle for table, by default is false; otherwise, returns the table. * @example * ```javascript * var sTable = activeSheet.tables.add("table1", 1, 1, 10, 5, GC.Spread.Sheets.Tables.TableThemes.medium2); * sTable.showResizeHandle(true); * ``` */ showResizeHandle(value?: boolean): any; /** * Gets or sets a style for the table. * @param {string | GC.Spread.Sheets.Tables.TableTheme} value The style or style name for the table. * @returns {GC.Spread.Sheets.Tables.TableTheme | GC.Spread.Sheets.Tables.Table} If no value is set, returns the table style; otherwise, returns the table. */ style(value?: string | GC.Spread.Sheets.Tables.TableTheme): any; /** * Gets or sets a value that indicates whether to use the footer dropdown list for a total row. * @param {boolean} [value] Whether to use the footer dropdown list. * @returns {boolean | GC.Spread.Sheets.Tables.Table} If no value is set, returns whether to use the footer dropdown list for a total row, by default is false; otherwise, returns the table. * @example * ```javascript * var sTable = activeSheet.tables.add("table1", 1, 1, 10, 5, GC.Spread.Sheets.Tables.TableThemes.medium2); * sTable.useFooterDropDownList(true); * ``` */ useFooterDropDownList(value?: boolean): any; } export class TableColumn{ /** * Represents the table column information. * @class * @param {number} id The table column ID. * @param {string} dataField The table column data field. * @param {string} name The table column name. * @param {string} formatter The table column formatter. * @param {GC.Spread.Sheets.CellTypes.Base} cellType The table column cellType. * @param {Function} value The table column value convert function. * @param {string | GC.Spread.Sheets.Style} headerStyle the header style of the table column * @param {string | GC.Spread.Sheets.Style} dataStyle the data style of the table column * @param {string | GC.Spread.Sheets.Style} footerStyle the footer style of the table column */ constructor(id: number, dataField?: string, name?: string, formatter?: string, cellType?: GC.Spread.Sheets.CellTypes.Base, value?: Function, dataStyle?: string | Style, headerStyle?: string | Style, footerStyle?: string | Style); /** * Gets or sets the table column cellType for custom cell type. * @param {GC.Spread.Sheets.CellTypes.Base} [value] The table column cellType. * @returns {GC.Spread.Sheets.CellTypes.Base | GC.Spread.Sheets.Tables.TableColumn} If no value is set, returns the table column cellType; otherwise, returns the table column. * @example * ```javascript * var data = { * sales: [ * { name: 'Pencil', isMakeMoney: true }, * { name: 'Binder', isMakeMoney: true }, * { name: 'Pen Set', isMakeMoney: false } * ] * }; * var table = sheet.tables.add('tableSales', 0, 0, 5, 2); * var tableColumn1 = new GC.Spread.Sheets.Tables.TableColumn(); * tableColumn1.name("name"); * tableColumn1.dataField("name"); * var tableColumn2 = new GC.Spread.Sheets.Tables.TableColumn(); * tableColumn2.name("IsMakeMoney"); * tableColumn2.dataField("isMakeMoney"); * tableColumn2.cellType(new GC.Spread.Sheets.CellTypes.CheckBox()); * table.autoGenerateColumns(false); * table.bind([tableColumn1, tableColumn2], 'sales', data); * ``` */ cellType(value?: GC.Spread.Sheets.CellTypes.Base): any; /** * Gets or sets the table column data field for accessing the table's data source. * @param {string} [value] The table column data field. * @returns {string | GC.Spread.Sheets.Tables.TableColumn} If no value is set, returns the table column data field; otherwise, returns the table column. * @example * ```javascript * var data = { * sales: [ * { name: 'Pencil' }, * { name: 'Binder' }, * { name: 'Pen Set' } * ] * }; * var table = sheet.tables.add('tableSales', 0, 0, 5, 2); * var tableColumn1 = new GC.Spread.Sheets.Tables.TableColumn(); * tableColumn1.name("name"); * tableColumn1.dataField("name"); * table.bind([tableColumn1], 'sales', data); * ``` */ dataField(value?: string): any; /** * Gets or sets the table column dataStyle. * @param {string | GC.Spread.Sheets.Style} [value] The table column dataStyle. * @returns {string | GC.Spread.Sheets.Style | GC.Spread.Sheets.Tables.TableColumn} If no value is set, returns the table column dataStyle; otherwise, returns the table column. */ dataStyle(value?: string | GC.Spread.Sheets.Style): any; /** * Gets or sets the table column footerStyle. * @param {string | GC.Spread.Sheets.Style} [value] The table column footerStyle. * @returns {string | GC.Spread.Sheets.Style | GC.Spread.Sheets.Tables.TableColumn} If no value is set, returns the table column footerStyle; otherwise, returns the table column. */ footerStyle(value?: string | GC.Spread.Sheets.Style): any; /** * Gets or sets the table column formatter for format display value. * @param {string} value The table column formatter. * @returns {string | GC.Spread.Sheets.Tables.TableColumn} If no value is set, returns the table column formatter; otherwise, returns the table column. * @example * ```javascript * var data = { * sales: [ * { name: 'Pencil', orderDate: new Date(2013, 3, 1) }, * { name: 'Binder', orderDate: new Date(2013, 4, 1) }, * { name: 'Pen Set', orderDate: new Date(2013, 6, 8) } * ] * }; * var table = sheet.tables.add('tableSales', 0, 0, 5, 2); * var tableColumn1 = new GC.Spread.Sheets.Tables.TableColumn(); * tableColumn1.name("name"); * tableColumn1.dataField("name"); * var tableColumn2 = new GC.Spread.Sheets.Tables.TableColumn(); * tableColumn2.name("Order Date"); * tableColumn2.dataField("orderDate"); * tableColumn2.formatter("d/M/yy"); * table.autoGenerateColumns(false); * table.bind([tableColumn1, tableColumn2], 'sales', data); * ``` */ formatter(value?: string): any; /** * Gets or sets the table column headerStyle. * @param {string | GC.Spread.Sheets.Style} [value] The table column headerStyle. * @returns {string | GC.Spread.Sheets.Style | GC.Spread.Sheets.Tables.TableColumn} If no value is set, returns the table column headerStyle; otherwise, returns the table column. */ headerStyle(value?: string | GC.Spread.Sheets.Style): any; /** * Gets or sets the table column ID. * @param {number} value The table column ID. * @returns {number | GC.Spread.Sheets.Tables.TableColumn} If no value is set, returns the table column ID; otherwise, returns the table column. * @example * ```javascript * var data = { * sales: [ * { name: 'Pencil' }, * { name: 'Binder' }, * { name: 'Pen Set' } * ] * }; * var table = sheet.tables.add('tableSales', 0, 0, 5, 2); * var tableColumn1 = new GC.Spread.Sheets.Tables.TableColumn(); * tableColumn1.id("name"); * tableColumn1.dataField("name"); * table.bind([tableColumn1], 'sales', data); * ``` */ id(value?: number): any; /** * Gets or sets the table column name for display. * @param {string} value The table column name. * @returns {string | GC.Spread.Sheets.Tables.TableColumn} If no value is set, returns the table column name; otherwise, returns the table column. * @example * ```javascript * var data = { * sales: [ * { name: 'Pencil' }, * { name: 'Binder' }, * { name: 'Pen Set' } * ] * }; * var table = sheet.tables.add('tableSales', 0, 0, 5, 2); * var tableColumn1 = new GC.Spread.Sheets.Tables.TableColumn(); * tableColumn1.name("name"); * tableColumn1.dataField("name"); * table.bind([tableColumn1], 'sales', data); * ``` */ name(value?: string): any; /** * Gets or sets the table column value convert function for display value. * @param {Function} [value] The table column value convert function. * @returns {Function | GC.Spread.Sheets.Tables.TableColumn} If no value is set, returns the table column value convert function; otherwise, returns the table column. * @example * ```javascript * var data = { * sales: [ * { name: 'Pencil', orderDate: new Date(2013, 3, 1), cost: 1.99 }, * { name: 'Binder', orderDate: new Date(2013, 4, 1), cost: 4.99 }, * { name: 'Pen Set', orderDate: new Date(2013, 6, 8), cost: 15.99 } * ] * }; * var table = sheet.tables.add('tableSales', 0, 0, 5, 3); * var tableColumn1 = new GC.Spread.Sheets.Tables.TableColumn(); * tableColumn1.name("name"); * tableColumn1.dataField("name"); * var tableColumn2 = new GC.Spread.Sheets.Tables.TableColumn(); * tableColumn2.name("Order Date"); * tableColumn2.dataField("orderDate"); * tableColumn2.formatter("d/M/yy"); * var tableColumn3 = new GC.Spread.Sheets.Tables.TableColumn(); * tableColumn3.name("Cost"); * tableColumn3.dataField("cost"); * tableColumn3.value(function (item) { * return item['cost'] + '$'; * }); * table.autoGenerateColumns(false); * table.bind([tableColumn1, tableColumn2, tableColumn3], 'sales', data); * ``` */ value(value?: Function): Function; } export class TableManager{ /** * Represents a table manager that can manage all tables in a sheet. * @class * @param {GC.Spread.Sheets.Worksheet} sheet The worksheet. */ constructor(sheet: GC.Spread.Sheets.Worksheet); /** * Adds a range table with a specified size to the sheet. * @param {string} name The table name. * @param {number} row The row index. * @param {number} column The column index. * @param {number} rowCount The row count of the table. * @param {number} columnCount The column count of the table. * @param {string | GC.Spread.Sheets.Tables.TableTheme} style The style of the table. * @param {GC.Spread.Sheets.Tables.ITableOptions} options The initialization options of the table. * @returns {GC.Spread.Sheets.Tables.Table} The new table instance. * @example * ```javascript * //This example adds a table. * activeSheet.tables.add("Table1", 0, 0, 3, 3, 'dark1'); * activeSheet.getCell(0,0).text("Name"); * activeSheet.getCell(0,1).text("Value"); * activeSheet.getCell(0,2).text("T/F"); * activeSheet.getCell(1,0).text("AW"); * activeSheet.getCell(1,1).text("5"); * activeSheet.getCell(1,2).text("T"); * ``` */ add(name?: string, row?: number, column?: number, rowCount?: number, columnCount?: number, style?: string | GC.Spread.Sheets.Tables.TableTheme): GC.Spread.Sheets.Tables.Table; /** * Adds a range table with a specified data source to the sheet. * @param {string} name The table name. * @param {number} row The row index. * @param {number} column The column index. * @param {object | string | GC.Data.Table} dataSource The data source for the table. * @param {GC.Spread.Sheets.Tables.TableTheme} style The style of the table. * @param {GC.Spread.Sheets.Tables.ITableOptions} [options] The initialization options of the table. * @returns {GC.Spread.Sheets.Tables.Table | Promise | undefined} The new table instance. * @example * ```javascript * var source = [ * { LastName: "Freehafer", FirstName: "Nancy", Title: "Sales Representative", Phone: "(123)555-0100"}, * { LastName: "Cencini", FirstName: "Andrew", Title: "Vice President, Sales", Phone: "(123)555-0101"}, * { LastName: "Kotas", FirstName: "Jan", Title: "Sales Representative", Phone: "(123)555-0102"}, * { LastName: "Sergienko", FirstName: "Mariya", Title: "Sales Representative", Phone: "(123)555-0103"}, * ]; * activeSheet.tables.addFromDataSource("Table1", 5, 2, source, GC.Spread.Sheets.Tables.TableThemes.dark1); * ``` */ addFromDataSource(name: string, row: number, column: number, dataSource: Object | string | GC.Data.Table, style: GC.Spread.Sheets.Tables.TableTheme, options?: GC.Spread.Sheets.Tables.ITableOptions): GC.Spread.Sheets.Tables.Table | Promise; /** * Gets all tables of the sheet. * @returns {GC.Spread.Sheets.Tables.Table[]} The GC.Spread.Sheets.Tables.Table array of table instances. The array is never null. */ all(): GC.Spread.Sheets.Tables.Table[]; /** * Converts the table binding a data manager table to a regular table. * @param {GC.Spread.Sheets.Tables.Table|string} table The table instance or the table name. * @returns {GC.Spread.Sheets.Tables.Table} * @example * ```javascript * var table = activeSheet.tables.find(0,0); * activeSheet.tables.convertFromDataTable(table); * ``` */ convertFromDataTable(table: GC.Spread.Sheets.Tables.Table | string): GC.Spread.Sheets.Tables.Table; /** * Convert a regular table to the table creating and binding a data manager table. * @param {GC.Spread.Sheets.Tables.Table|string} table The table instance or the table name. * @returns {GC.Spread.Sheets.Tables.Table} * @example * ```javascript * var table = activeSheet.tables.find(0,0); * activeSheet.tables.convertToDataTable(table); * ``` */ convertToDataTable(table: GC.Spread.Sheets.Tables.Table | string): GC.Spread.Sheets.Tables.Table; /** * Gets the table of the specified cell. * @param {number} row The row index. * @param {number} column The column index. * @returns {GC.Spread.Sheets.Tables.Table} The table instance if the cell belongs to a table; otherwise, null. * @example * ```javascript * //This example uses the find method. * activeSheet.tables.add("Table1", 0, 0, 3, 3, GC.Spread.Sheets.Tables.TableThemes.dark1); * activeSheet.getCell(0,0).text("Name"); * activeSheet.getCell(0,1).text("Value"); * activeSheet.getCell(0,2).text("T/F"); * activeSheet.getCell(1,0).text("AW"); * activeSheet.getCell(1,1).text("5"); * activeSheet.getCell(1,2).text("T"); * //button click * $("#button1").click(function () { * var table = activeSheet.tables.find(0,0); * console.log(table.name()); * }); * ``` */ find(row: number, column: number): GC.Spread.Sheets.Tables.Table; /** * Gets the table with a specified name. * @param {string} name The table name. * @returns {GC.Spread.Sheets.Tables.Table} The table instance if the cell belongs to a table; otherwise, null. * @example * ```javascript * //This example finds the table by name. * var activeSheet = spread.getActiveSheet(); * activeSheet.tables.add("Table1", 0, 0, 3, 3, GC.Spread.Sheets.Tables.TableThemes.dark1); * activeSheet.getCell(0,0).text("Name"); * activeSheet.getCell(0,1).text("Value"); * activeSheet.getCell(0,2).text("T/F"); * activeSheet.getCell(1,0).text("AW"); * activeSheet.getCell(1,1).text("5"); * activeSheet.getCell(1,2).text("T"); * // button click * $("#button1").click(function () { * var table = activeSheet.tables.findByName("Table1"); * console.log(table.name()); * }); * ``` */ findByName(name: string): GC.Spread.Sheets.Tables.Table; /** * Changes the table location. * @param {GC.Spread.Sheets.Tables.Table|string} table The table instance or the table name. * @param {number} row The new row index. * @param {number} column The new column index. * @example * ```javascript * var activeSheet = spread.getActiveSheet(); * activeSheet.tables.add("Table1", 0, 0, 3, 3, GC.Spread.Sheets.Tables.TableThemes.dark1); * activeSheet.getCell(0,0).text("Name"); * activeSheet.getCell(0,1).text("Value"); * activeSheet.getCell(0,2).text("T/F"); * activeSheet.getCell(1,0).text("AW"); * activeSheet.getCell(1,1).text("5"); * activeSheet.getCell(1,2).text("T"); * // button click * $("#button1").click(function () { * var table = activeSheet.tables.findByName("Table1"); * alert(table); * activeSheet.tables.move(table, 3, 3); * }); * ``` */ move(table: GC.Spread.Sheets.Tables.Table|string, row: number, column: number): void; /** * Removes a specified table. * @param {GC.Spread.Sheets.Tables.Table|string} table The table instance or the table name. * @param {GC.Spread.Sheets.Tables.TableRemoveOptions} options Specifies what data is kept when removing the table. * @returns {GC.Spread.Sheets.Tables.Table} * @example * ```javascript * var table = activeSheet.tables.find(0,0); * activeSheet.tables.remove(table, GC.Spread.Sheets.Tables.TableRemoveOptions.keepData); * ``` */ remove(table: GC.Spread.Sheets.Tables.Table|string, options: GC.Spread.Sheets.Tables.TableRemoveOptions): GC.Spread.Sheets.Tables.Table; /** * Changes the table size. * @param {GC.Spread.Sheets.Tables.Table|string} table The table or the table name. * @param {GC.Spread.Sheets.Range} range The new table range. The headers must remain in the same row, and the resulting table range must overlap the original table range. * @example * ```javascript * //This example resizes the table. * activeSheet.tables.add("Table1", 0, 0, 3, 3, GC.Spread.Sheets.Tables.TableThemes.dark1); * activeSheet.getCell(0,0).text("Name"); * activeSheet.getCell(0,1).text("Value"); * activeSheet.getCell(0,2).text("T/F"); * activeSheet.getCell(1,0).text("AW"); * activeSheet.getCell(1,1).text("5"); * activeSheet.getCell(1,2).text("T"); * //button click * $("#button1").click(function () { * var table = activeSheet.tables.find(0,0); * activeSheet.tables.resize(table, new GC.Spread.Sheets.Range(0,0,4,4)); * }); * ``` */ resize(table: GC.Spread.Sheets.Tables.Table | string, range: GC.Spread.Sheets.Range): void; } export class TableStyle{ /** * Represents table style information. * @class * @param {string|GC.Spread.Sheets.IPatternFill|GC.Spread.Sheets.IGradientFill|GC.Spread.Sheets.IGradientPathFill} [backColor] The background color of the table. * @param {string} [foreColor] The foreground color of the table. * @param {string} [font] The font. * @param {GC.Spread.Sheets.LineBorder} [borderLeft] The left border line of the table. * @param {GC.Spread.Sheets.LineBorder} [borderTop] The top border line of the table. * @param {GC.Spread.Sheets.LineBorder} [borderRight] The right border line of the table. * @param {GC.Spread.Sheets.LineBorder} [borderBottom] The bottom border line of the table. * @param {GC.Spread.Sheets.LineBorder} [borderHorizontal] The horizontal border line of the table. * @param {GC.Spread.Sheets.LineBorder} [borderVertical] The vertical border line of the table. * @param {GC.Spread.Sheets.TextDecorationType} [textDecoration] The text decoration of the table. * @param {string} [fontStyle] The font style. * @param {string} [fontWeight] The font weight. * @param {string} [fontSize] The font size. * @param {string} [fontFamily] The font family. * @example * ```javascript * //This example creates a table. * var tableStyle = new GC.Spread.Sheets.Tables.TableTheme(); * var thinBorder = new GC.Spread.Sheets.LineBorder("black", GC.Spread.Sheets.LineStyle.dotted); * tableStyle.wholeTableStyle(new GC.Spread.Sheets.Tables.TableStyle("aliceblue", "green", "bold 10pt arial", thinBorder, thinBorder, thinBorder, thinBorder, thinBorder, thinBorder)); * var tableStyleInfo = new GC.Spread.Sheets.Tables.TableStyle( * "black", * "white", * "bold 11pt arial", * new GC.Spread.Sheets.LineBorder("green", GC.Spread.Sheets.LineStyle.thin), * new GC.Spread.Sheets.LineBorder("red", GC.Spread.Sheets.LineStyle.thick), * new GC.Spread.Sheets.LineBorder("yellow", GC.Spread.Sheets.LineStyle.thin), * new GC.Spread.Sheets.LineBorder("blue", GC.Spread.Sheets.LineStyle.thick), * new GC.Spread.Sheets.LineBorder("pink", GC.Spread.Sheets.LineStyle.thin), * new GC.Spread.Sheets.LineBorder("black", GC.Spread.Sheets.LineStyle.thick), * GC.Spread.Sheets.TextDecorationType.overline | GC.Spread.Sheets.TextDecorationType.underline); * tableStyle.headerRowStyle(tableStyleInfo); * var table = activeSheet.tables.add("table1", 1, 1, 5, 5, tableStyle); * ``` */ constructor(backColor?: string|GC.Spread.Sheets.IPatternFill|GC.Spread.Sheets.IGradientFill|GC.Spread.Sheets.IGradientPathFill, foreColor?: string, font?: string, borderLeft?: GC.Spread.Sheets.LineBorder, borderTop?: GC.Spread.Sheets.LineBorder, borderRight?: GC.Spread.Sheets.LineBorder, borderBottom?: GC.Spread.Sheets.LineBorder, borderHorizontal?: GC.Spread.Sheets.LineBorder, borderVertical?: GC.Spread.Sheets.LineBorder, textDecoration?: GC.Spread.Sheets.TextDecorationType, fontStyle?: string, fontWeight?: string, fontSize?: string, fontFamily?: string); /** * Indicates the background color. * @type {string|GC.Spread.Sheets.IPatternFill|GC.Spread.Sheets.IGradientFill|GC.Spread.Sheets.IGradientPathFill} * @example * ```javascript * //This example creates a table. * var tableStyle = new GC.Spread.Sheets.Tables.TableTheme(); * var thinBorder = new GC.Spread.Sheets.LineBorder("black", GC.Spread.Sheets.LineStyle.dotted); * tableStyle.wholeTableStyle(new GC.Spread.Sheets.Tables.TableStyle("aliceblue", "green", "bold 10pt arial", thinBorder, thinBorder, thinBorder, thinBorder, thinBorder, thinBorder)); * var tStyleInfo = new GC.Spread.Sheets.Tables.TableStyle(); * tStyleInfo.backColor = "green"; * tStyleInfo.foreColor = "red"; * tStyleInfo.borderBottom = new GC.Spread.Sheets.LineBorder("green", GC.Spread.Sheets.LineStyle.thin); * tStyleInfo.borderLeft = new GC.Spread.Sheets.LineBorder("yellow", GC.Spread.Sheets.LineStyle.medium); * tStyleInfo.borderTop = new GC.Spread.Sheets.LineBorder("green", GC.Spread.Sheets.LineStyle.thin); * tStyleInfo.borderRight = new GC.Spread.Sheets.LineBorder("green", GC.Spread.Sheets.LineStyle.thin); * tStyleInfo.font = "bold 11pt arial"; * tableStyle.headerRowStyle(tStyleInfo); * var table = activeSheet.tables.add("table1", 1, 1, 5, 5, tableStyle); * ``` */ backColor: string|GC.Spread.Sheets.IPatternFill|GC.Spread.Sheets.IGradientFill|GC.Spread.Sheets.IGradientPathFill; /** * Indicates the bottom border line of the table. * @type {GC.Spread.Sheets.LineBorder} * @example * ```javascript * //This example creates a table. * var tableStyle = new GC.Spread.Sheets.Tables.TableTheme(); * var thinBorder = new GC.Spread.Sheets.LineBorder("black", GC.Spread.Sheets.LineStyle.dotted); * tableStyle.wholeTableStyle(new GC.Spread.Sheets.Tables.TableStyle("aliceblue", "green", "bold 10pt arial", thinBorder, thinBorder, thinBorder, thinBorder, thinBorder, thinBorder)); * var tStyleInfo = new GC.Spread.Sheets.Tables.TableStyle(); * tStyleInfo.backColor = "green"; * tStyleInfo.foreColor = "red"; * tStyleInfo.borderBottom = new GC.Spread.Sheets.LineBorder("green", GC.Spread.Sheets.LineStyle.thin); * tStyleInfo.borderLeft = new GC.Spread.Sheets.LineBorder("yellow", GC.Spread.Sheets.LineStyle.medium); * tStyleInfo.borderTop = new GC.Spread.Sheets.LineBorder("green", GC.Spread.Sheets.LineStyle.thin); * tStyleInfo.borderRight = new GC.Spread.Sheets.LineBorder("green", GC.Spread.Sheets.LineStyle.thin); * tStyleInfo.font = "bold 11pt arial"; * tableStyle.headerRowStyle(tStyleInfo); * var table = activeSheet.tables.add("table1", 1, 1, 5, 5, tableStyle); * ``` */ borderBottom: GC.Spread.Sheets.LineBorder; /** * Indicates the horizontal border line of the table. * @type {GC.Spread.Sheets.LineBorder} * @example * ```javascript * //This example sets the borderHorizontal property. * var tableStyle = new GC.Spread.Sheets.Tables.TableTheme(); * var thinBorder = new GC.Spread.Sheets.LineBorder("black", GC.Spread.Sheets.LineStyle.dotted); * tableStyle.wholeTableStyle(new GC.Spread.Sheets.Tables.TableStyle("aliceblue", "green", "bold 10pt arial", thinBorder, thinBorder, thinBorder, thinBorder, thinBorder, thinBorder)); * var tStyleInfo = new GC.Spread.Sheets.Tables.TableStyle(); * tStyleInfo.backColor = "green"; * tStyleInfo.foreColor = "red"; * tStyleInfo.borderHorizontal = new GC.Spread.Sheets.LineBorder("red", GC.Spread.Sheets.LineStyle.thin); * tStyleInfo.borderVertical = new GC.Spread.Sheets.LineBorder("blue", GC.Spread.Sheets.LineStyle.thin); * tStyleInfo.font = "bold 11pt arial"; * tableStyle.firstRowStripStyle(tStyleInfo); * var table = activeSheet.tables.add("table1", 1, 1, 5, 5, tableStyle); * ``` */ borderHorizontal: GC.Spread.Sheets.LineBorder; /** * Indicates the left border line of the table. * @type {GC.Spread.Sheets.LineBorder} * @example * ```javascript * //This example creates a table. * var tableStyle = new GC.Spread.Sheets.Tables.TableTheme(); * var thinBorder = new GC.Spread.Sheets.LineBorder("black", GC.Spread.Sheets.LineStyle.dotted); * tableStyle.wholeTableStyle(new GC.Spread.Sheets.Tables.TableStyle("aliceblue", "green", "bold 10pt arial", thinBorder, thinBorder, thinBorder, thinBorder, thinBorder, thinBorder)); * var tStyleInfo = new GC.Spread.Sheets.Tables.TableStyle(); * tStyleInfo.backColor = "green"; * tStyleInfo.foreColor = "red"; * tStyleInfo.borderBottom = new GC.Spread.Sheets.LineBorder("green", GC.Spread.Sheets.LineStyle.thin); * tStyleInfo.borderLeft = new GC.Spread.Sheets.LineBorder("yellow", GC.Spread.Sheets.LineStyle.medium); * tStyleInfo.borderTop = new GC.Spread.Sheets.LineBorder("green", GC.Spread.Sheets.LineStyle.thin); * tStyleInfo.borderRight = new GC.Spread.Sheets.LineBorder("green", GC.Spread.Sheets.LineStyle.thin); * tStyleInfo.font = "bold 11pt arial"; * tableStyle.headerRowStyle(tStyleInfo); * var table = activeSheet.tables.add("table1", 1, 1, 5, 5, tableStyle); * ``` */ borderLeft: GC.Spread.Sheets.LineBorder; /** * Indicates the right border line of the table. * @type {GC.Spread.Sheets.LineBorder} * @example * ```javascript * //This example creates a table. * var tableStyle = new GC.Spread.Sheets.Tables.TableTheme(); * var thinBorder = new GC.Spread.Sheets.LineBorder("black", GC.Spread.Sheets.LineStyle.dotted); * tableStyle.wholeTableStyle(new GC.Spread.Sheets.Tables.TableStyle("aliceblue", "green", "bold 10pt arial", thinBorder, thinBorder, thinBorder, thinBorder, thinBorder, thinBorder)); * var tStyleInfo = new GC.Spread.Sheets.Tables.TableStyle(); * tStyleInfo.backColor = "green"; * tStyleInfo.foreColor = "red"; * tStyleInfo.borderBottom = new GC.Spread.Sheets.LineBorder("green", GC.Spread.Sheets.LineStyle.thin); * tStyleInfo.borderLeft = new GC.Spread.Sheets.LineBorder("yellow", GC.Spread.Sheets.LineStyle.medium); * tStyleInfo.borderTop = new GC.Spread.Sheets.LineBorder("green", GC.Spread.Sheets.LineStyle.thin); * tStyleInfo.borderRight = new GC.Spread.Sheets.LineBorder("green", GC.Spread.Sheets.LineStyle.thin); * tStyleInfo.font = "bold 11pt arial"; * tableStyle.headerRowStyle(tStyleInfo); * var table = activeSheet.tables.add("table1", 1, 1, 5, 5, tableStyle); * ``` */ borderRight: GC.Spread.Sheets.LineBorder; /** * Indicates the top border line of the table. * @type {GC.Spread.Sheets.LineBorder} * @example * ```javascript * //This example creates a table. * var tableStyle = new GC.Spread.Sheets.Tables.TableTheme(); * var thinBorder = new GC.Spread.Sheets.LineBorder("black", GC.Spread.Sheets.LineStyle.dotted); * tableStyle.wholeTableStyle(new GC.Spread.Sheets.Tables.TableStyle("aliceblue", "green", "bold 10pt arial", thinBorder, thinBorder, thinBorder, thinBorder, thinBorder, thinBorder)); * var tStyleInfo = new GC.Spread.Sheets.Tables.TableStyle(); * tStyleInfo.backColor = "green"; * tStyleInfo.foreColor = "red"; * tStyleInfo.borderBottom = new GC.Spread.Sheets.LineBorder("green", GC.Spread.Sheets.LineStyle.thin); * tStyleInfo.borderLeft = new GC.Spread.Sheets.LineBorder("yellow", GC.Spread.Sheets.LineStyle.medium); * tStyleInfo.borderTop = new GC.Spread.Sheets.LineBorder("green", GC.Spread.Sheets.LineStyle.thin); * tStyleInfo.borderRight = new GC.Spread.Sheets.LineBorder("green", GC.Spread.Sheets.LineStyle.thin); * tStyleInfo.font = "bold 11pt arial"; * tableStyle.headerRowStyle(tStyleInfo); * var table = activeSheet.tables.add("table1", 1, 1, 5, 5, tableStyle); * ``` */ borderTop: GC.Spread.Sheets.LineBorder; /** * Indicates the vertical border line of the table. * @type {GC.Spread.Sheets.LineBorder} * @example * ```javascript * //This example sets the borderHorizontal property. * var tableStyle = new GC.Spread.Sheets.Tables.TableTheme(); * var thinBorder = new GC.Spread.Sheets.LineBorder("black", GC.Spread.Sheets.LineStyle.dotted); * tableStyle.wholeTableStyle(new GC.Spread.Sheets.Tables.TableStyle("aliceblue", "green", "bold 10pt arial", thinBorder, thinBorder, thinBorder, thinBorder, thinBorder, thinBorder)); * var tStyleInfo = new GC.Spread.Sheets.Tables.TableStyle(); * tStyleInfo.backColor = "green"; * tStyleInfo.foreColor = "red"; * tStyleInfo.borderHorizontal = new GC.Spread.Sheets.LineBorder("red", GC.Spread.Sheets.LineStyle.thin); * tStyleInfo.borderVertical = new GC.Spread.Sheets.LineBorder("blue", GC.Spread.Sheets.LineStyle.thin); * tStyleInfo.font = "bold 11pt arial"; * tableStyle.firstRowStripStyle(tStyleInfo); * var table = activeSheet.tables.add("table1", 1, 1, 5, 5, tableStyle); * ``` */ borderVertical: GC.Spread.Sheets.LineBorder; /** * Indicates the font. * @type {string} * @example * ```javascript * //This example creates a table. * var tableStyle = new GC.Spread.Sheets.Tables.TableTheme(); * var thinBorder = new GC.Spread.Sheets.LineBorder("black", GC.Spread.Sheets.LineStyle.dotted); * tableStyle.wholeTableStyle(new GC.Spread.Sheets.Tables.TableStyle("aliceblue", "green", "bold 10pt arial", thinBorder, thinBorder, thinBorder, thinBorder, thinBorder, thinBorder)); * var tStyleInfo = new GC.Spread.Sheets.Tables.TableStyle(); * tStyleInfo.backColor = "green"; * tStyleInfo.foreColor = "red"; * tStyleInfo.borderBottom = new GC.Spread.Sheets.LineBorder("green", GC.Spread.Sheets.LineStyle.thin); * tStyleInfo.borderLeft = new GC.Spread.Sheets.LineBorder("yellow", GC.Spread.Sheets.LineStyle.medium); * tStyleInfo.borderTop = new GC.Spread.Sheets.LineBorder("green", GC.Spread.Sheets.LineStyle.thin); * tStyleInfo.borderRight = new GC.Spread.Sheets.LineBorder("green", GC.Spread.Sheets.LineStyle.thin); * tStyleInfo.font = "bold 11pt arial"; * tableStyle.headerRowStyle(tStyleInfo); * var table = activeSheet.tables.add("table1", 1, 1, 5, 5, tableStyle); * ``` */ font: string; /** * Indicates the font family. * @type {string} * @example * ```javascript * //This example sets the fontFamily property. * var spread = new GC.Spread.Sheets.Workbook(document.getElementById('ss')); * var activeSheet = spread.getActiveSheet(); * var tableStyle = new GC.Spread.Sheets.Tables.TableTheme(); * var wholeTableStyle = new GC.Spread.Sheets.Tables.TableStyle(); * wholeTableStyle.fontFamily = "Arial Black"; * tableStyle.wholeTableStyle(wholeTableStyle); * var table = activeSheet.tables.add("table1", 1, 1, 5, 5, tableStyle); * ``` */ fontFamily: string; /** * Indicates the font size. * @type {string} * @example * ```javascript * //This example sets the fontSize property. * var spread = new GC.Spread.Sheets.Workbook(document.getElementById('ss')); * var activeSheet = spread.getActiveSheet(); * var tableStyle = new GC.Spread.Sheets.Tables.TableTheme(); * var wholeTableStyle = new GC.Spread.Sheets.Tables.TableStyle(); * wholeTableStyle.fontSize = "16px"; * tableStyle.wholeTableStyle(wholeTableStyle); * var table = activeSheet.tables.add("table1", 1, 1, 5, 5, tableStyle); * ``` */ fontSize: string; /** * Indicates the font style. * @type {string} * @example * ```javascript * //This example sets the fontStyle property. * var spread = new GC.Spread.Sheets.Workbook(document.getElementById('ss')); * var activeSheet = spread.getActiveSheet(); * var tableStyle = new GC.Spread.Sheets.Tables.TableTheme(); * var wholeTableStyle = new GC.Spread.Sheets.Tables.TableStyle(); * wholeTableStyle.fontStyle = "italic"; * tableStyle.wholeTableStyle(wholeTableStyle); * var table = activeSheet.tables.add("table1", 1, 1, 5, 5, tableStyle); * ``` */ fontStyle: string; /** * Indicates the font weight. * @type {string} * @example * ```javascript * //This example sets the fontWeight property. * var spread = new GC.Spread.Sheets.Workbook(document.getElementById('ss')); * var activeSheet = spread.getActiveSheet(); * var tableStyle = new GC.Spread.Sheets.Tables.TableTheme(); * var wholeTableStyle = new GC.Spread.Sheets.Tables.TableStyle(); * wholeTableStyle.fontWeight = "bold"; * tableStyle.wholeTableStyle(wholeTableStyle); * var table = activeSheet.tables.add("table1", 1, 1, 5, 5, tableStyle); * ``` */ fontWeight: string; /** * Indicates the foreground color. * @type {string} * @example * ```javascript * //This example sets the borderHorizontal property. * var tableStyle = new GC.Spread.Sheets.Tables.TableTheme(); * var thinBorder = new GC.Spread.Sheets.LineBorder("black", GC.Spread.Sheets.LineStyle.dotted); * tableStyle.wholeTableStyle(new GC.Spread.Sheets.Tables.TableStyle("aliceblue", "green", "bold 10pt arial", thinBorder, thinBorder, thinBorder, thinBorder, thinBorder, thinBorder)); * var tStyleInfo = new GC.Spread.Sheets.Tables.TableStyle(); * tStyleInfo.backColor = "green"; * tStyleInfo.foreColor = "red"; * tStyleInfo.borderHorizontal = new GC.Spread.Sheets.LineBorder("red", GC.Spread.Sheets.LineStyle.thin); * tStyleInfo.borderVertical = new GC.Spread.Sheets.LineBorder("blue", GC.Spread.Sheets.LineStyle.thin); * tStyleInfo.font = "bold 11pt arial"; * tableStyle.firstRowStripStyle(tStyleInfo); * var table = activeSheet.tables.add("table1", 1, 1, 5, 5, tableStyle); * ``` */ foreColor: string; /** * Indicates the text decoration of the table. * @type {GC.Spread.Sheets.TextDecorationType} * @example * ```javascript * //This example sets the textDecoration property. * var tableStyle = new GC.Spread.Sheets.Tables.TableTheme(); * var thinBorder = new GC.Spread.Sheets.LineBorder("black", GC.Spread.Sheets.LineStyle.dotted); * tableStyle.wholeTableStyle(new GC.Spread.Sheets.Tables.TableStyle("aliceblue", "green", "bold 10pt arial", thinBorder, thinBorder, thinBorder, thinBorder, thinBorder, thinBorder)); * var tStyleInfo = new GC.Spread.Sheets.Tables.TableStyle(); * tStyleInfo.backColor = "green"; * tStyleInfo.foreColor = "red"; * tStyleInfo.font = "bold 11pt arial"; * tStyleInfo.textDecoration = GC.Spread.Sheets.TextDecorationType.doubleUnderline; * tableStyle.firstRowStripStyle(tStyleInfo); * var table = activeSheet.tables.add("table1", 1, 1, 5, 5, tableStyle); * ``` */ textDecoration: GC.Spread.Sheets.TextDecorationType; } export class TableTheme{ /** * Represents the table style settings. * @class * @example * ```javascript * //This example creates a table. * var tableStyle = new GC.Spread.Sheets.Tables.TableTheme(); * var thinBorder = new GC.Spread.Sheets.LineBorder("black", GC.Spread.Sheets.LineStyle.dotted); * tableStyle.wholeTableStyle(new GC.Spread.Sheets.Tables.TableStyle("aliceblue", "green", "bold 10pt arial", thinBorder, thinBorder, thinBorder, thinBorder, thinBorder, thinBorder)); * var tableStyleInfo = new GC.Spread.Sheets.Tables.TableStyle( * "black", * "white", * "bold 11pt arial", * new GC.Spread.Sheets.LineBorder("green", GC.Spread.Sheets.LineStyle.thin), * new GC.Spread.Sheets.LineBorder("red", GC.Spread.Sheets.LineStyle.thick), * new GC.Spread.Sheets.LineBorder("yellow", GC.Spread.Sheets.LineStyle.thin), * new GC.Spread.Sheets.LineBorder("blue", GC.Spread.Sheets.LineStyle.thick)); * tableStyle.headerRowStyle(tableStyleInfo); * var table = activeSheet.tables.add("table1", 1, 1, 5, 5, tableStyle); * ``` */ constructor(); /** * Gets or sets the strip size of the first alternating column. * @param {number} [value] The size of the first alternating column. * @returns {number | GC.Spread.Sheets.Tables.TableTheme} If no value is set, returns the size of the first alternating column; otherwise, returns the table theme. * @example * ```javascript * //This example creates a table. * var tableStyle = new GC.Spread.Sheets.Tables.TableTheme(); * var thinBorder = new GC.Spread.Sheets.LineBorder("black", GC.Spread.Sheets.LineStyle.dotted); * tableStyle.wholeTableStyle(new GC.Spread.Sheets.Tables.TableStyle("aliceblue", "green", "bold 10pt arial", thinBorder, thinBorder, thinBorder, thinBorder, thinBorder, thinBorder)); * //style * var tStyleInfo = new GC.Spread.Sheets.Tables.TableStyle(); * tStyleInfo.backColor = "green"; * tStyleInfo.foreColor = "red"; * tStyleInfo.borderBottom = new GC.Spread.Sheets.LineBorder("green", GC.Spread.Sheets.LineStyle.thin); * tStyleInfo.borderLeft = new GC.Spread.Sheets.LineBorder("yellow", GC.Spread.Sheets.LineStyle.medium); * tStyleInfo.borderTop = new GC.Spread.Sheets.LineBorder("green", GC.Spread.Sheets.LineStyle.thin); * tStyleInfo.borderRight = new GC.Spread.Sheets.LineBorder("green", GC.Spread.Sheets.LineStyle.thin); * tStyleInfo.font = "bold 11pt arial"; * tableStyle.firstColumnStripSize(2); * tableStyle.firstColumnStripStyle(tStyleInfo); * var sTable = activeSheet.tables.add("Custom", 1, 1, 10, 5, tableStyle); * sTable.bandColumns(true); * ``` */ firstColumnStripSize(value?: number): any; /** * Gets or sets the strip style of the first alternating column. * @param {GC.Spread.Sheets.Tables.TableStyle} [value] The strip style for the first alternating column. * @returns {GC.Spread.Sheets.Tables.TableStyle | GC.Spread.Sheets.Tables.TableTheme} If no value is set, returns the style of the first alternating column; otherwise, returns the table theme. * @example * ```javascript * var tableStyle = new GC.Spread.Sheets.Tables.TableTheme(); * var thinBorder = new GC.Spread.Sheets.LineBorder("black", GC.Spread.Sheets.LineStyle.dotted); * tableStyle.wholeTableStyle(new GC.Spread.Sheets.Tables.TableStyle("aliceblue", "green", "bold 10pt arial", thinBorder, thinBorder, thinBorder, thinBorder, thinBorder, thinBorder)); * var tStyleInfo = new GC.Spread.Sheets.Tables.TableStyle(); * tStyleInfo.backColor = "green"; * tStyleInfo.foreColor = "red"; * tStyleInfo.borderBottom = new GC.Spread.Sheets.LineBorder("green", GC.Spread.Sheets.LineStyle.thin); * tStyleInfo.borderLeft = new GC.Spread.Sheets.LineBorder("yellow", GC.Spread.Sheets.LineStyle.medium); * tStyleInfo.borderTop = new GC.Spread.Sheets.LineBorder("green", GC.Spread.Sheets.LineStyle.thin); * tStyleInfo.borderRight = new GC.Spread.Sheets.LineBorder("green", GC.Spread.Sheets.LineStyle.thin); * tStyleInfo.font = "bold 11pt arial"; * tableStyle.firstColumnStripSize(2); * tableStyle.firstColumnStripStyle(tStyleInfo); * var sTable = activeSheet.tables.add("Custom", 1, 1, 10, 5, tableStyle); * sTable.bandColumns(true); * ``` */ firstColumnStripStyle(value?: GC.Spread.Sheets.Tables.TableStyle): any; /** * Gets or sets the style of the first footer cell, it works when table's highlightFirstColumn is true. * @param {GC.Spread.Sheets.Tables.TableStyle} [value] The style of the first footer cell. * @returns {GC.Spread.Sheets.Tables.TableStyle | GC.Spread.Sheets.Tables.TableTheme} If no value is set, returns the style of the first footer cell; otherwise, returns the table theme. * @example * ```javascript * var tableStyle = new GC.Spread.Sheets.Tables.TableTheme(); * var thinBorder = new GC.Spread.Sheets.LineBorder("black", GC.Spread.Sheets.LineStyle.dotted); * tableStyle.wholeTableStyle(new GC.Spread.Sheets.Tables.TableStyle("aliceblue", "green", "bold 10pt arial", thinBorder, thinBorder, thinBorder, thinBorder, thinBorder, thinBorder)); * var tStyleInfo = new GC.Spread.Sheets.Tables.TableStyle(); * tStyleInfo.backColor = "green"; * tStyleInfo.foreColor = "red"; * tStyleInfo.borderBottom = new GC.Spread.Sheets.LineBorder("green", GC.Spread.Sheets.LineStyle.thin); * tStyleInfo.borderLeft = new GC.Spread.Sheets.LineBorder("yellow", GC.Spread.Sheets.LineStyle.medium); * tStyleInfo.borderTop = new GC.Spread.Sheets.LineBorder("green", GC.Spread.Sheets.LineStyle.thin); * tStyleInfo.borderRight = new GC.Spread.Sheets.LineBorder("green", GC.Spread.Sheets.LineStyle.thin); * tStyleInfo.font = "bold 11pt arial"; * tableStyle.firstFooterCellStyle(tStyleInfo); * var sTable = activeSheet.tables.add("table1", 1, 1, 10, 5, tableStyle); * sTable.showFooter(true); * //set footer value * sTable.setColumnValue(0, "Total"); * sTable.highlightFirstColumn(true); * ``` */ firstFooterCellStyle(value?: GC.Spread.Sheets.Tables.TableStyle): any; /** * Gets or sets the style of the first header cell, it works when table's highlightFirstColumn is true. * @param {GC.Spread.Sheets.Tables.TableStyle} [value] The style of the first header cell. * @returns {GC.Spread.Sheets.Tables.TableStyle | GC.Spread.Sheets.Tables.TableTheme} If no value is set, returns the style of the first header cell; otherwise, returns the table theme. * @example * ```javascript * var tableStyle = new GC.Spread.Sheets.TableStyle(); * var thinBorder = new GC.Spread.Sheets.LineBorder("black", GC.Spread.Sheets.LineStyle.dotted); * tableStyle.wholeTableStyle(new GC.Spread.Sheets.TableStyleInfo("aliceblue", "green", "bold 10pt arial", thinBorder, thinBorder, thinBorder, thinBorder, thinBorder, thinBorder)); * var tStyleInfo = new GC.Spread.Sheets.TableStyleInfo(); * tStyleInfo.backColor = "green"; * tStyleInfo.foreColor = "red"; * tStyleInfo.borderBottom = new GC.Spread.Sheets.LineBorder("green", GC.Spread.Sheets.LineStyle.thin); * tStyleInfo.borderLeft = new GC.Spread.Sheets.LineBorder("yellow", GC.Spread.Sheets.LineStyle.medium); * tStyleInfo.borderTop = new GC.Spread.Sheets.LineBorder("green", GC.Spread.Sheets.LineStyle.thin); * tStyleInfo.borderRight = new GC.Spread.Sheets.LineBorder("green", GC.Spread.Sheets.LineStyle.thin); * tStyleInfo.font = "bold 11pt arial"; * tableStyle.firstHeaderCellStyle(tStyleInfo); * var sTable = activeSheet.addTable("table1", 1, 1, 10, 5, tableStyle); * sTable.highlightFirstColumn(true); * ``` */ firstHeaderCellStyle(value?: GC.Spread.Sheets.Tables.TableStyle): any; /** * Gets or sets the strip size of the first alternating row. * @param {number} [value] The size of the first alternating row. * @returns {number | GC.Spread.Sheets.Tables.TableTheme} If no value is set, returns the size of the first alternating row; otherwise, returns the table theme. * @example * ```javascript * var tableStyle = new GC.Spread.Sheets.Tables.TableTheme(); * var thinBorder = new GC.Spread.Sheets.LineBorder("black", GC.Spread.Sheets.LineStyle.dotted); * tableStyle.wholeTableStyle(new GC.Spread.Sheets.Tables.TableStyle("aliceblue", "green", "bold 10pt arial", thinBorder, thinBorder, thinBorder, thinBorder, thinBorder, thinBorder)); * var tStyleInfo = new GC.Spread.Sheets.Tables.TableStyle(); * tStyleInfo.backColor = "green"; * tStyleInfo.foreColor = "red"; * tStyleInfo.borderBottom = new GC.Spread.Sheets.LineBorder("green", GC.Spread.Sheets.LineStyle.thin); * tStyleInfo.borderLeft = new GC.Spread.Sheets.LineBorder("yellow", GC.Spread.Sheets.LineStyle.medium); * tStyleInfo.borderTop = new GC.Spread.Sheets.LineBorder("green", GC.Spread.Sheets.LineStyle.thin); * tStyleInfo.borderRight = new GC.Spread.Sheets.LineBorder("green", GC.Spread.Sheets.LineStyle.thin); * tStyleInfo.font = "bold 11pt arial"; * tableStyle.firstRowStripSize(2); * tableStyle.firstRowStripStyle(tStyleInfo); * activeSheet.tables.add("Custom", 1, 1, 10, 5, tableStyle); * ``` */ firstRowStripSize(value?: number): any; /** * Gets or sets the strip style of the first alternating row. * @param {GC.Spread.Sheets.Tables.TableStyle} [value] The strip style for first alternating row. * @returns {GC.Spread.Sheets.Tables.TableStyle | GC.Spread.Sheets.Tables.TableTheme} If no value is set, returns the first alternating row style; otherwise, returns the table theme. * @example * ```javascript * var tableStyle = new GC.Spread.Sheets.Tables.TableTheme(); * var thinBorder = new GC.Spread.Sheets.LineBorder("black", GC.Spread.Sheets.LineStyle.dotted); * tableStyle.wholeTableStyle(new GC.Spread.Sheets.Tables.TableStyle("aliceblue", "green", "bold 10pt arial", thinBorder, thinBorder, thinBorder, thinBorder, thinBorder, thinBorder)); * var tStyleInfo = new GC.Spread.Sheets.Tables.TableStyle(); * tStyleInfo.backColor = "green"; * tStyleInfo.foreColor = "red"; * tStyleInfo.borderBottom = new GC.Spread.Sheets.LineBorder("green", GC.Spread.Sheets.LineStyle.thin); * tStyleInfo.borderLeft = new GC.Spread.Sheets.LineBorder("yellow", GC.Spread.Sheets.LineStyle.medium); * tStyleInfo.borderTop = new GC.Spread.Sheets.LineBorder("green", GC.Spread.Sheets.LineStyle.thin); * tStyleInfo.borderRight = new GC.Spread.Sheets.LineBorder("green", GC.Spread.Sheets.LineStyle.thin); * tStyleInfo.font = "bold 11pt arial"; * tableStyle.firstRowStripSize(2); * tableStyle.firstRowStripStyle(tStyleInfo); * activeSheet.tables.add("Custom", 1, 1, 10, 5, tableStyle); * ``` */ firstRowStripStyle(value?: GC.Spread.Sheets.Tables.TableStyle): any; /** * Gets or sets the style of the footer row area. * @param {GC.Spread.Sheets.Tables.TableStyle} [value] The style for the footer row area. * @returns {GC.Spread.Sheets.Tables.TableStyle | GC.Spread.Sheets.Tables.TableTheme} If no value is set, returns the style of the footer area; otherwise, returns the table theme. * @example * ```javascript * var tableStyle = new GC.Spread.Sheets.Tables.TableTheme(); * var thinBorder = new GC.Spread.Sheets.LineBorder("black", GC.Spread.Sheets.LineStyle.dotted); * tableStyle.wholeTableStyle(new GC.Spread.Sheets.Tables.TableStyle("aliceblue", "green", "bold 10pt arial", thinBorder, thinBorder, thinBorder, thinBorder, thinBorder, thinBorder)); * var tStyleInfo = new GC.Spread.Sheets.Tables.TableStyle(); * tStyleInfo.backColor = "green"; * tStyleInfo.foreColor = "red"; * tStyleInfo.borderBottom = new GC.Spread.Sheets.LineBorder("green", GC.Spread.Sheets.LineStyle.thin); * tStyleInfo.borderLeft = new GC.Spread.Sheets.LineBorder("yellow", GC.Spread.Sheets.LineStyle.medium); * tStyleInfo.borderTop = new GC.Spread.Sheets.LineBorder("green", GC.Spread.Sheets.LineStyle.thin); * tStyleInfo.borderRight = new GC.Spread.Sheets.LineBorder("green", GC.Spread.Sheets.LineStyle.thin); * tStyleInfo.font = "bold 11pt arial"; * tableStyle.footerRowStyle(tStyleInfo); * var sTable = activeSheet.tables.add("Custom", 1, 1, 10, 5, tableStyle); * sTable.showFooter(true); * //set footer value * sTable.setColumnValue(0, "Total"); * ``` */ footerRowStyle(value?: GC.Spread.Sheets.Tables.TableStyle): any; /** * Loads the object state from the specified JSON string. * @param {Object} data The table theme data from deserialization. * @example * ```javascript * //This example uses the fromJSON method. * const light1 = GC.Spread.Sheets.Tables.TableThemes.light1; * //export * const jsonStr = JSON.stringify(light1.toJSON()); * //import * const newTheme = new GC.Spread.Sheets.Tables.TableTheme(); * newTheme.fromJSON(JSON.parse(jsonStr)); * newTheme.name('custom1'); * alert(jsonStr); * ``` */ fromJSON(data: Object): void; /** * Gets or sets the style of the header row area. * @param {GC.Spread.Sheets.Tables.TableStyle} [value] The style for the header row area. * @returns {GC.Spread.Sheets.Tables.TableStyle | GC.Spread.Sheets.Tables.TableTheme} If no value is set, returns the style of the header area; otherwise, returns the table theme. * @example * ```javascript * var tableStyle = new GC.Spread.Sheets.Tables.TableTheme(); * tableStyle.wholeTableStyle(new GC.Spread.Sheets.Tables.TableStyle("aliceblue")); * var tableStyleInfo = new GC.Spread.Sheets.Tables.TableStyle( * "black", * "white", * "bold 11pt arial", * new GC.Spread.Sheets.LineBorder("green", GC.Spread.Sheets.LineStyle.thin), * new GC.Spread.Sheets.LineBorder("red", GC.Spread.Sheets.LineStyle.thick), * new GC.Spread.Sheets.LineBorder("yellow", GC.Spread.Sheets.LineStyle.thin), * new GC.Spread.Sheets.LineBorder("blue", GC.Spread.Sheets.LineStyle.thick)); * tableStyle.headerRowStyle(tableStyleInfo); * var table = activeSheet.tables.add("table1", 1, 1, 5, 5, tableStyle); * ``` */ headerRowStyle(value?: GC.Spread.Sheets.Tables.TableStyle): any; /** * Gets or sets the style of the first column, it works when table's highlightFirstColumn is true. * @param {GC.Spread.Sheets.Tables.TableStyle} [value] The style of the first column. * @returns {GC.Spread.Sheets.Tables.TableStyle | GC.Spread.Sheets.Tables.TableTheme} If no value is set, returns the style of the first column; otherwise, returns the table theme. * @example * ```javascript * var tableStyle = new GC.Spread.Sheets.Tables.TableTheme(); * var thinBorder = new GC.Spread.Sheets.LineBorder("black", GC.Spread.Sheets.LineStyle.dotted); * tableStyle.wholeTableStyle(new GC.Spread.Sheets.Tables.TableStyle("aliceblue", "green", "bold 10pt arial", thinBorder, thinBorder, thinBorder, thinBorder, thinBorder, thinBorder)); * var tStyleInfo = new GC.Spread.Sheets.Tables.TableStyle(); * tStyleInfo.backColor = "green"; * tStyleInfo.foreColor = "red"; * tStyleInfo.borderBottom = new GC.Spread.Sheets.LineBorder("green", GC.Spread.Sheets.LineStyle.thin); * tStyleInfo.borderLeft = new GC.Spread.Sheets.LineBorder("yellow", GC.Spread.Sheets.LineStyle.medium); * tStyleInfo.borderTop = new GC.Spread.Sheets.LineBorder("green", GC.Spread.Sheets.LineStyle.thin); * tStyleInfo.borderRight = new GC.Spread.Sheets.LineBorder("green", GC.Spread.Sheets.LineStyle.thin); * tStyleInfo.font = "bold 11pt arial"; * tableStyle.highlightFirstColumnStyle(tStyleInfo); * var sTable = activeSheet.tables.add("Custom", 1, 1, 10, 5, tableStyle); * sTable.highlightFirstColumn(true); * ``` */ highlightFirstColumnStyle(value?: GC.Spread.Sheets.Tables.TableStyle): any; /** * Gets or sets the style of the last column, it works when table's highlightLastColumn is true. * @param {GC.Spread.Sheets.Tables.TableStyle} [value] The style of the last column. * @returns {GC.Spread.Sheets.Tables.TableStyle | GC.Spread.Sheets.Tables.TableTheme} If no value is set, returns the style of the last column; otherwise, returns the table theme. * @example * ```javascript * var tableStyle = new GC.Spread.Sheets.Tables.TableTheme(); * var thinBorder = new GC.Spread.Sheets.LineBorder("black", GC.Spread.Sheets.LineStyle.dotted); * tableStyle.wholeTableStyle(new GC.Spread.Sheets.Tables.TableStyle("aliceblue", "green", "bold 10pt arial", thinBorder, thinBorder, thinBorder, thinBorder, thinBorder, thinBorder)); * //style * var tStyleInfo = new GC.Spread.Sheets.Tables.TableStyle(); * tStyleInfo.backColor = "green"; * tStyleInfo.foreColor = "red"; * tStyleInfo.borderBottom = new GC.Spread.Sheets.LineBorder("green", GC.Spread.Sheets.LineStyle.thin); * tStyleInfo.borderLeft = new GC.Spread.Sheets.LineBorder("yellow", GC.Spread.Sheets.LineStyle.medium); * tStyleInfo.borderTop = new GC.Spread.Sheets.LineBorder("green", GC.Spread.Sheets.LineStyle.thin); * tStyleInfo.borderRight = new GC.Spread.Sheets.LineBorder("green", GC.Spread.Sheets.LineStyle.thin); * tStyleInfo.font = "bold 11pt arial"; * tableStyle.highlightLastColumnStyle(tStyleInfo); * var sTable = activeSheet.tables.add("Custom", 1, 1, 10, 5, tableStyle); * sTable.highlightLastColumn(true); * ``` */ highlightLastColumnStyle(value?: GC.Spread.Sheets.Tables.TableStyle): any; /** * Gets or sets the style of the last footer cell, it works when table's highlightLastColumn is true. * @param {GC.Spread.Sheets.Tables.TableStyle} [value] The style of the last footer cell. * @returns {GC.Spread.Sheets.Tables.TableStyle | GC.Spread.Sheets.Tables.TableTheme} If no value is set, returns the style of the last footer cell; otherwise, returns the table theme. * @example * ```javascript * var tableStyle = new GC.Spread.Sheets.Tables.TableTheme(); * var thinBorder = new GC.Spread.Sheets.LineBorder("black", GC.Spread.Sheets.LineStyle.dotted); * tableStyle.wholeTableStyle(new GC.Spread.Sheets.Tables.TableStyle("aliceblue", "green", "bold 10pt arial", thinBorder, thinBorder, thinBorder, thinBorder, thinBorder, thinBorder)); * var tStyleInfo = new GC.Spread.Sheets.Tables.TableStyle(); * tStyleInfo.backColor = "green"; * tStyleInfo.foreColor = "red"; * tStyleInfo.borderBottom = new GC.Spread.Sheets.LineBorder("green", GC.Spread.Sheets.LineStyle.thin); * tStyleInfo.borderLeft = new GC.Spread.Sheets.LineBorder("yellow", GC.Spread.Sheets.LineStyle.medium); * tStyleInfo.borderTop = new GC.Spread.Sheets.LineBorder("green", GC.Spread.Sheets.LineStyle.thin); * tStyleInfo.borderRight = new GC.Spread.Sheets.LineBorder("green", GC.Spread.Sheets.LineStyle.thin); * tStyleInfo.font = "bold 11pt arial"; * tableStyle.lastFooterCellStyle(tStyleInfo); * var sTable = activeSheet.tables.add("table1", 1, 1, 10, 5, tableStyle); * sTable.showFooter(true); * //set footer formula * sTable.setColumnFormula(4, "SUM(F3:F11)"); * sTable.highlightLastColumn(true); * ``` */ lastFooterCellStyle(value?: GC.Spread.Sheets.Tables.TableStyle): any; /** * Gets or sets the style of the last header cell, it works when table's highlightLastColumn is true. * @param {GC.Spread.Sheets.Tables.TableStyle} [value] The style of the last header cell. * @returns {GC.Spread.Sheets.Tables.TableStyle | GC.Spread.Sheets.Tables.TableTheme} If no value is set, returns the style of the last header cell; otherwise, returns the table theme. * @example * ```javascript * var tableStyle = new GC.Spread.Sheets.TableStyle(); * var thinBorder = new GC.Spread.Sheets.LineBorder("black", GC.Spread.Sheets.LineStyle.dotted); * tableStyle.wholeTableStyle(new GC.Spread.Sheets.TableStyleInfo("aliceblue", "green", "bold 10pt arial", thinBorder, thinBorder, thinBorder, thinBorder, thinBorder, thinBorder)); * var tStyleInfo = new GC.Spread.Sheets.TableStyleInfo(); * tStyleInfo.backColor = "green"; * tStyleInfo.foreColor = "red"; * tStyleInfo.borderBottom = new GC.Spread.Sheets.LineBorder("green", GC.Spread.Sheets.LineStyle.thin); * tStyleInfo.borderLeft = new GC.Spread.Sheets.LineBorder("yellow", GC.Spread.Sheets.LineStyle.medium); * tStyleInfo.borderTop = new GC.Spread.Sheets.LineBorder("green", GC.Spread.Sheets.LineStyle.thin); * tStyleInfo.borderRight = new GC.Spread.Sheets.LineBorder("green", GC.Spread.Sheets.LineStyle.thin); * tStyleInfo.font = "bold 11pt arial"; * tableStyle.lastHeaderCellStyle(tStyleInfo); * var sTable = activeSheet.addTable("table1", 1, 1, 10, 5, tableStyle); * sTable.highlightLastColumn(true); * ``` */ lastHeaderCellStyle(value?: GC.Spread.Sheets.Tables.TableStyle): any; /** * Gets or sets the name of the table style. * @param {string} [value] The name of the table style. * @returns {string | GC.Spread.Sheets.Tables.TableTheme} If no value is set, returns the name of the style; otherwise, returns the table theme. * @example * ```javascript * var tableStyle = new GC.Spread.Sheets.TableStyle(); * var thinBorder = new GC.Spread.Sheets.LineBorder("black", GC.Spread.Sheets.LineStyle.dotted); * tableStyle.wholeTableStyle(new GC.Spread.Sheets.TableStyleInfo("aliceblue", "green", "bold 10pt arial", thinBorder, thinBorder, thinBorder, thinBorder, thinBorder, thinBorder)); * var tStyleInfo = new GC.Spread.Sheets.TableStyleInfo(); * tStyleInfo.backColor = "green"; * tStyleInfo.foreColor = "red"; * tStyleInfo.borderBottom = new GC.Spread.Sheets.LineBorder("green", GC.Spread.Sheets.LineStyle.thin); * tStyleInfo.borderLeft = new GC.Spread.Sheets.LineBorder("yellow", GC.Spread.Sheets.LineStyle.medium); * tStyleInfo.borderTop = new GC.Spread.Sheets.LineBorder("green", GC.Spread.Sheets.LineStyle.thin); * tStyleInfo.borderRight = new GC.Spread.Sheets.LineBorder("green", GC.Spread.Sheets.LineStyle.thin); * tStyleInfo.font = "bold 11pt arial"; * tableStyle.name("tstyle"); * tableStyle.firstColumnStripSize(2); * tableStyle.firstColumnStripStyle(tStyleInfo); * var sTable = activeSheet.addTable("Custom", 1, 1, 10, 5, tableStyle); * sTable.bandColumns(true); * ``` */ name(value?: string): any; /** * Gets or sets the strip size of the second alternating column. * @param {number} value The size of the second alternating column. * @returns {number | GC.Spread.Sheets.Tables.TableTheme} If no value is set, returns the size of the second alternating column; otherwise, returns the table theme. * @example * ```javascript * var tableStyle = new GC.Spread.Sheets.Tables.TableTheme(); * var thinBorder = new GC.Spread.Sheets.LineBorder("black", GC.Spread.Sheets.LineStyle.dotted); * tableStyle.wholeTableStyle(new GC.Spread.Sheets.Tables.TableStyle("aliceblue", "green", "bold 10pt arial", thinBorder, thinBorder, thinBorder, thinBorder, thinBorder, thinBorder)); * var tStyleInfo = new GC.Spread.Sheets.Tables.TableStyle(); * tStyleInfo.backColor = "green"; * tStyleInfo.foreColor = "red"; * tStyleInfo.borderBottom = new GC.Spread.Sheets.LineBorder("green", GC.Spread.Sheets.LineStyle.thin); * tStyleInfo.borderLeft = new GC.Spread.Sheets.LineBorder("yellow", GC.Spread.Sheets.LineStyle.medium); * tStyleInfo.borderTop = new GC.Spread.Sheets.LineBorder("green", GC.Spread.Sheets.LineStyle.thin); * tStyleInfo.borderRight = new GC.Spread.Sheets.LineBorder("green", GC.Spread.Sheets.LineStyle.thin); * tStyleInfo.font = "bold 11pt arial"; * tableStyle.secondColumnStripSize(2); * tableStyle.secondColumnStripStyle(tStyleInfo); * var sTable = activeSheet.tables.add("Custom", 1, 1, 10, 5, tableStyle); * sTable.bandColumns(true); * ``` */ secondColumnStripSize(value?: number): any; /** * Gets or sets the strip style of the second alternating column. * @param {GC.Spread.Sheets.Tables.TableStyle} [value] The strip style of the second alternating column. * @returns {GC.Spread.Sheets.Tables.TableStyle | GC.Spread.Sheets.Tables.TableTheme} If no value is set, returns the style of the second alternating column; otherwise, returns the table theme. * @example * ```javascript * var tableStyle = new GC.Spread.Sheets.Tables.TableTheme(); * var thinBorder = new GC.Spread.Sheets.LineBorder("black", GC.Spread.Sheets.LineStyle.dotted); * tableStyle.wholeTableStyle(new GC.Spread.Sheets.Tables.TableStyle("aliceblue", "green", "bold 10pt arial", thinBorder, thinBorder, thinBorder, thinBorder, thinBorder, thinBorder)); * var tStyleInfo = new GC.Spread.Sheets.Tables.TableStyle(); * tStyleInfo.backColor = "green"; * tStyleInfo.foreColor = "red"; * tStyleInfo.borderBottom = new GC.Spread.Sheets.LineBorder("green", GC.Spread.Sheets.LineStyle.thin); * tStyleInfo.borderLeft = new GC.Spread.Sheets.LineBorder("yellow", GC.Spread.Sheets.LineStyle.medium); * tStyleInfo.borderTop = new GC.Spread.Sheets.LineBorder("green", GC.Spread.Sheets.LineStyle.thin); * tStyleInfo.borderRight = new GC.Spread.Sheets.LineBorder("green", GC.Spread.Sheets.LineStyle.thin); * tStyleInfo.font = "bold 11pt arial"; * tableStyle.secondColumnStripSize(2); * tableStyle.secondColumnStripStyle(tStyleInfo); * var sTable = activeSheet.tables.add("Custom", 1, 1, 10, 5, tableStyle); * sTable.bandColumns(true); * ``` */ secondColumnStripStyle(value?: GC.Spread.Sheets.Tables.TableStyle): any; /** * Gets or sets the strip size of the second alternating row. * @param {number} [value] The size of the second alternating row. * @returns {number | GC.Spread.Sheets.Tables.TableTheme} If no value is set, returns the size of the second alternating row; otherwise, returns the table theme. * @example * ```javascript * var tableStyle = new GC.Spread.Sheets.Tables.TableTheme(); * var thinBorder = new GC.Spread.Sheets.LineBorder("black", GC.Spread.Sheets.LineStyle.dotted); * tableStyle.wholeTableStyle(new GC.Spread.Sheets.Tables.TableStyle("aliceblue", "green", "bold 10pt arial", thinBorder, thinBorder, thinBorder, thinBorder, thinBorder, thinBorder)); * var tStyleInfo = new GC.Spread.Sheets.Tables.TableStyle(); * tStyleInfo.backColor = "green"; * tStyleInfo.foreColor = "red"; * tStyleInfo.borderBottom = new GC.Spread.Sheets.LineBorder("green", GC.Spread.Sheets.LineStyle.thin); * tStyleInfo.borderLeft = new GC.Spread.Sheets.LineBorder("yellow", GC.Spread.Sheets.LineStyle.medium); * tStyleInfo.borderTop = new GC.Spread.Sheets.LineBorder("green", GC.Spread.Sheets.LineStyle.thin); * tStyleInfo.borderRight = new GC.Spread.Sheets.LineBorder("green", GC.Spread.Sheets.LineStyle.thin); * tStyleInfo.font = "bold 11pt arial"; * tableStyle.secondRowStripSize(2); * tableStyle.secondRowStripStyle(tStyleInfo); * activeSheet.tables.add("Custom", 1, 1, 10, 5, tableStyle); * ``` */ secondRowStripSize(value?: number): any; /** * Gets or sets the strip style of the second alternating row. * @param {GC.Spread.Sheets.Tables.TableStyle} [value] The strip style for the second alternating row. * @returns {GC.Spread.Sheets.Tables.TableStyle | GC.Spread.Sheets.Tables.TableTheme} If no value is set, returns the second alternating row style; otherwise, returns the table theme. * @example * ```javascript * var tableStyle = new GC.Spread.Sheets.Tables.TableTheme(); * var thinBorder = new GC.Spread.Sheets.LineBorder("black", GC.Spread.Sheets.LineStyle.dotted); * tableStyle.wholeTableStyle(new GC.Spread.Sheets.Tables.TableStyle("aliceblue", "green", "bold 10pt arial", thinBorder, thinBorder, thinBorder, thinBorder, thinBorder, thinBorder)); * var tStyleInfo = new GC.Spread.Sheets.Tables.TableStyle(); * tStyleInfo.backColor = "green"; * tStyleInfo.foreColor = "red"; * tStyleInfo.borderBottom = new GC.Spread.Sheets.LineBorder("green", GC.Spread.Sheets.LineStyle.thin); * tStyleInfo.borderLeft = new GC.Spread.Sheets.LineBorder("yellow", GC.Spread.Sheets.LineStyle.medium); * tStyleInfo.borderTop = new GC.Spread.Sheets.LineBorder("green", GC.Spread.Sheets.LineStyle.thin); * tStyleInfo.borderRight = new GC.Spread.Sheets.LineBorder("green", GC.Spread.Sheets.LineStyle.thin); * tStyleInfo.font = "bold 11pt arial"; * tableStyle.secondRowStripSize(2); * tableStyle.secondRowStripStyle(tStyleInfo); * activeSheet.tables.add("Custom", 1, 1, 10, 5, tableStyle); * ``` */ secondRowStripStyle(value?: GC.Spread.Sheets.Tables.TableStyle): any; /** * Saves the object state to a JSON string. * @returns {Object} The table theme data. * @example * ```javascript * //This example uses the toJSON method. * const light1 = GC.Spread.Sheets.Tables.TableThemes.light1; * //export * const jsonStr = JSON.stringify(light1.toJSON()); * //import * const newTheme = new GC.Spread.Sheets.Tables.TableTheme(); * newTheme.fromJSON(JSON.parse(jsonStr)); * newTheme.name('custom1'); * alert(jsonStr); * ``` */ toJSON(): Object; /** * Gets or sets the style of the whole table area. * @param {GC.Spread.Sheets.Tables.TableStyle} [value] The style for the whole table area. * @returns {GC.Spread.Sheets.Tables.TableStyle | GC.Spread.Sheets.Tables.TableTheme} If no value is set, returns the style of whole table; otherwise, returns the table theme. * @example * ```javascript * var tableStyle = new GC.Spread.Sheets.Tables.TableTheme(); * var thinBorder = new GC.Spread.Sheets.LineBorder("black", GC.Spread.Sheets.LineStyle.dotted); * tableStyle.wholeTableStyle(new GC.Spread.Sheets.Tables.TableStyle("aliceblue", "green", "bold 10pt arial", thinBorder, thinBorder, thinBorder, thinBorder, thinBorder, thinBorder)); * var table = activeSheet.tables.add("table1", 1, 1, 5, 5, tableStyle); * ``` */ wholeTableStyle(value?: GC.Spread.Sheets.Tables.TableStyle): any; } export class TableThemes{ /** * Represents a built-in table theme collection. * @class */ constructor(); /** * Gets the dark1 style. * @returns {GC.Spread.Sheets.Tables.TableTheme} * @example * ```javascript * var table = sheet.tables.add("table1", 1, 1, 10, 5, GC.Spread.Sheets.Tables.TableThemes.dark1); * ``` */ static dark1: GC.Spread.Sheets.Tables.TableTheme; /** * Gets the dark10 style. * @returns {GC.Spread.Sheets.Tables.TableTheme} * @example * ```javascript * var table = sheet.tables.add("table1", 1, 1, 10, 5, GC.Spread.Sheets.Tables.TableThemes.dark10); * ``` */ static dark10: GC.Spread.Sheets.Tables.TableTheme; /** * Gets the dark11 style. * @returns {GC.Spread.Sheets.Tables.TableTheme} * @example * ```javascript * var table = sheet.tables.add("table1", 1, 1, 10, 5, GC.Spread.Sheets.Tables.TableThemes.dark11); * ``` */ static dark11: GC.Spread.Sheets.Tables.TableTheme; /** * Gets the dark2 style. * @returns {GC.Spread.Sheets.Tables.TableTheme} * @example * ```javascript * var table = sheet.tables.add("table1", 1, 1, 10, 5, GC.Spread.Sheets.Tables.TableThemes.dark2); * ``` */ static dark2: GC.Spread.Sheets.Tables.TableTheme; /** * Gets the dark3 style. * @returns {GC.Spread.Sheets.Tables.TableTheme} * @example * ```javascript * var table = sheet.tables.add("table1", 1, 1, 10, 5, GC.Spread.Sheets.Tables.TableThemes.dark3); * ``` */ static dark3: GC.Spread.Sheets.Tables.TableTheme; /** * Gets the dark4 style. * @returns {GC.Spread.Sheets.Tables.TableTheme} * @example * ```javascript * var table = sheet.tables.add("table1", 1, 1, 10, 5, GC.Spread.Sheets.Tables.TableThemes.dark4); * ``` */ static dark4: GC.Spread.Sheets.Tables.TableTheme; /** * Gets the dark5 style. * @returns {GC.Spread.Sheets.Tables.TableTheme} * @example * ```javascript * var table = sheet.tables.add("table1", 1, 1, 10, 5, GC.Spread.Sheets.Tables.TableThemes.dark5); * ``` */ static dark5: GC.Spread.Sheets.Tables.TableTheme; /** * Gets the dark6 style. * @returns {GC.Spread.Sheets.Tables.TableTheme} * @example * ```javascript * var table = sheet.tables.add("table1", 1, 1, 10, 5, GC.Spread.Sheets.Tables.TableThemes.dark6); * ``` */ static dark6: GC.Spread.Sheets.Tables.TableTheme; /** * Gets the dark7 style. * @returns {GC.Spread.Sheets.Tables.TableTheme} * @example * ```javascript * var table = sheet.tables.add("table1", 1, 1, 10, 5, GC.Spread.Sheets.Tables.TableThemes.dark7); * ``` */ static dark7: GC.Spread.Sheets.Tables.TableTheme; /** * Gets the dark8 style. * @returns {GC.Spread.Sheets.Tables.TableTheme} * @example * ```javascript * var table = sheet.tables.add("table1", 1, 1, 10, 5, GC.Spread.Sheets.Tables.TableThemes.dark8); * ``` */ static dark8: GC.Spread.Sheets.Tables.TableTheme; /** * Gets the dark9 style. * @returns {GC.Spread.Sheets.Tables.TableTheme} * @example * ```javascript * var table = sheet.tables.add("table1", 1, 1, 10, 5, GC.Spread.Sheets.Tables.TableThemes.dark9); * ``` */ static dark9: GC.Spread.Sheets.Tables.TableTheme; /** * Gets the light1 style. * @returns {GC.Spread.Sheets.Tables.TableTheme} * @example * ```javascript * var table = sheet.tables.add("table1", 1, 1, 10, 5, GC.Spread.Sheets.Tables.TableThemes.light1); * ``` */ static light1: GC.Spread.Sheets.Tables.TableTheme; /** * Gets the light10 style. * @returns {GC.Spread.Sheets.Tables.TableTheme} * @example * ```javascript * var table = sheet.tables.add("table1", 1, 1, 10, 5, GC.Spread.Sheets.Tables.TableThemes.light10); * ``` */ static light10: GC.Spread.Sheets.Tables.TableTheme; /** * Gets the light11 style. * @returns {GC.Spread.Sheets.Tables.TableTheme} * @example * ```javascript * var table = sheet.tables.add("table1", 1, 1, 10, 5, GC.Spread.Sheets.Tables.TableThemes.light11); * ``` */ static light11: GC.Spread.Sheets.Tables.TableTheme; /** * Gets the light12 style. * @returns {GC.Spread.Sheets.Tables.TableTheme} * @example * ```javascript * var table = sheet.tables.add("table1", 1, 1, 10, 5, GC.Spread.Sheets.Tables.TableThemes.light12); * ``` */ static light12: GC.Spread.Sheets.Tables.TableTheme; /** * Gets the light13 style. * @returns {GC.Spread.Sheets.Tables.TableTheme} * @example * ```javascript * var table = sheet.tables.add("table1", 1, 1, 10, 5, GC.Spread.Sheets.Tables.TableThemes.light13); * ``` */ static light13: GC.Spread.Sheets.Tables.TableTheme; /** * Gets the light14 style. * @returns {GC.Spread.Sheets.Tables.TableTheme} * @example * ```javascript * var table = sheet.tables.add("table1", 1, 1, 10, 5, GC.Spread.Sheets.Tables.TableThemes.light14); * ``` */ static light14: GC.Spread.Sheets.Tables.TableTheme; /** * Gets the light15 style. * @returns {GC.Spread.Sheets.Tables.TableTheme} * @example * ```javascript * var table = sheet.tables.add("table1", 1, 1, 10, 5, GC.Spread.Sheets.Tables.TableThemes.light15); * ``` */ static light15: GC.Spread.Sheets.Tables.TableTheme; /** * Gets the light16 style. * @returns {GC.Spread.Sheets.Tables.TableTheme} * @example * ```javascript * var table = sheet.tables.add("table1", 1, 1, 10, 5, GC.Spread.Sheets.Tables.TableThemes.light16); * ``` */ static light16: GC.Spread.Sheets.Tables.TableTheme; /** * Gets the light17 style. * @returns {GC.Spread.Sheets.Tables.TableTheme} * @example * ```javascript * var table = sheet.tables.add("table1", 1, 1, 10, 5, GC.Spread.Sheets.Tables.TableThemes.light17); * ``` */ static light17: GC.Spread.Sheets.Tables.TableTheme; /** * Gets the light18 style. * @returns {GC.Spread.Sheets.Tables.TableTheme} * @example * ```javascript * var table = sheet.tables.add("table1", 1, 1, 10, 5, GC.Spread.Sheets.Tables.TableThemes.light18); * ``` */ static light18: GC.Spread.Sheets.Tables.TableTheme; /** * Gets the light19 style. * @returns {GC.Spread.Sheets.Tables.TableTheme} * @example * ```javascript * var table = sheet.tables.add("table1", 1, 1, 10, 5, GC.Spread.Sheets.Tables.TableThemes.light19); * ``` */ static light19: GC.Spread.Sheets.Tables.TableTheme; /** * Gets the light2 style. * @returns {GC.Spread.Sheets.Tables.TableTheme} * @example * ```javascript * var table = sheet.tables.add("table1", 1, 1, 10, 5, GC.Spread.Sheets.Tables.TableThemes.light2); * ``` */ static light2: GC.Spread.Sheets.Tables.TableTheme; /** * Gets the light20 style. * @returns {GC.Spread.Sheets.Tables.TableTheme} * @example * ```javascript * var table = sheet.tables.add("table1", 1, 1, 10, 5, GC.Spread.Sheets.Tables.TableThemes.light20); * ``` */ static light20: GC.Spread.Sheets.Tables.TableTheme; /** * Gets the light21 style. * @returns {GC.Spread.Sheets.Tables.TableTheme} * @example * ```javascript * var table = sheet.tables.add("table1", 1, 1, 10, 5, GC.Spread.Sheets.Tables.TableThemes.light21); * ``` */ static light21: GC.Spread.Sheets.Tables.TableTheme; /** * Gets the light3 style. * @returns {GC.Spread.Sheets.Tables.TableTheme} * @example * ```javascript * var table = sheet.tables.add("table1", 1, 1, 10, 5, GC.Spread.Sheets.Tables.TableThemes.light3); * ``` */ static light3: GC.Spread.Sheets.Tables.TableTheme; /** * Gets the light4 style. * @returns {GC.Spread.Sheets.Tables.TableTheme} * @example * ```javascript * var table = sheet.tables.add("table1", 1, 1, 10, 5, GC.Spread.Sheets.Tables.TableThemes.light4); * ``` */ static light4: GC.Spread.Sheets.Tables.TableTheme; /** * Gets the light5 style. * @returns {GC.Spread.Sheets.Tables.TableTheme} * @example * ```javascript * var table = sheet.tables.add("table1", 1, 1, 10, 5, GC.Spread.Sheets.Tables.TableThemes.light5); * ``` */ static light5: GC.Spread.Sheets.Tables.TableTheme; /** * Gets the light6 style. * @returns {GC.Spread.Sheets.Tables.TableTheme} * @example * ```javascript * var table = sheet.tables.add("table1", 1, 1, 10, 5, GC.Spread.Sheets.Tables.TableThemes.light6); * ``` */ static light6: GC.Spread.Sheets.Tables.TableTheme; /** * Gets the light7 style. * @returns {GC.Spread.Sheets.Tables.TableTheme} * @example * ```javascript * var table = sheet.tables.add("table1", 1, 1, 10, 5, GC.Spread.Sheets.Tables.TableThemes.light7); * ``` */ static light7: GC.Spread.Sheets.Tables.TableTheme; /** * Gets the light8 style. * @returns {GC.Spread.Sheets.Tables.TableTheme} * @example * ```javascript * var table = sheet.tables.add("table1", 1, 1, 10, 5, GC.Spread.Sheets.Tables.TableThemes.light8); * ``` */ static light8: GC.Spread.Sheets.Tables.TableTheme; /** * Gets the light9 style. * @returns {GC.Spread.Sheets.Tables.TableTheme} * @example * ```javascript * var table = sheet.tables.add("table1", 1, 1, 10, 5, GC.Spread.Sheets.Tables.TableThemes.light9); * ``` */ static light9: GC.Spread.Sheets.Tables.TableTheme; /** * Gets the medium1 style. * @returns {GC.Spread.Sheets.Tables.TableTheme} * @example * ```javascript * var table = sheet.tables.add("table1", 1, 1, 10, 5, GC.Spread.Sheets.Tables.TableThemes.medium1); * ``` */ static medium1: GC.Spread.Sheets.Tables.TableTheme; /** * Gets the medium10 style. * @returns {GC.Spread.Sheets.Tables.TableTheme} * @example * ```javascript * var table = sheet.tables.add("table1", 1, 1, 10, 5, GC.Spread.Sheets.Tables.TableThemes.medium10); * ``` */ static medium10: GC.Spread.Sheets.Tables.TableTheme; /** * Gets the medium11 style. * @returns {GC.Spread.Sheets.Tables.TableTheme} * @example * ```javascript * var table = sheet.tables.add("table1", 1, 1, 10, 5, GC.Spread.Sheets.Tables.TableThemes.medium11); * ``` */ static medium11: GC.Spread.Sheets.Tables.TableTheme; /** * Gets the medium12 style. * @returns {GC.Spread.Sheets.Tables.TableTheme} * @example * ```javascript * var table = sheet.tables.add("table1", 1, 1, 10, 5, GC.Spread.Sheets.Tables.TableThemes.medium12); * ``` */ static medium12: GC.Spread.Sheets.Tables.TableTheme; /** * Gets the medium13 style. * @returns {GC.Spread.Sheets.Tables.TableTheme} * @example * ```javascript * var table = sheet.tables.add("table1", 1, 1, 10, 5, GC.Spread.Sheets.Tables.TableThemes.medium13); * ``` */ static medium13: GC.Spread.Sheets.Tables.TableTheme; /** * Gets the medium14 style. * @returns {GC.Spread.Sheets.Tables.TableTheme} * @example * ```javascript * var table = sheet.tables.add("table1", 1, 1, 10, 5, GC.Spread.Sheets.Tables.TableThemes.medium14); * ``` */ static medium14: GC.Spread.Sheets.Tables.TableTheme; /** * Gets the medium15 style. * @returns {GC.Spread.Sheets.Tables.TableTheme} * @example * ```javascript * var table = sheet.tables.add("table1", 1, 1, 10, 5, GC.Spread.Sheets.Tables.TableThemes.medium15); * ``` */ static medium15: GC.Spread.Sheets.Tables.TableTheme; /** * Gets the medium16 style. * @returns {GC.Spread.Sheets.Tables.TableTheme} * @example * ```javascript * var table = sheet.tables.add("table1", 1, 1, 10, 5, GC.Spread.Sheets.Tables.TableThemes.medium16); * ``` */ static medium16: GC.Spread.Sheets.Tables.TableTheme; /** * Gets the medium17 style. * @returns {GC.Spread.Sheets.Tables.TableTheme} * @example * ```javascript * var table = sheet.tables.add("table1", 1, 1, 10, 5, GC.Spread.Sheets.Tables.TableThemes.medium17); * ``` */ static medium17: GC.Spread.Sheets.Tables.TableTheme; /** * Gets the medium18 style. * @returns {GC.Spread.Sheets.Tables.TableTheme} * @example * ```javascript * var table = sheet.tables.add("table1", 1, 1, 10, 5, GC.Spread.Sheets.Tables.TableThemes.medium18); * ``` */ static medium18: GC.Spread.Sheets.Tables.TableTheme; /** * Gets the medium19 style. * @returns {GC.Spread.Sheets.Tables.TableTheme} * @example * ```javascript * var table = sheet.tables.add("table1", 1, 1, 10, 5, GC.Spread.Sheets.Tables.TableThemes.medium19); * ``` */ static medium19: GC.Spread.Sheets.Tables.TableTheme; /** * Gets the medium2 style. * @returns {GC.Spread.Sheets.Tables.TableTheme} * @example * ```javascript * var table = sheet.tables.add("table1", 1, 1, 10, 5, GC.Spread.Sheets.Tables.TableThemes.medium2); * ``` */ static medium2: GC.Spread.Sheets.Tables.TableTheme; /** * Gets the medium20 style. * @returns {GC.Spread.Sheets.Tables.TableTheme} * @example * ```javascript * var table = sheet.tables.add("table1", 1, 1, 10, 5, GC.Spread.Sheets.Tables.TableThemes.medium20); * ``` */ static medium20: GC.Spread.Sheets.Tables.TableTheme; /** * Gets the medium21 style. * @returns {GC.Spread.Sheets.Tables.TableTheme} * @example * ```javascript * var table = sheet.tables.add("table1", 1, 1, 10, 5, GC.Spread.Sheets.Tables.TableThemes.medium21); * ``` */ static medium21: GC.Spread.Sheets.Tables.TableTheme; /** * Gets the medium22 style. * @returns {GC.Spread.Sheets.Tables.TableTheme} * @example * ```javascript * var table = sheet.tables.add("table1", 1, 1, 10, 5, GC.Spread.Sheets.Tables.TableThemes.medium22); * ``` */ static medium22: GC.Spread.Sheets.Tables.TableTheme; /** * Gets the medium23 style. * @returns {GC.Spread.Sheets.Tables.TableTheme} * @example * ```javascript * var table = sheet.tables.add("table1", 1, 1, 10, 5, GC.Spread.Sheets.Tables.TableThemes.medium23); * ``` */ static medium23: GC.Spread.Sheets.Tables.TableTheme; /** * Gets the medium24 style. * @returns {GC.Spread.Sheets.Tables.TableTheme} * @example * ```javascript * var table = sheet.tables.add("table1", 1, 1, 10, 5, GC.Spread.Sheets.Tables.TableThemes.medium24); * ``` */ static medium24: GC.Spread.Sheets.Tables.TableTheme; /** * Gets the medium25 style. * @returns {GC.Spread.Sheets.Tables.TableTheme} * @example * ```javascript * var table = sheet.tables.add("table1", 1, 1, 10, 5, GC.Spread.Sheets.Tables.TableThemes.medium25); * ``` */ static medium25: GC.Spread.Sheets.Tables.TableTheme; /** * Gets the medium26 style. * @returns {GC.Spread.Sheets.Tables.TableTheme} * @example * ```javascript * var table = sheet.tables.add("table1", 1, 1, 10, 5, GC.Spread.Sheets.Tables.TableThemes.medium26); * ``` */ static medium26: GC.Spread.Sheets.Tables.TableTheme; /** * Gets the medium27 style. * @returns {GC.Spread.Sheets.Tables.TableTheme} * @example * ```javascript * var table = sheet.tables.add("table1", 1, 1, 10, 5, GC.Spread.Sheets.Tables.TableThemes.medium27); * ``` */ static medium27: GC.Spread.Sheets.Tables.TableTheme; /** * Gets the medium28 style. * @returns {GC.Spread.Sheets.Tables.TableTheme} * @example * ```javascript * var table = sheet.tables.add("table1", 1, 1, 10, 5, GC.Spread.Sheets.Tables.TableThemes.medium28); * ``` */ static medium28: GC.Spread.Sheets.Tables.TableTheme; /** * Gets the medium3 style. * @returns {GC.Spread.Sheets.Tables.TableTheme} * @example * ```javascript * var table = sheet.tables.add("table1", 1, 1, 10, 5, GC.Spread.Sheets.Tables.TableThemes.medium3); * ``` */ static medium3: GC.Spread.Sheets.Tables.TableTheme; /** * Gets the medium4 style. * @returns {GC.Spread.Sheets.Tables.TableTheme} * @example * ```javascript * var table = sheet.tables.add("table1", 1, 1, 10, 5, GC.Spread.Sheets.Tables.TableThemes.medium4); * ``` */ static medium4: GC.Spread.Sheets.Tables.TableTheme; /** * Gets the medium5 style. * @returns {GC.Spread.Sheets.Tables.TableTheme} * @example * ```javascript * var table = sheet.tables.add("table1", 1, 1, 10, 5, GC.Spread.Sheets.Tables.TableThemes.medium5); * ``` */ static medium5: GC.Spread.Sheets.Tables.TableTheme; /** * Gets the medium6 style. * @returns {GC.Spread.Sheets.Tables.TableTheme} * @example * ```javascript * var table = sheet.tables.add("table1", 1, 1, 10, 5, GC.Spread.Sheets.Tables.TableThemes.medium6); * ``` */ static medium6: GC.Spread.Sheets.Tables.TableTheme; /** * Gets the medium7 style. * @returns {GC.Spread.Sheets.Tables.TableTheme} * @example * ```javascript * var table = sheet.tables.add("table1", 1, 1, 10, 5, GC.Spread.Sheets.Tables.TableThemes.medium7); * ``` */ static medium7: GC.Spread.Sheets.Tables.TableTheme; /** * Gets the medium8 style. * @returns {GC.Spread.Sheets.Tables.TableTheme} * @example * ```javascript * var table = sheet.tables.add("table1", 1, 1, 10, 5, GC.Spread.Sheets.Tables.TableThemes.medium8); * ``` */ static medium8: GC.Spread.Sheets.Tables.TableTheme; /** * Gets the medium9 style. * @returns {GC.Spread.Sheets.Tables.TableTheme} * @example * ```javascript * var table = sheet.tables.add("table1", 1, 1, 10, 5, GC.Spread.Sheets.Tables.TableThemes.medium9); * ``` */ static medium9: GC.Spread.Sheets.Tables.TableTheme; /** * Gets the professional1 theme. * @returns {GC.Spread.Sheets.Tables.TableTheme} */ static professional1: GC.Spread.Sheets.Tables.TableTheme; /** * Gets the professional10 theme. * @returns {GC.Spread.Sheets.Tables.TableTheme} */ static professional10: GC.Spread.Sheets.Tables.TableTheme; /** * Gets the professional11 theme. * @returns {GC.Spread.Sheets.Tables.TableTheme} */ static professional11: GC.Spread.Sheets.Tables.TableTheme; /** * Gets the professional12 theme. * @returns {GC.Spread.Sheets.Tables.TableTheme} */ static professional12: GC.Spread.Sheets.Tables.TableTheme; /** * Gets the professional13 theme. * @returns {GC.Spread.Sheets.Tables.TableTheme} */ static professional13: GC.Spread.Sheets.Tables.TableTheme; /** * Gets the professional14 theme. * @returns {GC.Spread.Sheets.Tables.TableTheme} */ static professional14: GC.Spread.Sheets.Tables.TableTheme; /** * Gets the professional15 theme. * @returns {GC.Spread.Sheets.Tables.TableTheme} */ static professional15: GC.Spread.Sheets.Tables.TableTheme; /** * Gets the professional16 theme. * @returns {GC.Spread.Sheets.Tables.TableTheme} */ static professional16: GC.Spread.Sheets.Tables.TableTheme; /** * Gets the professional17 theme. * @returns {GC.Spread.Sheets.Tables.TableTheme} */ static professional17: GC.Spread.Sheets.Tables.TableTheme; /** * Gets the professional18 theme. * @returns {GC.Spread.Sheets.Tables.TableTheme} */ static professional18: GC.Spread.Sheets.Tables.TableTheme; /** * Gets the professional19 theme. * @returns {GC.Spread.Sheets.Tables.TableTheme} */ static professional19: GC.Spread.Sheets.Tables.TableTheme; /** * Gets the professional2 theme. * @returns {GC.Spread.Sheets.Tables.TableTheme} */ static professional2: GC.Spread.Sheets.Tables.TableTheme; /** * Gets the professional20 theme. * @returns {GC.Spread.Sheets.Tables.TableTheme} */ static professional20: GC.Spread.Sheets.Tables.TableTheme; /** * Gets the professional21 theme. * @returns {GC.Spread.Sheets.Tables.TableTheme} */ static professional21: GC.Spread.Sheets.Tables.TableTheme; /** * Gets the professional22 theme. * @returns {GC.Spread.Sheets.Tables.TableTheme} */ static professional22: GC.Spread.Sheets.Tables.TableTheme; /** * Gets the professional23 theme. * @returns {GC.Spread.Sheets.Tables.TableTheme} */ static professional23: GC.Spread.Sheets.Tables.TableTheme; /** * Gets the professional24 theme. * @returns {GC.Spread.Sheets.Tables.TableTheme} */ static professional24: GC.Spread.Sheets.Tables.TableTheme; /** * Gets the professional3 theme. * @returns {GC.Spread.Sheets.Tables.TableTheme} */ static professional3: GC.Spread.Sheets.Tables.TableTheme; /** * Gets the professional4 theme. * @returns {GC.Spread.Sheets.Tables.TableTheme} */ static professional4: GC.Spread.Sheets.Tables.TableTheme; /** * Gets the professional5 theme. * @returns {GC.Spread.Sheets.Tables.TableTheme} */ static professional5: GC.Spread.Sheets.Tables.TableTheme; /** * Gets the professional6 theme. * @returns {GC.Spread.Sheets.Tables.TableTheme} */ static professional6: GC.Spread.Sheets.Tables.TableTheme; /** * Gets the professional7 theme. * @returns {GC.Spread.Sheets.Tables.TableTheme} */ static professional7: GC.Spread.Sheets.Tables.TableTheme; /** * Gets the professional8 theme. * @returns {GC.Spread.Sheets.Tables.TableTheme} */ static professional8: GC.Spread.Sheets.Tables.TableTheme; /** * Gets the professional9 theme. * @returns {GC.Spread.Sheets.Tables.TableTheme} */ static professional9: GC.Spread.Sheets.Tables.TableTheme; } } module TableSheet{ export interface IAlternatingRowOptions{ /** * The alternating row style fill row count and blank row count. */ step?: number[]; /** * Defines the alternating fill row style. */ style?: GC.Spread.Sheets.Style; } export interface IColumnTypeItem{ /** * identifier the column type, any of "Number", "Text", "Formula", "Checkbox", "Date", "Currency", "Percent", "Phone", "Email", "URL", "Lookup", "CreatedTime", "ModifiedTime", "Attachment", "Select", "Barcode" */ name: string; /** * the display name of the column type by the culture resources */ text?: string; /** * the icon before the display name of the column type */ iconClass?: string; } export interface IDataViewChanges{ /** * The change type, could be one of "insert", "update", "delete", "addColumn", "updateColumn", "removeColumn". */ type: string; /** * The current row data. */ dataItem: any; /** * The original row data, only used for "update". */ oldDataItem?: any; /** * the current column. */ column?: GC.Data.IColumn; /** * the default value of the current added column. */ data?: any[]; /** * The original column, only used for "update column". */ originalColumn?: GC.Data.IColumn; /** * The view index of table sheet. */ index: number; } export interface IGroupByOptions extends GC.Spread.Sheets.TableSheet.IGroupColumnOptions{ field: string; spacing?: GC.Spread.Sheets.TableSheet.IGroupSpacingOptions; summaryFields?: GC.Spread.Sheets.TableSheet.IGroupSummaryFieldOptions[]; } export interface IGroupColumnOptions{ caption?: string; style?: GC.Data.StyleOptions; width?: number; /** * the column header style */ headerStyle?: GC.Data.HeaderStyleOptions; conditionalFormats?: (GC.Data.CellValueRuleOptions | GC.Data.SpecificTextRuleOptions | GC.Data.FormulaRuleOptions | GC.Data.DateOccurringRuleOptions | GC.Data.Top10RuleOptions | GC.Data.UniqueRuleOptions | GC.Data.DuplicateRuleOptions | GC.Data.AverageRuleOptions | GC.Data.TwoScaleRuleOptions | GC.Data.ThreeScaleRuleOptions | GC.Data.DataBarRuleOptions | GC.Data.IconSetRuleOptions)[]; validator?: GC.Data.NumberValidatorOptions | GC.Data.DateValidatorOptions | GC.Data.TimeValidatorOptions | GC.Data.TextLengthValidatorOptions | GC.Data.FormulaValidatorOptions | GC.Data.FormulaListValidatorOptions | GC.Data.ListValidatorOptions; /** * the header fit mode, default is normal */ headerFit?: "normal" | "vertical" | "stack"; /** * Whether show sort after opening filer dialog. */ allowSort?: boolean; /** * Whether show filter by value after opening filer dialog. */ allowFilterByValue?: boolean; /** * Whether show filter by list after opening filer dialog. If allowSort, allowFilterByValue and allowFilterByList are all false, not show the filter button in this column. */ allowFilterByList?: boolean; } export interface IGroupLayoutOptions{ /** * identifier the mode of the group layout */ mode: GC.Spread.Sheets.TableSheet.GroupLayoutMode; /** * Specify the default position of the summary results, such as "header", "footer". */ position?: "header" | "footer"; } export interface IGroupSpacingOptions{ /** * Specify the value of spacing between groups. */ row?: number; } export interface IGroupSummaryFieldOptions extends GC.Spread.Sheets.TableSheet.IGroupColumnOptions{ formula: string; relateTo?: string; position?: "header" | "footer"; slice?: string | IGroupSummarySliceFieldOptions; } export interface IGroupSummarySliceFieldOptions extends GC.Spread.Sheets.TableSheet.IGroupColumnOptions{ field: string; } export interface IMenuItemVisibility{ /** * Whether promoting menu item to show */ promoteMenuItemVisible: false, /** * Whether demoting menu item to show */ demoteMenuItemVisible: false, /** * Whether moving up menu item to show */ moveUpMenuItemVisible: false, /** * Whether moving down menu item to show */ moveDownMenuItemVisible: false, /** * Whether adding before menu item to show */ addBeforeMenuItemVisible: false, /** * Whether adding after menu item to show */ addAfterMenuItemVisible: false, /** * Whether adding above menu item to show */ addAboveMenuItemVisible: false, /** * Whether adding below menu item to show */ addBelowMenuItemVisible: false, /** * Whether expanding all level menu item to show */ expandAllLevelMenuItemVisible: false, /** * Whether collapsing all level menu item to show */ collapseAllLevelMenuItemVisible: false, /** * Whether expanding to level menu item to show */ expandToLevelMenuItemVisible: false, } export interface IPanelOption{ /** * How to show a column value. */ showSource?: GC.Spread.Sheets.TableSheet.ShowSourceOptions; /** * weather show the field area in panel, default is true. */ fieldAreaVisible?: boolean; /** * weather show the group area in panel, default is true. */ groupAreaVisible?: boolean; } export interface IRowActionOptions{ name?: string; icons?: (string | GC.Spread.Sheets.ButtonImageType)[]; iconSelector?: (item: any, index: number, context: any) => number | boolean; tooltip?: string; shortcutKey?: GC.Spread.Sheets.TableSheet.IShortcutKey; command?: string; } export interface IShortcutKey{ key?: number; ctrl?: boolean; shift?: boolean; alt?: boolean; meta?: boolean; } export interface ITableSheetOptions{ /** * Whether to allow to add new empty row. */ allowAddNew?: boolean; /** * Defines the alternating row style options. */ alternatingRowOptions?: GC.Spread.Sheets.TableSheet.IAlternatingRowOptions; /** * Tablesheet default stack row height, will calculate the average height by default, the default value is null. */ defaultStackRowHeight?: number; /** * The visibility of the menu item in the tablesheet. */ menuItemVisibility?: GC.Spread.Sheets.TableSheet.IMenuItemVisibility; /** * A color string used to represent the sheet tab color, such as "red", "#FFFF00", "rgb(255,0,0)", "Accent 5", and so on. */ sheetTabColor?: string; /** * Whether to show the row number header. */ showRowNumber?: boolean; /** * Whether to enable defining column. */ enableDefineColumn?: boolean; /** * Specify the command for defining column options. */ defineColumnCommand?: string; /** * Specify the command for submitting defined column options. */ submitDefineColumnCommand?: string; /** * Specify the column types. */ columnTypeItems?: GC.Spread.Sheets.TableSheet.IColumnTypeItem[]; /** * Specify the options for group layout. */ groupLayout?: GC.Spread.Sheets.TableSheet.IGroupLayoutOptions; } /** * Represents which row action is operated. * @enum {number} */ export enum ActionType{ /** * The action that removes a row. */ remove= 0, /** * The action that saves a row. */ save= 1, /** * The action that resets a row. */ reset= 2, /** * The action that adds a new empty row. */ addNewEmptyRow= 3 } /** * Defines how the group layout is displayed. * @enum {number} * @example * ```javascript * // This sample shows how to change the group layout mode to outline. * tableSheet.options.groupLayout={ mode: GC.Spread.Sheets.TableSheet.GroupLayoutMode.outline }; * ``` */ export enum GroupLayoutMode{ /** Specifies that the group layout is tabular mode. * @type {number} */ tabular= 0, /** Specifies that the group layout is outline mode. * @type {number} */ outline= 1, /** Specifies that the group layout is condensed mode. * @type {number} */ condensed= 2 } /** * Represents where to show the group outline. * @enum {number} */ export enum GroupOutlinePosition{ /** * Hides group outline. */ none= 0, /** * Shows group outline in viewport area and column header area. */ groupCell= 1, /** * Shows group outline in row header area. */ rowHeader= 2, /** * Shows group outline in viewport area, column header area, and row header area. */ groupCellAll= 3 } /** * Represents how to show a column value. * @enum {number} */ export enum ShowSourceOptions{ /** * Doesn't show a column value. */ none= 0, /** * Shows a column value when it is own field or related field. */ field= 1, /** * Shows a column value when it is calculated field. */ formula= 2, /** * Shows a column value, no matter it is own field, related field, or calculated field. */ all= 3 } export class BuiltInRowActions{ /** * Represent the table sheet built-in row actions. * @constructor */ constructor(); /** * Represents the data changes in a row * @property {GC.Spread.Sheets.TableSheet.IRowActionOptions} dirtyStatus - show the data changes in a row. */ static dirtyStatus: IRowActionOptions; /** * Represents pin a row. * @property {GC.Spread.Sheets.TableSheet.IRowActionOptions} pinRow - pin a row. */ static pinRow: IRowActionOptions; /** * Represents remove a row. * @property {GC.Spread.Sheets.TableSheet.IRowActionOptions} removeRow - remove a row. * @example * ```javascript * let buildInRowActions = GC.Spread.Sheets.TableSheet.BuiltInRowActions; * let options = tableSheet.rowActionOptions(); * tableSheet.rowActionOptions(options.concat([buildInRowActions.removeRow,buildInRowActions.saveRow,buildInRowActions.resetRow])); * ``` */ static removeRow: IRowActionOptions; /** * Represents reset the data change. * @property {GC.Spread.Sheets.TableSheet.IRowActionOptions} resetRow - reset the data changes in a row. * @example * ```javascript * let buildInRowActions = GC.Spread.Sheets.TableSheet.BuiltInRowActions; * let options = tableSheet.rowActionOptions(); * tableSheet.rowActionOptions(options.concat([buildInRowActions.removeRow,buildInRowActions.saveRow,buildInRowActions.resetRow])); * ``` */ static resetRow: IRowActionOptions; /** * Represents save the data change in a row. * @property {GC.Spread.Sheets.TableSheet.IRowActionOptions} saveRow - save the data changes in a row. * @example * ```javascript * let buildInRowActions = GC.Spread.Sheets.TableSheet.BuiltInRowActions; * let options = tableSheet.rowActionOptions(); * tableSheet.rowActionOptions(options.concat([buildInRowActions.removeRow,buildInRowActions.saveRow,buildInRowActions.resetRow])); * ``` */ static saveRow: IRowActionOptions; /** * Represents the text of warning info. * @property {GC.Spread.Sheets.TableSheet.IRowActionOptions} warningInfo - show warning infomation in a row. */ static warningInfo: IRowActionOptions; } export class TableSheet{ /** * Represents a table sheet with the specified name, data view and options setting. * @class * @param {string} [name] - The table sheet name. * @param {GC.Data.View} [dataView] - The table sheet data view. * @param {Object} [options] - The initialization options. * @param {boolean} [options.allowAddNew] - Whether to allow to add new empty row. * @param {boolean} [options.showRowNumber] - Whether to show the row number header. * @param {boolean} [options.enableDefineColumn] - Whether to enable defining column. * @param {string} [options.defineColumnCommand] - Specify the command for defining column options. * @param {string} [options.submitDefineColumnCommand] - Specify the command for submitting defined column options. * @param {GC.Spread.Sheets.TableSheet.IColumnTypeItem[]} [options.columnTypeItems] - Specify the column types. * @param {GC.Spread.Sheets.TableSheet.IGroupLayoutOptions} [options.groupLayout] - Specify the options for group layout. * @param {GC.Spread.Sheets.TableSheet.GroupLayoutMode} [options.groupLayout.mode] - Specify the mode for group layout. * @param {"header" | "footer"} [options.groupLayout.position] - Specify the default position of the summary results. * @param {string} [options.sheetTabColor] - A color string used to represent the sheet tab color, such as "red", "#FFFF00", "rgb(255,0,0)", "Accent 5", and so on. * @param {GC.Spread.Sheets.TableSheet.IAlternatingRowOptions} [options.alternatingRowOptions] - Defines the alternating row style option. * @param {number} [options.defaultStackRowHeight] - Tablesheet default stack row height, will calculate the average height by default. * @param {GC.Spread.Sheets.TableSheet.IMenuItemVisibility} [options.menuItemVisibility] - The visibility of the menu item in the tablesheet. * @param {boolean} [options.menuItemVisibility.promoteMenuItemVisible] - Whether promoting menu item to show. * @param {boolean} [options.menuItemVisibility.demoteMenuItemVisible] - Whether demoting menu item to show. * @param {boolean} [options.menuItemVisibility.moveUpMenuItemVisible] - Whether moving up menu item to show. * @param {boolean} [options.menuItemVisibility.moveDownMenuItemVisible] - Whether moving down menu item to show. * @param {boolean} [options.menuItemVisibility.addBeforeMenuItemVisible] - Whether adding before menu item to show. * @param {boolean} [options.menuItemVisibility.addAfterMenuItemVisible] - Whether adding after menu item to show. * @param {boolean} [options.menuItemVisibility.addAboveMenuItemVisible] - Whether adding above menu item to show. * @param {boolean} [options.menuItemVisibility.addBelowMenuItemVisible] - Whether adding below menu item to show. * @param {boolean} [options.menuItemVisibility.expandAllLevelMenuItemVisible] - Whether expanding all level menu item to show. * @param {boolean} [options.menuItemVisibility.collapseAllLevelMenuItemVisible] - Whether collapsing all level menu item to show. * @param {boolean} [options.menuItemVisibility.expandToLevelMenuItemVisible] - Whether expanding to level menu item to show. * @example * ```javascript * //This example creates a empty TableSheet. * var tableSheet = spread.addSheetTab(0, "", GC.Spread.Sheets.SheetType.tableSheet); * * //This example creates a TableSheet with name. * var tableSheet = spread.addSheetTab(0, "tableSheet1", GC.Spread.Sheets.SheetType.tableSheet); * * //This example creates a TableSheet with name and data source. * var dataManager = spread.dataManager(); * var myTable = dataManager.addTable("myTable", { * remote: { * read: { * url: 'https://demodata.mescius.io/northwind/api/v1/Orders' * } * } * }); * myTable.fetch().then(function() { * var myView = myTable.addView("myView"); * var tableSheet = spread.addSheetTab(0, "tableSheet1", GC.Spread.Sheets.SheetType.tableSheet); * tableSheet.setDataView(myView); * }); * * //This example creates a TableSheet with name and options. * var style = new GC.Spread.Sheets.Style(); * var tableSheet = spread.addSheetTab(0, "tableSheet1", GC.Spread.Sheets.SheetType.tableSheet); * tableSheet.options = {allowAddNew: false, alternatingRowOptions: { step: [1, 1], style: style}}; * ``` */ constructor(name?: string, dataView?: GC.Data.View, options?: GC.Spread.Sheets.TableSheet.ITableSheetOptions); /** * Represents the options of the table sheet. * @type {Object} * @property {boolean} [allowAddNew] - Whether to allow to add new empty row. * @property {string} [sheetTabColor] - A color string used to represent the sheet tab color, such as "red", "#FFFF00", "rgb(255,0,0)", "Accent 5", and so on. * @property {GC.Spread.Sheets.TableSheet.IAlternatingRowOptions} [alternatingRowOptions] - Defines the alternating row style options. * @property {number} [defaultStackRowHeight] - Tablesheet default stack row height, will calculate the average height by default. * @property {GC.Spread.Sheets.TableSheet.IMenuItemVisibility} [menuItemVisibility] - Tablesheet default stack row height, will calculate the average height by default. * @property {boolean} [showRowNumber] - Whether to show the row number header. * @property {boolean} [enableDefineColumn] - Whether to enable defining column. * @property {string} [defineColumnCommand] - Specify the command for defining column options. * @property {string} [submitDefineColumnCommand] - Specify the command for submitting defined column options. * @property {GC.Spread.Sheets.TableSheet.IColumnTypeItem[]} [columnTypeItems] - Specify the column types. * @property {GC.Spread.Sheets.TableSheet.IGroupLayoutOptions} [groupLayout] - Specify the options for group layout. * @example * ```javascript * //This example changes a TableSheet's options. * tableSheet.options.allowAddNew = false; * tableSheet.options.alternatingRowOptions = { step: [1, 1], style: new GC.Spread.Sheets.Style("lightyellow")}; * ``` */ options: GC.Spread.Sheets.TableSheet.ITableSheetOptions; /** * Add a new row data as the parent of the specified row. * @param {number} row - The row index. * @param {Object} rowData - The row data. * @returns {void} * @example * ```javascript * //This example adds a new row data as the parent of the specified row. * tableSheet.addHierarchyItemAbove(8, {id: 8, name: "spreadjs"}); * ``` */ addHierarchyItemAbove(row: number, rowData: any): void; /** * Add a new row data after the specified row. * @param {number} row - The row index. * @param {Object} rowData - The row data. * @returns {void} * @example * ```javascript * //This example adds a new row data after the specified row. * tableSheet.addHierarchyItemAfter(8, {id: 8, name: "spreadjs"}); * ``` */ addHierarchyItemAfter(row: number, rowData: any): void; /** * Add a new row data before the specified row. * @param {number} row - The row index. * @param {Object} rowData - The row data. * @returns {void} * @example * ```javascript * //This example adds a new row data before the specified row. * tableSheet.addHierarchyItemBefore(8, {id: 8, name: "spreadjs"}); * ``` */ addHierarchyItemBefore(row: number, rowData: any): void; /** * Add a new row data as the child of the specified row. * @param {number} row - The row index. * @param {Object} rowData - The row data. * @returns {void} * @example * ```javascript * //This example adds a new row data as the child of the specified row. * tableSheet.addHierarchyItemBelow(8, {id: 8, name: "spreadjs"}); * ``` */ addHierarchyItemBelow(row: number, rowData: any): void; /** * Adds a new row to table sheet. * @param {Object} rowData - The row data. * @returns {Promise} * @example * ```javascript * //This example adds a new row with data. * tableSheet.addRow({id: 8, name: "spreadjs"}); * ``` */ addRow(rowData: any): Promise; /** * Applies a Worksheet JSON to a TableSheet column header free layout area. * @param {Object} sheetJson - a Worksheet JSON, which can be gotten easily by Worksheet's toJSON method. */ applyFreeHeaderArea(sheetJson?: any): any; /** * Applies a table theme to current TableSheet. * @param {GC.Spread.Sheets.Tables.TableTheme} tableTheme - A table theme instance. */ applyTableTheme(tableTheme: GC.Spread.Sheets.Tables.TableTheme): void; /** * Cancels the changes of data manager in batch mode. * @example * ```javascript * //This example cancel changes manually in batch mode. * tableSheet.cancelChanges(); * ``` */ cancelChanges(): void; /** * Collapse the all hierarchy levels. * @returns {void} * @example * ```javascript * //This example collapse the all hierarchy levels. * tableSheet.collapseAllHierarchyLevels(); * ``` */ collapseAllHierarchyLevels(): void; /** * Demote the hierarchy data level of the specified row. * @param {number} row - The row index. * @param {boolean} withChildren - Optional, the children will be demoted with the record by default. * @returns {void} * @example * ```javascript * //This example demote the hierarchy data level by specified index. * tableSheet.demoteHierarchyLevel(8); * ``` */ demoteHierarchyLevel(row: number, withChildren?: boolean): void; /** * Whether to show or hide the detail columns after Table Sheet is grouped. * @param {boolean} value - A boolean value which indicates the visibility of the detail columns. * @returns {boolean} Returns the visibility of the detail columns. * @example * ```javascript * //This sample shows how to hide the detail columns. * tableSheet.detailColumnsVisible(false); * ``` */ detailColumnsVisible(value?: boolean): boolean; /** * Expand the all hierarchy levels. * @returns {void} * @example * ```javascript * //This example expand the all hierarchy levels. * tableSheet.expandAllHierarchyLevels(); * ``` */ expandAllHierarchyLevels(): void; /** * Expands or collapses one level grouping by the specified field. * @param {string} field - The field name. * @param {boolean} expand - A boolean value, true means expanding the grouping, false means collapsing the grouping. * @example * ```javascript * //This sample shows how to collapse one level grouping, which is grouped by "LastName". * tableSheet.expandGroup("LastName", false); * ``` */ expandGroup(field: string, expand: boolean): void; /** * Expands or collapses one grouping by the specified level and index. * @param {number} level - The grouping level. * @param {number} index - The grouping start index. * @param {boolean} expand - A boolean value, true means expanding the grouping, false means collapsing the grouping. * @example * ```javascript * //This sample shows how to collapse one grouping, which level is 1 and start index is 10. * tableSheet.expandGroupItem(1, 10, false); * ``` */ expandGroupItem(level: number, index: number, expand: boolean): void; /** * Expand the hierarchy data by specified level. * @param {number} level - The level to expand. * @returns {void} * @example * ```javascript * //This example expand the hierarchy data by specified level. * tableSheet.expandHierarchyLevel(8); * ``` */ expandHierarchyLevel(level: number): void; /** * Gets the changes of data manager in autoSync or batch mode. * @returns {GC.Spread.Sheets.TableSheet.IDataViewChanges[]} Returns a object array, each object could contain "type", "dataItem", "oldDataItem", "column", "originalColumn", and "index". * The "type" is the change type, could be one of "insert", "update", "delete", "addColumn", "updateColumn", "removeColumn". * the "dataItem" is the current row data. * The "oldDataItem" is the original row data, only used for "update". * The "column" is the current column. * The "data" is the default value of the current added column. * The "originalColumn" is the original column, only used for "update column". * The "index" is the view index of table sheet. * @example * ```javascript * //This example get changes manually in autoSync or batch mode, including updated rows, inserted rows, deleted rows, add column, update column, remove column. * tableSheet.getChanges(); * ``` */ getChanges(): GC.Spread.Sheets.TableSheet.IDataViewChanges[]; /** * Gets the data view of table sheet. * @returns {GC.Data.View} Returns the data view. * @example * ```javascript * //This example gets the data source. * tableSheet.getDataView(); * ``` */ getDataView(): GC.Data.View; /** * group the table sheet by options * @param {GC.Spread.Sheets.TableSheet.IGroupByOptions[]} options - The options of the groupBy * @returns {GC.Spread.Sheets.TableSheet.IGroupByOptions[]} * @example * ```javascript * //This example sets group options and group the table sheet. * tablesheet.groupBy([ * { * caption: 'Category', * field: 'category', * summaryFields:[ * { * caption: 'SUM(Quantity)', width: 120, style: { formatter: "$ #,##0.00" } * formula: '=SUM([Quantity])', * slice: 'Office' * } * ] * } * ]) * ``` */ groupBy(options?: GC.Spread.Sheets.TableSheet.IGroupByOptions[]): GC.Spread.Sheets.TableSheet.IGroupByOptions[]; /** * Whether to show or hide the grouping outline in viewport area and column header area, or row header area after Table Sheet is grouped. * @param {GC.Spread.Sheets.TableSheet.GroupOutlinePosition} value - A value which indicates the position of the grouping outline. * @returns {GC.Spread.Sheets.TableSheet.GroupOutlinePosition} Returns the position of the grouping outline. * @example * ```javascript * //This sample shows how to hide the grouping outline. * tableSheet.groupOutlinePosition(GC.Spread.Sheets.TableSheet.GroupOutlinePosition.none); * ``` */ groupOutlinePosition(value?: GC.Spread.Sheets.TableSheet.GroupOutlinePosition): boolean; /** * Judges the row with the specified state. * @param {GC.Data.RowColumnStates} type - The type of row states. * @param {number} row - The row index. * @returns {boolean} * @example * ```javascript * //This example judges the row with the specified state. * tableSheet.hasRowState(GC.Data.RowColumnStates.selected, 0); * ``` */ hasRowState(type: GC.Data.RowColumnStates, row: number): boolean; /** * Move the hierarchy data by the specified row down. * @param {number} row - The row index. * @returns {void} * @example * ```javascript * //This example move the hierarchy data by specified index down. * tableSheet.moveDown(8); * ``` */ moveDown(row: number): void; /** * Move the hierarchy data by the specified row up. * @param {number} row - The row index. * @returns {void} * @example * ```javascript * //This example move the hierarchy data by specified index up. * tableSheet.moveUp(8); * ``` */ moveUp(row: number): void; /** * Gets or sets the print information for the table sheet. * @param {GC.Spread.Sheets.Print.PrintInfo} [value] The print information for the table sheet. * @returns {GC.Spread.Sheets.Print.PrintInfo | GC.Spread.Sheets.TableSheet.TableSheet} If no value is set, returns the print information for the table sheet; otherwise, returns the table sheet. * @example * ```javascript * //This example sets print info. * var printInfo = tableSheet.printInfo(); * printInfo.bestFitRows(true); * printInfo.bestFitColumns(true); * tableSheet.printInfo(printInfo); * ``` */ printInfo(value?: GC.Spread.Sheets.Print.PrintInfo): any; /** * Promote the hierarchy data level of the specified row. * @param {number} row - The row index. * @returns {void} * @example * ```javascript * //This example promote the hierarchy data level by specified index. * tableSheet.promoteHierarchyLevel(8); * ``` */ promoteHierarchyLevel(row: number): void; /** * remove group status of the table sheet * @returns {void} * @example * ```javascript * //This example shows removing the group status of the table sheet. * tablesheet.removeGroupBy() * ``` */ removeGroupBy(): void; /** * Removes the specified row from table sheet. * @param {number} row - The row index. * @returns {Promise} * @example * ```javascript * //This example removes a row by specified index. * //The changes will be synchronized when the autoSync be true. * tableSheet.removeRow(8); * ``` */ removeRow(row: number): Promise; /** * Resets the changes of the specified row of table sheet. * @param {number} row - The row index. * @returns {void} * @example * ```javascript * //This example resets a row by specified index. * tableSheet.resetRow(8); * ``` */ resetRow(row: number): void; /** * Gets or sets the options of the row action. * @param {GC.Spread.Sheets.TableSheet.IRowActionOptions[]} options - The options of the row action. * @returns {GC.Spread.Sheets.TableSheet.IRowActionOptions[]} * @example * ```javascript * //This example set the options of the row action. * let options = tableSheet.rowActionOptions(); * options.push({ * icons: ["./comment.png"], * iconSelector: (item) => { * return item.comment && item.comment.length > 0; * } * }); * tableSheet.rowActionOptions(options); * ``` */ rowActionOptions(options?: GC.Spread.Sheets.TableSheet.IRowActionOptions[]): GC.Spread.Sheets.TableSheet.IRowActionOptions[]; /** * Saves the changes of the specified row of table sheet to data manager, including updated row or and inserted row. * @param {number} row - The row index. * @returns {Promise} * @example * ```javascript * //This example saves a row by specified index. * //The changes will be synchronized when the autoSync be true. * tableSheet.saveRow(8); * ``` */ saveRow(row: number): Promise; /** * Sets the data view of table sheet. * @param {GC.Data.View} dataView - The data view to bind. * @example * ```javascript * //This example sets the data source. * var dataManager = spread.dataManager(); * var myTable = dataManager.addTable("myTable", { * remote: { * read: { * url: 'https://demodata.mescius.io/northwind/api/v1/Orders' * } * } * }); * myTable.fetch().then(function() { * var myView = myTable.addView("myView"); * tableSheet.setDataView(myView); * }); * ``` */ setDataView(dataView: GC.Data.View): void; /** * Sets the default height in pixels for the all rows in the viewport area. * @param {number} value The height in pixels. * @param {GC.Spread.Sheets.SheetArea} [sheetArea] The sheet area. * @example * ```javascript * //This example sets the default row height in pixels. * tableSheet.setDefaultRowHeight(50); * ``` */ setDefaultRowHeight(value: number, sheetArea?: GC.Spread.Sheets.SheetArea): void; /** * Submits the changes of data manager to server in batch mode, including updated rows, inserted rows and deleted rows. * @example * ```javascript * //This example submit changes manually in batch mode. * tableSheet.submitChanges(); * ``` */ submitChanges(): Promise; /** * Pin or unpin columns with specified column index array. * @param {number} index - The array of column indexes to do pin or unpin. * @returns {number} Returns the count of the pinned columns. * @example * ```javascript * //This example pin several columns. * tableSheet.togglePinnedColumns([1,2,4]); * ``` */ togglePinnedColumns(index: number[]): void; /** * Pin or unpin rows with specified row index array. * @param {number} index - The array of row indexes to do pin or unpin. * @returns {number} Returns the count of the pinned rows. * @example * ```javascript * //This example pin several rows. * tableSheet.togglePinnedRows([1,2,4]); * ``` */ togglePinnedRows(indexes: number[]): void; } export class TableSheetPanel{ /** * Represents a table sheet panel with the specified name, table sheet, host element and options setting. * @class * @param {string} name - The table sheet panel name. * @param {GC.Spread.Sheets.TableSheet.TableSheet} tableSheet - The table sheet. * @param {HTMLElement} host - The host element. * @param {Object} [options] - The initialization options. * @param {GC.Spread.Sheets.TableSheet.ShowSourceOptions} [options.showSource] - How to show a column value. * @example * ```javascript * //This example creates a TableSheetPanel. * var host = document.getElementById("panel"); * var panel = new GC.Spread.Sheets.TableSheet.TableSheetPanel("myPanel", tableSheet, host); * ``` */ constructor(name: string, tableSheet: GC.Spread.Sheets.TableSheet.TableSheet, host: HTMLElement, options?: GC.Spread.Sheets.TableSheet.IPanelOption); /** * Attaches a table sheet into current table sheet panel. * @param {GC.Spread.Sheets.TableSheet.TableSheet} tableSheet The table sheet. * @example * ```javascript * //This example attaches a table sheet. * panel.attach(tableSheet); * ``` */ attach(tableSheet: GC.Spread.Sheets.TableSheet.TableSheet): void; /** * Destroys current table sheet panel. * @example * ```javascript * //This example destroys current table sheet panel. * panel.destroy(); * ``` */ destroy(): void; /** * Detaches a table sheet from current table sheet panel. * @example * ```javascript * //This example detaches a table sheet. * panel.detach(); * ``` */ detach(): void; /** * Finds a table sheet panel by a DOM element. * @param {HTMLElement | string} host The host element. * @example * ```javascript * //This example finds a table sheet panel by a DOM element. * GC.Spread.Sheets.TableSheet.TableSheetPanel.findControl(document.getElementById("sampleDiv")); * ``` */ static findControl(host: HTMLElement | string): GC.Spread.Sheets.TableSheet.TableSheetPanel; } } module Touch{ export class TouchToolStrip{ /** * Represents a toolbar. * @class * @param {GC.Spread.Sheets.Workbook} workbook The Spread object. * @param {HTMLElement} host The host DOM element. */ constructor(workbook: GC.Spread.Sheets.Workbook, host: HTMLElement); /** * Adds an item to the touch toolbar. * @param {GC.Spread.Sheets.Touch.TouchToolStripSeparator | GC.Spread.Sheets.Touch.TouchToolStripItem} item The item to be added. * @remarks The item to be added can be a toolbar item or a line separator. * @example * ```javascript * //This example adds a custom item. * spread.touchToolStrip.add(new GC.Spread.Sheets.Touch.TouchToolStripItem("C", "Delete", "tsoutline.png", function(){ })) * spread.touchToolStrip.getItem("C").font("15px Arial").foreColor("red"); * spread.touchToolStrip.imageAreaHeight(30); * spread.touchToolStrip.itemHeight(80); * spread.touchToolStrip.itemWidth(50); * spread.touchToolStrip.add(new GC.Spread.Sheets.Touch.TouchToolStripSeparator()); * ``` */ add(item: GC.Spread.Sheets.Touch.TouchToolStripSeparator | GC.Spread.Sheets.Touch.TouchToolStripItem): void; /** * Clears all items in the toolbar. * @example * ```javascript * //This example uses the clear method. * spread.touchToolStrip.add(new GC.Spread.Sheets.Touch.TouchToolStripItem("C", "Delete", "tsoutline.png", function(){ })) * spread.touchToolStrip.getItem("C").font("15px Arial").foreColor("red"); * spread.touchToolStrip.imageAreaHeight(30); * spread.touchToolStrip.itemHeight(80); * spread.touchToolStrip.itemWidth(50); * spread.touchToolStrip.add(new GC.Spread.Sheets.Touch.TouchToolStripSeparator()); * spread.touchToolStrip.clear(); * ``` */ clear(): void; /** * Closes the toolbar. */ close(): void; /** * Gets the item with the specified name. * @param {string} name The item name. * @returns {GC.Spread.Sheets.Touch.TouchToolStripSeparator|GC.Spread.Sheets.Touch.TouchToolStripItem} If the item exists in the toolbar, the item is returned; otherwise, returns undefined. * @example * ```javascript * spread.touchToolStrip.add(new GC.Spread.Sheets.Touch.TouchToolStripItem("Cut", "Delete", "cut.png", function(){ })) * spread.touchToolStrip.getItem("Cut").font("15px Arial").foreColor("red"); * spread.touchToolStrip.add(new GC.Spread.Sheets.Touch.TouchToolStripSeparator()); * ``` */ getItem(name: string): any; /** * Gets all the items that belong to the toolbar. * @returns {GC.Spread.Sheets.Touch.TouchToolStripSeparator[]|GC.Spread.Sheets.Touch.TouchToolStripItem[]} An array that contains all the items in the toolbar. * @example * ```javascript * spread.touchToolStrip.add(new GC.Spread.Sheets.Touch.TouchToolStripItem("OP1", "OP1", "op1.png", function(){ })) * spread.touchToolStrip.add(new GC.Spread.Sheets.Touch.TouchToolStripItem("OP2", "OP2", "op2.png", function(){ })) * // Gets all the items that belong to the toolbar. * console.log(spread.touchToolStrip.getItems()); * ``` */ getItems(): any; /** * Gets or sets the image area height. * @param {number} height The image area height. * @returns {number | GC.Spread.Sheets.Touch.TouchToolStrip} If no value is set, returns the image area height; otherwise, returns the toolbar. * @example * ```javascript * spread.touchToolStrip.add(new GC.Spread.Sheets.Touch.TouchToolStripItem("C", "Delete", "tsoutline.png", function(){ })) * spread.touchToolStrip.getItem("C").font("15px Arial").foreColor("red"); * spread.touchToolStrip.imageAreaHeight(30); * spread.touchToolStrip.itemHeight(80); * spread.touchToolStrip.itemWidth(50); * spread.touchToolStrip.add(new GC.Spread.Sheets.Touch.TouchToolStripSeparator()); * ``` */ imageAreaHeight(height?: number): any; /** * Gets or sets the toolbar item height. * @param {number} height The toolbar item height. * @returns {number | GC.Spread.Sheets.Touch.TouchToolStrip} If no value is set, returns the toolbar item height; otherwise, returns the toolbar. * @example * ```javascript * spread.touchToolStrip.add(new GC.Spread.Sheets.Touch.TouchToolStripItem("C", "Delete", "tsoutline.png", function(){ })) * spread.touchToolStrip.getItem("C").font("15px Arial").foreColor("red"); * spread.touchToolStrip.imageAreaHeight(30); * spread.touchToolStrip.itemHeight(80); * spread.touchToolStrip.itemWidth(50); * spread.touchToolStrip.add(new GC.Spread.Sheets.Touch.TouchToolStripSeparator()); * ``` */ itemHeight(height?: number): any; /** * Gets or sets the toolbar item width. * @param {number} width The toolbar item width. * @returns {number | GC.Spread.Sheets.Touch.TouchToolStrip} If no value is set, returns the toolbar item width; otherwise, returns the toolbar. * @example * ```javascript * spread.touchToolStrip.add(new GC.Spread.Sheets.Touch.TouchToolStripItem("C", "Delete", "tsoutline.png", function(){ })) * spread.touchToolStrip.getItem("C").font("15px Arial").foreColor("red"); * spread.touchToolStrip.imageAreaHeight(30); * spread.touchToolStrip.itemHeight(80); * spread.touchToolStrip.itemWidth(50); * spread.touchToolStrip.add(new GC.Spread.Sheets.Touch.TouchToolStripSeparator()); * ``` */ itemWidth(width?: number): any; /** * Opens a toolbar in a specific position relative to the touch point. * @param {number} x The x-coordinate. * @param {number} y The y-coordinate. */ open(x: number, y: number): void; /** * Removes the toolbar item with the specified name. * @param {string} name The name of the item to be removed. * @returns {GC.Spread.Sheets.Touch.TouchToolStripItem} The removed item. * @example * ```javascript * spread.touchToolStrip.add(new GC.Spread.Sheets.Touch.TouchToolStripItem("Cut", "Delete", "cut.png", function(){ })) * spread.touchToolStrip.getItem("Cut").font("15px Arial").foreColor("red"); * spread.touchToolStrip.add(new GC.Spread.Sheets.Touch.TouchToolStripSeparator()); * spread.touchToolStrip.remove("Cut"); * activeSheet.resumePaint(); * activeSheet.repaint(); * ``` */ remove(name: string): GC.Spread.Sheets.Touch.TouchToolStripItem; /** * Gets or sets the toolbar separator height. * @param {number} height The toolbar separator height. * @returns {number | GC.Spread.Sheets.Touch.TouchToolStrip} If no value is set, returns the toolbar separator height; otherwise, returns the toolbar. * @example * ```javascript * spread.touchToolStrip.add(new GC.Spread.Sheets.Touch.TouchToolStripItem("Cut", "Delete", "cut.png", function(){ })) * spread.touchToolStrip.getItem("Cut").font("15px Arial").foreColor("red"); * spread.touchToolStrip.separatorHeight(33); * spread.touchToolStrip.add(new GC.Spread.Sheets.Touch.TouchToolStripSeparator()); * ``` */ separatorHeight(height?: number): any; } export class TouchToolStripItem{ /** * Represents an item in the toolbar. * @class * @param {string} name The name of the item. * @param {string} text The item text. * @param {string} image The item image source. * @param {Object} command Defines the executive function that occurs when the user taps the item. * @param {Object} canExecute Defines when to show the item by a function. If returns `true`, display the item; otherwise, hide the item. * @example * ```javascript * //This example adds a delete image with red text. * spread.touchToolStrip.add(new GC.Spread.Sheets.Touch.TouchToolStripItem("Cut", "Delete", "cut.png", function(){ })) * spread.touchToolStrip.getItem("Cut").font("15px Arial").foreColor("red"); * spread.touchToolStrip.add(new GC.Spread.Sheets.Touch.TouchToolStripSeparator()); * ``` */ constructor(name: string, text: string, image: string, command?: any, canExecute?: Function); /** * Gets or sets the font of the item text. * @param {string} [value] The font of the toolbar item text. * @returns {string | GC.Spread.Sheets.Touch.TouchToolStripItem} If no value is set, returns the font of the item text; otherwise, returns the toolbar item. * @example * ```javascript * //This example adds a delete image with red text. * spread.touchToolStrip.add(new GC.Spread.Sheets.Touch.TouchToolStripItem("Cut", "Delete", "cut.png", function(){ })) * spread.touchToolStrip.getItem("Cut").font("15px Arial").foreColor("red"); * spread.touchToolStrip.add(new GC.Spread.Sheets.Touch.TouchToolStripSeparator()); * ``` */ font(value?: string): any; /** * Gets or sets the color of the item text. * @param {string} [value] The color of the toolbar item text. * @returns {string | GC.Spread.Sheets.Touch.TouchToolStripItem} If no value is set, returns the color of the item text; otherwise, returns the toolbar item. * @example * ```javascript * //This example adds a delete image with red text. * spread.touchToolStrip.add(new GC.Spread.Sheets.Touch.TouchToolStripItem("Cut", "Delete", "cut.png", function(){ })) * spread.touchToolStrip.getItem("Cut").font("15px Arial").foreColor("red"); * spread.touchToolStrip.add(new GC.Spread.Sheets.Touch.TouchToolStripSeparator()); * ``` */ foreColor(value?: string): any; /** * Gets or sets the source of the item image. * @param {string} [value] The path and filename for the item image source. * @returns {string | GC.Spread.Sheets.Touch.TouchToolStripItem} If no value is set, returns the source of the item image; otherwise, returns the toolbar item. * @example * ```javascript * //This example adds a delete image with red text. * var tts = new GC.Spread.Sheets.Touch.TouchToolStripItem(); * tts.image("cut.png"); * tts.name("C"); * tts.text("Delete"); * spread.touchToolStrip.add(tts, function(){ }); * spread.touchToolStrip.getItem("C").font("15px Arial").foreColor("red"); * ``` */ image(value?: string): any; /** * Gets or sets the name of the item. * @param {string} [value] The name of the toolbar item. * @returns {string | GC.Spread.Sheets.Touch.TouchToolStripItem} If no value is set, returns the name of the item; otherwise, returns the toolbar item. * @example * ```javascript * //This example adds a delete image with red text. * var tts = new GC.Spread.Sheets.Touch.TouchToolStripItem(); * tts.image("cut.png"); * tts.name("C"); * tts.text("Delete"); * spread.touchToolStrip.add(tts, function(){ }); * spread.touchToolStrip.getItem("C").font("15px Arial").foreColor("red"); * ``` */ name(value?: string): any; /** * Gets or sets the text of the item. * @param {string} [value] The text of the toolbar item. * @returns {string | GC.Spread.Sheets.Touch.TouchToolStripItem} If no value is set, returns the text of the item; otherwise, returns the toolbar item. * @example * ```javascript * //This example adds a delete image with red text. * var tts = new GC.Spread.Sheets.Touch.TouchToolStripItem(); * tts.image("cut.png"); * tts.name("C"); * tts.text("Delete"); * spread.touchToolStrip.add(tts, function(){ }); * spread.touchToolStrip.getItem("C").font("15px Arial").foreColor("red"); * ``` */ text(value?: string): any; } export class TouchToolStripSeparator{ /** * Represents a separator in the toolbar. * @class * @param {Object} canExecute - Defines when to display the separator with a function. If returns `true`, display the separator; otherwise, hide the separator. * @example * ```javascript * spread.touchToolStrip.add(new GC.Spread.Sheets.Touch.TouchToolStripItem("Cut", "Delete", "cut.png", function(){ })) * spread.touchToolStrip.getItem("Cut").font("15px Arial").foreColor("red"); * spread.touchToolStrip.add(new GC.Spread.Sheets.Touch.TouchToolStripSeparator()); * ``` */ constructor(canExecute?: Function); /** * Gets the name of the separator. * @returns {string} Returns the current separator name. */ name(): string; } } } module Slicers{ export interface ISlicerConditional{ /** * visible exclusive row indexes */ exclusiveRowIndexes?: number[]; /** * visible ranges */ ranges?: ISlicerRangeConditional[]; } export interface ISlicerData{ getColumnIndex(columnName: string): number; getData(columnName: string, range?: ISlicerRangeConditional): any[]; getExclusiveData(columnName: string): any[]; getRowIndexes(columnName: string, exclusiveRowIndex: number): number[]; getExclusiveRowIndex(columnName: string, rowIndex: number): number; getFilteredIndexes(columnName: string, isPreview?: boolean): number[]; getFilteredOutIndexes(columnName: string, filteredOutDataType: GC.Spread.Slicers.FilteredOutDataType, isPreview?: boolean): number[]; getFilteredRanges(columnName: string): ISlicerRangeConditional[]; getFilteredOutRanges(columnName: string): ISlicerRangeConditional[]; attachListener(listener: ISlicerListener): void; detachListener(listener: ISlicerListener): void; doFilter(columnName: string, slicerConditional: ISlicerConditional, isPreview?: boolean): void; doUnfilter(columnName: string): void; clearPreview():void; } export interface ISlicerDataItem{ columnName: string; rowIndex: number; data: any; } export interface ISlicerFilteredData{ isPreview: boolean; rowIndexes: number[]; } export interface ISlicerListener{ onFiltered(data: ISlicerFilteredData): void; onDataChanged(data: ISlicerDataItem[]): void; onRowsChanged(rowIndex: number, rowCount: number, isAdd: boolean): void; onColumnNameChanged(oldName: string, newName: string): void; onColumnRemoved(columnName: string): void; } export interface ISlicerRangeConditional{ /** * the minimum value. */ min: number; /** * the maximum value. */ max: number; } /** * Represents the kind of filtered out exclusive data index that should be included in the result. * @enum {number} */ export enum FilteredOutDataType{ /** * Indicates all of the filtered out data. */ all= 0, /** * Indicates the data was filtered out based on the current column. */ byCurrentColumn= 1, /** * Indicates the data was filtered out based on other columns. */ byOtherColumns= 2 } /** * Represents the aggregate type. * @enum {number} */ export enum SlicerAggregateType{ /** * Calculates the average of the specified numeric values. */ average= 1, /** * Calculates the number of data that contain numbers. */ count= 2, /** * Calculates the number of data that contain non-null values. */ counta= 3, /** * Calculates the maximum value, the greatest value, of all the values. */ max= 4, /** * Calculates the minimum value, the least value, of all the values. */ min= 5, /** * Multiplies all the arguments and returns the product. */ product= 6, /** * Calculates the standard deviation based on a sample. */ stdev= 7, /** * Calculates the standard deviation of a population based on the entire population using the numbers in a column of a list or database that match the specified conditions. */ stdevp= 8, /** * Calculates the sum of the specified numeric values. */ sum= 9, /** * Calculates the variance based on a sample of a population, which uses only numeric values. */ vars= 10, /** * Calculates the variance based on a sample of a population, which includes numeric, logical, or text values. */ varp= 11 } export class GeneralSlicerData{ /** * Represents general slicer data. * @class GC.Spread.Slicers.GeneralSlicerData * @param {Object[][]} data The slicer data; it is a matrix array. * @param {Array} columnNames The column names of the slicer data. */ constructor(data: any[][], columnNames: string[]); /** * Indicates the column names for the general slicer data. * @type {string[]} */ columnNames: string[]; /** * Indicates the data source for general slicer data. * @type {Object[][]} */ data: any[][]; /** * Aggregates the data by the specified column name. * @param {string} columnName The column name. * @param {GC.Spread.Slicers.SlicerAggregateType} aggregateType The aggregate type. * @param {GC.Spread.Slicers.ISlicerRangeConditional} range The specific range. * @returns {number} The aggregated data. * @example * ```javascript * var slicerData = new GC.Spread.Slicers.GeneralSlicerData( * [ * [ * { value: 'Bob', text: 'Bob' }, * { value: 'NewYork', text: 'NewYork' }, * { value: new Date("1968/6/8"), text: '6/8/1968' }, * { value: 10000, text: '10 000' } * ], * [ * { value: 'Betty', text: 'Betty' }, * { value: 'NewYork', text: 'NewYork' }, * { value: new Date("1972/7/3"), text: '7/3/1972' }, * { value: 8000, text: '8 000' } * ], * [ * { value: 'Alice', text: 'Alice' }, * { value: 'Washington', text: 'Washington' }, * { value: new Date("2012/2/15"), text: '2/15/2012' }, * { value: 5500, text: '5 500' } * ], * [ * { value: 'Chris', text: 'Chris' }, * { value: 'Washington', text: 'Washington' }, * { value: new Date("2001/9/2"), text: '9/2/2001' }, * { value: 6200, text: '6 200' } * ], * [ * { value: 'James', text: 'James' }, * { value: 'Phoenix', text: 'Phoenix' }, * { value: new Date("1995/11/22"), text: '11/22/1995' }, * { value: 16150, text: '16 150' } * ] * ], ["Name", "City", "Birthday", "Salary"] * ); * console.log(slicerData.aggregateData('Salary', GC.Spread.Slicers.SlicerAggregateType.average)); * console.log(slicerData.aggregateData('Salary', GC.Spread.Slicers.SlicerAggregateType.count, {min: 8000, max: 20000})); * ``` */ aggregateData(columnName: string, aggregateType: GC.Spread.Slicers.SlicerAggregateType, range?: GC.Spread.Slicers.ISlicerRangeConditional): number; /** * Attaches the listener. SlicerData will call the corresponding interface at the appropriate time. * @param {GC.Spread.Slicers.ISlicerListener} listener The listener. * @example * ```javascript * //Define data source. * var slicerData = new GC.Spread.Slicers.GeneralSlicerData( * [ * [ * { value: 'Bob', text: 'Bob' }, * { value: 'NewYork', text: 'NewYork' }, * { value: new Date("1968/6/8"), text: '6/8/1968' }, * { value: 10000, text: '10 000' } * ], * [ * { value: 'Betty', text: 'Betty' }, * { value: 'NewYork', text: 'NewYork' }, * { value: new Date("1972/7/3"), text: '7/3/1972' }, * { value: 8000, text: '8 000' } * ], * [ * { value: 'Alice', text: 'Alice' }, * { value: 'Washington', text: 'Washington' }, * { value: new Date("2012/2/15"), text: '2/15/2012' }, * { value: 5500, text: '5 500' } * ], * [ * { value: 'Chris', text: 'Chris' }, * { value: 'Washington', text: 'Washington' }, * { value: new Date("2001/9/2"), text: '9/2/2001' }, * { value: 6200, text: '6 200' } * ], * [ * { value: 'James', text: 'James' }, * { value: 'Phoenix', text: 'Phoenix' }, * { value: new Date("1995/11/22"), text: '11/22/1995' }, * { value: 16150, text: '16 150' } * ] * ], ["Name", "City", "Birthday", "Salary"] * ); * //Define custom slicer. * function MySlicer(container) { * this.container = container; * this.slicerData = null; * this.columnName = null; * } * MySlicer.prototype.setData = function (slicerData, columnName) { * this.slicerData = slicerData; * this.columnName = columnName; * // attach listener here * this.slicerData.attachListener(this); * this.onDataLoaded(); * } * MySlicer.prototype.onDataLoaded = function () { * //create slicer dom tree. * var columnName = this.columnName, * exclusiveData = this.slicerData.getExclusiveData(columnName); * $(this.container).append($('' + this.columnName + ':' + '
')); * var domString = ""; * for (var i = 0; i < exclusiveData.length; i++) { * domString += ''; * domString += '' + exclusiveData[i] + ''; * domString += '
'; * } * $(this.container).append($(domString)); * //attach events to dom. * var self = this; * $("[name='" + self.columnName + "']").change(function () { * var slicer = self, * exclusiveData = slicer.slicerData.getExclusiveData(slicer.columnName), * parent = $(this).parent(), * items = parent.children(), * indexes = []; * for (var i = 0, length = items.length; i < length; i++) { * if (items[i].checked) { * var value = items[i].value; * if (!isNaN(parseInt(value))) { * value = parseInt(value); * } * indexes.push(exclusiveData.indexOf(value)) * } * } * if (indexes.length === 0) { * slicer.slicerData.doUnfilter(slicer.columnName); * } else { * slicer.slicerData.doFilter(slicer.columnName, { exclusiveRowIndexes: indexes }); * } * }); * }; * MySlicer.prototype.onFiltered = function () { * //Sync the status if the data has been filtered by the Spread.Sheets table. * var slicerData = this.slicerData; * var exclusiveIndexes = slicerData.getFilteredIndexes(this.columnName); * $.each($("#slicerContainer").children("input"), function (i, input) { * }); * } * MySlicer.prototype.onColumnsRemoved = function (columnName) { * if (columnName === this.columnName) { * this.slicerData.detachListener(this); * this.slicerData = null; * $("#slicerContainer").remove(); * } * } * * //create a custom slicer and add this slicer to the "slicerContainer" div. * var slicer = new MySlicer($("#slicerContainer")[0]); * slicer.setData(slicerData, 'Name'); * ``` */ attachListener(listener: GC.Spread.Slicers.ISlicerListener): void; /** * Clears the preview filter state. * you can check whether slicer is doing filter in preview with slicerData.inPreview() API, * If you set doFilter() with isPreview flag to true, (like slicerData.doFilter('Name', {exclusiveRowIndexes: [1]}, true);) * you can clear the preview status by clearPreview() API. * which will remove the preview filter status. * @example * ```javascript * var slicerData = new GC.Spread.Slicers.GeneralSlicerData( * [ * [ * { value: 'Bob', text: 'Bob' }, * { value: 'NewYork', text: 'NewYork' }, * { value: new Date("1968/6/8"), text: '6/8/1968' }, * { value: 10000, text: '10 000' } * ], * [ * { value: 'Betty', text: 'Betty' }, * { value: 'NewYork', text: 'NewYork' }, * { value: new Date("1972/7/3"), text: '7/3/1972' }, * { value: 8000, text: '8 000' } * ], * [ * { value: 'Bob', text: 'Bob' }, * { value: 'Washington', text: 'Washington' }, * { value: new Date("2012/2/15"), text: '2/15/2012' }, * { value: 8000, text: '5 500' } * ], * ], ["Name", "City", "Birthday", "Salary"] * ); * console.log(slicerData.getFilteredOutIndexes('Name', GC.Spread.Slicers.FilteredOutDataType.all)); // [] * slicerData.doFilter('Name', {exclusiveRowIndexes: [1, 2]}); * console.log(slicerData.getFilteredOutIndexes('Name', GC.Spread.Slicers.FilteredOutDataType.all)); // [0] * console.log(slicerData.inPreview()); // false * slicerData.clearPreview(); * console.log(slicerData.getFilteredOutIndexes('Name', GC.Spread.Slicers.FilteredOutDataType.all)); // [0] * slicerData.doUnfilter('Name'); * console.log(slicerData.getFilteredOutIndexes('Name', GC.Spread.Slicers.FilteredOutDataType.all)); // [] * * slicerData.doFilter('Name', {exclusiveRowIndexes: [1, 2]}, true); * console.log(slicerData.getFilteredOutIndexes('Name', GC.Spread.Slicers.FilteredOutDataType.all)); // [0] * console.log(slicerData.inPreview()); // true * slicerData.clearPreview(); * console.log(slicerData.inPreview()); // false * console.log(slicerData.getFilteredOutIndexes('Name', GC.Spread.Slicers.FilteredOutDataType.all)); // [] * ``` */ clearPreview(): void; /** * Detaches the listener. * @param {Object} listener The listener. * @example * ```javascript * //Define data source. * var slicerData = new GC.Spread.Slicers.GeneralSlicerData( * [ * [ * { value: 'Bob', text: 'Bob' }, * { value: 'NewYork', text: 'NewYork' }, * { value: new Date("1968/6/8"), text: '6/8/1968' }, * { value: 10000, text: '10 000' } * ], * [ * { value: 'Betty', text: 'Betty' }, * { value: 'NewYork', text: 'NewYork' }, * { value: new Date("1972/7/3"), text: '7/3/1972' }, * { value: 8000, text: '8 000' } * ], * [ * { value: 'Alice', text: 'Alice' }, * { value: 'Washington', text: 'Washington' }, * { value: new Date("2012/2/15"), text: '2/15/2012' }, * { value: 5500, text: '5 500' } * ], * [ * { value: 'Chris', text: 'Chris' }, * { value: 'Washington', text: 'Washington' }, * { value: new Date("2001/9/2"), text: '9/2/2001' }, * { value: 6200, text: '6 200' } * ], * [ * { value: 'James', text: 'James' }, * { value: 'Phoenix', text: 'Phoenix' }, * { value: new Date("1995/11/22"), text: '11/22/1995' }, * { value: 16150, text: '16 150' } * ] * ], ["Name", "City", "Birthday", "Salary"] * ); * //Define custom slicer. * function MySlicer(container) { * this.container = container; * this.slicerData = null; * this.columnName = null; * } * MySlicer.prototype.setData = function (slicerData, columnName) { * this.slicerData = slicerData; * this.columnName = columnName; * // attach listener here * this.slicerData.attachListener(this); * this.onDataLoaded(); * } * MySlicer.prototype.onDataLoaded = function () { * //create slicer dom tree. * var columnName = this.columnName, * exclusiveData = this.slicerData.getExclusiveData(columnName); * $(this.container).append($('' + this.columnName + ':' + '
')); * var domString = ""; * for (var i = 0; i < exclusiveData.length; i++) { * domString += ''; * domString += '' + exclusiveData[i] + ''; * domString += '
'; * } * $(this.container).append($(domString)); * //attach events to dom. * var self = this; * $("[name='" + self.columnName + "']").change(function () { * var slicer = self, * exclusiveData = slicer.slicerData.getExclusiveData(slicer.columnName), * parent = $(this).parent(), * items = parent.children(), * indexes = []; * for (var i = 0, length = items.length; i < length; i++) { * if (items[i].checked) { * var value = items[i].value; * if (!isNaN(parseInt(value))) { * value = parseInt(value); * } * indexes.push(exclusiveData.indexOf(value)) * } * } * if (indexes.length === 0) { * slicer.slicerData.doUnfilter(slicer.columnName); * } else { * slicer.slicerData.doFilter(slicer.columnName, { exclusiveRowIndexes: indexes }); * } * }); * }; * MySlicer.prototype.onFiltered = function () { * //Sync the status if the data has been filtered by the Spread.Sheets table. * var slicerData = this.slicerData; * var exclusiveIndexes = slicerData.getFilteredIndexes(this.columnName); * $.each($("#slicerContainer").children("input"), function (i, input) { * }); * } * MySlicer.prototype.onColumnRemoved = function (columnName) { * if (columnName === this.columnName) { * this.slicerData.detachListener(this); * this.slicerData = null; * $("#slicerContainer").remove(); * } * } * * //create a custom slicer and add this slicer to the "slicerContainer" div. * var slicer = new MySlicer($("#slicerContainer")[0]); * slicer.setData(slicerData, 'Name'); * ``` */ detachListener(listener: GC.Spread.Slicers.ISlicerListener): void; /** * Filters the data that corresponds to the specified column name and exclusive data indexes. * @param {string} columnName The column name. * @param {GC.Spread.Slicers.ISlicerConditional} conditional The conditional filter. * @param {number[]} [conditional.exclusiveRowIndexes] - visible exclusive row indexes * @param {GC.Spread.Slicers.ISlicerRangeConditional[]} [conditional.ranges] - visible ranges. * @param {boolean} [isPreview] Indicates whether preview is set. if set as preview, the filter result can be clear by clearPreview(), the preview status can be checked by inPreview(). * @example * ```javascript * var slicerData = new GC.Spread.Slicers.GeneralSlicerData( * [ * [ * { value: 'Bob', text: 'Bob' }, * { value: 'NewYork', text: 'NewYork' }, * { value: new Date("1968/6/8"), text: '6/8/1968' }, * { value: 10000, text: '10 000' } * ], * [ * { value: 'Betty', text: 'Betty' }, * { value: 'NewYork', text: 'NewYork' }, * { value: new Date("1972/7/3"), text: '7/3/1972' }, * { value: 8000, text: '8 000' } * ], * [ * { value: 'Alice', text: 'Alice' }, * { value: 'Washington', text: 'Washington' }, * { value: new Date("2012/2/15"), text: '2/15/2012' }, * { value: 5500, text: '5 500' } * ], * [ * { value: 'Chris', text: 'Chris' }, * { value: 'Washington', text: 'Washington' }, * { value: new Date("2001/9/2"), text: '9/2/2001' }, * { value: 6200, text: '6 200' } * ], * [ * { value: 'James', text: 'James' }, * { value: 'Phoenix', text: 'Phoenix' }, * { value: new Date("1995/11/22"), text: '11/22/1995' }, * { value: 16150, text: '16 150' } * ] * ], ["Name", "City", "Birthday", "Salary"] * ); * console.log(slicerData.getFilteredOutIndexes('Name', GC.Spread.Slicers.FilteredOutDataType.all)); // [] * slicerData.doFilter('Name', {exclusiveRowIndexes: [1, 2]}); * console.log(slicerData.getFilteredOutIndexes('Name', GC.Spread.Slicers.FilteredOutDataType.all)); // [0, 3, 4] * slicerData.doUnfilter('Name'); * console.log(slicerData.getFilteredOutIndexes('Name', GC.Spread.Slicers.FilteredOutDataType.all)); // [] * ``` */ doFilter(columnName: string, conditional: GC.Spread.Slicers.ISlicerConditional, isPreview?: boolean): void; /** * Unfilter the data that corresponds to the specified column name. * @param {string} columnName The column name. * @example * ```javascript * var slicerData = new GC.Spread.Slicers.GeneralSlicerData( * [ * [ * { value: 'Bob', text: 'Bob' }, * { value: 'NewYork', text: 'NewYork' }, * { value: new Date("1968/6/8"), text: '6/8/1968' }, * { value: 10000, text: '10 000' } * ], * [ * { value: 'Betty', text: 'Betty' }, * { value: 'NewYork', text: 'NewYork' }, * { value: new Date("1972/7/3"), text: '7/3/1972' }, * { value: 8000, text: '8 000' } * ], * [ * { value: 'Alice', text: 'Alice' }, * { value: 'Washington', text: 'Washington' }, * { value: new Date("2012/2/15"), text: '2/15/2012' }, * { value: 5500, text: '5 500' } * ], * [ * { value: 'Chris', text: 'Chris' }, * { value: 'Washington', text: 'Washington' }, * { value: new Date("2001/9/2"), text: '9/2/2001' }, * { value: 6200, text: '6 200' } * ], * [ * { value: 'James', text: 'James' }, * { value: 'Phoenix', text: 'Phoenix' }, * { value: new Date("1995/11/22"), text: '11/22/1995' }, * { value: 16150, text: '16 150' } * ] * ], ["Name", "City", "Birthday", "Salary"] * ); * console.log(slicerData.getFilteredOutIndexes('Name', GC.Spread.Slicers.FilteredOutDataType.all)); // [] * slicerData.doFilter('Name', {exclusiveRowIndexes: [1, 2]}); * console.log(slicerData.getFilteredOutIndexes('Name', GC.Spread.Slicers.FilteredOutDataType.all)); // [0, 3, 4] * slicerData.doUnfilter('Name'); * console.log(slicerData.getFilteredOutIndexes('Name', GC.Spread.Slicers.FilteredOutDataType.all)); // [] * ``` */ doUnfilter(columnName: string): void; /** * Gets the column index by the specified column name. * @param {string} columnName The column name. * @returns {number} The column index. * @example * ```javascript * var slicerData = new GC.Spread.Slicers.GeneralSlicerData( * [ * [ * { value: 'Bob', text: 'Bob' }, * { value: 'NewYork', text: 'NewYork' }, * { value: new Date("1968/6/8"), text: '6/8/1968' }, * { value: 10000, text: '10 000' } * ], * [ * { value: 'Betty', text: 'Betty' }, * { value: 'NewYork', text: 'NewYork' }, * { value: new Date("1972/7/3"), text: '7/3/1972' }, * { value: 8000, text: '8 000' } * ], * [ * { value: 'Alice', text: 'Alice' }, * { value: 'Washington', text: 'Washington' }, * { value: new Date("2012/2/15"), text: '2/15/2012' }, * { value: 5500, text: '5 500' } * ], * [ * { value: 'Chris', text: 'Chris' }, * { value: 'Washington', text: 'Washington' }, * { value: new Date("2001/9/2"), text: '9/2/2001' }, * { value: 6200, text: '6 200' } * ], * [ * { value: 'James', text: 'James' }, * { value: 'Phoenix', text: 'Phoenix' }, * { value: new Date("1995/11/22"), text: '11/22/1995' }, * { value: 16150, text: '16 150' } * ] * ], ["Name", "City", "Birthday", "Salary"] * ); * console.log(slicerData.getColumnIndex('Name')); // 0 * console.log(slicerData.getColumnIndex('Unknown')); // -1 * console.log(slicerData.getColumnIndex('Salary')); // 3 * ``` */ getColumnIndex(columnName: string): number; /** * Gets the data by the specified column name. * @param {string} columnName The column name. * @param {GC.Spread.Slicers.ISlicerRangeConditional} [range] The specific range to filter the data by min & max, only supported in number type value. * @returns {string[]} The data that corresponds to the specified column name. * @example * ```javascript * var slicerData = new GC.Spread.Slicers.GeneralSlicerData( * [ * [ * { value: 'Bob', text: 'Bob' }, * { value: 'NewYork', text: 'NewYork' }, * { value: new Date("1968/6/8"), text: '6/8/1968' }, * { value: 10000, text: '10 000' } * ], * [ * { value: 'Betty', text: 'Betty' }, * { value: 'NewYork', text: 'NewYork' }, * { value: new Date("1972/7/3"), text: '7/3/1972' }, * { value: 8000, text: '8 000' } * ], * [ * { value: 'Alice', text: 'Alice' }, * { value: 'Washington', text: 'Washington' }, * { value: new Date("2012/2/15"), text: '2/15/2012' }, * { value: 5500, text: '5 500' } * ], * [ * { value: 'Chris', text: 'Chris' }, * { value: 'Washington', text: 'Washington' }, * { value: new Date("2001/9/2"), text: '9/2/2001' }, * { value: 6200, text: '6 200' } * ], * [ * { value: 'James', text: 'James' }, * { value: 'Phoenix', text: 'Phoenix' }, * { value: new Date("1995/11/22"), text: '11/22/1995' }, * { value: 16150, text: '16 150' } * ] * ], ["Name", "City", "Birthday", "Salary"] * ); * * console.log(slicerData.getData('Name')); // ['Bob', 'Betty', 'Alice', 'Chris', 'James'] * console.log(slicerData.getData('Salary')); // ['10 000', '8 000', '5 500', '6 200', '16 150'] * console.log(slicerData.getData('Salary', {min: 5000, max: 10000})); // ['5 500', '6 200', '8 000', '10 000'] * ``` */ getData(columnName: string, range?: GC.Spread.Slicers.ISlicerRangeConditional): string[]; /** * Gets the exclusive data by the specified column name. * @param {string} columnName The column name. * @returns {Array} The exclusive data that corresponds to the specified column name. * @example * ```javascript * var slicerData = new GC.Spread.Slicers.GeneralSlicerData( * [ * [ * { value: 'Bob', text: 'Bob' }, * { value: 'NewYork', text: 'NewYork' }, * { value: new Date("1968/6/8"), text: '6/8/1968' }, * { value: 10000, text: '10 000' } * ], * [ * { value: 'Betty', text: 'Betty' }, * { value: 'NewYork', text: 'NewYork' }, * { value: new Date("1972/7/3"), text: '7/3/1972' }, * { value: 8000, text: '8 000' } * ], * [ * { value: 'Bob', text: 'Bob' }, * { value: 'Washington', text: 'Washington' }, * { value: new Date("2012/2/15"), text: '2/15/2012' }, * { value: 8000, text: '8 000' } * ], * ], ["Name", "City", "Birthday", "Salary"] * ); * console.log(slicerData.getData('Name')); // ['Bob', 'Betty', 'Bob'] * console.log(slicerData.getExclusiveData('Name')); // ['Bob', 'Betty'] * console.log(slicerData.getData('Salary')); // ['10 000', '8 000', '8 000'] * console.log(slicerData.getExclusiveData('Salary')); // ['10 000', '8 000'] * ``` */ getExclusiveData(columnName: string): any[]; /** * Gets the exclusive data index by the specified column name and data index. * @param {string} columnName The column name. * @param {number} rowIndex The index of the data. * @returns {number} The exclusive data index that corresponds to the specified column name and data index. * @example * ```javascript * var slicerData = new GC.Spread.Slicers.GeneralSlicerData( * [ * [ * { value: 'Bob', text: 'Bob' }, * { value: 'NewYork', text: 'NewYork' }, * { value: new Date("1968/6/8"), text: '6/8/1968' }, * { value: 10000, text: '10 000' } * ], * [ * { value: 'Betty', text: 'Betty' }, * { value: 'NewYork', text: 'NewYork' }, * { value: new Date("1972/7/3"), text: '7/3/1972' }, * { value: 8000, text: '8 000' } * ], * [ * { value: 'Bob', text: 'Bob' }, * { value: 'Washington', text: 'Washington' }, * { value: new Date("2012/2/15"), text: '2/15/2012' }, * { value: 8000, text: '8 000' } * ], * ], ["Name", "City", "Birthday", "Salary"] * ); * console.log(slicerData.getRowIndexes('Name', 0)); // [0, 2] * console.log(slicerData.getExclusiveRowIndex('Name', 0)); // 0 * console.log(slicerData.getExclusiveRowIndex('Name', 1)); // 1 * console.log(slicerData.getExclusiveRowIndex('Name', 2)); // 0 * ``` */ getExclusiveRowIndex(columnName: string, rowIndex: number): number; /** * Gets the filtered exclusive data indexes by the specified column name. * @param {string} columnName The column name. * @returns {number[]} The filtered exclusive data indexes that correspond to the specified column name. * @example * ```javascript * var slicerData = new GC.Spread.Slicers.GeneralSlicerData( * [ * [ * { value: 'Bob', text: 'Bob' }, * { value: 'NewYork', text: 'NewYork' }, * { value: new Date("1968/6/8"), text: '6/8/1968' }, * { value: 10000, text: '10 000' } * ], * [ * { value: 'Betty', text: 'Betty' }, * { value: 'NewYork', text: 'NewYork' }, * { value: new Date("1972/7/3"), text: '7/3/1972' }, * { value: 8000, text: '8 000' } * ], * [ * { value: 'Alice', text: 'Alice' }, * { value: 'Washington', text: 'Washington' }, * { value: new Date("2012/2/15"), text: '2/15/2012' }, * { value: 5500, text: '5 500' } * ], * [ * { value: 'Chris', text: 'Chris' }, * { value: 'Washington', text: 'Washington' }, * { value: new Date("2001/9/2"), text: '9/2/2001' }, * { value: 6200, text: '6 200' } * ], * [ * { value: 'James', text: 'James' }, * { value: 'Phoenix', text: 'Phoenix' }, * { value: new Date("1995/11/22"), text: '11/22/1995' }, * { value: 16150, text: '16 150' } * ] * ], ["Name", "City", "Birthday", "Salary"] * ); * console.log(slicerData.getFilteredIndexes('Name')); // [0, 1, 2, 3, 4] * slicerData.doFilter('Name', {exclusiveRowIndexes: [1, 2]}); * console.log(slicerData.getFilteredIndexes('Name')); // [1, 2] * slicerData.doUnfilter('Name'); * console.log(slicerData.getFilteredIndexes('Name')); // [0, 1, 2, 3, 4] * ``` */ getFilteredIndexes(columnName: string): number[]; /** * Gets the filtered out exclusive data indexes by the specified column name. * @param {string} columnName The column name. * @param {GC.Spread.Slicers.FilteredOutDataType} filteredOutDataType Indicates the kind of filtered out exclusive data index that should be included in the result. * @returns {number[]} The filtered out exclusive data indexes that correspond to the specified column name. * @example * ```javascript * var slicerData = new GC.Spread.Slicers.GeneralSlicerData( * [ * [ * { value: 'Bob', text: 'Bob' }, * { value: 'NewYork', text: 'NewYork' }, * { value: new Date("1968/6/8"), text: '6/8/1968' }, * { value: 10000, text: '10 000' } * ], * [ * { value: 'Betty', text: 'Betty' }, * { value: 'NewYork', text: 'NewYork' }, * { value: new Date("1972/7/3"), text: '7/3/1972' }, * { value: 8000, text: '8 000' } * ], * [ * { value: 'Alice', text: 'Alice' }, * { value: 'Washington', text: 'Washington' }, * { value: new Date("2012/2/15"), text: '2/15/2012' }, * { value: 5500, text: '5 500' } * ], * [ * { value: 'Chris', text: 'Chris' }, * { value: 'Washington', text: 'Washington' }, * { value: new Date("2001/9/2"), text: '9/2/2001' }, * { value: 6200, text: '6 200' } * ], * [ * { value: 'James', text: 'James' }, * { value: 'Phoenix', text: 'Phoenix' }, * { value: new Date("1995/11/22"), text: '11/22/1995' }, * { value: 16150, text: '16 150' } * ] * ], ["Name", "City", "Birthday", "Salary"] * ); * console.log(slicerData.getFilteredOutIndexes('Name', GC.Spread.Slicers.FilteredOutDataType.all)); // [] * slicerData.doFilter('Name', {exclusiveRowIndexes: [1, 2]}); * console.log(slicerData.getFilteredOutIndexes('Name', GC.Spread.Slicers.FilteredOutDataType.all)); // [0, 3, 4] * slicerData.doUnfilter('Name'); * console.log(slicerData.getFilteredOutIndexes('Name', GC.Spread.Slicers.FilteredOutDataType.all)); // [] * ``` */ getFilteredOutIndexes(columnName: string, filteredOutDataType: GC.Spread.Slicers.FilteredOutDataType): number[]; /** * Gets the filtered out ranges by other columns. * @param {string} columnName The column name. * @returns {GC.Spread.Slicers.ISlicerRangeConditional[]} The filtered out ranges by other columns that correspond to the specified column name. * @example * ```javascript * var slicerData = new GC.Spread.Slicers.GeneralSlicerData( * [ * [ * { value: 'Bob', text: 'Bob' }, * { value: 'NewYork', text: 'NewYork' }, * { value: new Date("1968/6/8"), text: '6/8/1968' }, * { value: 10000, text: '10 000' } * ], * [ * { value: 'Betty', text: 'Betty' }, * { value: 'NewYork', text: 'NewYork' }, * { value: new Date("1972/7/3"), text: '7/3/1972' }, * { value: 8000, text: '8 000' } * ], * [ * { value: 'Alice', text: 'Alice' }, * { value: 'Washington', text: 'Washington' }, * { value: new Date("2012/2/15"), text: '2/15/2012' }, * { value: 5500, text: '5 500' } * ], * [ * { value: 'Chris', text: 'Chris' }, * { value: 'Washington', text: 'Washington' }, * { value: new Date("2001/9/2"), text: '9/2/2001' }, * { value: 6200, text: '6 200' } * ], * [ * { value: 'James', text: 'James' }, * { value: 'Phoenix', text: 'Phoenix' }, * { value: new Date("1995/11/22"), text: '11/22/1995' }, * { value: 16150, text: '16 150' } * ] * ], ["Name", "City", "Birthday", "Salary"] * ); * slicerData.doFilter('Salary', { * ranges: [ * { min: 5000, max: 10000 }, * { min: 5000, max: 200000 }, * { min: 60000, max: 61000 } * ] * }); * console.log(slicerData.getFilteredOutRanges('Salary')); // [{min: 60000, max: 61000}] * console.log(slicerData.getFilteredRanges('Salary')); // [{min: 5000, max: 10000}, {min: 5000, max: 200000}] * ``` */ getFilteredOutRanges(columnName: string): GC.Spread.Slicers.ISlicerRangeConditional[]; /** * Gets the filtered out row indexes. * @returns {number[]} The filtered out row indexes. * @example * ```javascript * var slicerData = new GC.Spread.Slicers.GeneralSlicerData( * [ * [ * { value: 'Bob', text: 'Bob' }, * { value: 'NewYork', text: 'NewYork' }, * { value: new Date("1968/6/8"), text: '6/8/1968' }, * { value: 10000, text: '10 000' } * ], * [ * { value: 'Betty', text: 'Betty' }, * { value: 'NewYork', text: 'NewYork' }, * { value: new Date("1972/7/3"), text: '7/3/1972' }, * { value: 8000, text: '8 000' } * ], * [ * { value: 'Alice', text: 'Alice' }, * { value: 'Washington', text: 'Washington' }, * { value: new Date("2012/2/15"), text: '2/15/2012' }, * { value: 5500, text: '5 500' } * ], * [ * { value: 'Chris', text: 'Chris' }, * { value: 'Washington', text: 'Washington' }, * { value: new Date("2001/9/2"), text: '9/2/2001' }, * { value: 6200, text: '6 200' } * ], * [ * { value: 'James', text: 'James' }, * { value: 'Phoenix', text: 'Phoenix' }, * { value: new Date("1995/11/22"), text: '11/22/1995' }, * { value: 16150, text: '16 150' } * ] * ], ["Name", "City", "Birthday", "Salary"] * ); * slicerData.doFilter('Salary', { * exclusiveRowIndexes: [0, 1, 2] * }); * console.log(slicerData.getFilteredOutRowIndexes('Salary')); // [3, 4] * console.log(slicerData.getFilteredRowIndexes('Salary')); // [0, 1, 2] * ``` */ getFilteredOutRowIndexes(): number[]; /** * Gets the filtered ranges by the specified column name. * @param {string} columnName The column name. * @returns {GC.Spread.Slicers.ISlicerRangeConditional[]} The filtered ranges that correspond to the specified column name. * @example * ```javascript * var slicerData = new GC.Spread.Slicers.GeneralSlicerData( * [ * [ * { value: 'Bob', text: 'Bob' }, * { value: 'NewYork', text: 'NewYork' }, * { value: new Date("1968/6/8"), text: '6/8/1968' }, * { value: 10000, text: '10 000' } * ], * [ * { value: 'Betty', text: 'Betty' }, * { value: 'NewYork', text: 'NewYork' }, * { value: new Date("1972/7/3"), text: '7/3/1972' }, * { value: 8000, text: '8 000' } * ], * [ * { value: 'Alice', text: 'Alice' }, * { value: 'Washington', text: 'Washington' }, * { value: new Date("2012/2/15"), text: '2/15/2012' }, * { value: 5500, text: '5 500' } * ], * [ * { value: 'Chris', text: 'Chris' }, * { value: 'Washington', text: 'Washington' }, * { value: new Date("2001/9/2"), text: '9/2/2001' }, * { value: 6200, text: '6 200' } * ], * [ * { value: 'James', text: 'James' }, * { value: 'Phoenix', text: 'Phoenix' }, * { value: new Date("1995/11/22"), text: '11/22/1995' }, * { value: 16150, text: '16 150' } * ] * ], ["Name", "City", "Birthday", "Salary"] * ); * slicerData.doFilter('Salary', { * ranges: [ * { min: 5000, max: 10000 }, * { min: 5000, max: 200000 }, * { min: 60000, max: 61000 } * ] * }); * console.log(slicerData.getFilteredOutRanges('Salary')); // [{min: 60000, max: 61000}] * console.log(slicerData.getFilteredRanges('Salary')); // [{min: 5000, max: 10000}, {min: 5000, max: 200000}] * ``` */ getFilteredRanges(columnName: string): GC.Spread.Slicers.ISlicerRangeConditional[]; /** * Gets the filtered row indexes. * @returns {number[]} The filtered row indexes. * @example * ```javascript * var slicerData = new GC.Spread.Slicers.GeneralSlicerData( * [ * [ * { value: 'Bob', text: 'Bob' }, * { value: 'NewYork', text: 'NewYork' }, * { value: new Date("1968/6/8"), text: '6/8/1968' }, * { value: 10000, text: '10 000' } * ], * [ * { value: 'Betty', text: 'Betty' }, * { value: 'NewYork', text: 'NewYork' }, * { value: new Date("1972/7/3"), text: '7/3/1972' }, * { value: 8000, text: '8 000' } * ], * [ * { value: 'Alice', text: 'Alice' }, * { value: 'Washington', text: 'Washington' }, * { value: new Date("2012/2/15"), text: '2/15/2012' }, * { value: 5500, text: '5 500' } * ], * [ * { value: 'Chris', text: 'Chris' }, * { value: 'Washington', text: 'Washington' }, * { value: new Date("2001/9/2"), text: '9/2/2001' }, * { value: 6200, text: '6 200' } * ], * [ * { value: 'James', text: 'James' }, * { value: 'Phoenix', text: 'Phoenix' }, * { value: new Date("1995/11/22"), text: '11/22/1995' }, * { value: 16150, text: '16 150' } * ] * ], ["Name", "City", "Birthday", "Salary"] * ); * slicerData.doFilter('Salary', { * exclusiveRowIndexes: [0, 1, 2] * }); * console.log(slicerData.getFilteredOutRowIndexes('Salary')); // [3, 4] * console.log(slicerData.getFilteredRowIndexes('Salary')); // [0, 1, 2] * ``` */ getFilteredRowIndexes(): number[]; /** * Gets the data indexes by the specified column name and exclusive data index. * @param {string} columnName The column name. * @param {number} exclusiveRowIndex The index of the exclusive data. * @returns {number[]} The data indexes that correspond to the specified column name and exclusive data index. * @example * ```javascript * var slicerData = new GC.Spread.Slicers.GeneralSlicerData( * [ * [ * { value: 'Bob', text: 'Bob' }, * { value: 'NewYork', text: 'NewYork' }, * { value: new Date("1968/6/8"), text: '6/8/1968' }, * { value: 10000, text: '10 000' } * ], * [ * { value: 'Betty', text: 'Betty' }, * { value: 'NewYork', text: 'NewYork' }, * { value: new Date("1972/7/3"), text: '7/3/1972' }, * { value: 8000, text: '8 000' } * ], * [ * { value: 'Bob', text: 'Bob' }, * { value: 'Washington', text: 'Washington' }, * { value: new Date("2012/2/15"), text: '2/15/2012' }, * { value: 8000, text: '8 000' } * ], * ], ["Name", "City", "Birthday", "Salary"] * ); * console.log(slicerData.getRowIndexes('Name', 0)); // [0, 2] * console.log(slicerData.getRowIndexes('Name', 1)); // [1] * console.log(slicerData.getRowIndexes('Name', 2)); // undefined * console.log(slicerData.getRowIndexes('Salary', 1)); // [1, 2] * ``` */ getRowIndexes(columnName: string, exclusiveRowIndex: number): number[]; /** * Gets whether the slicer is in the preview state. * If you set doFilter() with isPreview flag to true, (like slicerData.doFilter('Name', {exclusiveRowIndexes: [1]}, true);) * you can check whether slicer is doing filter in preview with slicerData.inPreview() API, * @example * ```javascript * var slicerData = new GC.Spread.Slicers.GeneralSlicerData( * [ * [ * { value: 'Bob', text: 'Bob' }, * { value: 'NewYork', text: 'NewYork' }, * { value: new Date("1968/6/8"), text: '6/8/1968' }, * { value: 10000, text: '10 000' } * ], * [ * { value: 'Betty', text: 'Betty' }, * { value: 'NewYork', text: 'NewYork' }, * { value: new Date("1972/7/3"), text: '7/3/1972' }, * { value: 8000, text: '8 000' } * ], * [ * { value: 'Bob', text: 'Bob' }, * { value: 'Washington', text: 'Washington' }, * { value: new Date("2012/2/15"), text: '2/15/2012' }, * { value: 8000, text: '5 500' } * ], * ], ["Name", "City", "Birthday", "Salary"] * ); * console.log(slicerData.getFilteredOutIndexes('Name', GC.Spread.Slicers.FilteredOutDataType.all)); // [] * slicerData.doFilter('Name', {exclusiveRowIndexes: [1, 2]}); * console.log(slicerData.getFilteredOutIndexes('Name', GC.Spread.Slicers.FilteredOutDataType.all)); // [0] * console.log(slicerData.inPreview()); // false * slicerData.clearPreview(); * console.log(slicerData.getFilteredOutIndexes('Name', GC.Spread.Slicers.FilteredOutDataType.all)); // [0] * slicerData.doUnfilter('Name'); * console.log(slicerData.getFilteredOutIndexes('Name', GC.Spread.Slicers.FilteredOutDataType.all)); // [] * * slicerData.doFilter('Name', {exclusiveRowIndexes: [1, 2]}, true); * console.log(slicerData.getFilteredOutIndexes('Name', GC.Spread.Slicers.FilteredOutDataType.all)); // [0] * console.log(slicerData.inPreview()); // true * slicerData.clearPreview(); * console.log(slicerData.inPreview()); // false * console.log(slicerData.getFilteredOutIndexes('Name', GC.Spread.Slicers.FilteredOutDataType.all)); // [] * ``` */ inPreview(): boolean; /** * Changes a column name for the general slicer data. * @param {string} oldName The old name of the column. * @param {string} newName The new name of the column. * @example * ```javascript * var slicerData = new GC.Spread.Slicers.GeneralSlicerData( * [ * [ * { value: 'Bob', text: 'Bob' }, * { value: 'NewYork', text: 'NewYork' }, * { value: new Date("1968/6/8"), text: '6/8/1968' }, * { value: 10000, text: '10 000' } * ], * [ * { value: 'Betty', text: 'Betty' }, * { value: 'NewYork', text: 'NewYork' }, * { value: new Date("1972/7/3"), text: '7/3/1972' }, * { value: 8000, text: '8 000' } * ] * ], ["Name", "City", "Birthday", "Salary"] * ); * console.log(slicerData.getExclusiveData('Name')); // ['Bob', 'Betty'] * slicerData.onColumnNameChanged('Name', 'NewName'); * console.log(slicerData.getExclusiveData('Name')); // [] * console.log(slicerData.getExclusiveData('NewName')); // ['Bob', 'Betty'] * ``` */ onColumnNameChanged(oldName: string, newName: string): void; /** * Removes columns of the general slicer data. * @param {number} colIndex The index of the starting column. * @param {number} colCount The number of columns to remove. * @example * ```javascript * var slicerData = new GC.Spread.Slicers.GeneralSlicerData( * [ * [ * { value: 'Bob', text: 'Bob' }, * { value: 'NewYork', text: 'NewYork' }, * { value: new Date("1968/6/8"), text: '6/8/1968' }, * { value: 10000, text: '10 000' } * ], * [ * { value: 'Betty', text: 'Betty' }, * { value: 'NewYork', text: 'NewYork' }, * { value: new Date("1972/7/3"), text: '7/3/1972' }, * { value: 8000, text: '8 000' } * ] * ], ["Name", "City", "Birthday", "Salary"] * ); * console.log(slicerData.getData('Name')); // ['Bob', 'Betty'] * slicerData.onColumnsRemoved(0, 1); * console.log(slicerData.getData('Name')); // [] * ``` */ onColumnsRemoved(colIndex: number, colCount: number): void; /** * Changes data items in the data source of the general slicer data. * @param {GC.Spread.Slicers.ISlicerDataItem} changedDataItems The changed data item in the data source. * @example * ```javascript * var slicerData = new GC.Spread.Slicers.GeneralSlicerData( * [ * [ * { value: 'Bob', text: 'Bob' }, * { value: 'NewYork', text: 'NewYork' }, * { value: new Date("1968/6/8"), text: '6/8/1968' }, * { value: 10000, text: '10 000' } * ], * [ * { value: 'Betty', text: 'Betty' }, * { value: 'NewYork', text: 'NewYork' }, * { value: new Date("1972/7/3"), text: '7/3/1972' }, * { value: 8000, text: '8 000' } * ] * ], ["Name", "City", "Birthday", "Salary"] * ); * console.log(slicerData.getData('Name')); // ['Bob', 'Betty'] * slicerData.onDataChanged([{columnName: 'Name', rowIndex: 1, row: 1, data: {value: 'Alice', text: 'Alice'}}]); * console.log(slicerData.getData('Name')); // ['Bob', 'Alice'] * ``` */ onDataChanged(changedDataItems: GC.Spread.Slicers.ISlicerDataItem): void; /** * Occurs after the slicer data has been filtered. * @param {Array} filteredIndexes The filtered exclusive data indexes. * @param {boolean} isPreview Indicates whether the slicer is in preview mode. */ onFiltered(): void; /** * Adds rows in the data source of the general slicer data. * @param {number} rowIndex The index of the starting row. * @param {number} rowCount The number of rows to add. * @example * ```javascript * var slicerData = new GC.Spread.Slicers.GeneralSlicerData( * [ * [ * { value: 'Bob', text: 'Bob' }, * { value: 'NewYork', text: 'NewYork' }, * { value: new Date("1968/6/8"), text: '6/8/1968' }, * { value: 10000, text: '10 000' } * ], * [ * { value: 'Betty', text: 'Betty' }, * { value: 'NewYork', text: 'NewYork' }, * { value: new Date("1972/7/3"), text: '7/3/1972' }, * { value: 8000, text: '8 000' } * ] * ], ["Name", "City", "Birthday", "Salary"] * ); * console.log(slicerData.getData('Name')); // ['Bob', 'Betty'] * slicerData.onRowsAdded(1, 2); * console.log(slicerData.getData('Name')); // ['Bob', undefined, undefined, 'Betty'] * ``` */ onRowsAdded(rowIndex: number, rowCount: number): void; /** * Removes rows in the data source of the general slicer data. * @param {number} rowIndex The index of the starting row. * @param {number} rowCount The number of rows to remove. * @example * ```javascript * var slicerData = new GC.Spread.Slicers.GeneralSlicerData( * [ * [ * { value: 'Bob', text: 'Bob' }, * { value: 'NewYork', text: 'NewYork' }, * { value: new Date("1968/6/8"), text: '6/8/1968' }, * { value: 10000, text: '10 000' } * ], * [ * { value: 'Betty', text: 'Betty' }, * { value: 'NewYork', text: 'NewYork' }, * { value: new Date("1972/7/3"), text: '7/3/1972' }, * { value: 8000, text: '8 000' } * ] * ], ["Name", "City", "Birthday", "Salary"] * ); * console.log(slicerData.getData('Name')); // ['Bob', 'Betty'] * slicerData.onRowsAdded(1, 2); * console.log(slicerData.getData('Name')); // ['Bob', undefined, undefined, 'Betty'] * slicerData.onRowsRemoved(2, 1); * console.log(slicerData.getData('Name')); // ['Bob', undefined, 'Betty'] * ``` */ onRowsRemoved(rowIndex: number, rowCount: number): void; /** * Resumes the onFiltered event. * @example * ```javascript * var slicerData = new GC.Spread.Slicers.GeneralSlicerData( * [ * [ * { value: 'Bob', text: 'Bob' }, * { value: 'NewYork', text: 'NewYork' }, * { value: new Date("1968/6/8"), text: '6/8/1968' }, * { value: 10000, text: '10 000' } * ], * [ * { value: 'Betty', text: 'Betty' }, * { value: 'NewYork', text: 'NewYork' }, * { value: new Date("1972/7/3"), text: '7/3/1972' }, * { value: 8000, text: '8 000' } * ], * ], ["Name", "City", "Birthday", "Salary"] * ); * //Define custom slicer. * function MySlicer(container) { * this.container = container; * this.slicerData = null; * this.columnName = null; * } * MySlicer.prototype.setData = function (slicerData, columnName) { * this.slicerData = slicerData; * this.columnName = columnName; * // attach listener here * this.slicerData.attachListener(this); * } * MySlicer.prototype.onFiltered = function () { * console.log('filter event triggered'); * } * //create a custom slicer and add this slicer to the "slicerContainer" div. * var slicer = new MySlicer($("#slicerContainer")[0]); * slicer.setData(slicerData, 'Name'); * slicerData.doFilter('Name', {exclusiveRowIndexes: [1]}); * // watch console log: 'filter event triggered' * slicerData.suspendFilteredEvents(); * slicerData.doFilter('Name', {exclusiveRowIndexes: [0]}); * // watch console log: nothing * slicerData.suspendFilteredEvents(); * slicerData.doFilter('Name', {exclusiveRowIndexes: [0, 1]}); * // watch console log: 'filter event triggered' * ``` */ resumeFilteredEvents(): void; /** * Suspends the onFiltered event. * @example * ```javascript * var slicerData = new GC.Spread.Slicers.GeneralSlicerData( * [ * [ * { value: 'Bob', text: 'Bob' }, * { value: 'NewYork', text: 'NewYork' }, * { value: new Date("1968/6/8"), text: '6/8/1968' }, * { value: 10000, text: '10 000' } * ], * [ * { value: 'Betty', text: 'Betty' }, * { value: 'NewYork', text: 'NewYork' }, * { value: new Date("1972/7/3"), text: '7/3/1972' }, * { value: 8000, text: '8 000' } * ], * ], ["Name", "City", "Birthday", "Salary"] * ); * //Define custom slicer. * function MySlicer(container) { * this.container = container; * this.slicerData = null; * this.columnName = null; * } * MySlicer.prototype.setData = function (slicerData, columnName) { * this.slicerData = slicerData; * this.columnName = columnName; * // attach listener here * this.slicerData.attachListener(this); * } * MySlicer.prototype.onFiltered = function () { * console.log('filter event triggered'); * } * //create a custom slicer and add this slicer to the "slicerContainer" div. * var slicer = new MySlicer($("#slicerContainer")[0]); * slicer.setData(slicerData, 'Name'); * slicerData.doFilter('Name', {exclusiveRowIndexes: [1]}); * // watch console log: 'filter event triggered' * slicerData.suspendFilteredEvents(); * slicerData.doFilter('Name', {exclusiveRowIndexes: [0]}); * // watch console log: nothing * slicerData.suspendFilteredEvents(); * slicerData.doFilter('Name', {exclusiveRowIndexes: [0, 1]}); * // watch console log: 'filter event triggered' * ``` */ suspendFilteredEvents(): void; } } } } export = GC;