diff --git a/js/notebook/package.json b/js/notebook/package.json index c78a5978f6..5836e447bc 100644 --- a/js/notebook/package.json +++ b/js/notebook/package.json @@ -21,22 +21,32 @@ "build:dev": "webpack --config webpack.dev.js --progress && yarn run build-lab-extension", "build-lab-extension": "cd ../lab && npm install", "prepublish": "yarn run build:prod", - "test": "echo \"Error: no test specified\" && exit 1", + "test": "TS_NODE_PROJECT=test mocha", "stats": "webpack --env production --profile --json > stats.json" }, "devDependencies": { + "@types/chai": "^4.1.1", + "@types/mocha": "^2.2.46", "base64-loader": "^1.0.0", + "chai": "^4.1.2", "css-loader": "^0.28.4", "file-loader": "^0.10.0", "fork-ts-checker-webpack-plugin": "^0.2.8", "html-loader": "^0.4.5", + "ignore-styles": "^5.0.1", + "jsdom": "^11.5.1", "json-loader": "^0.5.4", + "mocha": "^5.0.0", "node-sass": "^4.5.2", "sass-loader": "^6.0.5", + "sinon": "^4.2.0", "source-map-loader": "^0.2.1", "style-loader": "^0.18.1", "ts-loader": "^3.0.3", - "typescript": "^2.5.2", + "ts-node": "^4.1.0", + "tsconfig-paths": "^3.1.1", + "tsconfig-paths-webpack-plugin": "^2.0.0", + "typescript": "^2.6.2", "uglifyjs-webpack-plugin": "^1.0.0-rc.0", "url-loader": "^0.5.9", "webpack": "^3.5.6", diff --git a/js/notebook/src/shared/bkUtils.js b/js/notebook/src/shared/bkUtils.js index f88330c4a7..72dcdebfd9 100644 --- a/js/notebook/src/shared/bkUtils.js +++ b/js/notebook/src/shared/bkUtils.js @@ -14,52 +14,45 @@ * limitations under the License. */ -define([ - './../plot/commonUtils', - 'underscore' -], function( - commonUtils, - _ -) { - var bkUtils = { - generateId: function(length) { - var text = ""; - var possible = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"; +var commonUtils = require('./../plot/commonUtils'); +var _ = require('underscore'); - if (_.isUndefined(length)) { - length = 6; - } - for (var i = 0; i < length; i++) { - text += possible.charAt(Math.floor(Math.random() * possible.length)); - } - return text; - }, - applyTimezone: function(timestamp, tz) { - return commonUtils.applyTimezone(timestamp, tz); - }, - formatTimestamp: function(timestamp, tz, format) { - return commonUtils.formatTimestamp(timestamp, tz, format); - }, - rgbaToHex: function (r, g, b, a) { - if(a == undefined){ - a = 0xFF; - } - var num = ((a & 0xFF) << 24) | - ((r & 0xFF) << 16) | - ((g & 0xFF) << 8) | - ((b & 0xFF)); - if(num < 0) { - num = 0xFFFFFFFF + num + 1; - } - return "#" + num.toString(16); - }, - timeout: function(fn, ms) { - return setTimeout(fn, ms); - }, - newDeferred: function() { - return jQuery.Deferred(); - } - }; +module.exports = { + generateId: function(length) { + var text = ""; + var possible = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"; - return bkUtils; -}); \ No newline at end of file + if (_.isUndefined(length)) { + length = 6; + } + for (var i = 0; i < length; i++) { + text += possible.charAt(Math.floor(Math.random() * possible.length)); + } + return text; + }, + applyTimezone: function(timestamp, tz) { + return commonUtils.applyTimezone(timestamp, tz); + }, + formatTimestamp: function(timestamp, tz, format) { + return commonUtils.formatTimestamp(timestamp, tz, format); + }, + rgbaToHex: function (r, g, b, a) { + if(a == undefined){ + a = 0xFF; + } + var num = ((a & 0xFF) << 24) | + ((r & 0xFF) << 16) | + ((g & 0xFF) << 8) | + ((b & 0xFF)); + if(num < 0) { + num = 0xFFFFFFFF + num + 1; + } + return "#" + num.toString(16); + }, + timeout: function(fn, ms) { + return setTimeout(fn, ms); + }, + newDeferred: function() { + return jQuery.Deferred(); + } +}; diff --git a/js/notebook/src/tableDisplay/consts.js b/js/notebook/src/tableDisplay/consts.js deleted file mode 100644 index 43ae9de8ea..0000000000 --- a/js/notebook/src/tableDisplay/consts.js +++ /dev/null @@ -1,83 +0,0 @@ -/* - * Copyright 2017 TWO SIGMA OPEN SOURCE, LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -define(function() { - - var scopeData = { - allStringTypes: [ - {type: 0, name: 'string'}, - {type: 10, name: 'html'} - ], - allTimeTypes: [ - {type: 8, name: 'datetime'}, - {type: 0, name: 'string'} - ], - allIntTypes: [ - {type: 0, name: 'string'}, - {type: 1, name: 'integer'}, - {type: 2, name: 'formatted integer'}, - {type: 8, name: 'datetime'} - ], - allDoubleTypes: [ - {type: 0, name: 'string'}, - {type: 3, name: 'double'}, - {type: 4, name: 'double with precision'}, - {type: 6, name: 'exponential 5'}, - {type: 7, name: 'exponential 15'} - ], - allBoolTypes: [ - {type: 0, name: 'string'}, - {type: 9, name: 'boolean'} - ], - allTypes: [ - {type: 0, name: 'string'}, - {type: 1, name: 'integer'}, - {type: 2, name: 'formatted integer'}, - {type: 3, name: 'double'}, - {type: 4, name: 'double with precision'}, - {type: 6, name: 'exponential 5'}, - {type: 7, name: 'exponential 15'}, - {type: 8, name: 'datetime'}, - {type: 9, name: 'boolean'}, - {type: 10, name: 'html'} - ], - rowsToDisplayMenu: [ - [10, 25, 50, 100, -1], - [10, 25, 50, 100, 'All'] - ] - }; - - return { - scopeData: scopeData, - CELL_TYPE: 'bko-tabledisplay', - ROW_HEIGHT: 27, - ROW_HEIGHT_ADVANCED_MODE: 22, - DEFAULT_PAGE_LENGTH: 25, - MIN_ROWS_FOR_PAGING: 25, - FC_LEFT_SEPARATOR_CLASS: 'left-fix-col-separator', - FC_RIGHT_SEPARATOR_CLASS: 'right-fix-col-separator', - FC_COL_FIXED_CLASS: 'fix-col-fixed', - TIME_UNIT_FORMATS: { - DATETIME: { title: 'datetime', format: 'YYYYMMDD HH:mm:ss.SSS ZZ' }, - DAYS: { title: 'date', format: 'YYYYMMDD' }, - HOURS: { title: 'hours', format: 'YYYYMMDD HH:mm ZZ' }, - MINUTES: { title: 'minutes', format: 'HH:mm ZZ' }, - SECONDS: { title: 'seconds', format: 'HH:mm:ss ZZ' }, - MILLISECONDS: { title: 'milliseconds', format: 'HH:mm:ss.SSS ZZ' } - } - }; - -}); \ No newline at end of file diff --git a/js/notebook/src/tableDisplay/consts.ts b/js/notebook/src/tableDisplay/consts.ts new file mode 100644 index 0000000000..9d2e3ab3e4 --- /dev/null +++ b/js/notebook/src/tableDisplay/consts.ts @@ -0,0 +1,89 @@ +/* + * Copyright 2017 TWO SIGMA OPEN SOURCE, LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export const scopeData = { + allStringTypes: [ + {type: 0, name: 'string'}, + {type: 10, name: 'html'} + ], + allTimeTypes: [ + {type: 8, name: 'datetime'}, + {type: 0, name: 'string'} + ], + allIntTypes: [ + {type: 0, name: 'string'}, + {type: 1, name: 'integer'}, + {type: 2, name: 'formatted integer'}, + {type: 8, name: 'datetime'} + ], + allDoubleTypes: [ + {type: 0, name: 'string'}, + {type: 3, name: 'double'}, + {type: 4, name: 'double with precision'}, + {type: 6, name: 'exponential 5'}, + {type: 7, name: 'exponential 15'} + ], + allBoolTypes: [ + {type: 0, name: 'string'}, + {type: 9, name: 'boolean'} + ], + allTypes: [ + {type: 0, name: 'string'}, + {type: 1, name: 'integer'}, + {type: 2, name: 'formatted integer'}, + {type: 3, name: 'double'}, + {type: 4, name: 'double with precision'}, + {type: 6, name: 'exponential 5'}, + {type: 7, name: 'exponential 15'}, + {type: 8, name: 'datetime'}, + {type: 9, name: 'boolean'}, + {type: 10, name: 'html'} + ], + rowsToDisplayMenu: [ + [10, 25, 50, 100, -1], + [10, 25, 50, 100, 'All'] + ] +}; + +export const CELL_TYPE = 'bko-tabledisplay'; +export const ROW_HEIGHT = 27; +export const ROW_HEIGHT_ADVANCED_MODE = 22; +export const DEFAULT_PAGE_LENGTH = 25; +export const MIN_ROWS_FOR_PAGING = 25; +export const FC_LEFT_SEPARATOR_CLASS = 'left-fix-col-separator'; +export const FC_RIGHT_SEPARATOR_CLASS = 'right-fix-col-separator'; +export const FC_COL_FIXED_CLASS = 'fix-col-fixed'; +export const TIME_UNIT_FORMATS = { + DATETIME: { title: 'datetime', format: 'YYYYMMDD HH:mm:ss.SSS ZZ' }, + DAYS: { title: 'date', format: 'YYYYMMDD' }, + HOURS: { title: 'hours', format: 'YYYYMMDD HH:mm ZZ' }, + MINUTES: { title: 'minutes', format: 'HH:mm ZZ' }, + SECONDS: { title: 'seconds', format: 'HH:mm:ss ZZ' }, + MILLISECONDS: { title: 'milliseconds', format: 'HH:mm:ss.SSS ZZ' } +}; + +export default { + scopeData, + CELL_TYPE, + ROW_HEIGHT, + ROW_HEIGHT_ADVANCED_MODE, + DEFAULT_PAGE_LENGTH, + MIN_ROWS_FOR_PAGING, + FC_LEFT_SEPARATOR_CLASS, + FC_RIGHT_SEPARATOR_CLASS, + FC_COL_FIXED_CLASS, + TIME_UNIT_FORMATS +}; diff --git a/js/notebook/src/tableDisplay/dataGrid/DataFormatter.ts b/js/notebook/src/tableDisplay/dataGrid/DataFormatter.ts index d5024b9351..ecd40a3ee5 100644 --- a/js/notebook/src/tableDisplay/dataGrid/DataFormatter.ts +++ b/js/notebook/src/tableDisplay/dataGrid/DataFormatter.ts @@ -18,9 +18,9 @@ import * as moment from 'moment-timezone/builds/moment-timezone-with-data'; import * as _ from 'underscore'; import { isDoubleWithPrecision, getDoublePrecisionByType } from './dataTypes'; import { DataGridHelpers } from './dataGridHelpers'; +import { TIME_UNIT_FORMATS } from '../consts'; const bkUtils = require('../../shared/bkUtils'); -const tableConsts = require('../consts'); interface IFormatterOptions { stringFormatForColumn?: any, @@ -31,6 +31,8 @@ interface IFormatterOptions { columnNames?: string[] } +export const DEFAULT_TIME_FORMAT = 'YYYYMMDD HH:mm:ss.SSS ZZ'; + export class DataFormatter { stringFormatForColumn: any; stringFormatForType: any; @@ -68,15 +70,15 @@ export class DataFormatter { switch (displayType) { case 1: - return this.handleNull(this.integer); + return this.integer; case 2: - return this.handleNull(this.formattedInteger); + return this.formattedInteger; case 3: - return this.handleNull(this.double); + return this.double; case 6: - return this.handleNull(this.exponential_5); + return this.exponential_5; case 7: - return this.handleNull(this.exponential_15); + return this.exponential_15; case 8: return this.datetime; case 9: @@ -120,7 +122,7 @@ export class DataFormatter { if (objectValue) { formattedValue = value.type === 'Date' ? - moment(value.timestamp).format('YYYYMMDD HH:mm:ss.SSS ZZ') : + moment(value.timestamp).format(DEFAULT_TIME_FORMAT) : JSON.stringify(value); } else if (_.isString(value)) { const escapedText = DataGridHelpers.escapeHTML(value); @@ -128,15 +130,23 @@ export class DataFormatter { formattedValue = limitedText; } - + return formattedValue; } private integer(value: any) { + if (this.isNull(value)) { + return value; + } + return parseInt(value); } private formattedInteger(value: any) { + if (this.isNull(value)) { + return value; + } + let x = parseInt(value); if (!isNaN(x)) { @@ -147,6 +157,10 @@ export class DataFormatter { } private double(value: any, row: number, column: number) { + if (this.isNull(value)) { + return value; + } + let doubleValue = parseFloat(value); let colFormat = this.stringFormatForColumn[this.columnNames[column]]; let typeFormat = this.stringFormatForType.double; @@ -172,10 +186,18 @@ export class DataFormatter { } private exponential_5(value: any) { + if (this.isNull(value)) { + return value; + } + return parseFloat(value).toExponential(5); } private exponential_15(value: any) { + if (this.isNull(value)) { + return value; + } + return parseFloat(value).toExponential(15); } @@ -185,8 +207,8 @@ export class DataFormatter { } let format = _.isEmpty(this.formatForTimes) ? - tableConsts.TIME_UNIT_FORMATS.DATETIME.format : - tableConsts.TIME_UNIT_FORMATS[this.formatForTimes].format; + TIME_UNIT_FORMATS.DATETIME.format : + TIME_UNIT_FORMATS[this.formatForTimes].format; if (_.isObject(value) && value.type === 'Date') { return bkUtils.formatTimestamp(value.timestamp, this.timeZone, format); @@ -198,7 +220,13 @@ export class DataFormatter { } private boolean(value: any) { - return this.isNull(value) ? 'false' : 'true'; + return ( + this.isNull(value) || + value === false || + (typeof value === 'number' && isNaN(value)) + ) ? + 'false': + 'true'; } private html(value: any) { diff --git a/js/notebook/src/tableDisplay/dataGrid/DataGridScope.ts b/js/notebook/src/tableDisplay/dataGrid/DataGridScope.ts index 2ef4345fe4..29b168d3b9 100644 --- a/js/notebook/src/tableDisplay/dataGrid/DataGridScope.ts +++ b/js/notebook/src/tableDisplay/dataGrid/DataGridScope.ts @@ -14,49 +14,30 @@ * limitations under the License. */ -import { StackedPanel, Widget } from '@phosphor/widgets'; +import { Widget } from '@phosphor/widgets'; import { DataGrid } from '@phosphor/datagrid'; -import IDataGridScopeOptions from "./IDataGridScopeOptions"; import { TableDataModel } from './TableDataModel'; - -import './dataGrid.css'; +import { silverStripeStyle } from './dataGridStyle'; +import IDataGridScopeOptions from "./IDataGridScopeOptions"; +import IDataModelOptions from "./IDataModelOptions"; export class DataGridScope { - dataGrid: DataGrid; - - element: HTMLElement; - - data: any; - - greenStripeStyle: DataGrid.IStyle = { - ...DataGrid.defaultStyle, - voidColor: '#ffffff', - headerBackgroundColor: '#E6E6E6', - rowBackgroundColor: i => i % 2 === 0 ? '#f9f9f9' : '' - }; + private dataGrid: DataGrid; + private element: HTMLElement; + private modelOptions: IDataModelOptions; constructor(options: IDataGridScopeOptions) { this.element = options.element; - this.data = options.data; + this.modelOptions = options.data; this.dataGrid = new DataGrid({ - style: this.greenStripeStyle + style: silverStripeStyle }); - this.dataGrid.model = new TableDataModel(this.data); + this.dataGrid.model = new TableDataModel(this.modelOptions); } render(): void { - let wrapper = this.createWrapper(this.dataGrid, 'example'); - Widget.attach(wrapper, this.element); - } - - createWrapper(content: Widget, title: string): Widget { - let wrapper = new StackedPanel(); - wrapper.addClass('content-wrapper'); - wrapper.addWidget(content); - wrapper.title.label = title; - - return wrapper; + Widget.attach(this.dataGrid, this.element); } doDestroy() { diff --git a/js/notebook/src/tableDisplay/dataGrid/IDataGridScopeOptions.ts b/js/notebook/src/tableDisplay/dataGrid/IDataGridScopeOptions.ts index 01bd2569a4..cef6ab5723 100644 --- a/js/notebook/src/tableDisplay/dataGrid/IDataGridScopeOptions.ts +++ b/js/notebook/src/tableDisplay/dataGrid/IDataGridScopeOptions.ts @@ -14,7 +14,7 @@ * limitations under the License. */ -import {DataGrid} from "@phosphor/datagrid"; +import { DataGrid } from "@phosphor/datagrid"; export default interface IDataGridScopeOptions extends DataGrid.IOptions { element: HTMLElement diff --git a/js/notebook/src/tableDisplay/dataGrid/IDataModelOptions.ts b/js/notebook/src/tableDisplay/dataGrid/IDataModelOptions.ts index 511df4cc2d..fa748cbbd5 100644 --- a/js/notebook/src/tableDisplay/dataGrid/IDataModelOptions.ts +++ b/js/notebook/src/tableDisplay/dataGrid/IDataModelOptions.ts @@ -15,36 +15,36 @@ */ export default interface IDataModelOptions { - formatForTimes: any; - timeStrings: any; + formatForTimes?: any; + timeStrings?: any; - alignmentForColumn: {}, - alignmentForType: {}, - cellHighlighters: Function[], + alignmentForColumn?: {}, + alignmentForType?: {}, + cellHighlighters?: Function[], columnNames: string[], - columnOrder: number[], - columnsFrozen: {}, - columnsFrozenRight: {}, - columnsVisible: {}, - contextMenuItems: object[], - contextMenuTags: {}, - dataFontSize: number|null, - doubleClickTag: string|null, - fontColor: string[], - hasDoubleClickAction: boolean, + columnOrder?: number[], + columnsFrozen?: {}, + columnsFrozenRight?: {}, + columnsVisible?: {}, + contextMenuItems?: object[], + contextMenuTags?: {}, + dataFontSize?: number|null, + doubleClickTag?: string|null, + fontColor?: string[], + hasDoubleClickAction?: boolean, hasIndex: boolean, - headerFontSize: number|null, - headersVertical: boolean, - rendererForColumn: {}, - rendererForType: {}, + headerFontSize?: number|null, + headersVertical?: boolean, + rendererForColumn?: {}, + rendererForType?: {}, stringFormatForColumn: {}, - stringFormatForTimes: string|null, - stringFormatForType: {}, + stringFormatForTimes?: string|null, + stringFormatForType?: {}, subtype?: string, timeZone?: string, - tooManyRows: boolean, - tooltips: string[], - type: string, + tooManyRows?: boolean, + tooltips?: string[], + type?: string, types: string[], values: any, } diff --git a/js/notebook/src/tableDisplay/dataGrid/TableDataModel.ts b/js/notebook/src/tableDisplay/dataGrid/TableDataModel.ts index 0179119400..a4df219c7b 100644 --- a/js/notebook/src/tableDisplay/dataGrid/TableDataModel.ts +++ b/js/notebook/src/tableDisplay/dataGrid/TableDataModel.ts @@ -15,7 +15,7 @@ */ import { DataModel } from "@phosphor/datagrid"; -import {getDisplayType, getTypeByName} from './dataTypes'; +import { getDisplayType } from './dataTypes'; import { DataFormatter } from './DataFormatter'; import IDataModelOptions from './IDataModelOptions'; @@ -59,7 +59,7 @@ export class TableDataModel extends DataModel { return ''; } - return this.convertData( + return this.formatData( this._data[row][column], this._options.types[column] || 'string', row, @@ -67,10 +67,10 @@ export class TableDataModel extends DataModel { ); } - convertData(data: any, typeName: string, row: number, column: number): any { - const type = getTypeByName(typeName); + formatData(data: any, typeName: string, row: number, column: number): any { + //@todo check if raw type no is required, keep only display type const displayType = getDisplayType( - type, + typeName, this._options.stringFormatForType, this._options.stringFormatForColumn[this._columnNames[column]] ); diff --git a/js/notebook/src/tableDisplay/dataGrid/dataGrid.css b/js/notebook/src/tableDisplay/dataGrid/dataGrid.css deleted file mode 100644 index 4db1765b0a..0000000000 --- a/js/notebook/src/tableDisplay/dataGrid/dataGrid.css +++ /dev/null @@ -1,80 +0,0 @@ -.p-DataGrid { - min-width: 64px; - min-height: 330px; - border: 1px solid #A0A0A0; -} - -.p-DataGrid-scrollCorner { - background-color: #F0F0F0; -} - -.p-DataGrid-scrollCorner::after { - content: ''; - position: absolute; - top: 0; - left: 0; - width: 1px; - height: 1px; - background-color: #A0A0A0; -} - -.p-ScrollBar[data-orientation='horizontal'] { - min-height: 16px; - max-height: 16px; - min-width: 45px; - border-top: 1px solid #A0A0A0; -} - -.p-ScrollBar[data-orientation='vertical'] { - min-width: 16px; - max-width: 16px; - min-height: 45px; - border-left: 1px solid #A0A0A0; -} - -.p-ScrollBar-button { - background-color: #F0F0F0; - background-position: center center; - min-height: 15px; - max-height: 15px; - min-width: 15px; - max-width: 15px; -} - -.p-ScrollBar-button:hover { - background-color: #DADADA; -} - -.p-ScrollBar-button.p-mod-active { - background-color: #CDCDCD; -} - -.p-ScrollBar-track { - background: #F0F0F0; -} - -.p-ScrollBar-thumb { - background: #CDCDCD; -} - -.p-ScrollBar-thumb:hover { - background: #BABABA; -} - -.p-ScrollBar-thumb.p-mod-active { - background: #A0A0A0; -} - -.p-ScrollBar[data-orientation='horizontal'] .p-ScrollBar-thumb { - height: 100%; - min-width: 15px; - border-left: 1px solid #A0A0A0; - border-right: 1px solid #A0A0A0; -} - -.p-ScrollBar[data-orientation='vertical'] .p-ScrollBar-thumb { - width: 100%; - min-height: 15px; - border-top: 1px solid #A0A0A0; - border-bottom: 1px solid #A0A0A0; -} diff --git a/js/notebook/src/tableDisplay/dataGrid/dataGrid.scss b/js/notebook/src/tableDisplay/dataGrid/dataGrid.scss new file mode 100644 index 0000000000..d0bb8a84a2 --- /dev/null +++ b/js/notebook/src/tableDisplay/dataGrid/dataGrid.scss @@ -0,0 +1,109 @@ +/* + * Copyright 2017 TWO SIGMA OPEN SOURCE, LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +//Colors +$alto: #DADADA; +$gallery: #F0F0F0; +$silver: #CDCDCD; +$silverChalice: #A0A0A0; + +$gridBackgroundColor: $gallery; +$borderColor: $silverChalice; +$buttonActive: $silver; +$gridBorder: 1px solid $borderColor; + +.p-DataGrid { + min-width: 64px; + min-height: 330px; + border: $gridBorder; +} + +.p-DataGrid-scrollCorner { + background-color: $gridBackgroundColor; +} + +.p-DataGrid-scrollCorner::after { + content: ''; + position: absolute; + top: 0; + left: 0; + width: 1px; + height: 1px; + background-color: $borderColor; +} + +.p-ScrollBar { + &[data-orientation='horizontal'] { + min-height: 16px; + max-height: 16px; + min-width: 45px; + border-top: $gridBorder; + + .p-ScrollBar-thumb { + height: 100%; + min-width: 15px; + border-left: $gridBorder; + border-right: $gridBorder; + } + } + + &[data-orientation='vertical'] { + min-width: 16px; + max-width: 16px; + min-height: 45px; + border-left: $gridBorder; + + .p-ScrollBar-thumb { + width: 100%; + min-height: 15px; + border-top: $gridBorder; + border-bottom: $gridBorder; + } + } +} + +.p-ScrollBar-button { + background-color: $gridBackgroundColor; + background-position: center center; + min-height: 15px; + max-height: 15px; + min-width: 15px; + max-width: 15px; + + &:hover { + background-color: $alto; + } + + &.p-mod-active { + background-color: $buttonActive; + } +} + +.p-ScrollBar-track { + background: $gridBackgroundColor; +} + +.p-ScrollBar-thumb { + background: $silver; + + &:hover { + background: $silver; + } + + &.p-mod-active { + background: $silverChalice; + } +} diff --git a/js/notebook/src/tableDisplay/dataGrid/dataGridStyle.ts b/js/notebook/src/tableDisplay/dataGrid/dataGridStyle.ts new file mode 100644 index 0000000000..df4eb7c321 --- /dev/null +++ b/js/notebook/src/tableDisplay/dataGrid/dataGridStyle.ts @@ -0,0 +1,26 @@ +/* + * Copyright 2017 TWO SIGMA OPEN SOURCE, LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { DataGrid } from '@phosphor/datagrid'; + +import './dataGrid.scss'; + +export const silverStripeStyle: DataGrid.IStyle = { + ...DataGrid.defaultStyle, + voidColor: '#ffffff', + headerBackgroundColor: '#E6E6E6', + rowBackgroundColor: i => i % 2 === 0 ? '#f9f9f9' : '' +}; diff --git a/js/notebook/src/tableDisplay/dataGrid/dataTypes.ts b/js/notebook/src/tableDisplay/dataGrid/dataTypes.ts index bf7c03ea7d..faeb3b92c8 100644 --- a/js/notebook/src/tableDisplay/dataGrid/dataTypes.ts +++ b/js/notebook/src/tableDisplay/dataGrid/dataTypes.ts @@ -14,7 +14,7 @@ * limitations under the License. */ -enum ALL_TYPES { +export enum ALL_TYPES { 'string', 'integer', 'formatted integer', @@ -27,13 +27,13 @@ enum ALL_TYPES { 'html' } -enum TYPES_MAP { +export enum TYPES_MAP { 'int64' = ALL_TYPES.string, 'time' = ALL_TYPES.datetime, 'integer' = ALL_TYPES['formatted integer'] } -enum ALIGNMENTS_BY_TYPE { +export enum ALIGNMENTS_BY_TYPE { 'datetime' = 'C', 'integer' = 'R', 'double' = 'R' @@ -50,7 +50,9 @@ export const getTypeByName = (typeName: string): number => { return ALL_TYPES[typeName] || 0; }; -export function getDisplayType(type: number, stringFormatForType: any, stringFormatForColumn: any) { +export function getDisplayType(typeName: string, stringFormatForType?: any, stringFormatForColumn?: any) { + const type: number = getTypeByName(typeName); + if (type === ALL_TYPES.datetime) { return ALL_TYPES.datetime; } @@ -79,41 +81,3 @@ export function isDoubleWithPrecision(type: string|number) { export function getDoublePrecisionByType(type: string|number): string { return type.toString().split(".")[1]; } - -// allStringTypes: [ -// {type: 0, name: 'string'}, -// {type: 10, name: 'html'} -// ], -// allTimeTypes: [ -// {type: 8, name: 'datetime'}, -// {type: 0, name: 'string'} -// ], -// allIntTypes: [ -// {type: 0, name: 'string'}, -// {type: 1, name: 'integer'}, -// {type: 2, name: 'formatted integer'}, -// {type: 8, name: 'datetime'} -// ], -// allDoubleTypes: [ -// {type: 0, name: 'string'}, -// {type: 3, name: 'double'}, -// {type: 4, name: 'double with precision'}, -// {type: 6, name: 'exponential 5'}, -// {type: 7, name: 'exponential 15'} -// ], -// allBoolTypes: [ -// {type: 0, name: 'string'}, -// {type: 9, name: 'boolean'} -// ], -// allTypes: [ -// {type: 0, name: 'string'}, -// {type: 1, name: 'integer'}, -// {type: 2, name: 'formatted integer'}, -// {type: 3, name: 'double'}, -// {type: 4, name: 'double with precision'}, -// {type: 6, name: 'exponential 5'}, -// {type: 7, name: 'exponential 15'}, -// {type: 8, name: 'datetime'}, -// {type: 9, name: 'boolean'}, -// {type: 10, name: 'html'} -// ], \ No newline at end of file diff --git a/js/notebook/src/tableDisplay/tableHeaderMenu/createFormatMenuItems.ts b/js/notebook/src/tableDisplay/tableHeaderMenu/createFormatMenuItems.ts index cf531ce79b..69db501eaf 100644 --- a/js/notebook/src/tableDisplay/tableHeaderMenu/createFormatMenuItems.ts +++ b/js/notebook/src/tableDisplay/tableHeaderMenu/createFormatMenuItems.ts @@ -16,8 +16,7 @@ import MenuItem from "../../shared/interfaces/menuItemInterface"; import _ from 'underscore'; - -const tableConsts = require('../consts'); +import { TIME_UNIT_FORMATS } from '../consts'; const getColumnTypes = (scope: any, colIdx: number): object[] => { if (colIdx === 0) { @@ -110,8 +109,8 @@ export function createPrecisionSubitems(scope): MenuItem[] { export function createTimeSubitems(scope): MenuItem[] { const items: MenuItem[] = []; - _.forEach(tableConsts.TIME_UNIT_FORMATS, function(value, unit) { - if (tableConsts.TIME_UNIT_FORMATS.hasOwnProperty(unit)) { + _.forEach(TIME_UNIT_FORMATS, function(value, unit) { + if (TIME_UNIT_FORMATS.hasOwnProperty(unit)) { let item = { title: value.title, isChecked: function(colIdx) { diff --git a/js/notebook/src/tableDisplay/tableScope.js b/js/notebook/src/tableDisplay/tableScope.js index ce90d4bf18..45b8520c22 100644 --- a/js/notebook/src/tableDisplay/tableScope.js +++ b/js/notebook/src/tableDisplay/tableScope.js @@ -28,7 +28,6 @@ define([ './../shared/bkUtils', './cellHighlighters', './../shared/bkHelper', - './consts', 'jquery-ui/ui/widgets/tooltip', './tableUtils' ], function( @@ -45,13 +44,13 @@ define([ bkUtils, cellHighlighters, bkHelper, - tableConsts, tooltip, tableUtils ) { var jQuery = $; var updateTableEventListener; + var tableConsts = require('./consts').default; tableUtils.setJqExtentions(); diff --git a/js/notebook/tsconfig.json b/js/notebook/src/tsconfig.json similarity index 56% rename from js/notebook/tsconfig.json rename to js/notebook/src/tsconfig.json index 391c582290..cc213a463b 100644 --- a/js/notebook/tsconfig.json +++ b/js/notebook/src/tsconfig.json @@ -1,6 +1,6 @@ { "compilerOptions": { - "baseUrl": "src", + "baseUrl": "./", "sourceMap": true, "strictNullChecks": true, "module": "ES2015", @@ -8,12 +8,7 @@ "allowJs": true, "moduleResolution": "Node", "noEmit": true, - "lib": ["dom", "es5", "es2015.promise"] - }, - "include": [ - "./src/**/*.ts" - ], - "exclude": [ - "node_modules" - ] + "lib": ["dom", "es5", "es2015.promise"], + "types": [] + } } \ No newline at end of file diff --git a/js/notebook/test/mocha.opts b/js/notebook/test/mocha.opts new file mode 100644 index 0000000000..28bdd63adb --- /dev/null +++ b/js/notebook/test/mocha.opts @@ -0,0 +1,6 @@ +--require tsconfig-paths/register +--require ts-node/register +--require ignore-styles +--require ./test/setup.js +--watch-extensions ts,tsx +./test/**/*.spec.ts diff --git a/js/notebook/test/setup.js b/js/notebook/test/setup.js new file mode 100644 index 0000000000..3ad2c216e3 --- /dev/null +++ b/js/notebook/test/setup.js @@ -0,0 +1,27 @@ +/* + * Copyright 2017 TWO SIGMA OPEN SOURCE, LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +var jsdom = require('jsdom'); + +global.window = new jsdom.JSDOM().window; +global.document = window.document; +global.Element = window.Element; +window.HTMLCanvasElement.prototype.getContext = function() { + return {}; +}; + +global.navigator = window.navigator; +global.define = function() {}; diff --git a/js/notebook/test/src/tableDisplay/dataGrid/DataFormatter.spec.ts b/js/notebook/test/src/tableDisplay/dataGrid/DataFormatter.spec.ts new file mode 100644 index 0000000000..9b2faef1fb --- /dev/null +++ b/js/notebook/test/src/tableDisplay/dataGrid/DataFormatter.spec.ts @@ -0,0 +1,329 @@ +/* + * Copyright 2017 TWO SIGMA OPEN SOURCE, LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import * as sinon from 'sinon'; +import { expect, assert } from 'chai'; +import { DataFormatter } from '@beakerx/tableDisplay/dataGrid/DataFormatter'; +import { TIME_UNIT_FORMATS } from '@beakerx/tableDisplay/consts'; +import * as moment from 'moment-timezone/builds/moment-timezone-with-data'; + +declare var require: Function; + +describe('DataFormatter', () => { + const dataFormatter = new DataFormatter({}); + + it('should implement getFormatFnByType method', () => { + expect(dataFormatter.getFormatFnByType).to.be.a('function'); + }); + + describe('getFormatFnByType', () => { + it('should throw Error while called withoud param', () => { + assert.throws( + () => { dataFormatter.getFormatFnByType(undefined); }, + Error, + "Cannot read property 'toString' of undefined" + ); + }); + + it('should return function', () => { + expect(dataFormatter.getFormatFnByType(0)).to.be.a('function'); + }); + + it('should return "string" function', () => { + expect(dataFormatter.getFormatFnByType(0)).to.equal(dataFormatter['string']); + }); + + it('should return "string" function', () => { + expect(dataFormatter.getFormatFnByType(400)).to.equal(dataFormatter['string']); + }); + + it('should return "integer" function', () => { + expect(dataFormatter.getFormatFnByType(1)).to.equal(dataFormatter['integer']); + }); + + it('should return "formattedInteger" function', () => { + expect(dataFormatter.getFormatFnByType(2)).to.equal(dataFormatter['formattedInteger']); + }); + + it('should return "double" function', () => { + expect(dataFormatter.getFormatFnByType(3)).to.equal(dataFormatter['double']); + }); + + it('should return "exponential_5" function', () => { + expect(dataFormatter.getFormatFnByType(6)).to.equal(dataFormatter['exponential_5']); + }); + + it('should return "exponential_15" function', () => { + expect(dataFormatter.getFormatFnByType(7)).to.equal(dataFormatter['exponential_15']); + }); + + it('should return "datetime" function', () => { + expect(dataFormatter.getFormatFnByType(8)).to.equal(dataFormatter['datetime']); + }); + + it('should return "boolean" function', () => { + expect(dataFormatter.getFormatFnByType(9)).to.equal(dataFormatter['boolean']); + }); + + it('should return "html" function', () => { + expect(dataFormatter.getFormatFnByType(10)).to.equal(dataFormatter['html']); + }); + + it('should return "doubleWithPrecission" function', () => { + expect(dataFormatter.getFormatFnByType('4.3').toString()) + .to.equal((dataFormatter['doubleWithPrecission']('3')).toString()); + }); + }); + + describe('dataFormatter.string', () => { + const stringFormatFn = dataFormatter.getFormatFnByType(0); + + it('should return empty string', () => { + expect(stringFormatFn('', 0, 0)).to.equal(''); + }); + + it('should escape html characters', () => { + expect(stringFormatFn('&test<>"Works"Ok/<>', 0, 0)) + .to.equal('&test<>"Works"Ok/<>'); + }); + + it('should convert to date', () => { + expect(stringFormatFn({ timestamp: 1516697673043, type: 'Date' }, 0, 0)) + .to.equal('20180123 09:54:33.043 +0100'); + }); + + it('should return given value', () => { + expect(stringFormatFn(1, 0, 0)).to.equal(1); + expect(stringFormatFn(null, 0, 0)).to.equal(null); + expect(stringFormatFn('', 0, 0)).to.equal(''); + expect(stringFormatFn(0, 0, 0)).to.equal(0); + expect(stringFormatFn(false, 0, 0)).to.equal(false); + }); + + }); + + describe('dataFormatter.integer', () => { + const integerFormatFn = dataFormatter.getFormatFnByType(1); + + it('should return integer', () => { + expect(integerFormatFn('1', 0, 0)).to.equal(1); + expect(integerFormatFn('0', 0, 0)).to.equal(0); + expect(integerFormatFn('123', 0, 0)).to.equal(123); + expect(integerFormatFn(123, 0, 0)).to.equal(123); + expect(integerFormatFn(1, 0, 0)).to.equal(1); + }); + + it('should return empty value', () => { + expect(integerFormatFn(undefined, 0, 0)).to.equal(undefined); + expect(integerFormatFn(null, 0, 0)).to.equal(null); + expect(integerFormatFn(0, 0, 0)).to.equal(0); + expect(integerFormatFn('', 0, 0)).to.equal(''); + }); + + it('should return NaN', () => { + expect(integerFormatFn(false, 0, 0).toString()).to.equal('NaN'); + expect(integerFormatFn(NaN, 0, 0).toString()).to.equal('NaN'); + expect(integerFormatFn('something', 0, 0).toString()).to.equal('NaN'); + }); + + }); + + describe('dataFormatter.formattedInteger', () => { + const formattedIntegerFormatFn = dataFormatter.getFormatFnByType(2); + + it('should return formatted integer', () => { + expect(formattedIntegerFormatFn('1', 0, 0)).to.equal('1'); + expect(formattedIntegerFormatFn('0', 0, 0)).to.equal('0'); + expect(formattedIntegerFormatFn('123', 0, 0)).to.equal('123'); + expect(formattedIntegerFormatFn(123, 0, 0)).to.equal('123'); + expect(formattedIntegerFormatFn(1, 0, 0)).to.equal('1'); + expect(formattedIntegerFormatFn(0, 0, 0)).to.equal('0'); + expect(formattedIntegerFormatFn(1230, 0, 0)).to.equal('1,230'); + expect(formattedIntegerFormatFn(123023, 0, 0)).to.equal('123,023'); + expect(formattedIntegerFormatFn(1123023, 0, 0)).to.equal('1,123,023'); + expect(formattedIntegerFormatFn('1123023', 0, 0)).to.equal('1,123,023'); + }); + + it('should return empty value', () => { + expect(formattedIntegerFormatFn(undefined, 0, 0)).to.equal(undefined); + expect(formattedIntegerFormatFn(null, 0, 0)).to.equal(null); + expect(formattedIntegerFormatFn('', 0, 0)).to.equal(''); + }); + + it('should return NaN', () => { + expect(formattedIntegerFormatFn(false, 0, 0).toString()).to.equal('NaN'); + expect(formattedIntegerFormatFn(NaN, 0, 0).toString()).to.equal('NaN'); + expect(formattedIntegerFormatFn('something', 0, 0).toString()).to.equal('NaN'); + }); + + }); + + describe('dataFormatter.double', () => { + const doubleFormatFn = dataFormatter.getFormatFnByType(3); + + it('should return formatted double', () => { + expect(doubleFormatFn('1', 0, 0)).to.equal(1); + expect(doubleFormatFn('1.2', 0, 0)).to.equal(1.2); + expect(doubleFormatFn(1.2, 0, 0)).to.equal(1.2); + }); + + it('should return empty value', () => { + expect(doubleFormatFn(undefined, 0, 0)).to.equal(undefined); + expect(doubleFormatFn(null, 0, 0)).to.equal(null); + expect(doubleFormatFn('', 0, 0)).to.equal(''); + }); + + it('should return NaN', () => { + expect(doubleFormatFn(false, 0, 0).toString()).to.equal('NaN'); + expect(doubleFormatFn(NaN, 0, 0).toString()).to.equal('NaN'); + expect(doubleFormatFn('something', 0, 0).toString()).to.equal('NaN'); + }); + + }); + + describe('dataFormatter.doubleWithPrecission', () => { + const doubleWithPrecissionFormatFn = dataFormatter.getFormatFnByType('4.3'); + + it('should return formatted double with precission', () => { + expect(doubleWithPrecissionFormatFn('1', 0, 0)).to.equal('1.000'); + expect(doubleWithPrecissionFormatFn('1.2', 0, 0)).to.equal('1.200'); + expect(doubleWithPrecissionFormatFn(1.2, 0, 0)).to.equal('1.200'); + expect(doubleWithPrecissionFormatFn(1.23456, 0, 0)).to.equal('1.235'); + expect(doubleWithPrecissionFormatFn(1.23446, 0, 0)).to.equal('1.234'); + }); + + it('should return empty value', () => { + expect(doubleWithPrecissionFormatFn(undefined, 0, 0)).to.equal(undefined); + expect(doubleWithPrecissionFormatFn(null, 0, 0)).to.equal(null); + expect(doubleWithPrecissionFormatFn('', 0, 0)).to.equal(''); + }); + + it('should return NaN', () => { + expect(doubleWithPrecissionFormatFn(false, 0, 0).toString()).to.equal('NaN'); + expect(doubleWithPrecissionFormatFn(NaN, 0, 0).toString()).to.equal('NaN'); + expect(doubleWithPrecissionFormatFn('something', 0, 0).toString()).to.equal('NaN'); + }); + + }); + + describe('dataFormatter.exponential_5', () => { + const exponential_5FormatFn = dataFormatter.getFormatFnByType(6); + + it('should return formatted exponential_5', () => { + expect(exponential_5FormatFn('1', 0, 0)).to.equal('1.00000e+0'); + expect(exponential_5FormatFn(1234, 0, 0)).to.equal('1.23400e+3'); + expect(exponential_5FormatFn(0, 0, 0)).to.equal('0.00000e+0'); + }); + + it('should return empty value', () => { + expect(exponential_5FormatFn(undefined, 0, 0)).to.equal(undefined); + expect(exponential_5FormatFn(null, 0, 0)).to.equal(null); + expect(exponential_5FormatFn('', 0, 0)).to.equal(''); + }); + + it('should return NaN', () => { + expect(exponential_5FormatFn(false, 0, 0).toString()).to.equal('NaN'); + expect(exponential_5FormatFn(NaN, 0, 0).toString()).to.equal('NaN'); + expect(exponential_5FormatFn('something', 0, 0).toString()).to.equal('NaN'); + }); + + }); + + describe('dataFormatter.exponential_15', () => { + const exponential_15FormatFn = dataFormatter.getFormatFnByType(7); + + it('should return formatted exponential_15', () => { + expect(exponential_15FormatFn('1', 0, 0)).to.equal('1.000000000000000e+0'); + expect(exponential_15FormatFn(1234, 0, 0)).to.equal('1.234000000000000e+3'); + expect(exponential_15FormatFn(12343456, 0, 0)).to.equal('1.234345600000000e+7'); + expect(exponential_15FormatFn(0, 0, 0)).to.equal('0.000000000000000e+0'); + }); + + it('should return empty value', () => { + expect(exponential_15FormatFn(undefined, 0, 0)).to.equal(undefined); + expect(exponential_15FormatFn(null, 0, 0)).to.equal(null); + expect(exponential_15FormatFn('', 0, 0)).to.equal(''); + }); + + it('should return NaN', () => { + expect(exponential_15FormatFn(false, 0, 0).toString()).to.equal('NaN'); + expect(exponential_15FormatFn(NaN, 0, 0).toString()).to.equal('NaN'); + expect(exponential_15FormatFn('something', 0, 0).toString()).to.equal('NaN'); + }); + + }); + + describe('dataFormatter.datetime', () => { + const datetimeFormatFn = dataFormatter.getFormatFnByType(8); + const bkUtils = require('@beakerx/shared/bkUtils'); + + before (() => { + sinon.stub( + bkUtils, + 'formatTimestamp', + ).callsFake((value) => moment(new Date(value)).format(TIME_UNIT_FORMATS.DATETIME.format)); + }); + + after(() => { + bkUtils.formatTimestamp.restore() + }); + + it('should return formatted datetime', () => { + expect(datetimeFormatFn({ timestamp: 1516697673043, type: 'Date' }, 0, 0)) + .to.equal('20180123 09:54:33.043 +0100'); + + expect(datetimeFormatFn(1516703121, 0, 0)).to.equal('20180123 11:25:21.000 +0100'); + }); + + it('should return Invalid date', () => { + expect(datetimeFormatFn(NaN, 0, 0).toString()).to.equal('Invalid date'); + expect(datetimeFormatFn('something', 0, 0).toString()).to.equal('Invalid date'); + }); + + }); + + describe('dataFormatter.boolean', () => { + const booleanFormatFn = dataFormatter.getFormatFnByType(9); + + it('should return "true"', () => { + expect(booleanFormatFn('something', 0, 0)).to.equal('true'); + expect(booleanFormatFn(true, 0, 0)).to.equal('true'); + expect(booleanFormatFn(0, 0, 0)).to.equal('true'); + }); + + it('should return "false"', () => { + expect(booleanFormatFn(NaN, 0, 0)).to.equal('false'); + expect(booleanFormatFn(false, 0, 0)).to.equal('false'); + expect(booleanFormatFn(undefined, 0, 0)).to.equal('false'); + expect(booleanFormatFn(null, 0, 0)).to.equal('false'); + expect(booleanFormatFn('', 0, 0)).to.equal('false'); + }); + + }); + + describe('dataFormatter.html', () => { + const booleanFormatFn = dataFormatter.getFormatFnByType(10); + const testObject = { someProp: '' }; + + it('should return given value', () => { + expect(booleanFormatFn('something', 0, 0)).to.equal('something'); + expect(booleanFormatFn(true, 0, 0)).to.equal(true); + expect(booleanFormatFn(0, 0, 0)).to.equal(0); + expect(booleanFormatFn(testObject, 0, 0)).to.equal(testObject); + }); + + }); +}); diff --git a/js/notebook/test/src/tableDisplay/dataGrid/DataGridScope.spec.ts b/js/notebook/test/src/tableDisplay/dataGrid/DataGridScope.spec.ts new file mode 100644 index 0000000000..a0bf4e1445 --- /dev/null +++ b/js/notebook/test/src/tableDisplay/dataGrid/DataGridScope.spec.ts @@ -0,0 +1,70 @@ +/* + * Copyright 2017 TWO SIGMA OPEN SOURCE, LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +declare var require: Function; + +import { expect, assert } from 'chai'; +import * as sinon from 'sinon'; +import { Widget } from "@phosphor/widgets"; +import { DataGridScope } from '@beakerx/tableDisplay/dataGrid/DataGridScope'; + +const element = document.createElement('div'); + +describe('dataGridScope', () => { + const dataGridScope = new DataGridScope({ + element, + data: { + values: [], + columnNames: [] + } + }); + + it('should fail initialization', () => { + assert.throws( + () => { new DataGridScope({ element, data: {} }); }, + Error, + "Cannot read property 'length' of undefined" + ); + }); + + it('should implement "render" method', () => { + expect(dataGridScope).to.have.property('render'); + expect(dataGridScope.render).to.be.a('function'); + }); + + it('should implement "doDestroy" method', () => { + expect(dataGridScope).to.have.property('doDestroy'); + expect(dataGridScope.doDestroy).to.be.a('function'); + }); + + it('should call "dispose" method when calling "doDestroy"', () => { + const dataGridMock = sinon.mock(dataGridScope['dataGrid']); + + dataGridMock.expects('dispose'); + dataGridScope.doDestroy(); + dataGridMock.verify(); + dataGridMock.restore(); + }); + + it('should call "attach" method when calling "render"', () => { + const widgetMock = sinon.mock(Widget); + + widgetMock.expects('attach'); + dataGridScope.render(); + widgetMock.verify(); + widgetMock.restore(); + }); +}); diff --git a/js/notebook/test/src/tableDisplay/dataGrid/DataGridStyle.spec.ts b/js/notebook/test/src/tableDisplay/dataGrid/DataGridStyle.spec.ts new file mode 100644 index 0000000000..284c355629 --- /dev/null +++ b/js/notebook/test/src/tableDisplay/dataGrid/DataGridStyle.spec.ts @@ -0,0 +1,37 @@ +/* + * Copyright 2017 TWO SIGMA OPEN SOURCE, LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { expect } from 'chai'; +import { DataGrid } from '@phosphor/datagrid'; +import { silverStripeStyle } from '@beakerx/tableDisplay/dataGrid/dataGridStyle'; + +describe('dataGridStyle', () => { + it('should be an object', () => { + expect(silverStripeStyle).to.be.an('object'); + }); + + it('should have same properties as DataGrid.defaultStyle', () => { + expect(silverStripeStyle).to.have.any.keys(Object.keys(DataGrid.defaultStyle)); + }); + + it('should have the voidColor set to #ffffff', () => { + expect(silverStripeStyle.voidColor).to.equal('#ffffff'); + }); + + it('should have the rowBackgroundColor method', () => { + expect(silverStripeStyle.rowBackgroundColor).to.be.a('function'); + }); +}); diff --git a/js/notebook/test/src/tableDisplay/dataGrid/TableDataModel.spec.ts b/js/notebook/test/src/tableDisplay/dataGrid/TableDataModel.spec.ts new file mode 100644 index 0000000000..eecb8ae6f8 --- /dev/null +++ b/js/notebook/test/src/tableDisplay/dataGrid/TableDataModel.spec.ts @@ -0,0 +1,67 @@ +/* + * Copyright 2017 TWO SIGMA OPEN SOURCE, LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { expect } from 'chai'; +import { TableDataModel } from '@beakerx/tableDisplay/dataGrid/TableDataModel'; +import { DataModel } from "@phosphor/datagrid"; + +describe('dataGridScope', () => { + const tableDataModel = new TableDataModel({ + values: [[1]], + columnNames: ['first column'], + hasIndex: false, + types: ['double'], + stringFormatForColumn: {} + }); + + it('should be instance of DataModel', () => { + expect(tableDataModel).to.be.an.instanceof(DataModel); + }); + + it('should implement the formatData method', () => { + expect(tableDataModel).to.have.property('formatData'); + }); + + it('should implement the data method', () => { + expect(tableDataModel).to.have.property('data'); + }); + + it('should return proper data', () => { + expect(tableDataModel.data('corner-header', 0, 0)).to.equal(''); + expect(tableDataModel.data('column-header', 0, 0)).to.equal('first column'); + expect(tableDataModel.data('row-header', 0, 0)).to.equal(0); + expect(tableDataModel.data('body', 0, 0)).to.equal('1.000'); + }); + + it('should implement the rowCount method', () => { + expect(tableDataModel).to.have.property('rowCount'); + }); + + it('should return the proper row count', () => { + expect(tableDataModel.rowCount('body')).to.equal(1); + expect(tableDataModel.rowCount('column-header')).to.equal(1); + }); + + it('should implement the columnCount method', () => { + expect(tableDataModel).to.have.property('columnCount'); + }); + + it('should return the proper column count', () => { + expect(tableDataModel.columnCount('body')).to.equal(1); + expect(tableDataModel.columnCount('row-header')).to.equal(1); + }); + +}); diff --git a/js/notebook/test/src/tableDisplay/dataGrid/dataGridHelpers.spec.ts b/js/notebook/test/src/tableDisplay/dataGrid/dataGridHelpers.spec.ts new file mode 100644 index 0000000000..6662dce5cf --- /dev/null +++ b/js/notebook/test/src/tableDisplay/dataGrid/dataGridHelpers.spec.ts @@ -0,0 +1,46 @@ +/* + * Copyright 2017 TWO SIGMA OPEN SOURCE, LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { expect } from 'chai'; +import { DataGridHelpers } from '@beakerx/tableDisplay/dataGrid/dataGridHelpers'; + +describe('DataGridHelpers', () => { + it('should export escapeHTML helper function', () => { + expect(DataGridHelpers.escapeHTML).to.be.a('function'); + }); + + it('should escape html characters', () => { + const testObject = {}; + + expect(DataGridHelpers.escapeHTML('&test<>"Works"Ok/<>')) + .to.equal('&test<>"Works"Ok/<>'); + expect(DataGridHelpers.escapeHTML(testObject)).to.equal(testObject); + }); + + it('should export truncateString helper function', () => { + expect(DataGridHelpers.truncateString).to.be.a('function'); + }); + + it('should truncate string', () => { + const testObject = {}; + + expect(DataGridHelpers.truncateString('testString')).to.equal('testString'); + expect(DataGridHelpers.truncateString('testString', 2)).to.equal('te...'); + expect(DataGridHelpers.truncateString('testString', 0)).to.equal('...'); + expect(DataGridHelpers.truncateString(testObject)).to.equal(testObject); + }); + +}); diff --git a/js/notebook/test/src/tableDisplay/dataGrid/dataTypes.spec.ts b/js/notebook/test/src/tableDisplay/dataGrid/dataTypes.spec.ts new file mode 100644 index 0000000000..d48fd394a1 --- /dev/null +++ b/js/notebook/test/src/tableDisplay/dataGrid/dataTypes.spec.ts @@ -0,0 +1,78 @@ +/* + * Copyright 2017 TWO SIGMA OPEN SOURCE, LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { expect } from 'chai'; +import { getTypeByName, getDisplayType, ALL_TYPES } from '@beakerx/tableDisplay/dataGrid/dataTypes'; + +describe('dataTypes', () => { + describe('getTypeByName', () => { + it('should be a function', () => { + expect(getTypeByName).to.be.a('function'); + }); + + it('should return number', () => { + expect(getTypeByName('integer')).to.be.a('number'); + }); + + it('should return 0 as default', () => { + expect(getTypeByName('some dummy value')).to.equal(0); + }); + + it('should return proper type number', () => { + expect(getTypeByName('string')).to.equal(0); + expect(getTypeByName('formatted integer')).to.equal(2); + expect(getTypeByName('double')).to.equal(3); + expect(getTypeByName('double with precision')).to.equal(4); + expect(getTypeByName('exponential 5')).to.equal(6); + expect(getTypeByName('exponential 15')).to.equal(7); + expect(getTypeByName('datetime')).to.equal(8); + expect(getTypeByName('boolean')).to.equal(9); + expect(getTypeByName('html')).to.equal(10); + }); + + it('should return mapped types number', () => { + expect(getTypeByName('integer')).to.equal(2); + expect(getTypeByName('int64')).to.equal(0); + expect(getTypeByName('time')).to.equal(8); + }); + }); + + describe('getDisplayType', () => { + it('should be a function', () => { + expect(getDisplayType).to.be.a('function'); + }); + + it('should return number', () => { + expect(getDisplayType('some dummy value')).to.be.a('number'); + }); + + it('should return 0 by default', () => { + expect(getDisplayType('some dummy value')).to.equal(0); + }); + + it('should return display type as number', () => { + expect(getDisplayType('string')).to.equal(0); + expect(getDisplayType('formatted integer')).to.equal(0); + expect(getDisplayType('exponential 5')).to.equal(0); + expect(getDisplayType('exponential 15')).to.equal(0); + expect(getDisplayType('html')).to.equal(0); + expect(getDisplayType('boolean')).to.equal(0); + expect(getDisplayType('double')).to.equal('4.3'); + expect(getTypeByName('double with precision')).to.equal(4); + expect(getDisplayType('datetime')).to.equal(8); + }); + }); +}); diff --git a/js/notebook/test/tsconfig.json b/js/notebook/test/tsconfig.json new file mode 100644 index 0000000000..25ca3b55cf --- /dev/null +++ b/js/notebook/test/tsconfig.json @@ -0,0 +1,15 @@ +{ + "compilerOptions": { + "baseUrl": "src", + "module": "commonjs", + "target": "es5", + "allowJs": true, + "moduleResolution": "node", + "lib": ["dom", "es6", "es5"], + "types": ["mocha", "chai", "node"], + "paths": { + "@beakerx/*": ["../../src/*"] + } + }, + "compileOnSave": false +} diff --git a/js/notebook/webpack.config.js b/js/notebook/webpack.config.js index 058b7a9f1b..4e038ef0de 100644 --- a/js/notebook/webpack.config.js +++ b/js/notebook/webpack.config.js @@ -18,6 +18,8 @@ var webpack = require('webpack'); var package = require('./package.json'); var path = require('path'); var ForkTsCheckerWebpackPlugin = require('fork-ts-checker-webpack-plugin'); +var TsconfigPathsPlugin = require('tsconfig-paths-webpack-plugin'); +var tsConfigPath = path.resolve(__dirname, './src/tsconfig.json'); // Custom webpack loaders are generally the same for all webpack bundles, hence // stored in a separate local variable. @@ -51,7 +53,9 @@ var plugins = [ "jQuery":"jquery", "window.jQuery":"jquery" }), + new TsconfigPathsPlugin({ configFile: tsConfigPath }), new ForkTsCheckerWebpackPlugin({ + tsconfig: tsConfigPath, watch: 'src', workers: ForkTsCheckerWebpackPlugin.TWO_CPUS_FREE }), diff --git a/js/notebook/yarn.lock b/js/notebook/yarn.lock index fbc9fbb322..6e0be6ca0b 100644 --- a/js/notebook/yarn.lock +++ b/js/notebook/yarn.lock @@ -100,6 +100,30 @@ "@phosphor/signaling" "^1.2.2" "@phosphor/virtualdom" "^1.1.2" +"@types/chai@^4.1.1": + version "4.1.1" + resolved "https://registry.yarnpkg.com/@types/chai/-/chai-4.1.1.tgz#15f1257fab17b7acb9c413f9f88d3d87f834d11e" + +"@types/mocha@^2.2.46": + version "2.2.46" + resolved "https://registry.yarnpkg.com/@types/mocha/-/mocha-2.2.46.tgz#b04713f7759d1cf752effdaae7b3969e285ebc16" + +"@types/node@*": + version "9.3.0" + resolved "https://registry.yarnpkg.com/@types/node/-/node-9.3.0.tgz#3a129cda7c4e5df2409702626892cb4b96546dd5" + +"@types/strip-bom@^3.0.0": + version "3.0.0" + resolved "https://registry.yarnpkg.com/@types/strip-bom/-/strip-bom-3.0.0.tgz#14a8ec3956c2e81edb7520790aecf21c290aebd2" + +"@types/strip-json-comments@0.0.30": + version "0.0.30" + resolved "https://registry.yarnpkg.com/@types/strip-json-comments/-/strip-json-comments-0.0.30.tgz#9aa30c04db212a9a0649d6ae6fd50accc40748a1" + +abab@^1.0.3: + version "1.0.4" + resolved "https://registry.yarnpkg.com/abab/-/abab-1.0.4.tgz#5faad9c2c07f60dd76770f71cf025b62a63cfd4e" + abbrev@1: version "1.1.1" resolved "https://registry.yarnpkg.com/abbrev/-/abbrev-1.1.1.tgz#f8f2c887ad10bf67f634f005b6987fed3179aac8" @@ -110,6 +134,12 @@ acorn-dynamic-import@^2.0.0: dependencies: acorn "^4.0.3" +acorn-globals@^4.0.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/acorn-globals/-/acorn-globals-4.1.0.tgz#ab716025dbe17c54d3ef81d32ece2b2d99fe2538" + dependencies: + acorn "^5.0.0" + acorn@^4.0.3: version "4.0.13" resolved "https://registry.yarnpkg.com/acorn/-/acorn-4.0.13.tgz#105495ae5361d697bd195c825192e1ad7f253787" @@ -118,6 +148,10 @@ acorn@^5.0.0: version "5.2.1" resolved "https://registry.yarnpkg.com/acorn/-/acorn-5.2.1.tgz#317ac7821826c22c702d66189ab8359675f135d7" +acorn@^5.1.2: + version "5.3.0" + resolved "https://registry.yarnpkg.com/acorn/-/acorn-5.3.0.tgz#7446d39459c54fb49a80e6ee6478149b940ec822" + ajv-keywords@^2.0.0: version "2.1.1" resolved "https://registry.yarnpkg.com/ajv-keywords/-/ajv-keywords-2.1.1.tgz#617997fc5f60576894c435f940d819e135b80762" @@ -206,6 +240,10 @@ arr-flatten@^1.0.1: version "1.1.0" resolved "https://registry.yarnpkg.com/arr-flatten/-/arr-flatten-1.1.0.tgz#36048bbff4e7b47e136644316c99669ea5ae91f1" +array-equal@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/array-equal/-/array-equal-1.0.0.tgz#8c2a5ef2472fd9ea742b04c77a75093ba2757c93" + array-find-index@^1.0.1: version "1.0.2" resolved "https://registry.yarnpkg.com/array-find-index/-/array-find-index-1.0.2.tgz#df010aa1287e164bbda6f9723b0a96a1ec4187a1" @@ -214,6 +252,10 @@ array-unique@^0.2.1: version "0.2.1" resolved "https://registry.yarnpkg.com/array-unique/-/array-unique-0.2.1.tgz#a1d97ccafcbc2625cc70fadceb36a50c58b01a53" +arrify@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/arrify/-/arrify-1.0.1.tgz#898508da2226f380df904728456849c1501a4b0d" + asn1.js@^4.0.0: version "4.9.2" resolved "https://registry.yarnpkg.com/asn1.js/-/asn1.js-4.9.2.tgz#8117ef4f7ed87cd8f89044b5bff97ac243a16c9a" @@ -240,6 +282,10 @@ assert@^1.1.1: dependencies: util "0.10.3" +assertion-error@^1.0.1: + version "1.1.0" + resolved "https://registry.yarnpkg.com/assertion-error/-/assertion-error-1.1.0.tgz#e60b6b0e8f301bd97e5375215bda406c85118c0b" + ast-types@0.9.6: version "0.9.6" resolved "https://registry.yarnpkg.com/ast-types/-/ast-types-0.9.6.tgz#102c9e9e9005d3e7e3829bf0c4fa24ee862ee9b9" @@ -378,6 +424,14 @@ brorand@^1.0.1: version "1.1.0" resolved "https://registry.yarnpkg.com/brorand/-/brorand-1.1.0.tgz#12c25efe40a45e3c323eb8675a0a0ce57b22371f" +browser-process-hrtime@^0.1.2: + version "0.1.2" + resolved "https://registry.yarnpkg.com/browser-process-hrtime/-/browser-process-hrtime-0.1.2.tgz#425d68a58d3447f02a04aa894187fce8af8b7b8e" + +browser-stdout@1.3.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/browser-stdout/-/browser-stdout-1.3.0.tgz#f351d32969d32fa5d7a5567154263d928ae3bd1f" + browserify-aes@^1.0.0, browserify-aes@^1.0.4: version "1.1.1" resolved "https://registry.yarnpkg.com/browserify-aes/-/browserify-aes-1.1.1.tgz#38b7ab55edb806ff2dcda1a7f1620773a477c49f" @@ -533,6 +587,17 @@ center-align@^0.1.1: align-text "^0.1.3" lazy-cache "^1.0.3" +chai@^4.1.2: + version "4.1.2" + resolved "https://registry.yarnpkg.com/chai/-/chai-4.1.2.tgz#0f64584ba642f0f2ace2806279f4f06ca23ad73c" + dependencies: + assertion-error "^1.0.1" + check-error "^1.0.1" + deep-eql "^3.0.0" + get-func-name "^2.0.0" + pathval "^1.0.0" + type-detect "^4.0.0" + chalk@^1.1.1, chalk@^1.1.3: version "1.1.3" resolved "https://registry.yarnpkg.com/chalk/-/chalk-1.1.3.tgz#a8115c55e4a702fe4d150abd3872822a7e09fc98" @@ -551,6 +616,10 @@ chalk@^2.3.0: escape-string-regexp "^1.0.5" supports-color "^4.0.0" +check-error@^1.0.1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/check-error/-/check-error-1.0.2.tgz#574d312edd88bb5dd8912e9286dd6c0aed4aac82" + chokidar@^1.7.0: version "1.7.0" resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-1.7.0.tgz#798e689778151c8076b4b360e5edd28cda2bb468" @@ -678,6 +747,10 @@ commander@2, commander@2.12.x, commander@^2.9.0, commander@~2.12.1: version "2.12.2" resolved "https://registry.yarnpkg.com/commander/-/commander-2.12.2.tgz#0f5946c427ed9ec0d91a46bb9def53e54650e555" +commander@2.11.0: + version "2.11.0" + resolved "https://registry.yarnpkg.com/commander/-/commander-2.11.0.tgz#157152fd1e7a6c8d98a5b715cf376df928004563" + commondir@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/commondir/-/commondir-1.0.1.tgz#ddd800da0c66127393cca5950ea968a3aaf1253b" @@ -708,6 +781,10 @@ constants-browserify@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/constants-browserify/-/constants-browserify-1.0.0.tgz#c20b96d8c617748aaf1c16021760cd27fcb8cb75" +content-type-parser@^1.0.1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/content-type-parser/-/content-type-parser-1.0.2.tgz#caabe80623e63638b2502fd4c7f12ff4ce2352e7" + copy-concurrently@^1.0.0: version "1.0.5" resolved "https://registry.yarnpkg.com/copy-concurrently/-/copy-concurrently-1.0.5.tgz#92297398cae34937fcafd6ec8139c18051f0b5e0" @@ -872,6 +949,16 @@ csso@~2.3.1: clap "^1.0.9" source-map "^0.5.3" +cssom@0.3.x, "cssom@>= 0.3.2 < 0.4.0": + version "0.3.2" + resolved "https://registry.yarnpkg.com/cssom/-/cssom-0.3.2.tgz#b8036170c79f07a90ff2f16e22284027a243848b" + +"cssstyle@>= 0.2.37 < 0.3.0": + version "0.2.37" + resolved "https://registry.yarnpkg.com/cssstyle/-/cssstyle-0.2.37.tgz#541097234cb2513c83ceed3acddc27ff27987d54" + dependencies: + cssom "0.3.x" + currently-unhandled@^0.4.1: version "0.4.1" resolved "https://registry.yarnpkg.com/currently-unhandled/-/currently-unhandled-0.4.1.tgz#988df33feab191ef799a61369dd76c17adf957ea" @@ -1180,6 +1267,12 @@ date-now@^0.1.4: version "0.1.4" resolved "https://registry.yarnpkg.com/date-now/-/date-now-0.1.4.tgz#eaf439fd4d4848ad74e5cc7dbef200672b9e345b" +debug@3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/debug/-/debug-3.1.0.tgz#5bb5a0672628b64149566ba16819e61518c67261" + dependencies: + ms "2.0.0" + debug@^2.2.0: version "2.6.9" resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.9.tgz#5d128515df134ff327e90a4c93f4e077a536341f" @@ -1190,10 +1283,24 @@ decamelize@^1.0.0, decamelize@^1.1.1, decamelize@^1.1.2: version "1.2.0" resolved "https://registry.yarnpkg.com/decamelize/-/decamelize-1.2.0.tgz#f6534d15148269b20352e7bee26f501f9a191290" +deep-eql@^3.0.0: + version "3.0.1" + resolved "https://registry.yarnpkg.com/deep-eql/-/deep-eql-3.0.1.tgz#dfc9404400ad1c8fe023e7da1df1c147c4b444df" + dependencies: + type-detect "^4.0.0" + deep-extend@~0.4.0: version "0.4.2" resolved "https://registry.yarnpkg.com/deep-extend/-/deep-extend-0.4.2.tgz#48b699c27e334bf89f10892be432f6e4c7d34a7f" +deep-is@~0.1.3: + version "0.1.3" + resolved "https://registry.yarnpkg.com/deep-is/-/deep-is-0.1.3.tgz#b369d6fb5dbc13eecf524f91b070feedc357cf34" + +deepmerge@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/deepmerge/-/deepmerge-2.0.1.tgz#25c1c24f110fb914f80001b925264dd77f3f4312" + defined@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/defined/-/defined-1.0.0.tgz#c98d9bcef75674188e110969151199e39b1fa693" @@ -1221,6 +1328,14 @@ detect-libc@^1.0.2: version "1.0.3" resolved "https://registry.yarnpkg.com/detect-libc/-/detect-libc-1.0.3.tgz#fa137c4bd698edf55cd5cd02ac559f91a4c4ba9b" +diff@3.3.1: + version "3.3.1" + resolved "https://registry.yarnpkg.com/diff/-/diff-3.3.1.tgz#aa8567a6eed03c531fc89d3f711cd0e5259dec75" + +diff@^3.1.0: + version "3.4.0" + resolved "https://registry.yarnpkg.com/diff/-/diff-3.4.0.tgz#b1d85507daf3964828de54b37d0d73ba67dda56c" + diffie-hellman@^5.0.0: version "5.0.2" resolved "https://registry.yarnpkg.com/diffie-hellman/-/diffie-hellman-5.0.2.tgz#b5835739270cfe26acf632099fded2a07f209e5e" @@ -1233,6 +1348,10 @@ domain-browser@^1.1.1: version "1.1.7" resolved "https://registry.yarnpkg.com/domain-browser/-/domain-browser-1.1.7.tgz#867aa4b093faa05f1de08c06f4d7b21fdf8698bc" +domexception@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/domexception/-/domexception-1.0.0.tgz#81fe5df81b3f057052cde3a9fa9bf536a85b9ab0" + duplexify@^3.1.2, duplexify@^3.4.2: version "3.5.1" resolved "https://registry.yarnpkg.com/duplexify/-/duplexify-3.5.1.tgz#4e1516be68838bc90a49994f0b39a6e5960befcd" @@ -1354,10 +1473,21 @@ es6-weak-map@^2.0.1: es6-iterator "^2.0.1" es6-symbol "^3.1.1" -escape-string-regexp@^1.0.2, escape-string-regexp@^1.0.5: +escape-string-regexp@1.0.5, escape-string-regexp@^1.0.2, escape-string-regexp@^1.0.5: version "1.0.5" resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4" +escodegen@^1.9.0: + version "1.9.0" + resolved "https://registry.yarnpkg.com/escodegen/-/escodegen-1.9.0.tgz#9811a2f265dc1cd3894420ee3717064b632b8852" + dependencies: + esprima "^3.1.3" + estraverse "^4.2.0" + esutils "^2.0.2" + optionator "^0.8.1" + optionalDependencies: + source-map "~0.5.6" + escope@^3.6.0: version "3.6.0" resolved "https://registry.yarnpkg.com/escope/-/escope-3.6.0.tgz#e01975e812781a163a6dadfdd80398dc64c889c3" @@ -1371,7 +1501,7 @@ esprima@^2.6.0: version "2.7.3" resolved "https://registry.yarnpkg.com/esprima/-/esprima-2.7.3.tgz#96e3b70d5779f6ad49cd032673d1c312767ba581" -esprima@~3.1.0: +esprima@^3.1.3, esprima@~3.1.0: version "3.1.3" resolved "https://registry.yarnpkg.com/esprima/-/esprima-3.1.3.tgz#fdca51cee6133895e3c88d535ce49dbff62a4633" @@ -1382,7 +1512,7 @@ esrecurse@^4.1.0: estraverse "^4.1.0" object-assign "^4.0.1" -estraverse@^4.1.0, estraverse@^4.1.1: +estraverse@^4.1.0, estraverse@^4.1.1, estraverse@^4.2.0: version "4.2.0" resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-4.2.0.tgz#0dee3fed31fcd469618ce7342099fc1afa0bdb13" @@ -1458,6 +1588,10 @@ fast-json-stable-stringify@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/fast-json-stable-stringify/-/fast-json-stable-stringify-2.0.0.tgz#d5142c0caee6b1189f87d3a76111064f86c8bbf2" +fast-levenshtein@~2.0.4: + version "2.0.6" + resolved "https://registry.yarnpkg.com/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz#3d8a5c66883a16a30ca8643e851f19baa7797917" + fastparse@^1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/fastparse/-/fastparse-1.1.1.tgz#d1e2643b38a94d7583b479060e6c4affc94071f8" @@ -1571,6 +1705,12 @@ form-data@~2.3.1: combined-stream "^1.0.5" mime-types "^2.1.12" +formatio@1.2.0, formatio@^1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/formatio/-/formatio-1.2.0.tgz#f3b2167d9068c4698a8d51f4f760a39a54d818eb" + dependencies: + samsam "1.x" + from2@^2.1.0: version "2.3.0" resolved "https://registry.yarnpkg.com/from2/-/from2-2.3.0.tgz#8bfb5502bde4a4d36cfdeea007fcca21d7e382af" @@ -1652,6 +1792,10 @@ get-caller-file@^1.0.1: version "1.0.2" resolved "https://registry.yarnpkg.com/get-caller-file/-/get-caller-file-1.0.2.tgz#f702e63127e7e231c160a80c1554acb70d5047e5" +get-func-name@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/get-func-name/-/get-func-name-2.0.0.tgz#ead774abee72e20409433a066366023dd6887a41" + get-stdin@^4.0.1: version "4.0.1" resolved "https://registry.yarnpkg.com/get-stdin/-/get-stdin-4.0.1.tgz#b968c6b0a04384324902e8bf1a5df32579a450fe" @@ -1679,24 +1823,24 @@ glob-parent@^2.0.0: dependencies: is-glob "^2.0.0" -glob@^6.0.4: - version "6.0.4" - resolved "https://registry.yarnpkg.com/glob/-/glob-6.0.4.tgz#0f08860f6a155127b2fadd4f9ce24b1aab6e4d22" +glob@7.1.2, glob@^7.0.0, glob@^7.0.3, glob@^7.0.5, glob@^7.1.2, glob@~7.1.1: + version "7.1.2" + resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.2.tgz#c19c9df9a028702d678612384a6552404c636d15" dependencies: + fs.realpath "^1.0.0" inflight "^1.0.4" inherits "2" - minimatch "2 || 3" + minimatch "^3.0.4" once "^1.3.0" path-is-absolute "^1.0.0" -glob@^7.0.0, glob@^7.0.3, glob@^7.0.5, glob@^7.1.2, glob@~7.1.1: - version "7.1.2" - resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.2.tgz#c19c9df9a028702d678612384a6552404c636d15" +glob@^6.0.4: + version "6.0.4" + resolved "https://registry.yarnpkg.com/glob/-/glob-6.0.4.tgz#0f08860f6a155127b2fadd4f9ce24b1aab6e4d22" dependencies: - fs.realpath "^1.0.0" inflight "^1.0.4" inherits "2" - minimatch "^3.0.4" + minimatch "2 || 3" once "^1.3.0" path-is-absolute "^1.0.0" @@ -1712,6 +1856,10 @@ graceful-fs@^4.1.11, graceful-fs@^4.1.2: version "4.1.11" resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.1.11.tgz#0e8bdfe4d1ddb8854d64e04ea7c00e2a026e5658" +growl@1.10.3: + version "1.10.3" + resolved "https://registry.yarnpkg.com/growl/-/growl-1.10.3.tgz#1926ba90cf3edfe2adb4927f5880bc22c66c790f" + har-schema@^1.0.5: version "1.0.5" resolved "https://registry.yarnpkg.com/har-schema/-/har-schema-1.0.5.tgz#d263135f43307c02c602afc8fe95970c0151369e" @@ -1820,7 +1968,7 @@ hawk@~6.0.2: hoek "4.x.x" sntp "2.x.x" -he@1.1.x: +he@1.1.1, he@1.1.x: version "1.1.1" resolved "https://registry.yarnpkg.com/he/-/he-1.1.1.tgz#93410fd21b009735151f8868c2f271f3427e23fd" @@ -1840,6 +1988,12 @@ hoek@4.x.x: version "4.2.0" resolved "https://registry.yarnpkg.com/hoek/-/hoek-4.2.0.tgz#72d9d0754f7fe25ca2d01ad8f8f9a9449a89526d" +homedir-polyfill@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/homedir-polyfill/-/homedir-polyfill-1.0.1.tgz#4c2bbc8a758998feebf5ed68580f76d46768b4bc" + dependencies: + parse-passwd "^1.0.0" + hosted-git-info@^2.1.4: version "2.5.0" resolved "https://registry.yarnpkg.com/hosted-git-info/-/hosted-git-info-2.5.0.tgz#6d60e34b3abbc8313062c3b798ef8d901a07af3c" @@ -1848,6 +2002,12 @@ html-comment-regex@^1.1.0: version "1.1.1" resolved "https://registry.yarnpkg.com/html-comment-regex/-/html-comment-regex-1.1.1.tgz#668b93776eaae55ebde8f3ad464b307a4963625e" +html-encoding-sniffer@^1.0.1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/html-encoding-sniffer/-/html-encoding-sniffer-1.0.2.tgz#e70d84b94da53aa375e11fe3a351be6642ca46f8" + dependencies: + whatwg-encoding "^1.0.1" + html-loader@^0.4.5: version "0.4.5" resolved "https://registry.yarnpkg.com/html-loader/-/html-loader-0.4.5.tgz#5fbcd87cd63a5c49a7fce2fe56f425e05729c68c" @@ -1891,7 +2051,7 @@ https-browserify@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/https-browserify/-/https-browserify-1.0.0.tgz#ec06c10e0a34c0f2faf199f7fd7fc78fffd03c73" -iconv-lite@0.4: +iconv-lite@0.4, iconv-lite@0.4.19: version "0.4.19" resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.19.tgz#f7468f60135f5e5dad3399c0a81be9a1603a082b" @@ -1913,6 +2073,10 @@ iferr@^0.1.5: version "0.1.5" resolved "https://registry.yarnpkg.com/iferr/-/iferr-0.1.5.tgz#c60eed69e6d8fdb6b3104a1fcbca1c192dc5b501" +ignore-styles@^5.0.1: + version "5.0.1" + resolved "https://registry.yarnpkg.com/ignore-styles/-/ignore-styles-5.0.1.tgz#b49ef2274bdafcd8a4880a966bfe38d1a0bf4671" + imurmurhash@^0.1.4: version "0.1.4" resolved "https://registry.yarnpkg.com/imurmurhash/-/imurmurhash-0.1.4.tgz#9218b9b2b928a238b13dc4fb6b6d576f231453ea" @@ -2087,6 +2251,10 @@ is-utf8@^0.2.0: version "0.2.1" resolved "https://registry.yarnpkg.com/is-utf8/-/is-utf8-0.2.1.tgz#4b0da1442104d1b336340e80797e865cf39f7d72" +isarray@0.0.1: + version "0.0.1" + resolved "https://registry.yarnpkg.com/isarray/-/isarray-0.0.1.tgz#8a18acfca9a8f4177e09abfc6038939b05d1eedf" + isarray@1.0.0, isarray@^1.0.0, isarray@~1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/isarray/-/isarray-1.0.0.tgz#bb935d48582cba168c06834957a54a3e07124f11" @@ -2136,6 +2304,35 @@ jsbn@~0.1.0: version "0.1.1" resolved "https://registry.yarnpkg.com/jsbn/-/jsbn-0.1.1.tgz#a5e654c2e5a2deb5f201d96cefbca80c0ef2f513" +jsdom@^11.5.1: + version "11.5.1" + resolved "https://registry.yarnpkg.com/jsdom/-/jsdom-11.5.1.tgz#5df753b8d0bca20142ce21f4f6c039f99a992929" + dependencies: + abab "^1.0.3" + acorn "^5.1.2" + acorn-globals "^4.0.0" + array-equal "^1.0.0" + browser-process-hrtime "^0.1.2" + content-type-parser "^1.0.1" + cssom ">= 0.3.2 < 0.4.0" + cssstyle ">= 0.2.37 < 0.3.0" + domexception "^1.0.0" + escodegen "^1.9.0" + html-encoding-sniffer "^1.0.1" + left-pad "^1.2.0" + nwmatcher "^1.4.3" + parse5 "^3.0.2" + pn "^1.0.0" + request "^2.83.0" + request-promise-native "^1.0.3" + sax "^1.2.1" + symbol-tree "^3.2.1" + tough-cookie "^2.3.3" + webidl-conversions "^4.0.2" + whatwg-encoding "^1.0.1" + whatwg-url "^6.3.0" + xml-name-validator "^2.0.1" + jsesc@~0.5.0: version "0.5.0" resolved "https://registry.yarnpkg.com/jsesc/-/jsesc-0.5.0.tgz#e7dee66e35d6fc16f710fe91d5cf69f70f08911d" @@ -2183,6 +2380,10 @@ jsprim@^1.2.2: json-schema "0.2.3" verror "1.10.0" +just-extend@^1.1.26: + version "1.1.27" + resolved "https://registry.yarnpkg.com/just-extend/-/just-extend-1.1.27.tgz#ec6e79410ff914e472652abfa0e603c03d60e905" + kind-of@^2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-2.0.1.tgz#018ec7a4ce7e3a86cb9141be519d24c8faa981b5" @@ -2215,6 +2416,17 @@ lcid@^1.0.0: dependencies: invert-kv "^1.0.0" +left-pad@^1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/left-pad/-/left-pad-1.2.0.tgz#d30a73c6b8201d8f7d8e7956ba9616087a68e0ee" + +levn@~0.3.0: + version "0.3.0" + resolved "https://registry.yarnpkg.com/levn/-/levn-0.3.0.tgz#3b09924edf9f083c0490fdd4c0bc4421e04764ee" + dependencies: + prelude-ls "~1.1.2" + type-check "~0.3.2" + load-json-file@^1.0.0: version "1.1.0" resolved "https://registry.yarnpkg.com/load-json-file/-/load-json-file-1.1.0.tgz#956905708d58b4bab4c2261b04f59f31c99374c0" @@ -2278,6 +2490,10 @@ lodash.endswith@^4.2.1: version "4.2.1" resolved "https://registry.yarnpkg.com/lodash.endswith/-/lodash.endswith-4.2.1.tgz#fed59ac1738ed3e236edd7064ec456448b37bc09" +lodash.get@^4.4.2: + version "4.4.2" + resolved "https://registry.yarnpkg.com/lodash.get/-/lodash.get-4.4.2.tgz#2d177f652fa31e939b4438d5341499dfa3825e99" + lodash.isfunction@^3.0.8: version "3.0.8" resolved "https://registry.yarnpkg.com/lodash.isfunction/-/lodash.isfunction-3.0.8.tgz#4db709fc81bc4a8fd7127a458a5346c5cdce2c6b" @@ -2294,6 +2510,10 @@ lodash.mergewith@^4.6.0: version "4.6.0" resolved "https://registry.yarnpkg.com/lodash.mergewith/-/lodash.mergewith-4.6.0.tgz#150cf0a16791f5903b8891eab154609274bdea55" +lodash.sortby@^4.7.0: + version "4.7.0" + resolved "https://registry.yarnpkg.com/lodash.sortby/-/lodash.sortby-4.7.0.tgz#edd14c824e2cc9c1e0b0a1b42bb5210516a42438" + lodash.startswith@^4.2.1: version "4.2.1" resolved "https://registry.yarnpkg.com/lodash.startswith/-/lodash.startswith-4.2.1.tgz#c598c4adce188a27e53145731cdc6c0e7177600c" @@ -2306,10 +2526,18 @@ lodash.uniq@^4.5.0: version "4.5.0" resolved "https://registry.yarnpkg.com/lodash.uniq/-/lodash.uniq-4.5.0.tgz#d0225373aeb652adc1bc82e4945339a842754773" -lodash@^4.0.0, lodash@^4.14.0, lodash@^4.15.0, lodash@^4.17.4, lodash@~4.17.4: +lodash@^4.0.0, lodash@^4.13.1, lodash@^4.14.0, lodash@^4.15.0, lodash@^4.17.4, lodash@~4.17.4: version "4.17.4" resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.4.tgz#78203a4d1c328ae1d86dca6460e369b57f4055ae" +lolex@^1.6.0: + version "1.6.0" + resolved "https://registry.yarnpkg.com/lolex/-/lolex-1.6.0.tgz#3a9a0283452a47d7439e72731b9e07d7386e49f6" + +lolex@^2.2.0: + version "2.3.1" + resolved "https://registry.yarnpkg.com/lolex/-/lolex-2.3.1.tgz#3d2319894471ea0950ef64692ead2a5318cff362" + longest@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/longest/-/longest-1.0.1.tgz#30a0b2da38f73770e8294a0d22e6625ed77d0097" @@ -2342,6 +2570,10 @@ make-dir@^1.0.0: dependencies: pify "^3.0.0" +make-error@^1.1.1: + version "1.3.2" + resolved "https://registry.yarnpkg.com/make-error/-/make-error-1.3.2.tgz#8762ffad2444dd8ff1f7c819629fa28e24fea1c4" + map-obj@^1.0.0, map-obj@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/map-obj/-/map-obj-1.0.1.tgz#d933ceb9205d82bdcf4886f6742bdc2b4dea146d" @@ -2472,12 +2704,27 @@ mixin-object@^2.0.1: for-in "^0.1.3" is-extendable "^0.1.1" -"mkdirp@>=0.5 0", mkdirp@^0.5.0, mkdirp@^0.5.1, mkdirp@~0.5.0, mkdirp@~0.5.1: +mkdirp@0.5.1, "mkdirp@>=0.5 0", mkdirp@^0.5.0, mkdirp@^0.5.1, mkdirp@~0.5.0, mkdirp@~0.5.1: version "0.5.1" resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.1.tgz#30057438eac6cf7f8c4767f38648d6697d75c903" dependencies: minimist "0.0.8" +mocha@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/mocha/-/mocha-5.0.0.tgz#cccac988b0bc5477119cba0e43de7af6d6ad8f4e" + dependencies: + browser-stdout "1.3.0" + commander "2.11.0" + debug "3.1.0" + diff "3.3.1" + escape-string-regexp "1.0.5" + glob "7.1.2" + growl "1.10.3" + he "1.1.1" + mkdirp "0.5.1" + supports-color "4.4.0" + moment-timezone@^0.5.13: version "0.5.14" resolved "https://registry.yarnpkg.com/moment-timezone/-/moment-timezone-0.5.14.tgz#4eb38ff9538b80108ba467a458f3ed4268ccfcb1" @@ -2513,6 +2760,16 @@ ncname@1.0.x: dependencies: xml-char-classes "^1.0.0" +nise@^1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/nise/-/nise-1.2.0.tgz#079d6cadbbcb12ba30e38f1c999f36ad4d6baa53" + dependencies: + formatio "^1.2.0" + just-extend "^1.1.26" + lolex "^1.6.0" + path-to-regexp "^1.7.0" + text-encoding "^0.6.4" + no-case@^2.2.0: version "2.3.2" resolved "https://registry.yarnpkg.com/no-case/-/no-case-2.3.2.tgz#60b813396be39b3f1288a4c1ed5d1e7d28b464ac" @@ -2673,6 +2930,10 @@ number-is-nan@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/number-is-nan/-/number-is-nan-1.0.1.tgz#097b602b53422a522c1afb8790318336941a011d" +nwmatcher@^1.4.3: + version "1.4.3" + resolved "https://registry.yarnpkg.com/nwmatcher/-/nwmatcher-1.4.3.tgz#64348e3b3d80f035b40ac11563d278f8b72db89c" + oauth-sign@~0.8.1, oauth-sign@~0.8.2: version "0.8.2" resolved "https://registry.yarnpkg.com/oauth-sign/-/oauth-sign-0.8.2.tgz#46a6ab7f0aead8deae9ec0565780b7d4efeb9d43" @@ -2694,6 +2955,17 @@ once@^1.3.0, once@^1.3.1, once@^1.3.3, once@^1.4.0: dependencies: wrappy "1" +optionator@^0.8.1: + version "0.8.2" + resolved "https://registry.yarnpkg.com/optionator/-/optionator-0.8.2.tgz#364c5e409d3f4d6301d6c0b4c05bba50180aeb64" + dependencies: + deep-is "~0.1.3" + fast-levenshtein "~2.0.4" + levn "~0.3.0" + prelude-ls "~1.1.2" + type-check "~0.3.2" + wordwrap "~1.0.0" + os-browserify@^0.3.0: version "0.3.0" resolved "https://registry.yarnpkg.com/os-browserify/-/os-browserify-0.3.0.tgz#854373c7f5c2315914fc9bfc6bd8238fdda1ec27" @@ -2784,6 +3056,16 @@ parse-json@^2.2.0: dependencies: error-ex "^1.2.0" +parse-passwd@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/parse-passwd/-/parse-passwd-1.0.0.tgz#6d5b934a456993b23d37f40a382d6f1666a8e5c6" + +parse5@^3.0.2: + version "3.0.3" + resolved "https://registry.yarnpkg.com/parse5/-/parse5-3.0.3.tgz#042f792ffdd36851551cf4e9e066b3874ab45b5c" + dependencies: + "@types/node" "*" + path-browserify@0.0.0: version "0.0.0" resolved "https://registry.yarnpkg.com/path-browserify/-/path-browserify-0.0.0.tgz#a0b870729aae214005b7d5032ec2cbbb0fb4451a" @@ -2806,6 +3088,12 @@ path-key@^2.0.0: version "2.0.1" resolved "https://registry.yarnpkg.com/path-key/-/path-key-2.0.1.tgz#411cadb574c5a140d3a4b1910d40d80cc9f40b40" +path-to-regexp@^1.7.0: + version "1.7.0" + resolved "https://registry.yarnpkg.com/path-to-regexp/-/path-to-regexp-1.7.0.tgz#59fde0f435badacba103a84e9d3bc64e96b9937d" + dependencies: + isarray "0.0.1" + path-type@^1.0.0: version "1.1.0" resolved "https://registry.yarnpkg.com/path-type/-/path-type-1.1.0.tgz#59c44f7ee491da704da415da5a4070ba4f8fe441" @@ -2820,6 +3108,10 @@ path-type@^2.0.0: dependencies: pify "^2.0.0" +pathval@^1.0.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/pathval/-/pathval-1.1.0.tgz#b942e6d4bde653005ef6b71361def8727d0645e0" + pbkdf2@^3.0.3: version "3.0.14" resolved "https://registry.yarnpkg.com/pbkdf2/-/pbkdf2-3.0.14.tgz#a35e13c64799b06ce15320f459c230e68e73bade" @@ -2862,6 +3154,10 @@ pkg-dir@^2.0.0: dependencies: find-up "^2.1.0" +pn@^1.0.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/pn/-/pn-1.1.0.tgz#e2f4cef0e219f463c179ab37463e4e1ecdccbafb" + postcss-calc@^5.2.0: version "5.3.1" resolved "https://registry.yarnpkg.com/postcss-calc/-/postcss-calc-5.3.1.tgz#77bae7ca928ad85716e2fda42f261bf7c1d65b5e" @@ -3108,6 +3404,10 @@ postcss@^6.0.1: source-map "^0.6.1" supports-color "^4.4.0" +prelude-ls@~1.1.2: + version "1.1.2" + resolved "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.1.2.tgz#21932a549f5e52ffd9a827f570e04be62a97da54" + prepend-http@^1.0.0: version "1.0.4" resolved "https://registry.yarnpkg.com/prepend-http/-/prepend-http-1.0.4.tgz#d4f4562b0ce3696e41ac52d0e002e57a635dc6dc" @@ -3173,6 +3473,10 @@ punycode@^1.2.4, punycode@^1.4.1: version "1.4.1" resolved "https://registry.yarnpkg.com/punycode/-/punycode-1.4.1.tgz#c0d5a63b2718800ad8e1eb0fa5269c84dd41845e" +punycode@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/punycode/-/punycode-2.1.0.tgz#5f863edc89b96db09074bad7947bf09056ca4e7d" + q@^1.1.2: version "1.5.1" resolved "https://registry.yarnpkg.com/q/-/q-1.5.1.tgz#7e32f75b41381291d04611f1bf14109ac00651d7" @@ -3364,7 +3668,21 @@ repeating@^2.0.0: dependencies: is-finite "^1.0.0" -request@2: +request-promise-core@1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/request-promise-core/-/request-promise-core-1.1.1.tgz#3eee00b2c5aa83239cfb04c5700da36f81cd08b6" + dependencies: + lodash "^4.13.1" + +request-promise-native@^1.0.3: + version "1.0.5" + resolved "https://registry.yarnpkg.com/request-promise-native/-/request-promise-native-1.0.5.tgz#5281770f68e0c9719e5163fd3fab482215f4fda5" + dependencies: + request-promise-core "1.1.1" + stealthy-require "^1.1.0" + tough-cookie ">=2.3.3" + +request@2, request@^2.83.0: version "2.83.0" resolved "https://registry.yarnpkg.com/request/-/request-2.83.0.tgz#ca0b65da02ed62935887808e6f510381034e3356" dependencies: @@ -3484,6 +3802,10 @@ safe-buffer@^5.0.1, safe-buffer@^5.1.0, safe-buffer@^5.1.1, safe-buffer@~5.1.0, version "5.1.1" resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.1.tgz#893312af69b2123def71f57889001671eeb2c853" +samsam@1.x: + version "1.3.0" + resolved "https://registry.yarnpkg.com/samsam/-/samsam-1.3.0.tgz#8d1d9350e25622da30de3e44ba692b5221ab7c50" + sass-graph@^2.2.4: version "2.2.4" resolved "https://registry.yarnpkg.com/sass-graph/-/sass-graph-2.2.4.tgz#13fbd63cd1caf0908b9fd93476ad43a51d1e0b49" @@ -3503,7 +3825,7 @@ sass-loader@^6.0.5: lodash.tail "^4.1.1" pify "^3.0.0" -sax@~1.2.1: +sax@^1.2.1, sax@~1.2.1: version "1.2.4" resolved "https://registry.yarnpkg.com/sax/-/sax-1.2.4.tgz#2816234e2378bddc4e5354fab5caa895df7100d9" @@ -3570,6 +3892,18 @@ signal-exit@^3.0.0, signal-exit@^3.0.2: version "3.0.2" resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.2.tgz#b5fdc08f1287ea1178628e415e25132b73646c6d" +sinon@^4.2.0: + version "4.2.0" + resolved "https://registry.yarnpkg.com/sinon/-/sinon-4.2.0.tgz#3b7c0d2289a80d2d84c4685f2ec130b7ab9af621" + dependencies: + diff "^3.1.0" + formatio "1.2.0" + lodash.get "^4.4.2" + lolex "^2.2.0" + nise "^1.2.0" + supports-color "^5.1.0" + type-detect "^4.0.5" + sntp@1.x.x: version "1.0.9" resolved "https://registry.yarnpkg.com/sntp/-/sntp-1.0.9.tgz#6541184cc90aeea6c6e7b35e2659082443c66198" @@ -3610,7 +3944,13 @@ source-map-loader@^0.2.1: loader-utils "~0.2.2" source-map "~0.6.1" -source-map@0.5.x, source-map@^0.5.3, source-map@^0.5.6, source-map@~0.5.0, source-map@~0.5.1: +source-map-support@^0.5.0: + version "0.5.2" + resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.2.tgz#1a6297fd5b2e762b39688c7fc91233b60984f0a5" + dependencies: + source-map "^0.6.0" + +source-map@0.5.x, source-map@^0.5.3, source-map@^0.5.6, source-map@~0.5.0, source-map@~0.5.1, source-map@~0.5.6: version "0.5.7" resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.5.7.tgz#8a039d2d1021d22d1ea14c80d8ea468ba2ef3fcc" @@ -3620,7 +3960,7 @@ source-map@^0.4.2, source-map@~0.4.1: dependencies: amdefine ">=0.0.4" -source-map@^0.6.1, source-map@~0.6.1: +source-map@^0.6.0, source-map@^0.6.1, source-map@~0.6.1: version "0.6.1" resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263" @@ -3668,6 +4008,10 @@ stdout-stream@^1.4.0: dependencies: readable-stream "^2.0.1" +stealthy-require@^1.1.0: + version "1.1.1" + resolved "https://registry.yarnpkg.com/stealthy-require/-/stealthy-require-1.1.1.tgz#35b09875b4ff49f26a777e509b3090a3226bf24b" + stream-browserify@^2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/stream-browserify/-/stream-browserify-2.0.1.tgz#66266ee5f9bdb9940a4e4514cafb43bb71e5c9db" @@ -3757,7 +4101,7 @@ strip-indent@^1.0.1: dependencies: get-stdin "^4.0.1" -strip-json-comments@~2.0.1: +strip-json-comments@^2.0.0, strip-json-comments@^2.0.1, strip-json-comments@~2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-2.0.1.tgz#3c531942e908c2697c0ec344858c286c7ca0a60a" @@ -3768,6 +4112,12 @@ style-loader@^0.18.1: loader-utils "^1.0.2" schema-utils "^0.3.0" +supports-color@4.4.0: + version "4.4.0" + resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-4.4.0.tgz#883f7ddabc165142b2a61427f3352ded195d1a3e" + dependencies: + has-flag "^2.0.0" + supports-color@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-2.0.0.tgz#535d045ce6b6363fa40117084629995e9df324c7" @@ -3784,6 +4134,12 @@ supports-color@^4.0.0, supports-color@^4.2.1, supports-color@^4.4.0: dependencies: has-flag "^2.0.0" +supports-color@^5.1.0: + version "5.1.0" + resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-5.1.0.tgz#058a021d1b619f7ddf3980d712ea3590ce7de3d5" + dependencies: + has-flag "^2.0.0" + svgo@^0.7.0: version "0.7.2" resolved "https://registry.yarnpkg.com/svgo/-/svgo-0.7.2.tgz#9f5772413952135c6fefbf40afe6a4faa88b4bb5" @@ -3796,6 +4152,10 @@ svgo@^0.7.0: sax "~1.2.1" whet.extend "~0.9.9" +symbol-tree@^3.2.1: + version "3.2.2" + resolved "https://registry.yarnpkg.com/symbol-tree/-/symbol-tree-3.2.2.tgz#ae27db38f660a7ae2e1c3b7d1bc290819b8519e6" + tapable@^0.2.7: version "0.2.8" resolved "https://registry.yarnpkg.com/tapable/-/tapable-0.2.8.tgz#99372a5c999bf2df160afc0d74bed4f47948cd22" @@ -3821,6 +4181,10 @@ tar@^2.0.0, tar@^2.2.1: fstream "^1.0.2" inherits "2" +text-encoding@^0.6.4: + version "0.6.4" + resolved "https://registry.yarnpkg.com/text-encoding/-/text-encoding-0.6.4.tgz#e399a982257a276dae428bb92845cb71bdc26d19" + through2@^2.0.0: version "2.0.3" resolved "https://registry.yarnpkg.com/through2/-/through2-2.0.3.tgz#0004569b37c7c74ba39c43f3ced78d1ad94140be" @@ -3842,12 +4206,18 @@ to-arraybuffer@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/to-arraybuffer/-/to-arraybuffer-1.0.1.tgz#7d229b1fcc637e466ca081180836a7aabff83f43" -tough-cookie@~2.3.0, tough-cookie@~2.3.3: +tough-cookie@>=2.3.3, tough-cookie@^2.3.3, tough-cookie@~2.3.0, tough-cookie@~2.3.3: version "2.3.3" resolved "https://registry.yarnpkg.com/tough-cookie/-/tough-cookie-2.3.3.tgz#0b618a5565b6dea90bf3425d04d55edc475a7561" dependencies: punycode "^1.4.1" +tr46@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/tr46/-/tr46-1.0.1.tgz#a8b13fd6bfd2489519674ccde55ba3693b706d09" + dependencies: + punycode "^2.1.0" + trim-newlines@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/trim-newlines/-/trim-newlines-1.0.0.tgz#5887966bb582a4503a41eb524f7d35011815a613" @@ -3867,6 +4237,45 @@ ts-loader@^3.0.3: loader-utils "^1.0.2" semver "^5.0.1" +ts-node@^4.1.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/ts-node/-/ts-node-4.1.0.tgz#36d9529c7b90bb993306c408cd07f7743de20712" + dependencies: + arrify "^1.0.0" + chalk "^2.3.0" + diff "^3.1.0" + make-error "^1.1.1" + minimist "^1.2.0" + mkdirp "^0.5.1" + source-map-support "^0.5.0" + tsconfig "^7.0.0" + v8flags "^3.0.0" + yn "^2.0.0" + +tsconfig-paths-webpack-plugin@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/tsconfig-paths-webpack-plugin/-/tsconfig-paths-webpack-plugin-2.0.0.tgz#7652dc684bb3206c8e7e446831ca01cbf4d11772" + dependencies: + chalk "^2.3.0" + tsconfig-paths "^3.1.1" + +tsconfig-paths@^3.1.1: + version "3.1.1" + resolved "https://registry.yarnpkg.com/tsconfig-paths/-/tsconfig-paths-3.1.1.tgz#368478faed54a247f2c8e59e44cb81418b2ae515" + dependencies: + deepmerge "^2.0.1" + strip-bom "^3.0.0" + strip-json-comments "^2.0.1" + +tsconfig@^7.0.0: + version "7.0.0" + resolved "https://registry.yarnpkg.com/tsconfig/-/tsconfig-7.0.0.tgz#84538875a4dc216e5c4a5432b3a4dec3d54e91b7" + dependencies: + "@types/strip-bom" "^3.0.0" + "@types/strip-json-comments" "0.0.30" + strip-bom "^3.0.0" + strip-json-comments "^2.0.0" + tty-browserify@0.0.0: version "0.0.0" resolved "https://registry.yarnpkg.com/tty-browserify/-/tty-browserify-0.0.0.tgz#a157ba402da24e9bf957f9aa69d524eed42901a6" @@ -3885,11 +4294,21 @@ tweetnacl@^0.14.3, tweetnacl@~0.14.0: version "0.14.5" resolved "https://registry.yarnpkg.com/tweetnacl/-/tweetnacl-0.14.5.tgz#5ae68177f192d4456269d108afa93ff8743f4f64" +type-check@~0.3.2: + version "0.3.2" + resolved "https://registry.yarnpkg.com/type-check/-/type-check-0.3.2.tgz#5884cab512cf1d355e3fb784f30804b2b520db72" + dependencies: + prelude-ls "~1.1.2" + +type-detect@^4.0.0, type-detect@^4.0.5: + version "4.0.7" + resolved "https://registry.yarnpkg.com/type-detect/-/type-detect-4.0.7.tgz#862bd2cf6058ad92799ff5a5b8cf7b6cec726198" + typedarray@^0.0.6: version "0.0.6" resolved "https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777" -typescript@^2.5.2: +typescript@^2.6.2: version "2.6.2" resolved "https://registry.yarnpkg.com/typescript/-/typescript-2.6.2.tgz#3c5b6fd7f6de0914269027f03c0946758f7673a4" @@ -4006,6 +4425,12 @@ uuid@^3.0.0, uuid@^3.1.0: version "3.1.0" resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.1.0.tgz#3dd3d3e790abc24d7b0d3a034ffababe28ebbc04" +v8flags@^3.0.0: + version "3.0.1" + resolved "https://registry.yarnpkg.com/v8flags/-/v8flags-3.0.1.tgz#dce8fc379c17d9f2c9e9ed78d89ce00052b1b76b" + dependencies: + homedir-polyfill "^1.0.1" + validate-npm-package-license@^3.0.1: version "3.0.1" resolved "https://registry.yarnpkg.com/validate-npm-package-license/-/validate-npm-package-license-3.0.1.tgz#2804babe712ad3379459acfbe24746ab2c303fbc" @@ -4039,6 +4464,10 @@ watchpack@^1.4.0: chokidar "^1.7.0" graceful-fs "^4.1.2" +webidl-conversions@^4.0.1, webidl-conversions@^4.0.2: + version "4.0.2" + resolved "https://registry.yarnpkg.com/webidl-conversions/-/webidl-conversions-4.0.2.tgz#a855980b1f0b6b359ba1d5d9fb39ae941faa63ad" + webpack-core@~0.6.0: version "0.6.9" resolved "https://registry.yarnpkg.com/webpack-core/-/webpack-core-0.6.9.tgz#fc571588c8558da77be9efb6debdc5a3b172bdc2" @@ -4086,6 +4515,20 @@ webpack@^3.5.6: webpack-sources "^1.0.1" yargs "^8.0.2" +whatwg-encoding@^1.0.1: + version "1.0.3" + resolved "https://registry.yarnpkg.com/whatwg-encoding/-/whatwg-encoding-1.0.3.tgz#57c235bc8657e914d24e1a397d3c82daee0a6ba3" + dependencies: + iconv-lite "0.4.19" + +whatwg-url@^6.3.0: + version "6.4.0" + resolved "https://registry.yarnpkg.com/whatwg-url/-/whatwg-url-6.4.0.tgz#08fdf2b9e872783a7a1f6216260a1d66cc722e08" + dependencies: + lodash.sortby "^4.7.0" + tr46 "^1.0.0" + webidl-conversions "^4.0.1" + whet.extend@~0.9.9: version "0.9.9" resolved "https://registry.yarnpkg.com/whet.extend/-/whet.extend-0.9.9.tgz#f877d5bf648c97e5aa542fadc16d6a259b9c11a1" @@ -4118,6 +4561,10 @@ wordwrap@0.0.2: version "0.0.2" resolved "https://registry.yarnpkg.com/wordwrap/-/wordwrap-0.0.2.tgz#b79669bb42ecb409f83d583cad52ca17eaa1643f" +wordwrap@~1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/wordwrap/-/wordwrap-1.0.0.tgz#27584810891456a4171c8d0226441ade90cbcaeb" + worker-farm@^1.4.1: version "1.5.2" resolved "https://registry.yarnpkg.com/worker-farm/-/worker-farm-1.5.2.tgz#32b312e5dc3d5d45d79ef44acc2587491cd729ae" @@ -4159,6 +4606,10 @@ xml-char-classes@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/xml-char-classes/-/xml-char-classes-1.0.0.tgz#64657848a20ffc5df583a42ad8a277b4512bbc4d" +xml-name-validator@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/xml-name-validator/-/xml-name-validator-2.0.1.tgz#4d8b8f1eccd3419aa362061becef515e1e559635" + xmlhttprequest@1: version "1.8.0" resolved "https://registry.yarnpkg.com/xmlhttprequest/-/xmlhttprequest-1.8.0.tgz#67fe075c5c24fef39f9d65f5f7b7fe75171968fc" @@ -4231,3 +4682,7 @@ yargs@~3.10.0: cliui "^2.1.0" decamelize "^1.0.0" window-size "0.1.0" + +yn@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/yn/-/yn-2.0.0.tgz#e5adabc8acf408f6385fc76495684c88e6af689a"