{
  "$schema": "https://ai.syncfusion.com/schema/registry-item.json",
  "name": "spreadsheet-editor-parsing-and-serialization",
  "framework": "javascript",
  "type": "registry:component",
  "component": "Spreadsheet",
  "variant": "parsing-and-serialization",
  "dependencies": [
    "@syncfusion/ej2-spreadsheet",
    "@syncfusion/ej2-buttons",
    "@syncfusion/ej2-dropdowns",
    "@syncfusion/ej2-inputs"
  ],
  "description": "Spreadsheet editor with parsing and serialization feature to import and export data in various formats.",
  "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": true,
    "platformIndex": "https://ai.syncfusion.com/javascript/llms.txt",
    "skillPack": "syncfusion/javascript-ui-components-skills",
    "docs": "https://ai.syncfusion.com/gallery/javascript/spreadsheet-editor-parsing-and-serialization.md"
  },
  "files": [
    {
      "target": "src/components/spreadsheet-editor-parsing-and-serialization/spreadsheet-editor.html",
      "content": "<div class=\"col-lg-8 control-section\">\n    <div id=\"spreadsheet\"></div>\n</div>\n<div class=\"col-lg-4 property-section\">\n    <div class=\"property\">\n        <input type=\"file\" id=\"parse_upload\">\n        <input type=\"text\" class=\"input\" id=\"open\" style=\"width: 100%;\" />\n        <button id=\"open_button\" style=\"align-self: flex-end; margin-top: 5px; width: 100px;\"></button>\n    </div>\n    <div class=\"property\">\n        <input type=\"text\" class=\"input\" id=\"save\" style=\"width: 100%;\" />\n        <button id=\"save_button\" style=\"align-self: flex-end; margin-top: 5px; width: 100px;\"></button>\n    </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    .col-lg-8 {\n        width: 70%;\n    }\n\n    .col-lg-4 {\n        width: 30%;\n    }\n\n    .e-ss-uploader .e-file-status {\n        display: none !important;\n    }\n\n    .property-section {\n        display: flex;\n        flex-direction: column;\n        gap: 15px;\n        margin-top: 20px;\n    }\n\n    .property {\n        display: flex;\n        flex-direction: column;\n        gap: 10px;\n        padding: 15px;\n        border: 1px solid #a5989887;\n        border-radius: 3px;\n    }\n</style>\n<!-- custom code end -->"
    },
    {
      "target": "src/components/spreadsheet-editor-parsing-and-serialization/spreadsheet-editor.ts",
      "content": "import { type BeforeOpenEventArgs, type BeforeSaveEventArgs, Spreadsheet } from '@syncfusion/ej2-spreadsheet';\nimport { Button } from '@syncfusion/ej2-buttons';\nimport { MultiSelect, CheckBoxSelection } from '@syncfusion/ej2-dropdowns';\nimport { Uploader } from '@syncfusion/ej2-inputs';\nimport { defaultData } from '../datasource/spreadsheet-editor-data';\nMultiSelect.Inject(CheckBoxSelection);\n\nexport function initSpreadsheetEditorParsingAndSerialization(): void {\n    let files: any;\n    const spreadsheet: Spreadsheet = new Spreadsheet({\n        sheets: [\n            {\n                name: 'Car Sales Report',\n                ranges: [{ dataSource: defaultData }],\n                rows: [\n                    {\n                        index: 30,\n                        cells: [\n                            { index: 4, value: 'Total Amount:', style: { fontWeight: 'bold', textAlign: 'right' } },\n                            { formula: '=SUM(F2:F30)', style: { fontWeight: 'bold' } },\n                        ]\n                    }],\n                columns: [\n                    { width: 180 }, { width: 130 }, { width: 130 }, { width: 180 },\n                    { width: 130 }, { width: 120 }\n                ]\n            }],\n        openUrl: 'https://document.syncfusion.com/web-services/spreadsheet-editor/api/spreadsheet/open',\n        saveUrl: 'https://document.syncfusion.com/web-services/spreadsheet-editor/api/spreadsheet/save',\n\n        created: (): void => {\n            spreadsheet.cellFormat({ fontWeight: 'bold', textAlign: 'center', verticalAlign: 'middle' }, 'A1:F1');\n            spreadsheet.numberFormat('$#,##0.00', 'F2:F31');\n            spreadsheet.numberFormat('m/d/yyyy', 'E2:E30');\n        },\n        beforeOpen: (args: BeforeOpenEventArgs) => {\n            args.parseOptions = getSelectedOptions(true);\n        },\n        beforeSave: (args: BeforeSaveEventArgs) => {\n            args.jsonConfig = getSelectedOptions();\n        }\n    });\n    spreadsheet.appendTo('#spreadsheet');\n\n    const multiSelect: MultiSelect = new MultiSelect({\n        dataSource: ['Ignore Styles', 'Ignore Charts', 'Ignore Images', 'Ignore Formats',\n            'Ignore Formulas', 'Ignore Validations', 'Ignore Merged Cells', 'Ignore Conditional Formats'],\n        placeholder: \"Select parse options\",\n        mode: 'CheckBox',\n        showDropDownIcon: true,\n        popupWidth: '240px'\n    });\n    multiSelect.appendTo('#open');\n\n    const multiSelectSave: MultiSelect = new MultiSelect({\n        dataSource: ['Only Values', 'Ignore Styles', 'Ignore Charts', 'Ignore Images',\n            'Ignore Formats', 'Ignore Notes', 'Ignore Wraps', 'Ignore Formulas',\n            'Ignore Validations', 'Ignore Freeze Panes', 'Ignore Conditional Formats'],\n        placeholder: \"Select serialization options\",\n        mode: 'CheckBox',\n        showDropDownIcon: true,\n        popupWidth: '240px'\n    });\n    multiSelectSave.appendTo('#save');\n\n    const uploadObj: Uploader = new Uploader({\n        cssClass: 'e-ss-uploader',\n        allowedExtensions: '.xls, .xlsx, .csv, .xlsm, .xlsb',\n        showFileList: true,\n        buttons: { browse: 'Choose file' },\n        multiple: false,\n        selected: (args: any) => {\n            files = args.filesData[0].rawFile;\n        }\n    });\n    uploadObj.appendTo('#parse_upload');\n\n    const openButton: Button = new Button({ isPrimary: true, content: 'Open' }, '#open_button');\n    openButton.element.onclick = (): void => {\n        if (files) {\n            spreadsheet.open({ file: files });\n        }\n    }\n\n    const saveButton: Button = new Button({ isPrimary: true, content: 'Save' }, '#save_button');\n    saveButton.element.onclick = (): void => {\n        spreadsheet.save({ fileName: 'Sample', saveType: 'Xlsx' });\n    }\n\n    function getSelectedOptions(isOpen?: boolean): { [key: string]: boolean } {\n        const optionMap: { [key: string]: string } = {\n            \"Only Values\": \"onlyValues\", \"Ignore Styles\": \"ignoreStyle\",\n            \"Ignore Charts\": \"ignoreChart\", \"Ignore Images\": \"ignoreImage\",\n            \"Ignore Formats\": \"ignoreFormat\", \"Ignore Notes\": \"ignoreNote\",\n            \"Ignore Wraps\": \"ignoreWrap\", \"Ignore Formulas\": \"ignoreFormula\",\n            \"Ignore Validations\": \"ignoreValidation\", \"Ignore Merged Cells\": \"ignoreMergedCell\",\n            \"Ignore Freeze Panes\": \"ignoreFreezePane\", \"Ignore Conditional Formats\": \"ignoreConditionalFormat\"\n        };\n        const parseOptions: { [key: string]: boolean } = {};\n        const selectedValues: string[] = isOpen ? multiSelect.value as string[] : multiSelectSave.value as string[];\n        if (selectedValues && selectedValues.length > 0) {\n            selectedValues.forEach((value: string) => {\n                if (optionMap[value]) {\n                    parseOptions[optionMap[value]] = true;\n                }\n            });\n        }\n        return parseOptions;\n    }\n}\n"
    }
  ]
}