In order to use the SpreadJS File Format feature, you need to add the related js file link into the document's head section below the Spread link. For example:
SpreadJS supports opening and saving sjs file formats. It also supports importing and exporting xlsx, xlsm, xltm, xltx, ssjson, and csv file formats.
For example:
class GC.Spread.Sheets.Workbook
GC.Spread.Sheets.SaveOptions
GC.Spread.Sheets.OpenOptions
GC.Spread.Sheets.ImportOptions
GC.Spread.Sheets.ExportOptions
GC.Spread.Sheets.ExcelFileType
GC.Spread.Sheets.ImportXlsxOptions
GC.Spread.Sheets.ExportXlsxOptions
GC.Spread.Sheets.ImportCsvOptions
.Spread.Sheets.ExportCsvOptions
GC.Spread.Sheets.ImportSSJsonOptions
GC.Spread.Sheets.ExportSSJsonOptions
import { Component, NgModule, enableProdMode } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { FormsModule } from '@angular/forms';
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
import { SpreadSheetsModule } from '@mescius/spread-sheets-angular';
import GC from '@mescius/spread-sheets';
import '@mescius/spread-sheets-print';
import '@mescius/spread-sheets-io';
import '@mescius/spread-sheets-shapes';
import '@mescius/spread-sheets-charts';
import '@mescius/spread-sheets-slicers';
import '@mescius/spread-sheets-pivot-addon';
import '@mescius/spread-sheets-reportsheet-addon';
import "@mescius/spread-sheets-tablesheet";
import "@mescius/spread-sheets-ganttsheet";
import './styles.css';
declare let orderDataSource: any;
declare var saveAs: any;
@Component({
selector: 'app-component',
templateUrl: 'src/app.component.html'
})
export class AppComponent {
spread: GC.Spread.Sheets.Workbook;
hostStyle = {
width: '100%',
height: '100%'
};
selectedFile: File = null;
openFileType: string = "";
saveFileType: string = "sjs";
excelFileType: string = 'XLSX';
openOptions = {
openMode: 0,
includeStyles: true,
includeFormulas: true,
frozenColumnsAsRowHeaders: false,
frozenRowsAsColumnHeaders: false,
fullRecalc: false,
dynamicReferences: true,
incrementalCalculation: false,
includeUnusedStyles: true,
convertSheetTableToDataTable: false,
incrementalLoading: false,
encoding: "UTF-8",
rowDelimiter: "\r\n",
columnDelimiter: ","
};
saveOptions = {
includeBindingSource: false,
includeStyles: true,
includeFormulas: true,
saveAsView: false,
rowHeadersAsFrozenColumns: false,
columnHeadersAsFrozenRows: false,
includeAutoMergedCells: false,
includeCalcModelCache: false,
includeUnusedNames: true,
includeEmptyRegionCells: true,
losslessEditing: true,
encoding: "UTF-8",
rowDelimiter: "\r\n",
columnDelimiter: ",",
sheetIndex: 0,
row: 0,
column: 0,
rowCount: 200,
columnCount: 20,
};
openOptionsConfig = {
sjs: [
{ propName: "openMode", type: "select", displayText: "OpenMode", options: [{name: 'normal', value: 0}, {name: 'lazy', value: 1}, {name: 'incremental', value: 2}], default: 0 },
{ propName: "includeStyles", type: "boolean", default: true },
{ propName: "includeFormulas", type: "boolean", default: true },
{ propName: "fullRecalc", type: "boolean", default: false },
{ propName: "dynamicReferences", type: "boolean", default: true },
{ propName: "incrementalCalculation", type: "boolean", default: false },
{ propName: "includeUnusedStyles", type: "boolean", default: true },
],
xlsx: [
{ propName: "openMode", type: "select", displayText: "OpenMode", options: [{name: 'normal', value: 0}, {name: 'lazy', value: 1}, {name: 'incremental', value: 2}], default: 0 },
{ propName: "includeStyles", type: "boolean", default: true },
{ propName: "includeFormulas", type: "boolean", default: true },
{ propName: "frozenColumnsAsRowHeaders", type: "boolean", default: false },
{ propName: "frozenRowsAsColumnHeaders", type: "boolean", default: false },
{ propName: "fullRecalc", type: "boolean", default: false },
{ propName: "dynamicReferences", type: "boolean", default: true },
{ propName: "incrementalCalculation", type: "boolean", default: false },
{ propName: "includeUnusedStyles", type: "boolean", default: true },
{ propName: "convertSheetTableToDataTable", type: "boolean", default: false },
],
ssjson: [
{ propName: "includeStyles", type: "boolean", default: true },
{ propName: "includeFormulas", type: "boolean", default: true },
{ propName: "frozenColumnsAsRowHeaders", type: "boolean", default: false },
{ propName: "frozenRowsAsColumnHeaders", type: "boolean", default: false },
{ propName: "fullRecalc", type: "boolean", default: false },
{ propName: "incrementalLoading", type: "boolean", default: false }
],
csv: [
{ propName: "encoding", type: "string", default: "UTF-8" },
{ propName: "rowDelimiter", type: "string", default: "\r\n" },
{ propName: "columnDelimiter", type: "string", default: "," }
]
};
saveOptionsConfig = {
sjs: [
{ propName: "includeBindingSource", type: "boolean", default: false },
{ propName: "includeStyles", type: "boolean", default: true },
{ propName: "includeFormulas", type: "boolean", default: true },
{ propName: "saveAsView", type: "boolean", default: false },
{ propName: "includeAutoMergedCells", type: "boolean", default: false },
{ propName: "includeCalcModelCache", type: "boolean", default: false },
{ propName: "saveR1C1Formula", type: "boolean", default: false },
{ propName: "includeUnusedNames", type: "boolean", default: true },
{ propName: "includeEmptyRegionCells", type: "boolean", default: true },
],
xlsx: [
{ propName: "includeBindingSource", type: "boolean", default: false },
{ propName: "includeStyles", type: "boolean", default: true },
{ propName: "includeFormulas", type: "boolean", default: true },
{ propName: "saveAsView", type: "boolean", default: false },
{ propName: "rowHeadersAsFrozenColumns", type: "boolean", default: false },
{ propName: "columnHeadersAsFrozenRows", type: "boolean", default: false },
{ propName: "includeAutoMergedCells", type: "boolean", default: false },
{ propName: "includeUnusedNames", type: "boolean", default: true },
{ propName: "includeEmptyRegionCells", type: "boolean", default: true },
{ propName: "losslessEditing", type: "boolean", default: true },
],
ssjson: [
{ propName: "includeBindingSource", type: "boolean", default: false },
{ propName: "includeStyles", type: "boolean", default: true },
{ propName: "includeFormulas", type: "boolean", default: true },
{ propName: "saveAsView", type: "boolean", default: false },
{ propName: "rowHeadersAsFrozenColumns", type: "boolean", default: false },
{ propName: "columnHeadersAsFrozenRows", type: "boolean", default: false },
{ propName: "includeAutoMergedCells", type: "boolean", default: false },
],
csv: [
{ propName: "encoding", type: "string", default: "UTF-8" },
{ propName: "rowDelimiter", type: "string", default: "\r\n" },
{ propName: "columnDelimiter", type: "string", default: "," },
{ propName: "sheetIndex", type: "number", default: 0 },
{ propName: "row", type: "number", default: 0 },
{ propName: "column", type: "number", default: 0 },
{ propName: "rowCount", type: "number", default: 200 },
{ propName: "columnCount", type: "number", default: 20 },
]
};
constructor() {
}
initSpread($event: any) {
this.spread = $event.spread;
var statusBar = new GC.Spread.Sheets.StatusBar.StatusBar(document.getElementById('statusBar'));
statusBar.bind(this.spread);
}
selectedFileChange(e: any) {
this.selectedFile = e.target.files[0];
this.openFileType = this.getFileType(this.selectedFile);
}
open() {
var file = this.selectedFile;
if (!file) {
return;
}
var fileType = this.getFileType(file);
var options = this.getOptions('open');
if (fileType === 'sjs') {
this.spread.open(file, function() {}, function() {}, options);
} else {
this.spread.import(file, function() {}, function() {}, options);
}
}
save() {
var fileType = this.saveFileType;
var fileName = 'export.' + (fileType === 'xlsx' ? this.excelFileType.toLowerCase() : fileType);
var options: any = this.getOptions('save');
if (fileType === 'sjs') {
this.spread.save(function(blob) { saveAs(blob, fileName); }, function() {}, options);
} else {
if (fileType === 'csv') {
var { sheetIndex, row, rowCount, column, columnCount } = options;
options.range = {
sheetIndex: sheetIndex,
row: row,
rowCount: rowCount,
column: column,
columnCount: columnCount,
};
}
options.fileType = this.mapExportFileType(fileType);
this.spread.export(function(blob) { saveAs(blob, fileName); }, function() {}, options);
}
}
getOptions (mode: string) {
let optionsConfig;
let optionsValue: any;
if (mode === 'open') {
optionsConfig = this.openOptionsConfig[this.openFileType];
optionsValue = this.openOptions;
} else {
optionsConfig = this.saveOptionsConfig[this.saveFileType];
optionsValue = this.saveOptions;
}
let options = {};
optionsConfig.forEach((prop: any) => {
let v = optionsValue[prop.propName];
if (prop.type === 'number') {
v = +v;
}
options[prop.propName] = v;
});
if (mode === 'save' && this.saveFileType === 'xlsx') {
options['excelFileType'] = this.excelFileType;
}
return options;
}
getFileType(file: File) {
if (!file) {
return;
}
var fileName = file.name;
var extensionName = fileName.substring(fileName.lastIndexOf(".") + 1);
if (extensionName === 'sjs') {
return 'sjs';
} else if (extensionName === 'xlsx' || extensionName === 'xlsm' || extensionName === 'xltm' || extensionName === 'xltx') {
return 'xlsx';
} else if (extensionName === 'ssjson' || extensionName === 'json') {
return 'ssjson';
} else if (extensionName === 'csv') {
return 'csv';
}
}
mapExportFileType (fileType: string) {
if (fileType === 'ssjson') {
return GC.Spread.Sheets.FileType.ssjson;
} else if (fileType === 'csv') {
return GC.Spread.Sheets.FileType.csv;
}
return GC.Spread.Sheets.FileType.excel;
}
needShow(mode: string, propName: string) {
let options = mode === 'open' ? this.openOptionsConfig[this.openFileType] : this.saveOptionsConfig[this.saveFileType];
return options && options.find((p: any) => p.propName === propName);
}
formatOptionLabel(text: string) {
return text
.replace(/([a-z])([A-Z])/g, '$1 $2')
.replace(/([0-9])([A-Z][a-z])/g, '$1 $2')
.replace(/\b[a-z]/g, function (letter: string) {
return letter.toUpperCase();
});
}
}
@NgModule({
imports: [BrowserModule, SpreadSheetsModule, FormsModule],
declarations: [AppComponent],
exports: [AppComponent],
bootstrap: [AppComponent]
})
export class AppModule { }
enableProdMode();
// Bootstrap application with hash style navigation and global services.
platformBrowserDynamic().bootstrapModule(AppModule);
<!doctype html>
<html style="height:100%;font-size:14px;">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link rel="stylesheet" type="text/css" href="$DEMOROOT$/en/angular/node_modules/@mescius/spread-sheets/styles/gc.spread.sheets.excel2013white.css">
<script src="$DEMOROOT$/spread/source/js/FileSaver.js" type="text/javascript"></script>
<!-- Polyfills -->
<script src="$DEMOROOT$/en/angular/node_modules/zone.js/fesm2015/zone.min.js"></script>
<!-- SystemJS -->
<script src="$DEMOROOT$/en/angular/node_modules/systemjs/dist/system.js"></script>
<script src="systemjs.config.js"></script>
<script>
// workaround to load 'rxjs/operators' from the rxjs bundle
System.import('rxjs').then(function (m) {
System.import('@angular/compiler');
System.set(SystemJS.resolveSync('rxjs/operators'), System.newModule(m.operators));
System.import('$DEMOROOT$/en/lib/angular/license.ts');
System.import('./src/app.component');
});
</script>
</head>
<body>
<app-component></app-component>
</body>
</html>
<div class="sample-tutorial">
<div class="sample-container">
<div class="sample-spreadsheets">
<gc-spread-sheets [hostStyle]="hostStyle" (workbookInitialized)="initSpread($event)">
<gc-worksheet>
</gc-worksheet>
</gc-spread-sheets>
</div>
<div id="statusBar"></div>
</div>
<aside class="options-container" aria-label="SpreadJS file format settings">
<div class="panel-header">
<h1>File Format Settings</h1>
<p class="panel-description">Open and save SpreadJS file or Excel file with format-specific import and export options.</p>
</div>
<div class="option-row">
<section class="inputContainer control-section">
<h2>Open File</h2>
<div class="file-action-row">
<label for="selectedFile">Source File</label>
<input id="selectedFile" type="file" accept=".sjs, .xlsx, .xlsm, .xltm, .xltx, .ssjson, .json, .csv" (change)="selectedFileChange($event)" />
<button class="settingButton" id="open" (click)="open()">Open</button>
</div>
<div class="open-options">
<div class="item" *ngIf="needShow('open', 'openMode')">
<label for="open-openMode">{{ formatOptionLabel('openMode') }}</label>
<select id="open-openMode" [(ngModel)]="openOptions.openMode">
<option value="0">normal</option>
<option value="1">lazy</option>
<option value="2">incremental</option>
</select>
</div>
<div class="item" *ngIf="needShow('open', 'openMode')" >
<input type="checkbox" id="open-includeStyles" [(ngModel)]="openOptions.includeStyles"/>
<label for="open-includeStyles">{{ formatOptionLabel('includeStyles') }}</label>
</div>
<div class="item" *ngIf="needShow('open', 'includeFormulas')" >
<input type="checkbox" id="open-includeFormulas" [(ngModel)]="openOptions.includeFormulas"/>
<label for="open-includeFormulas">{{ formatOptionLabel('includeFormulas') }}</label>
</div>
<div class="item" *ngIf="needShow('open', 'frozenColumnsAsRowHeaders')" >
<input type="checkbox" id="open-frozenColumnsAsRowHeaders" [(ngModel)]="openOptions.frozenColumnsAsRowHeaders"/>
<label for="open-frozenColumnsAsRowHeaders">{{ formatOptionLabel('frozenColumnsAsRowHeaders') }}</label>
</div>
<div class="item" *ngIf="needShow('open', 'frozenRowsAsColumnHeaders')" >
<input type="checkbox" id="open-frozenRowsAsColumnHeaders" [(ngModel)]="openOptions.frozenRowsAsColumnHeaders"/>
<label for="open-frozenRowsAsColumnHeaders">{{ formatOptionLabel('frozenRowsAsColumnHeaders') }}</label>
</div>
<div class="item" *ngIf="needShow('open', 'fullRecalc')" >
<input type="checkbox" id="open-fullRecalc" [(ngModel)]="openOptions.fullRecalc"/>
<label for="open-fullRecalc">{{ formatOptionLabel('fullRecalc') }}</label>
</div>
<div class="item" *ngIf="needShow('open', 'dynamicReferences')" >
<input type="checkbox" id="open-dynamicReferences" [(ngModel)]="openOptions.dynamicReferences"/>
<label for="open-dynamicReferences">{{ formatOptionLabel('dynamicReferences') }}</label>
</div>
<div class="item" *ngIf="needShow('open', 'incrementalCalculation')" >
<input type="checkbox" id="open-incrementalCalculation" [(ngModel)]="openOptions.incrementalCalculation"/>
<label for="open-incrementalCalculation">{{ formatOptionLabel('incrementalCalculation') }}</label>
</div>
<div class="item" *ngIf="needShow('open', 'includeUnusedStyles')" >
<input type="checkbox" id="open-includeUnusedStyles" [(ngModel)]="openOptions.includeUnusedStyles"/>
<label for="open-includeUnusedStyles">{{ formatOptionLabel('includeUnusedStyles') }}</label>
</div>
<div class="item" *ngIf="needShow('open', 'convertSheetTableToDataTable')" >
<input type="checkbox" id="open-convertSheetTableToDataTable" [(ngModel)]="openOptions.convertSheetTableToDataTable"/>
<label for="open-convertSheetTableToDataTable">{{ formatOptionLabel('convertSheetTableToDataTable') }}</label>
</div>
<div class="item" *ngIf="needShow('open', 'incrementalLoading')" >
<input type="checkbox" id="open-incrementalLoading" [(ngModel)]="openOptions.incrementalLoading"/>
<label for="open-incrementalLoading">{{ formatOptionLabel('incrementalLoading') }}</label>
</div>
<div class="item" *ngIf="needShow('open', 'encoding')" >
<label for="open-encoding">{{ formatOptionLabel('encoding') }}</label>
<input type="text" id="open-encoding" [(ngModel)]="openOptions.encoding"/>
</div>
<div class="item" *ngIf="needShow('open', 'rowDelimiter')" >
<label for="open-rowDelimiter">{{ formatOptionLabel('rowDelimiter') }}</label>
<input type="text" id="open-rowDelimiter" [(ngModel)]="openOptions.rowDelimiter"/>
</div>
<div class="item" *ngIf="needShow('open', 'columnDelimiter')" >
<label for="open-columnDelimiter">{{ formatOptionLabel('columnDelimiter') }}</label>
<input type="text" id="open-columnDelimiter" [(ngModel)]="openOptions.columnDelimiter"/>
</div>
</div>
</section>
<section class="inputContainer control-section">
<h2>Save File</h2>
<div class="save-action-row">
<label for="saveFileType">File Type</label>
<select id="saveFileType" [(ngModel)]="saveFileType">
<option value="sjs">SJS</option>
<option value="xlsx">Excel</option>
<option value="ssjson">SSJSON</option>
<option value="csv">CSV</option>
</select>
<button class="settingButton" id="save" (click)="save()">Save</button>
</div>
<div class="excelFileTypeContainer" *ngIf="saveFileType === 'xlsx'">
<label for="saveExcelFileType">Excel File Type</label>
<div>
<select id="saveExcelFileType" [(ngModel)]="excelFileType">
<option value="XLSX">Workbook (*.xlsx)</option>
<option value="XLSM">Macro-Enabled Workbook (*.xlsm)</option>
<option value="XLTM">Macro-Enabled Template (*.xltm)</option>
<option value="XLTX">Workbook Template (*.xltx)</option>
</select>
</div>
</div>
<div class="save-options">
<div class="item" *ngIf="needShow('save', 'includeBindingSource')" >
<input type="checkbox" id="save-includeBindingSource" [(ngModel)]="saveOptions.includeBindingSource"/>
<label for="save-includeBindingSource">{{ formatOptionLabel('includeBindingSource') }}</label>
</div>
<div class="item" *ngIf="needShow('save', 'includeStyles')" >
<input type="checkbox" id="save-includeStyles" [(ngModel)]="saveOptions.includeStyles"/>
<label for="save-includeStyles">{{ formatOptionLabel('includeStyles') }}</label>
</div>
<div class="item" *ngIf="needShow('save', 'includeFormulas')" >
<input type="checkbox" id="save-includeFormulas" [(ngModel)]="saveOptions.includeFormulas"/>
<label for="save-includeFormulas">{{ formatOptionLabel('includeFormulas') }}</label>
</div>
<div class="item" *ngIf="needShow('save', 'saveAsView')" >
<input type="checkbox" id="save-saveAsView" [(ngModel)]="saveOptions.saveAsView"/>
<label for="save-saveAsView">{{ formatOptionLabel('saveAsView') }}</label>
</div>
<div class="item" *ngIf="needShow('save', 'rowHeadersAsFrozenColumns')" >
<input type="checkbox" id="save-rowHeadersAsFrozenColumns" [(ngModel)]="saveOptions.rowHeadersAsFrozenColumns"/>
<label for="save-rowHeadersAsFrozenColumns">{{ formatOptionLabel('rowHeadersAsFrozenColumns') }}</label>
</div>
<div class="item" *ngIf="needShow('save', 'columnHeadersAsFrozenRows')" >
<input type="checkbox" id="save-columnHeadersAsFrozenRows" [(ngModel)]="saveOptions.columnHeadersAsFrozenRows"/>
<label for="save-columnHeadersAsFrozenRows">{{ formatOptionLabel('columnHeadersAsFrozenRows') }}</label>
</div>
<div class="item" *ngIf="needShow('save', 'includeAutoMergedCells')" >
<input type="checkbox" id="save-includeAutoMergedCells" [(ngModel)]="saveOptions.includeAutoMergedCells"/>
<label for="save-includeAutoMergedCells">{{ formatOptionLabel('includeAutoMergedCells') }}</label>
</div>
<div class="item" *ngIf="needShow('save', 'includeCalcModelCache')" >
<input type="checkbox" id="save-includeCalcModelCache" [(ngModel)]="saveOptions.includeCalcModelCache"/>
<label for="save-includeCalcModelCache">{{ formatOptionLabel('includeCalcModelCache') }}</label>
</div>
<div class="item" *ngIf="needShow('save', 'saveR1C1Formula')" >
<input type="checkbox" id="save-saveR1C1Formula" [(ngModel)]="saveOptions.saveR1C1Formula"/>
<label for="save-saveR1C1Formula">{{ formatOptionLabel('saveR1C1Formula') }}</label>
</div>
<div class="item" *ngIf="needShow('save', 'includeUnusedNames')" >
<input type="checkbox" id="save-includeUnusedNames" [(ngModel)]="saveOptions.includeUnusedNames"/>
<label for="save-includeUnusedNames">{{ formatOptionLabel('includeUnusedNames') }}</label>
</div>
<div class="item" *ngIf="needShow('save', 'includeEmptyRegionCells')" >
<input type="checkbox" id="save-includeEmptyRegionCells" [(ngModel)]="saveOptions.includeEmptyRegionCells"/>
<label for="save-includeEmptyRegionCells">{{ formatOptionLabel('includeEmptyRegionCells') }}</label>
</div>
<div class="item" *ngIf="needShow('save', 'losslessEditing')" >
<input type="checkbox" id="save-losslessEditing" [(ngModel)]="saveOptions.losslessEditing"/>
<label for="save-losslessEditing">{{ formatOptionLabel('losslessEditing') }}</label>
</div>
<div class="item" *ngIf="needShow('save', 'encoding')" >
<label for="save-encoding">{{ formatOptionLabel('encoding') }}</label>
<input type="text" id="save-encoding" [(ngModel)]="saveOptions.encoding"/>
</div>
<div class="item" *ngIf="needShow('save', 'rowDelimiter')" >
<label for="save-rowDelimiter">{{ formatOptionLabel('rowDelimiter') }}</label>
<input type="text" id="save-rowDelimiter" [(ngModel)]="saveOptions.rowDelimiter"/>
</div>
<div class="item" *ngIf="needShow('save', 'columnDelimiter')" >
<label for="save-columnDelimiter">{{ formatOptionLabel('columnDelimiter') }}</label>
<input type="text" id="save-columnDelimiter" [(ngModel)]="saveOptions.columnDelimiter"/>
</div>
<div class="item" *ngIf="needShow('save', 'sheetIndex')" >
<label for="save-sheetIndex">{{ formatOptionLabel('sheetIndex') }}</label>
<input type="number" id="save-sheetIndex" [(ngModel)]="saveOptions.sheetIndex"/>
</div>
<div class="item" *ngIf="needShow('save', 'row')" >
<label for="save-row">{{ formatOptionLabel('row') }}</label>
<input type="number" id="save-row" [(ngModel)]="saveOptions.row"/>
</div>
<div class="item" *ngIf="needShow('save', 'column')" >
<label for="save-column">{{ formatOptionLabel('column') }}</label>
<input type="number" id="save-column" [(ngModel)]="saveOptions.column"/>
</div>
<div class="item" *ngIf="needShow('save', 'rowCount')" >
<label for="save-rowCount">{{ formatOptionLabel('rowCount') }}</label>
<input type="number" id="save-rowCount" [(ngModel)]="saveOptions.rowCount"/>
</div>
<div class="item" *ngIf="needShow('save', 'columnCount')" >
<label for="save-columnCount">{{ formatOptionLabel('columnCount') }}</label>
<input type="number" id="save-columnCount" [(ngModel)]="saveOptions.columnCount"/>
</div>
</div>
</section>
</div>
</aside>
</div>
html,
body {
height: 100%;
margin: 0;
}
body {
position: absolute;
inset: 0;
color: #1f2933;
background: #f7f8fa;
}
app-component {
display: block;
height: 100%;
}
.sample-tutorial {
display: flex;
height: 100%;
overflow: hidden;
}
.sample-container {
display: flex;
flex: 1 1 auto;
flex-direction: column;
min-width: 0;
height: 100%;
}
.sample-spreadsheets {
flex: 1 1 auto;
min-height: 0;
overflow: hidden;
}
#statusBar {
flex: 0 0 25px;
width: 100%;
}
.options-container {
flex: 0 0 320px;
width: 320px;
height: 100%;
padding: 18px 16px;
box-sizing: border-box;
overflow: auto;
overflow-x: hidden;
background: #ffffff;
border-left: 1px solid #e5e7eb;
}
.sample-options {
z-index: 1000;
}
.panel-header {
padding-bottom: 14px;
border-bottom: 1px solid #eef0f3;
}
.panel-header h1 {
margin: 0;
font-size: 18px;
font-weight: 650;
line-height: 1.25;
}
.panel-description {
margin: 8px 0 0;
color: #6b7280;
font-size: 13px;
line-height: 1.6;
}
.option-row {
display: grid;
}
.inputContainer {
box-sizing: border-box;
}
.control-section {
padding: 14px 0;
border-bottom: 1px solid #eef0f3;
}
.control-section:last-child {
border-bottom: 0;
}
.control-section h2 {
margin: 0 0 10px;
color: #374151;
font-size: 13px;
font-weight: 700;
line-height: 1.3;
}
.options-container label {
color: #374151;
font-size: 13px;
font-weight: 600;
line-height: 1.35;
}
.options-container select,
.options-container input[type="text"],
.options-container input[type="number"] {
width: 100%;
height: 30px;
padding: 0 8px;
box-sizing: border-box;
color: #111827;
font: inherit;
background: #ffffff;
border: 1px solid #d8dde5;
border-radius: 6px;
outline: none;
transition: border-color .15s ease, box-shadow .15s ease;
}
.options-container select:focus,
.options-container input[type="text"]:focus,
.options-container input[type="number"]:focus,
.options-container input[type="file"]:focus,
.options-container button:focus {
border-color: #2563eb;
box-shadow: 0 0 0 3px rgba(37, 99, 235, .12);
}
.options-container input[type="file"] {
display: block;
min-width: 0;
color: #374151;
font-size: 12px;
}
.options-container input[type="file"]::file-selector-button {
height: 28px;
margin-right: 8px;
padding: 0 10px;
color: #1f4f82;
font: inherit;
font-weight: 600;
cursor: pointer;
background: #ffffff;
border: 1px solid #9bb2cf;
border-radius: 4px;
}
.options-container button,
.options-container input[type="button"] {
min-height: 30px;
padding: 0 12px;
box-sizing: border-box;
color: #1f4f82;
font: inherit;
font-weight: 600;
cursor: pointer;
background: #ffffff;
border: 1px solid #9bb2cf;
border-radius: 4px;
transition: background-color .15s ease, border-color .15s ease;
}
.options-container button:hover,
.options-container input[type="button"]:hover {
background: #edf5ff;
border-color: #6f98c8;
}
.settingButton {
flex: 0 0 auto;
margin: 0;
}
.file-action-row,
.save-action-row {
display: grid;
grid-template-columns: auto minmax(0, 1fr) auto;
gap: 8px;
align-items: center;
min-width: 0;
}
.file-action-row {
margin-bottom: 8px;
}
.file-action-row label,
.save-action-row label {
white-space: nowrap;
}
.file-action-row input[type="file"] {
width: 100%;
max-width: 100%;
min-width: 0;
overflow: hidden;
text-overflow: clip;
}
.save-action-row {
margin-bottom: 10px;
}
.save-action-row select {
width: 100%;
min-width: 0;
}
#open,
#save {
min-width: 56px;
}
.open-options .item,
.save-options .item {
display: flex;
gap: 8px;
align-items: center;
min-height: 24px;
margin: 4px 0;
}
.open-options .item label,
.save-options .item label {
flex: 1 1 auto;
min-width: 0;
font-weight: 500;
overflow-wrap: anywhere;
}
.open-options .item select,
.save-options .item select,
.open-options .item input[type="text"],
.save-options .item input[type="text"],
.open-options .item input[type="number"],
.save-options .item input[type="number"] {
flex: 0 0 128px;
width: 128px;
height: 28px;
}
.open-options .item input[type="checkbox"],
.save-options .item input[type="checkbox"] {
width: 16px;
height: 16px;
margin: 0;
accent-color: #2563eb;
flex: 0 0 auto;
}
.excelFileTypeContainer {
margin-bottom: 10px;
}
#saveExcelFileType {
margin: 8px 0 0;
}
@media (max-width: 760px) {
.sample-tutorial {
flex-direction: column;
}
.sample-container {
flex: 1 1 55%;
min-height: 55%;
}
.options-container {
flex: 0 0 45%;
width: 100%;
height: 45%;
border-top: 1px solid #e5e7eb;
border-left: 0;
}
}
(function (global) {
System.config({
transpiler: 'ts',
typescriptOptions: {
tsconfig: true
},
meta: {
'typescript': {
"exports": "ts"
},
'*.css': { loader: 'css' }
},
paths: {
// paths serve as alias
'npm:': 'node_modules/',
'cdn:': 'https://cdn.mescius.io/demoapps/packages/spreadjs/19.2.0-master-2026-08-10-0936/'
},
// map tells the System loader where to look for things
map: {
'zone': 'npm:zone.js/fesm2015/zone.min.js',
'rxjs': 'npm:rxjs/dist/bundles/rxjs.umd.min.js',
'@angular/core': 'npm:@angular/core/fesm2022',
'@angular/common': 'npm:@angular/common/fesm2022/common.mjs',
'@angular/compiler': 'npm:@angular/compiler/fesm2022/compiler.mjs',
'@angular/platform-browser': 'npm:@angular/platform-browser/fesm2022/platform-browser.mjs',
'@angular/platform-browser-dynamic': 'npm:@angular/platform-browser-dynamic/fesm2022/platform-browser-dynamic.mjs',
'@angular/common/http': 'npm:@angular/common/fesm2022/http.mjs',
'@angular/router': 'npm:@angular/router/fesm2022/router.mjs',
'@angular/forms': 'npm:@angular/forms/fesm2022/forms.mjs',
'jszip': 'npm:jszip/dist/jszip.min.js',
'typescript': 'npm:typescript/lib/typescript.js',
'ts': './plugin.js',
'tslib':'npm:tslib/tslib.js',
'css': 'npm:systemjs-plugin-css/css.js',
'plugin-babel': 'npm:systemjs-plugin-babel/plugin-babel.js',
'systemjs-babel-build':'npm:systemjs-plugin-babel/systemjs-babel-browser.js',
'@mescius/spread-sheets': 'cdn:@mescius/spread-sheets/index.js',
'@mescius/spread-sheets-print': 'cdn:@mescius/spread-sheets-print/index.js',
'@mescius/spread-sheets-io': 'cdn:@mescius/spread-sheets-io/index.js',
'@mescius/spread-sheets-charts': 'cdn:@mescius/spread-sheets-charts/index.js',
'@mescius/spread-sheets-shapes': 'cdn:@mescius/spread-sheets-shapes/index.js',
'@mescius/spread-sheets-slicers': 'cdn:@mescius/spread-sheets-slicers/index.js',
'@mescius/spread-sheets-pivot-addon': 'cdn:@mescius/spread-sheets-pivot-addon/index.js',
'@mescius/spread-sheets-reportsheet-addon': 'cdn:@mescius/spread-sheets-reportsheet-addon/index.js',
'@mescius/spread-sheets-tablesheet': 'cdn:@mescius/spread-sheets-tablesheet/index.js',
'@mescius/spread-sheets-ganttsheet': 'cdn:@mescius/spread-sheets-ganttsheet/index.js',
'@mescius/spread-sheets-angular': 'cdn:@mescius/spread-sheets-angular/fesm2020/mescius-spread-sheets-angular.mjs',
'@grapecity/jsob-test-dependency-package/react-components': 'npm:@grapecity/jsob-test-dependency-package/react-components/index.js'
},
// packages tells the System loader how to load when no filename and/or no extension
packages: {
src: {
defaultExtension: 'ts'
},
rxjs: {
defaultExtension: 'js'
},
"node_modules": {
defaultExtension: 'js'
},
"node_modules/@angular": {
defaultExtension: 'mjs'
},
"@mescius/spread-sheets-angular": {
defaultExtension: 'mjs'
},
'@angular/core': {
defaultExtension: 'mjs',
main: 'core.mjs'
}
}
});
})(this);