{
  "$schema": "https://ai.syncfusion.com/schema/registry-item.json",
  "name": "spreadsheet-editor-cell-formatting",
  "framework": "vue",
  "type": "registry:component",
  "component": "SpreadsheetEditor",
  "variant": "cell-formatting",
  "dependencies": [
    "@syncfusion/ej2-vue-spreadsheet"
  ],
  "description": "Spreadsheet editor with cell formatting feature by applying different styles to a range of cells.",
  "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/vue/llms.txt",
    "skillPack": "syncfusion/vue-ui-components-skills",
    "docs": "https://ai.syncfusion.com/gallery/vue/spreadsheet-editor-cell-formatting.md"
  },
  "files": [
    {
      "target": "src/components/spreadsheet-editor-cell-formatting/SpreadSheetEditor.vue",
      "content": "<template>\n  <div class=\"control-section\">\n    <div id=\"spreadsheet-cell-format\">\n      <ejs-spreadsheet ref=\"spreadsheet\" :showRibbon=\"false\" :showFormulaBar=\"false\" :created=\"createdHandler\" :beforeCellRender=\"beforeCellRender\">\n        <e-sheets>\n          <e-sheet name=\"Order Details\" :showGridLines=\"false\">\n            <e-ranges>\n              <e-range :dataSource=\"orderDetails\"></e-range>\n            </e-ranges>\n            <e-columns>\n              <e-column :width=\"70\"></e-column>\n              <e-column :width=\"126\"></e-column>\n              <e-column :width=\"172\"></e-column>\n              <e-column :width=\"90\"></e-column>\n              <e-column :width=\"238\"></e-column>\n              <e-column :width=\"82\"></e-column>\n              <e-column :width=\"80\"></e-column>\n              <e-column :width=\"249\"></e-column>\n            </e-columns>\n          </e-sheet>\n        </e-sheets>\n      </ejs-spreadsheet>\n    </div>\n  </div>\n</template>\n<script>\nimport { SpreadsheetComponent, SheetsDirective, SheetDirective, ColumnsDirective, ColumnDirective, RangesDirective, RangeDirective, getFormatFromType } from \"@syncfusion/ej2-vue-spreadsheet\";\nimport { orderDetails } from '../datasource/spreadsheet-editor-data';\n\nexport default {\n   components: {\n    'ejs-spreadsheet': SpreadsheetComponent,\n    'e-sheet': SheetDirective,\n    'e-sheets': SheetsDirective,\n    'e-column': ColumnDirective,\n    'e-columns': ColumnsDirective,\n    'e-range': RangeDirective,\n    'e-ranges': RangesDirective\n   }, \n   data: () => {\n      return {\n          orderDetails: orderDetails\n      }\n  },\n  methods: {\n    createdHandler: function() {\n        // Temporarily suspends UI rendering to batch model updates for better performance.\n        this.$refs.spreadsheet.suspendRefresh();\n        //Applying cell formatting dynamically using cellFormat method.\n        this.$refs.spreadsheet.cellFormat({ fontWeight: 'bold', backgroundColor: '#4b5366', color: '#ffffff', fontSize: '12pt' }, 'A1:I1');\n        this.$refs.spreadsheet.cellFormat({ fontWeight: 'bold', textIndent: '2pt' }, 'B2:B16');\n        this.$refs.spreadsheet.cellFormat({ fontStyle: 'italic', textIndent: '2pt' }, 'E2:E16');\n        this.$refs.spreadsheet.cellFormat({ textAlign: 'center', fontWeight: 'bold' }, 'G2:G16');\n        this.$refs.spreadsheet.cellFormat({ textAlign: 'center'}, 'H2:H16');\n        this.$refs.spreadsheet.cellFormat({ fontFamily: 'Helvetica New', verticalAlign: 'middle' }, 'A1:I16');\n        //Applying border to a range\n        this.$refs.spreadsheet.setBorder({ border: '1px solid #e0e0e0' }, 'A1:I16', 'Outer');\n        this.$refs.spreadsheet.setBorder({ border: '1px solid #e0e0e0' }, 'A2:I15', 'Horizontal');\n        // Applying a short date format to a range.\n        this.$refs.spreadsheet.numberFormat('m/d/yyyy', 'D2:D16');\n        // Applying currency format to a range.\n        this.$refs.spreadsheet.numberFormat('$#,##0.00', 'I2:I16');\n        // Applying subscript and superscript format.\n        this.$refs.spreadsheet.updateCell({ richText: [\n                { text: 'Mineral Water H' },\n                { text: '2', style: { verticalAlign: 'sub' } },\n                { text: 'O' }\n            ] }, 'C2');\n        this.$refs.spreadsheet.updateCell({ richText: [\n                { text: 'Energy Supplement C' },\n                { text: '6', style: { verticalAlign: 'sub' } },\n                { text: 'H' },\n                { text: '12', style: { verticalAlign: 'sub' } },\n                { text: 'O' },\n                { text: '6', style: { verticalAlign: 'sub' } }\n            ] }, 'C4');\n        this.$refs.spreadsheet.updateCell({ richText: [\n                { text: 'Refrigerant Gas CO' },\n                { text: '2', style: { verticalAlign: 'sub' } }\n            ] }, 'C6');\n        this.$refs.spreadsheet.updateCell({ richText: [\n                { text: 'Water Purifier H' },\n                { text: '2', style: { verticalAlign: 'sub' } },\n                { text: 'O System' }\n            ] }, 'C10');\n        // Address formatting with maintained superscript for ordinals\n        this.$refs.spreadsheet.updateCell({ richText: [\n                { text: 'n' },\n                { text: 'o', style: { verticalAlign: 'super' } },\n                { text: ' 59 rue de l Abbaye' },\n                { text: ', Reims 51100' }\n            ] }, 'E2');\n        this.$refs.spreadsheet.updateCell({ richText: [\n                { text: '2' },\n                { text: 'e', style: { verticalAlign: 'super' } },\n                { text: ' rue du Commerce' },\n                { text: ', Lyon 69004'}\n            ] }, 'E5');\n        this.$refs.spreadsheet.updateCell({ richText: [\n                { text: '6' },\n                { text: 'th', style: { verticalAlign: 'super' } },\n                { text: ' street, Kirchgasse' },\n                { text: ', Graz 8010'}\n            ] }, 'E7');\n        this.$refs.spreadsheet.updateCell({ richText: [\n                { text: '22' },\n                { text: 'nd', style: { verticalAlign: 'super' } },\n                { text: ' Carrera con Ave. Carlos Soublette' },\n                { text: ', San Cristóbal 5022'}\n            ] }, 'E11');\n        this.$refs.spreadsheet.updateCell({ richText: [\n                { text: '101 4' },\n                { text: 'th', style: { verticalAlign: 'super' } },\n                { text: ' Street, San Francisco' },\n                { text: ', Albuquerque 87110'}\n            ] }, 'E16');\n        // Order Notes rich text formatting with styled pipe separator\n        this.$refs.spreadsheet.updateCell({ richText: [\n                { text: 'Quality Checked', style: { fontWeight: 'bold', color: '#1F4E79' } },\n                { text: ' | ', style: { color: '#808080' } },\n                { text: 'Signed by Customer', style: { fontStyle: 'italic', color: '#2E8B57' } }\n            ] }, 'H2');\n        this.$refs.spreadsheet.updateCell({ richText: [\n                { text: 'Packed Securely', style: { fontWeight: 'bold', color: '#1F4E79' } },\n                { text: ' | ', style: { color: '#808080' } },\n                { text: 'Customer Confirmed', style: { fontStyle: 'italic', color: '#2E8B57' } }\n            ] }, 'H3');\n        this.$refs.spreadsheet.updateCell({ richText: [\n                { text: 'Tracking Active', style: { fontWeight: 'bold', color: '#1F4E79' } },\n                { text: ' | ', style: { color: '#808080' } },\n                { text: 'Express Delivery', style: { fontStyle: 'italic', color: '#2E8B57' } }\n            ] }, 'H4');\n        this.$refs.spreadsheet.updateCell({ richText: [\n                { text: 'Delivery Verified', style: { fontWeight: 'bold', color: '#1F4E79' } },\n                { text: ' | ', style: { color: '#808080' } },\n                { text: 'Received On Time', style: { fontStyle: 'italic', color: '#2E8B57' } }\n            ] }, 'H5');\n        this.$refs.spreadsheet.updateCell({ richText: [\n                { text: 'Shipment Processed', style: { fontWeight: 'bold', color: '#1F4E79' } },\n                { text: ' | ', style: { color: '#808080' } },\n                { text: 'Route Confirmed', style: { fontStyle: 'italic', color: '#2E8B57' } }\n            ] }, 'H6');\n        this.$refs.spreadsheet.updateCell({ richText: [\n                { text: 'Return Requested', style: { fontWeight: 'bold', color: '#1F4E79' } },\n                { text: ' | ', style: { color: '#808080' } },\n                { text: 'Refund Approved', style: { fontStyle: 'italic', color: '#2E8B57' } }\n            ] }, 'H7');\n        this.$refs.spreadsheet.updateCell({ richText: [\n                { text: 'Awaiting Dispatch', style: { fontWeight: 'bold', color: '#1F4E79' } },\n                { text: ' | ', style: { color: '#808080' } },\n                { text: 'Inventory Reserved', style: { fontStyle: 'italic', color: '#2E8B57' } }\n            ] }, 'H8');\n        this.$refs.spreadsheet.updateCell({ richText: [\n                { text: 'Quality Checked', style: { fontWeight: 'bold', color: '#1F4E79' } },\n                { text: ' | ', style: { color: '#808080' } },\n                { text: 'Signature Required', style: { fontStyle: 'italic', color: '#2E8B57' } }\n            ] }, 'H9');\n        this.$refs.spreadsheet.updateCell({ richText: [\n                { text: 'Tracking Active', style: { fontWeight: 'bold', color: '#1F4E79' } },\n                { text: ' | ', style: { color: '#808080' } },\n                { text: 'Scheduled Delivery', style: { fontStyle: 'italic', color: '#2E8B57' } }\n            ] }, 'H10');\n        this.$refs.spreadsheet.updateCell({ richText: [\n                { text: 'Package Delivered', style: { fontWeight: 'bold', color: '#1F4E79' } },\n                { text: ' | ', style: { color: '#808080' } },\n                { text: 'Customer Verified', style: { fontStyle: 'italic', color: '#2E8B57' } }\n            ] }, 'H11');\n        this.$refs.spreadsheet.updateCell({ richText: [\n                { text: 'Refund Initiated', style: { fontWeight: 'bold', color: '#1F4E79' } },\n                { text: ' | ', style: { color: '#808080' } },\n                { text: 'Case Closed', style: { fontStyle: 'italic', color: '#2E8B57' } }\n            ] }, 'H12');\n        this.$refs.spreadsheet.updateCell({ richText: [\n                { text: 'Awaiting Processing', style: { fontWeight: 'bold', color: '#1F4E79' } },\n                { text: ' | ', style: { color: '#808080' } },\n                { text: 'Stock Allocation', style: { fontStyle: 'italic', color: '#2E8B57' } }\n            ] }, 'H13');\n        this.$refs.spreadsheet.updateCell({ richText: [\n                { text: 'Inspection Passed', style: { fontWeight: 'bold', color: '#1F4E79' } },\n                { text: ' | ', style: { color: '#808080' } },\n                { text: 'Customer Approved', style: { fontStyle: 'italic', color: '#2E8B57' } }\n            ] }, 'H14');\n        this.$refs.spreadsheet.updateCell({ richText: [\n                { text: 'Order Packed', style: { fontWeight: 'bold', color: '#1F4E79' } },\n                { text: ' | ', style: { color: '#808080' } },\n                { text: 'Carrier Assigned', style: { fontStyle: 'italic', color: '#2E8B57' } }\n            ] }, 'H15');\n        this.$refs.spreadsheet.updateCell({ richText: [\n                { text: 'Delivered Successfully', style: { fontWeight: 'bold', color: '#1F4E79' } },\n                { text: ' | ', style: { color: '#808080' } },\n                { text: 'Signature Captured', style: { fontStyle: 'italic', color: '#2E8B57' } }\n            ] }, 'H16');\n        // Resumes rendering and applies all queued UI updates at once.\n        this.$refs.spreadsheet.resumeRefresh();\n    },\n    beforeCellRender: function(args) {\n       if (this.applyCellFormat()) {\n            if (args.cell && args.cell.value) {\n                //Applying cell formatting before rendering the particular cell\n                switch (args.cell.value) {\n                    case 'Delivered':\n                        this.$refs.spreadsheet.cellFormat({ color: '#10c469', textDecoration: 'line-through' }, args.address);\n                        break;\n                    case 'Shipped':\n                        this.$refs.spreadsheet.cellFormat({ color: '#62c9e8' }, args.address);\n                        break;\n                    case 'Pending':\n                        this.$refs.spreadsheet.cellFormat({ color: '#FFC107', textDecoration: 'underline' }, args.address);\n                        break;\n                    case 'Cancelled':\n                        this.$refs.spreadsheet.cellFormat({ color: '#ff5b5b' }, args.address);\n                        break;\n                }\n            }\n      }\n    },\n    applyCellFormat: function() {\n      return !this.$refs.spreadsheet.ej2Instances.isOpen && this.$refs.spreadsheet.ej2Instances.sheets[this.$refs.spreadsheet.ej2Instances.activeSheetIndex].name === 'Order Details';\n    }\n  }\n}\n</script>"
    }
  ]
}