{
  "$schema": "https://ai.syncfusion.com/schema/registry-item.json",
  "name": "spreadsheet-editor-formula",
  "framework": "javascript",
  "type": "registry:component",
  "component": "Spreadsheet",
  "variant": "formula",
  "dependencies": [
    "@syncfusion/ej2-spreadsheet"
  ],
  "description": "Spreadsheet sample demonstrating formulas, references, and calculation behaviors.",
  "meta": {
    "essentialStudioRelease": "2026 Volume 3 (v35.1.37)",
    "license": "commercial-or-community",
    "licenseNote": "The Syncfusion package is licensed. The composition in this file is source you own and edit. See https://ai.syncfusion.com/licensing.md",
    "requiresLicenseKey": true,
    "requiresServerEndpoint": false,
    "platformIndex": "https://ai.syncfusion.com/javascript/llms.txt",
    "skillPack": "syncfusion/javascript-ui-components-skills",
    "docs": "https://ai.syncfusion.com/gallery/javascript/spreadsheet-editor-formula.md"
  },
  "files": [
    {
      "target": "src/components/spreadsheet-editor-formula/spreadsheet-editor.html",
      "content": "<div class=\"control-section\">\n    <div id=\"container\"></div>\n</div>\n\n<style>\n    .control-section .control-wrapper {\n        height: calc(100vh - 230px);\n    }\n\n    #sb-content .e-spreadsheet .e-tab .e-tab-text {\n        display: inherit;\n    }\n\n    .ej2-new .control-section {\n        height: 550px;\n    }\n    .e-spreadsheet .e-main-panel .e-main-content{\n        margin-left: 0 !important;\n    }\n</style>\n<!-- custom code end -->"
    },
    {
      "target": "src/components/spreadsheet-editor-formula/spreadsheet-editor.ts",
      "content": "import { Spreadsheet, type SheetModel, type CellStyleModel } from '@syncfusion/ej2-spreadsheet';\nimport { formulaData } from '../datasource/spreadsheet-editor-data';\n\nexport function initSpreadsheetEditorFormula(): void {\n    let style: CellStyleModel = { fontWeight: 'bold', backgroundColor: '#279377', color: '#fff', textAlign: 'center',\n        verticalAlign: 'middle', fontSize: '14px' };\n    let sheets: SheetModel[] = [{\n        name: 'Stock Details',\n        rows: [{\n            height: 40\n        },\n        {\n            index: 11,\n            cells: [\n                { index: 3, value: 'Average profit:' },\n                { index: 5, formula: '=AVERAGE(Profit)', format: '0.00' },\n            ],\n            height: 25\n        },\n        {\n            index: 12,\n            cells: [\n                { index: 3, value: 'Maximum stock value:' },\n                { index: 5, formula: '=MAX(High)', format: '0.00' }\n            ],\n            height: 25\n        },\n        {\n            index: 13,\n            cells: [\n                { index: 3, value: 'Minimum stock value:' },\n                { index: 5, formula: '=MIN(E2:E11)' },\n            ],\n            height: 25\n        }, {\n            index: 14,\n            cells: [\n                { index: 3, value: 'Nonprofitable days:' },\n                { index: 5, formula: '=COUNTIF(F2:F11,\"<=0\")' },\n            ],\n            height: 25\n        }],\n        columns: [{ width: 100 }, { width: 130 }, { width: 140 }, { width: 140 }, { width: 130 }, { width: 130 }],\n        selectedRange: 'F15',\n        ranges: [{ dataSource: formulaData }]\n    }];\n\n    //Initialize Spreadsheet component\n    let spreadsheet: Spreadsheet = new Spreadsheet({\n        sheets: sheets,\n        showRibbon: false,\n        //Initializing defined names and its range\n        definedNames: [{\n            name: 'Profit', refersTo: '=F2:F11'\n        },\n        {\n            name: 'High', refersTo: '=D2:D11'\n        }],\n        created: (): void => {\n            spreadsheet.cellFormat(style, 'A1:F1');\n            spreadsheet.cellFormat({ fontWeight: 'bold', backgroundColor: '#EEEEEE' }, 'A12:F15');\n            spreadsheet.numberFormat('0.00', 'F2:F11');\n            spreadsheet.numberFormat('m/d/yyyy', 'A2:A11');\n        }\n    });\n    spreadsheet.appendTo('#container');\n}\n"
    }
  ]
}