{
  "$schema": "https://ai.syncfusion.com/schema/registry-item.json",
  "name": "spreadsheet-editor-data-validation",
  "framework": "javascript",
  "type": "registry:component",
  "component": "Spreadsheet",
  "variant": "data-validation",
  "dependencies": [
    "@syncfusion/ej2-spreadsheet"
  ],
  "description": "Spreadsheet editor with data validation feature using gross pay calculation as an example.",
  "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-data-validation.md"
  },
  "files": [
    {
      "target": "src/components/spreadsheet-editor-data-validation/spreadsheet-editor.html",
      "content": "<div class=\"control-section\">\n    <div id=\"spreadsheet\"></div>\n</div>\n<!-- custom code start -->\n<style>\n    .control-section .control-wrapper {\n        height: calc(100vh - 230px);\n        min-height: 550px\n    }\n\n    .e-spreadsheet .e-main-panel .e-main-content {\n        margin-left: 0 !important;\n    }\n\n    #sb-content .e-spreadsheet .e-tab .e-tab-text {\n        display: inherit;\n    }\n\n    /* newTab support styles */\n    .ej2-new .sb-header,\n    .ej2-new .sb-bread-crumb,\n    .ej2-new #action-description,\n    .ej2-new #description-section,\n    .ej2-new #description {\n        display: none\n    }\n\n    .ej2-new .container-fluid,\n    .ej2-new .container-fluid .control-section,\n    #sidebar-section {\n        padding: 0px;\n    }\n\n    .ej2-new .sample-browser>.content.e-view {\n        top: 0px;\n        padding: 0px;\n        text-align: initial;\n        height: 100%;\n        overflow: hidden;\n    }\n\n    .ej2-new .control-section .control-section {\n        height: 100vh;\n    }\n    /* end of newTab support styles */\n</style>\n<!-- custom code end -->"
    },
    {
      "target": "src/components/spreadsheet-editor-data-validation/spreadsheet-editor.ts",
      "content": "import { type SheetModel, Spreadsheet } from '@syncfusion/ej2-spreadsheet';\nimport { grossPay } from '../datasource/spreadsheet-editor-data';\n\n/**\n * Data Validation sample\n */\nexport function initSpreadsheetEditorDataValidation(): void {\n    //Initialize Spreadsheet component.\n    let sheet: SheetModel[] = [\n        {\n            ranges: [{\n                dataSource: grossPay,\n                startCell: 'A3'\n                },\n            ],\n            name: 'Gross Pay',\n            rows: [{\n                        cells: [{ value: 'Gross Pay Calculation',\n                        style: { fontSize: '20pt', fontWeight : 'bold', textAlign: 'center', backgroundColor: '#B3FFB3',\n                        verticalAlign: 'middle'} }]\n                    },\n                    {\n                        index: 13,\n                        cells: [{\n                            index: 7, value: 'Total Gross',\n                            style: { border: '1px solid #A6A6A6', textAlign: 'center', verticalAlign: 'middle', fontWeight: 'bold'} },\n                        {\n                            index: 8, formula: '=Sum(I4:I13)', format: '$#,##0.00',\n                            style: { border: '1px solid #A6A6A6', textAlign: 'center', verticalAlign: 'middle', fontWeight: 'bold'}\n                        }]\n                    }\n            ],\n            columns: [\n                { width: 88,  }, { width: 120 }, { width: 106 }, { width: 98 }, { width: 110 },\n                { width: 110 }, { width: 110 }, { width: 98}, { width: 130}\n            ]\n        }  ];\n\n    //Initialize the SpreadSheet control\n    let spreadsheet: Spreadsheet = new Spreadsheet({\n        sheets: sheet,\n        created: () => {\n            spreadsheet.merge('A1:I2');\n            spreadsheet.setBorder({ border: '1px solid #A6A6A6' }, 'A1:I13');\n            spreadsheet.cellFormat({ textAlign: 'center', verticalAlign: 'middle'}, 'A3:I13');\n            spreadsheet.cellFormat({ backgroundColor: '#B3FFB3', fontWeight : 'bold'}, 'A3:I3');\n            spreadsheet.numberFormat('$#,##0.00', 'H4:I13');\n            spreadsheet.numberFormat('m/d/yyyy', 'C4:C13');\n            spreadsheet.wrap('H3:I3');\n            //Add Data validation to range.\n            spreadsheet.addDataValidation({ type: 'WholeNumber', operator: 'LessThan', value1: '9', ignoreBlank: false }, 'G4:G13');\n            spreadsheet.addDataValidation({ type: 'TextLength', operator: 'GreaterThan', value1: '3', ignoreBlank: false }, 'B4:B13');\n            spreadsheet.addDataValidation({ type: 'Time', operator: 'GreaterThan', value1: '8:00:00 AM', ignoreBlank: false  }, 'E4:E13');\n            spreadsheet.addDataValidation({ type: 'Time', operator: 'LessThan', value1: '6:00:00 PM', ignoreBlank: false  }, 'F4:F13');\n            spreadsheet.addDataValidation({ type: 'List', value1: 'Mon, Tue, Wed, Thu, Fri', ignoreBlank: false  }, 'D4:D13');\n            spreadsheet.addDataValidation({ type: 'WholeNumber', operator: 'LessThan', value1: '=H5', ignoreBlank: false }, 'I4:I13');\n            //Highlight Invalid Data.\n            spreadsheet.addInvalidHighlight('G4:G13');\n            spreadsheet.addInvalidHighlight('I4:I13');\n        }\n    });\n\n    spreadsheet.appendTo('#spreadsheet');\n}\n"
    }
  ]
}