本文整理匯總了TypeScript中sql/base/common/objects.clone函數的典型用法代碼示例。如果您正苦於以下問題:TypeScript clone函數的具體用法?TypeScript clone怎麽用?TypeScript clone使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了clone函數的8個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1: reSizeColumn
private reSizeColumn(e: JQuery.Event<HTMLElement, string>) {
let headerEl = $(e.currentTarget).closest('.slick-header-column');
let columnDef = headerEl.data('column');
if (!columnDef || !columnDef.resizable) {
return;
}
e.preventDefault();
e.stopPropagation();
let headerWidth = this.getElementWidth(headerEl[0]);
let colIndex = this._grid.getColumnIndex(columnDef.id);
let origCols = this._grid.getColumns();
let allColumns = clone(origCols);
allColumns.forEach((col, index) => {
col.formatter = origCols[index].formatter;
col.asyncPostRender = origCols[index].asyncPostRender;
});
let column = allColumns[colIndex];
let autoSizeWidth = Math.max(headerWidth, this.getMaxColumnTextWidth(columnDef, colIndex)) + 1;
if (autoSizeWidth !== column.width) {
allColumns[colIndex].width = autoSizeWidth;
this._grid.setColumns(allColumns);
this._grid.onColumnsResized.notify();
}
}
示例2: mixin
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import { mixin } from 'vs/base/common/objects';
import { clone } from 'sql/base/common/objects';
import { IJSONSchema } from 'vs/base/common/jsonSchema';
import * as nls from 'vs/nls';
import { registerInsight } from 'sql/platform/dashboard/common/insightRegistry';
import { properties as BarChartSchema } from 'sql/parts/dashboard/widgets/insights/views/charts/types/barChart.contribution';
import LineChart from './lineChart.component';
const properties: IJSONSchema = {
properties: {
dataType: {
type: 'string',
description: nls.localize('dataTypeDescription', 'Indicates data property of a data set for a chart.'),
default: 'number',
enum: ['number', 'point'],
enumDescriptions: ['Set "number" if the data values are contained in 1 column.', 'Set "point" if the data is an {x,y} combination requiring 2 columns for each value.']
},
}
};
export const lineSchema = mixin(clone(BarChartSchema), properties) as IJSONSchema;
registerInsight('line', '', lineSchema, LineChart);
示例3: mixin
yAxisMin: {
type: 'number',
description: nls.localize('yAxisMin', "Minimum value of the y axis")
},
yAxisMax: {
type: 'number',
description: nls.localize('yAxisMax', "Maximum value of the y axis")
},
yAxisLabel: {
type: 'string',
description: nls.localize('barchart.yAxisLabel', "Label for the y axis")
},
xAxisMin: {
type: 'number',
description: nls.localize('xAxisMin', "Minimum value of the x axis")
},
xAxisMax: {
type: 'number',
description: nls.localize('xAxisMax', "Maximum value of the x axis")
},
xAxisLabel: {
type: 'string',
description: nls.localize('barchart.xAxisLabel', "Label for the x axis")
}
}
};
export const barChartSchema = mixin(clone(chartInsightSchema), properties) as IJSONSchema;
registerInsight('bar', '', barChartSchema, BarChart);
示例4: mixin
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import { clone } from 'sql/base/common/objects';
import { mixin } from 'vs/base/common/objects';
import { IJSONSchema } from 'vs/base/common/jsonSchema';
import { registerInsight } from 'sql/platform/dashboard/common/insightRegistry';
import { chartInsightSchema } from 'sql/parts/dashboard/widgets/insights/views/charts/chartInsight.contribution';
import DoughnutChart from './doughnutChart.component';
const properties: IJSONSchema = {
};
const doughnutChartSchema = mixin(clone(chartInsightSchema), properties) as IJSONSchema;
registerInsight('doughnut', '', doughnutChartSchema, DoughnutChart);
示例5: mixin
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import { mixin } from 'vs/base/common/objects';
import { clone } from 'sql/base/common/objects';
import { IJSONSchema } from 'vs/base/common/jsonSchema';
import { registerInsight } from 'sql/platform/dashboard/common/insightRegistry';
import { chartInsightSchema } from 'sql/parts/dashboard/widgets/insights/views/charts/chartInsight.contribution';
import PieChart from './pieChart.component';
const properties: IJSONSchema = {
};
const pieSchema = mixin(clone(chartInsightSchema), properties) as IJSONSchema;
registerInsight('pie', '', pieSchema, PieChart);
示例6: mixin
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import { clone } from 'sql/base/common/objects';
import { mixin } from 'vs/base/common/objects';
import { IJSONSchema } from 'vs/base/common/jsonSchema';
import { registerInsight } from 'sql/platform/dashboard/common/insightRegistry';
import { barChartSchema } from 'sql/parts/dashboard/widgets/insights/views/charts/types/barChart.contribution';
import HorizontalBarChart from './horizontalBarChart.component';
const properties: IJSONSchema = {
};
const horizontalBarSchema = mixin(clone(barChartSchema), properties) as IJSONSchema;
registerInsight('horizontalBar', '', horizontalBarSchema, HorizontalBarChart);
示例7: mixin
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import { mixin } from 'vs/base/common/objects';
import { clone } from 'sql/base/common/objects';
import { IJSONSchema } from 'vs/base/common/jsonSchema';
import { registerInsight } from 'sql/platform/dashboard/common/insightRegistry';
import { barChartSchema } from 'sql/parts/dashboard/widgets/insights/views/charts/types/barChart.contribution';
import ScatterChart from './scatterChart.component';
const properties: IJSONSchema = {
};
const scatterSchema = mixin(clone(barChartSchema), properties) as IJSONSchema;
registerInsight('scatter', '', scatterSchema, ScatterChart);
示例8: mixin
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import { mixin } from 'vs/base/common/objects';
import { clone } from 'sql/base/common/objects';
import { IJSONSchema } from 'vs/base/common/jsonSchema';
import { registerInsight } from 'sql/platform/dashboard/common/insightRegistry';
import { barChartSchema } from 'sql/parts/dashboard/widgets/insights/views/charts/types/barChart.contribution';
import TimeSeriesChart from './timeSeriesChart.component';
const properties: IJSONSchema = {
};
const timeSeriesSchema = mixin(clone(barChartSchema), properties) as IJSONSchema;
registerInsight('timeSeries', '', timeSeriesSchema, TimeSeriesChart);