To create a check box cell, follow this example:
The CheckBox can support a three-state check box. You can use the isThreeState method to get and set whether the check box supports three states. For example:
The three states are true, false, or indeterminate. Every state has its own text; you can use the textTrue, textFalse, and textIndeterminate methods to get and set these states' text. For example:
You can use the caption method to get and set the caption of the check box cell. Use the textAlign method to get and set the text alignment relative to the check box. The setting is a CheckBoxTextAlign enumeration value.
top: Text is on top of the check box.
bottom: Text is below the check box.
left: Text is to the left of the check box.
right: Text is to the right of the check box.
inside: Text is to the inside of the check box. This enumeration value takes effect only when mode is set to toggle.
You can use the boxSize method to get and set checkbox size. You can set number or "auto" to cellType.
When the cell style "wordWrap” is set to true and the cell width is not enough for the text, the text will display wrapped.
You can use the mode method to get and set checkbox mode. You can set "checkbox" or "toggle" to cellType.
You can use the toggleOptions method to get and set the toggle options of a checkbox. Please refer to GC.Spread.Sheets.CellTypes.IToggleOptions for parameter types.
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 './styles.css';
const spreadNS = GC.Spread.Sheets;
@Component({
selector: 'app-component',
templateUrl: 'src/app.component.html'
})
export class AppComponent {
hostStyle = {
width: 'calc(100% - 280px)',
height: '100%',
overflow: 'hidden',
float: 'left'
};
caption = '';
textTrue = 'textTrue';
textIndeterminate = 'textIndeterminate';
textFalse = 'textFalse';
textAlign = 'top';
isThreeState = true;
disabled = false;
hasCaption: any = null;
boxSize: number | string = 12;
mode: string = 'checkbox';
width: number = 40;
height: number = 20;
sliderMargin: number = 2;
sliderRadius: number | null = null;
trackRadius: number | null = null;
trackColorOn: string = '#8cbae8';
trackColorOff: string = '#9e9e9e';
sliderColorOn: string = '#1565c0';
sliderColorOff: string = '#ffffff';
animationDuration: number = 200;
autoSize: boolean = false;
spread: GC.Spread.Sheets.Workbook;
propertyChange(e: MouseEvent, settings?: any) {
var spreadNS = GC.Spread.Sheets;
const sheet = this.spread.getActiveSheet();
const sels = sheet.getSelections();
if (sels && sels.length > 0) {
const sel = this.getActualRange(sels[0], sheet.getRowCount(), sheet.getColumnCount());
const checkboxCellType = sheet.getCellType(sel.row, sel.col);
if (!(checkboxCellType instanceof spreadNS.CellTypes.CheckBox)) {
this.disabled = true;
return;
}
const checkboxMode = checkboxCellType.mode();
if (!settings) {
if (checkboxMode === 'toggle') {
this.mode = 'toggle';
this.disabled = false;
this.hasCaption = true;
this.caption = checkboxCellType.caption();
this.textTrue = checkboxCellType.textTrue();
this.textFalse = checkboxCellType.textFalse();
this.textAlign = checkboxCellType.textAlign();
const toggleOptions = checkboxCellType.toggleOptions();
this.width = toggleOptions.width;
this.height = toggleOptions.height;
this.trackColorOn = toggleOptions.trackColorOn;
this.trackColorOff = toggleOptions.trackColorOff;
this.sliderColorOn = toggleOptions.sliderColorOn;
this.sliderColorOff = toggleOptions.sliderColorOff;
this.animationDuration = toggleOptions.animationDuration;
this.autoSize = toggleOptions.autoSize;
this.sliderMargin = toggleOptions.sliderMargin;
this.sliderRadius = toggleOptions.sliderRadius;
this.trackRadius = toggleOptions.trackRadius;
} else {
this.mode = 'checkbox';
this.disabled = false;
this.hasCaption = checkboxCellType.caption() ? true : false;
this.caption = checkboxCellType.caption();
this.textTrue = checkboxCellType.textTrue();
this.textIndeterminate = checkboxCellType.textIndeterminate();
this.textFalse = checkboxCellType.textFalse();
this.textAlign = checkboxCellType.textAlign();
this.isThreeState = checkboxCellType.isThreeState();
this.boxSize = checkboxCellType.boxSize();
}
} else {
if (checkboxMode === 'checkbox') {
checkboxCellType.caption(this.caption);
checkboxCellType.textTrue(this.textTrue);
checkboxCellType.textIndeterminate(this.textIndeterminate);
checkboxCellType.textFalse(this.textFalse);
checkboxCellType.textAlign(Number(this.textAlign));
checkboxCellType.isThreeState(this.isThreeState);
var boxSize = Number(this.boxSize);
if (isNaN(boxSize)) {
checkboxCellType.boxSize(this.boxSize);
} else {
checkboxCellType.boxSize(boxSize);
}
} else {
checkboxCellType.caption(this.caption);
checkboxCellType.textTrue(this.textTrue);
checkboxCellType.textFalse(this.textFalse);
checkboxCellType.textAlign(Number(this.textAlign));
checkboxCellType.toggleOptions({
width: this.width - 0,
height: this.height - 0,
sliderMargin: this.sliderMargin - 0,
sliderRadius: this.sliderRadius === null ? null : (this.sliderRadius - 0),
trackRadius: this.trackRadius === null ? null : (this.trackRadius - 0),
sliderColorOn: this.sliderColorOn,
sliderColorOff: this.sliderColorOff,
trackColorOn: this.trackColorOn,
trackColorOff: this.trackColorOff,
animationDuration: this.animationDuration - 0,
autoSize: this.autoSize,
});
}
}
}
sheet.repaint();
}
getActualRange(range: GC.Spread.Sheets.Range, maxRowCount: number, maxColCount: number) {
var spreadNS = GC.Spread.Sheets;
const row = range.row < 0 ? 0 : range.row;
const col = range.col < 0 ? 0 : range.col;
const rowCount = range.rowCount < 0 ? maxRowCount : range.rowCount;
const colCount = range.colCount < 0 ? maxColCount : range.colCount;
return new spreadNS.Range(row, col, rowCount, colCount);
}
initCellStyle(fontSize: number, foreColor: string) {
const style = new GC.Spread.Sheets.Style();
style.hAlign = GC.Spread.Sheets.HorizontalAlign.center;
style.vAlign = GC.Spread.Sheets.VerticalAlign.center;
style.font = `bold ${fontSize}pt Calibri`;
style.foreColor = foreColor;
return style;
}
initSpread($event: any) {
this.spread = $event.spread;
this.initToggleSheet(this.spread);
this.initCheckboxSheet(this.spread);
}
initToggleSheet(spread: GC.Spread.Sheets.Workbook) {
var spreadNS = GC.Spread.Sheets;
var sheet1 = spread.getSheet(0);
sheet1.name("Toggle");
sheet1.defaults.colWidth = 190;
sheet1.defaults.rowHeight = 60;
sheet1.suspendPaint();
sheet1.bind(spreadNS.Events.SelectionChanged, () => {
this.propertyChange(spread, false);
});
sheet1.setColumnWidth(0, 110);
sheet1.setColumnWidth(1, 190);
sheet1.setColumnWidth(2, 130);
sheet1.setColumnWidth(3, 110);
sheet1.setColumnWidth(4, 190);
sheet1.setColumnWidth(5, 130);
sheet1.setColumnWidth(6, 130);
sheet1.setColumnWidth(7, 130);
sheet1.setColumnWidth(8, 130);
sheet1.setColumnWidth(9, 130);
for (let i = 0; i < 7; i++) {
sheet1.setRowHeight(i, 60);
}
sheet1.addSpan(0, 0, 7, 1);
sheet1.setValue(0, 0, "Toggle Mode");
// sheet1.setStyle(0, 0, initCellStyle(11, "Accent 1"));
sheet1.setStyle(0, 0, this.initCellStyle(11, "Accent 2"));
sheet1.setStyle(0, 1, this.initCellStyle(11, "#000"));
sheet1.setStyle(1, 1, this.initCellStyle(11, "#000"));
sheet1.setStyle(2, 1, this.initCellStyle(11, "#000"));
sheet1.setStyle(3, 1, this.initCellStyle(11, "#000"));
sheet1.setStyle(4, 1, this.initCellStyle(11, "#000"));
sheet1.setStyle(5, 1, this.initCellStyle(11, "#000"));
sheet1.setStyle(6, 1, this.initCellStyle(11, "#000"));
sheet1.getCell(0, 0).hAlign(GC.Spread.Sheets.HorizontalAlign.center).vAlign(GC.Spread.Sheets.VerticalAlign.center);
for (let i = 0; i < 7; i++) {
for (let j = 1; j < 8; j++) {
sheet1.getCell(i, j).hAlign(GC.Spread.Sheets.HorizontalAlign.center).vAlign(GC.Spread.Sheets.VerticalAlign.center);
}
}
var toggleOptions = {
width: 30,
height: 15,
trackColorOn: '#4CAF50',
trackColorOff: '#bfbfbf',
sliderColorOn: '#ffffff',
sliderColorOff: '#ffffff',
animationDuration: 200,
};
sheet1.setValue(0, 1, "Custom Size");
var toggleCustomSizeCellType1 = new spreadNS.CellTypes.CheckBox();
toggleCustomSizeCellType1.mode('toggle');
toggleCustomSizeCellType1.toggleOptions(toggleOptions);
sheet1.setCellType(0, 2, toggleCustomSizeCellType1);
var toggleCustomSizeCellType2 = new spreadNS.CellTypes.CheckBox();
toggleCustomSizeCellType2.mode('toggle');
toggleCustomSizeCellType2.toggleOptions({
...toggleOptions,
width: 40,
height: 20,
});
sheet1.setCellType(0, 3, toggleCustomSizeCellType2);
var toggleCustomSizeCellType3 = new spreadNS.CellTypes.CheckBox();
toggleCustomSizeCellType3.mode('toggle');
toggleCustomSizeCellType3.toggleOptions({
...toggleOptions,
width: 60,
height: 30,
});
sheet1.setCellType(0, 4, toggleCustomSizeCellType3);
sheet1.setValue(1, 1, "Auto Size");
sheet1.comments.add(1, 1, 'After enabling the Auto Size option, the button size will be dynamically adjusted according to the text.');
var comment = sheet1.comments.get(1, 1);
comment.indicatorSize(8);
comment.indicatorColor('blue');
var toggleAutoSizeCellType1 = new spreadNS.CellTypes.CheckBox();
toggleAutoSizeCellType1.mode('toggle');
toggleAutoSizeCellType1.caption("Auto");
toggleAutoSizeCellType1.textAlign(GC.Spread.Sheets.CellTypes.CheckBoxTextAlign.inside);
toggleAutoSizeCellType1.toggleOptions({
...toggleOptions,
autoSize: true,
});
sheet1.setCellType(1, 2, toggleAutoSizeCellType1);
sheet1.getStyle(1, 2).fontSize = '8pt';
var toggleAutoSizeCellType2 = new spreadNS.CellTypes.CheckBox();
toggleAutoSizeCellType2.mode('toggle');
toggleAutoSizeCellType2.caption("Auto");
toggleAutoSizeCellType2.textAlign(GC.Spread.Sheets.CellTypes.CheckBoxTextAlign.inside);
toggleAutoSizeCellType2.toggleOptions({
...toggleOptions,
autoSize: true,
});
sheet1.setCellType(1, 3, toggleAutoSizeCellType2);
sheet1.getStyle(1, 3).fontSize = '12pt';
var toggleAutoSizeCellType3 = new spreadNS.CellTypes.CheckBox();
toggleAutoSizeCellType3.mode('toggle');
toggleAutoSizeCellType3.caption("Auto");
toggleAutoSizeCellType3.textAlign(GC.Spread.Sheets.CellTypes.CheckBoxTextAlign.inside);
toggleAutoSizeCellType3.toggleOptions({
...toggleOptions,
autoSize: true,
});
sheet1.setCellType(1, 4, toggleAutoSizeCellType3);
sheet1.getStyle(1, 4).fontSize = '16pt';
sheet1.setValue(2, 1, "Custom Colors");
var toggleCustomColorsCellType1 = new spreadNS.CellTypes.CheckBox();
toggleCustomColorsCellType1.mode('toggle');
toggleCustomColorsCellType1.textTrue("On");
toggleCustomColorsCellType1.textFalse("Off");
toggleCustomColorsCellType1.textAlign(GC.Spread.Sheets.CellTypes.CheckBoxTextAlign.inside);
toggleCustomColorsCellType1.toggleOptions({
trackColorOn: "Accent 1 60",
trackColorOff: "Background 1 -15",
sliderColorOn: "Accent 1",
sliderColorOff: "Background 1",
animationDuration: 500,
autoSize: true
});
sheet1.setCellType(2, 2, toggleCustomColorsCellType1);
sheet1.setValue(3, 1, "Text Align");
var toggleTextAlignCellType1 = new spreadNS.CellTypes.CheckBox();
toggleTextAlignCellType1.mode('toggle');
toggleTextAlignCellType1.caption("Top");
toggleTextAlignCellType1.textAlign(GC.Spread.Sheets.CellTypes.CheckBoxTextAlign.top);
toggleTextAlignCellType1.toggleOptions(toggleOptions);
sheet1.setCellType(3, 2, toggleTextAlignCellType1);
var toggleTextAlignCellType2 = new spreadNS.CellTypes.CheckBox();
toggleTextAlignCellType2.mode('toggle');
toggleTextAlignCellType2.caption("Bottom");
toggleTextAlignCellType2.textAlign(GC.Spread.Sheets.CellTypes.CheckBoxTextAlign.bottom);
toggleTextAlignCellType2.toggleOptions(toggleOptions);
sheet1.setCellType(3, 3, toggleTextAlignCellType2);
var toggleTextAlignCellType3 = new spreadNS.CellTypes.CheckBox();
toggleTextAlignCellType3.mode('toggle');
toggleTextAlignCellType3.caption("Left");
toggleTextAlignCellType3.textAlign(GC.Spread.Sheets.CellTypes.CheckBoxTextAlign.left);
toggleTextAlignCellType3.toggleOptions(toggleOptions);
sheet1.setCellType(3, 4, toggleTextAlignCellType3);
var toggleTextAlignCellType4 = new spreadNS.CellTypes.CheckBox();
toggleTextAlignCellType4.mode('toggle');
toggleTextAlignCellType4.caption("Right");
toggleTextAlignCellType4.textAlign(GC.Spread.Sheets.CellTypes.CheckBoxTextAlign.right);
toggleTextAlignCellType4.toggleOptions(toggleOptions);
sheet1.setCellType(3, 5, toggleTextAlignCellType4);
var toggleTextAlignCellType5 = new spreadNS.CellTypes.CheckBox();
toggleTextAlignCellType5.mode('toggle');
toggleTextAlignCellType5.caption("Inside");
toggleTextAlignCellType5.textAlign(GC.Spread.Sheets.CellTypes.CheckBoxTextAlign.inside);
toggleTextAlignCellType5.toggleOptions({
...toggleOptions,
width: 70,
height: 20,
});
sheet1.setCellType(3, 6, toggleTextAlignCellType5);
sheet1.setValue(4, 1, "Slider Margin");
var toggleSliderMarginCellType1 = new spreadNS.CellTypes.CheckBox();
toggleSliderMarginCellType1.mode('toggle');
toggleSliderMarginCellType1.toggleOptions({
...toggleOptions,
width: 40,
height: 20,
sliderMargin: 2,
});
sheet1.setCellType(4, 2, toggleSliderMarginCellType1);
var toggleSliderMarginCellType2 = new spreadNS.CellTypes.CheckBox();
toggleSliderMarginCellType2.mode('toggle');
toggleSliderMarginCellType2.toggleOptions({
...toggleOptions,
width: 40,
height: 20,
sliderMargin: 4,
});
sheet1.setCellType(4, 3, toggleSliderMarginCellType2);
var toggleSliderMarginCellType3 = new spreadNS.CellTypes.CheckBox();
toggleSliderMarginCellType3.mode('toggle');
toggleSliderMarginCellType3.toggleOptions({
...toggleOptions,
width: 40,
height: 20,
sliderMargin: 6,
});
sheet1.setCellType(4, 4, toggleSliderMarginCellType3);
sheet1.setValue(5, 1, "Border Radius");
var toggleBorderRadiusCellType1 = new spreadNS.CellTypes.CheckBox();
toggleBorderRadiusCellType1.mode('toggle');
toggleBorderRadiusCellType1.toggleOptions({
...toggleOptions,
width: 40,
height: 20,
trackRadius: 0,
sliderRadius: 0,
});
sheet1.setCellType(5, 2, toggleBorderRadiusCellType1);
var toggleBorderRadiusCellType2 = new spreadNS.CellTypes.CheckBox();
toggleBorderRadiusCellType2.mode('toggle');
toggleBorderRadiusCellType2.toggleOptions({
...toggleOptions,
width: 40,
height: 20,
trackRadius: 0,
sliderRadius: 12,
});
sheet1.setCellType(5, 3, toggleBorderRadiusCellType2);
var toggleBorderRadiusCellType3 = new spreadNS.CellTypes.CheckBox();
toggleBorderRadiusCellType3.mode('toggle');
toggleBorderRadiusCellType3.toggleOptions({
...toggleOptions,
width: 40,
height: 20,
sliderMargin: 4,
trackRadius: 15,
sliderRadius: 0,
});
sheet1.setCellType(5, 4, toggleBorderRadiusCellType3);
var toggleBorderRadiusCellType4 = new spreadNS.CellTypes.CheckBox();
toggleBorderRadiusCellType4.mode('toggle');
toggleBorderRadiusCellType4.toggleOptions({
...toggleOptions,
width: 40,
height: 20,
trackRadius: 8,
sliderRadius: 6,
});
sheet1.setCellType(5, 5, toggleBorderRadiusCellType4);
var toggleBorderRadiusCellType5 = new spreadNS.CellTypes.CheckBox();
toggleBorderRadiusCellType5.mode('toggle');
toggleBorderRadiusCellType5.toggleOptions({
...toggleOptions,
width: 40,
height: 20,
trackRadius: null,
sliderRadius: null,
});
sheet1.setCellType(5, 6, toggleBorderRadiusCellType5);
sheet1.setValue(6, 1, "Animation Duration");
var toggleAnimationDurationCellType1 = new spreadNS.CellTypes.CheckBox();
toggleAnimationDurationCellType1.mode('toggle');
toggleAnimationDurationCellType1.toggleOptions({
...toggleOptions,
width: 40,
height: 20,
animationDuration: 100,
});
sheet1.setCellType(6, 2, toggleAnimationDurationCellType1);
var toggleAnimationDurationCellType2 = new spreadNS.CellTypes.CheckBox();
toggleAnimationDurationCellType2.mode('toggle');
toggleAnimationDurationCellType2.toggleOptions({
...toggleOptions,
width: 40,
height: 20,
animationDuration: 300,
});
sheet1.setCellType(6, 3, toggleAnimationDurationCellType2);
var toggleAnimationDurationCellType3 = new spreadNS.CellTypes.CheckBox();
toggleAnimationDurationCellType3.mode('toggle');
toggleAnimationDurationCellType3.toggleOptions({
...toggleOptions,
width: 40,
height: 20,
animationDuration: 500,
});
sheet1.setCellType(6, 4, toggleAnimationDurationCellType3);
sheet1.resumePaint();
}
initCheckboxSheet(spread: GC.Spread.Sheets.Workbook) {
var spreadNS = GC.Spread.Sheets;
var sheet2 = spread.getSheet(1);
sheet2.name("Checkbox");
sheet2.defaults.colWidth = 190;
sheet2.defaults.rowHeight = 60;
sheet2.suspendPaint();
sheet2.bind(spreadNS.Events.SelectionChanged, () => {
this.propertyChange(spread, false);
});
sheet2.setColumnWidth(0, 110);
sheet2.setColumnWidth(1, 190);
sheet2.setColumnWidth(2, 130);
for (let i = 0; i < 4; i++) {
sheet2.setRowHeight(i, 60);
}
sheet2.addSpan(0, 0, 4, 1);
sheet2.setValue(0, 0, "Checkbox Mode");
sheet2.setStyle(0, 0, this.initCellStyle(11, "Accent 1"));
sheet2.setStyle(0, 1, this.initCellStyle(11, "Accent 6"));
sheet2.setStyle(1, 1, this.initCellStyle(11, "#FF0000"));
sheet2.setStyle(2, 1, this.initCellStyle(11, "Accent 5"));
sheet2.setStyle(3, 1, this.initCellStyle(11, "Accent 4"));
sheet2.getCell(0, 0).hAlign(GC.Spread.Sheets.HorizontalAlign.center).vAlign(GC.Spread.Sheets.VerticalAlign.center);
for (let i = 0; i < 4; i++) {
for (let j = 1; j < 4; j++) {
sheet2.getCell(i, j).hAlign(GC.Spread.Sheets.HorizontalAlign.center).vAlign(GC.Spread.Sheets.VerticalAlign.center);
}
}
sheet2.setValue(0, 1, "caption");
var captionCellType = new spreadNS.CellTypes.CheckBox();
captionCellType.caption("Caption");
sheet2.setCellType(0, 2, captionCellType);
sheet2.setValue(1, 1, "threeState");
var threeStateCellType = new spreadNS.CellTypes.CheckBox();
threeStateCellType.isThreeState(false);
threeStateCellType.textTrue("Checked!");
threeStateCellType.textFalse("Check Me!");
sheet2.setCellType(1, 2, threeStateCellType);
sheet2.setValue(2, 1, "textAlign");
var textAlignCellType = new spreadNS.CellTypes.CheckBox();
textAlignCellType.isThreeState(false);
textAlignCellType.caption("textAlign");
textAlignCellType.textAlign(spreadNS.CellTypes.CheckBoxTextAlign.bottom);
sheet2.setCellType(2, 2, textAlignCellType);
sheet2.setValue(3, 1, "text wrap");
var textWrapCellType = new spreadNS.CellTypes.CheckBox();
textWrapCellType.caption("This is a long long text");
sheet2.setCellType(3, 2, textWrapCellType);
sheet2.getCell(3, 2).wordWrap(true);
sheet2.resumePaint();
}
}
@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">
<!-- Polyfills -->
<script src="$DEMOROOT$/en/angular/node_modules/core-js/client/shim.min.js"></script>
<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">
<gc-spread-sheets [hostStyle]="hostStyle" (workbookInitialized)="initSpread($event)">
<gc-worksheet></gc-worksheet>
<gc-worksheet></gc-worksheet>
</gc-spread-sheets>
<div class="options-container">
<label>Select the check box cell in Spread and edit its options with these text boxes.</label>
<div class="checkbox-options" *ngIf="mode === 'checkbox'">
<div class="option-row" *ngIf="hasCaption === null || hasCaption">
<label for="caption">caption:</label>
<input id="caption" type="text" [(ngModel)]="caption" />
</div>
<div class="option-row" *ngIf="hasCaption === null || !hasCaption">
<label for="textTrue">textTrue:</label>
<input id="textTrue" type="text" [(ngModel)]="textTrue" />
</div>
<div class="option-row" *ngIf="hasCaption === null || !hasCaption">
<label for="textIndeterminate">textIndeterminate(for 3-state option):</label>
<input id="textIndeterminate" type="text" [(ngModel)]="textIndeterminate" />
</div>
<div class="option-row" *ngIf="hasCaption === null || !hasCaption">
<label for="textFalse">textFalse:</label>
<input id="textFalse" type="text" [(ngModel)]="textFalse" />
</div>
<div class="option-row" *ngIf="hasCaption === null || !hasCaption">
<label for="boxSize">boxSize:</label>
<input id="boxSize" type="text" [(ngModel)]="boxSize" />
</div>
<div class="option-row">
<label>textAlign:</label>
<select id="textAlign" [(ngModel)]="textAlign">
<option value="0">top</option>
<option value="1">bottom</option>
<option value="2">left</option>
<option value="3">right</option>
</select>
</div>
<div class="option-row" *ngIf="hasCaption === null || !hasCaption">
<input id="isThreeState" type="checkbox" checked="checked" [(ngModel)]="isThreeState" />
<label for="isThreeState">isThreeState:</label>
</div>
</div>
<div class="toggle-options" *ngIf="mode === 'toggle'">
<div class="option-row">
<label>caption:</label>
<input type="text" id="toggleCheckBoxCellTextCaption" [(ngModel)]="caption" />
</div>
<div class="option-row">
<label>textTrue:</label>
<input type="text" id="toggleCheckBoxCellTextTrue" [(ngModel)]="textTrue" />
</div>
<div class="option-row">
<label>textFalse:</label>
<input type="text" id="toggleCheckBoxCellTextFalse" [(ngModel)]="textFalse" />
</div>
<div class="option-row">
<label>textAlign:</label>
<select id="selToggleCheckBoxCellAlign" [(ngModel)]="textAlign">
<option value="0" selected="selected">top</option>
<option value="1">bottom</option>
<option value="2">left</option>
<option value="3">right</option>
<option value="4">inside</option>
</select>
</div>
<div class="option-row">
<label class="toggle-checkbox-cell-auto-size">
<input type="checkbox" id="toggleCheckBoxCellAutoSize" [(ngModel)]="autoSize" />
autoSize
</label>
</div>
<div class="option-row" [class.disabled]="autoSize">
<label>width:</label>
<input type="text" id="toggleCheckBoxCellWidth" [(ngModel)]="width" />
</div>
<div class="option-row" [class.disabled]="autoSize">
<label>height:</label>
<input type="text" id="toggleCheckBoxCellHeight" [(ngModel)]="height" />
</div>
<div class="option-row">
<label>sliderMargin:</label>
<input type="text" id="toggleCheckBoxCellSliderMargin" [(ngModel)]="sliderMargin" />
</div>
<div class="option-row">
<label>sliderRadius:</label>
<input type="text" id="toggleCheckBoxCellSliderRadius" [(ngModel)]="sliderRadius" />
</div>
<div class="option-row">
<label>trackRadius:</label>
<input type="text" id="toggleCheckBoxCellTrackRadius" [(ngModel)]="trackRadius" />
</div>
<div class="option-row">
<label>sliderColorOn:</label>
<input type="text" id="toggleCheckBoxCellSliderColorOn" [(ngModel)]="sliderColorOn" />
</div>
<div class="option-row">
<label>sliderColorOff:</label>
<input type="text" id="toggleCheckBoxCellSliderColorOff" [(ngModel)]="sliderColorOff" />
</div>
<div class="option-row">
<label>trackColorOn:</label>
<input type="text" id="toggleCheckBoxCellTrackColorOn" [(ngModel)]="trackColorOn" />
</div>
<div class="option-row">
<label>trackColorOff:</label>
<input type="text" id="toggleCheckBoxCellTrackColorOff" [(ngModel)]="trackColorOff" />
</div>
<div class="option-row">
<label>animationDuration:</label>
<input type="text" id="toggleCheckBoxCellAnimationDuration" [(ngModel)]="animationDuration" />
</div>
</div>
<div class="option-row">
<input type="button" id="setProperty" value="Update" [disabled]="disabled" (click)="propertyChange($event, true)" />
</div>
</div>
</div>
.sample-tutorial {
position: relative;
height: 100%;
overflow: hidden;
}
.sample-spreadsheets {
width: calc(100% - 280px);
height: 100%;
overflow: hidden;
float: left;
}
.options-container {
float: right;
width: 280px;
overflow: auto;
padding: 12px;
height: 100%;
box-sizing: border-box;
background: #fbfbfb;
}
.sample-options{
z-index: 1000;
}
.option {
padding-bottom: 6px;
}
.option-row {
font-size: 14px;
padding: 5px;
}
.disabled {
opacity: 0.5;
pointer-events: none;
}
.checkbox {
padding-right: 12px;
display: inline-block;
}
label {
padding-bottom: 4px;
display: block;
}
input, select {
width: 100%;
padding: 4px 8px;
box-sizing: border-box;
}
input[type=checkbox] {
width: auto;
}
input[type=checkbox]+label {
display: inline-block;
width: auto;
}
body {
position: absolute;
top: 0;
bottom: 0;
left: 0;
right: 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/'
},
// map tells the System loader where to look for things
map: {
'core-js': 'npm:core-js/client/shim.min.js',
'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': 'npm:@mescius/spread-sheets/index.js',
'@mescius/spread-sheets-angular': 'npm:@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);