feature(EJ2-1850): Seed project updated

This commit is contained in:
pipeline 2017-06-19 17:32:36 +05:30
Коммит 46d4569f9a
12 изменённых файлов: 390 добавлений и 0 удалений

2
.gitignore поставляемый Normal file
Просмотреть файл

@ -0,0 +1,2 @@
src/**/*.js
node_modules/

30
README.md Normal file
Просмотреть файл

@ -0,0 +1,30 @@
# Essential JS 2 Typescript Seed
## Resources
* [Pure JS Demos](http://ej2.syncfusion.com/demos/)
* [Pure JS Documentation](http://ej2.syncfusion.com/documentation/)
## Installing
To install all dependent packages, use the below command
```
npm install
```
## Testing
To test the source files, use the below command
```
npm run test
```
## Running
To run the samples, use the below command
```
npm run serve
```

65
gulpfile.js Normal file
Просмотреть файл

@ -0,0 +1,65 @@
'use strict';
var gulp = require('gulp');
/**
* Load the sample in src/app/index
*/
gulp.task('serve', ['compile'], function(done) {
var browserSync = require('browser-sync');
var bs = browserSync.create('Essential JS 2');
var options = {
server: {
baseDir: [
'./src/app/',
'./src/resource/',
'./node_modules/@syncfusion/ej2/'
]
},
ui: false
};
bs.init(options, done);
});
/**
* Compile TypeScript to JS
*/
gulp.task('compile', function(done) {
var webpack = require('webpack');
var webpackStream = require('webpack-stream');
gulp.src(['./src/app/index.ts', './spec/index.spec.ts']).pipe(webpackStream({
entry: {
'src/app/index': './src/app/index.ts',
'spec/index.spec': './spec/index.spec.ts'
},
output: {
filename: '[name].js'
},
module: {
rules: [{
loader: 'ts-loader',
exclude: /node_modules/,
}]
},
resolve: {
extensions: [".ts", ".js"]
}
}, webpack))
.pipe(gulp.dest('./'))
.on('end', function() {
done();
});
});
/**
* Testing spec files
*/
gulp.task('test', ['compile'], function(done) {
var karma = require('karma');
new karma.Server({
configFile: __dirname + '/karma.conf.js'
}, function(e) {
done(e === 0 ? null : 'karma exited with status ' + e);
}).start();
});

63
karma.conf.js Normal file
Просмотреть файл

@ -0,0 +1,63 @@
// Karma configuration
module.exports = function(config) {
config.set({
// base path that will be used to resolve all patterns (eg. files, exclude)
basePath: '',
// frameworks to use
// available frameworks: https://npmjs.org/browse/keyword/karma-adapter
frameworks: ['jasmine', 'requirejs'],
// list of files / patterns to load in the browser
files: [
"test-main.js",
{ pattern: "spec/**/*.spec.js", included: false }
],
// list of files to exclude
exclude: [],
// preprocess matching files before serving them to the browser
// available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor
preprocessors: {},
// test results reporter to use
// possible values: 'dots', 'progress'
// available reporters: https://npmjs.org/browse/keyword/karma-reporter
reporters: ['dots', 'html'],
// the default html configuration
htmlReporter: {
outputFile: "test-report/units.html",
pageTitle: "Unit Tests",
subPageTitle: "Asampleprojectdescription"
},
// web server port
port: 9876,
// enable / disable colors in the output (reporters and logs)
colors: true,
// level of logging
// possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG
logLevel: config.LOG_INFO,
// enable / disable watching file and executing tests whenever any file changes
autoWatch: true,
// start these browsers
// available browser launchers: https://npmjs.org/browse/keyword/karma-launcher
browsers: ['PhantomJS'],
// Continuous Integration mode
// if true, Karma captures browsers, runs the tests and exits
singleRun: true,
// Concurrency level
// how many browser should be started simultaneous
concurrency: Infinity,
});
};

10
license Normal file
Просмотреть файл

@ -0,0 +1,10 @@
Essential JS 2 library is available under the Syncfusion Essential Studio program, and can be licensed either under the Syncfusion Community License Program or the Syncfusion commercial license.
To be qualified for the Syncfusion Community License Program you must have a gross revenue of less than one (1) million U.S. dollars ($1,000,000.00 USD) per year and have less than five (5) developers in your organization, and agree to be bound by Syncfusions terms and conditions.
Customers who do not qualify for the community license can contact sales@syncfusion.com for commercial licensing options.
Under no circumstances can you use this product without (1) either a Community License or a commercial license and (2) without agreeing and abiding by Syncfusions license containing all terms and conditions.
The Syncfusion license that contains the terms and conditions can be found at
https://www.syncfusion.com/content/downloads/syncfusion_license.pdf

39
package.json Normal file
Просмотреть файл

@ -0,0 +1,39 @@
{
"name": "ej2-typescript-seed",
"version": "0.0.1",
"description": "ej2 typescript seed project",
"author": "Syncfusion Inc.",
"license": "SEE LICENSE IN license",
"repository": {
"type": "git",
"url": "https://github.com/syncfusion/ej2-typescript-seed"
},
"dependencies": {
"@syncfusion/ej2": "*"
},
"devDependencies": {
"@types/jasmine": "^2.5.52",
"@types/requirejs": "^2.1.29",
"browser-sync": "^2.18.12",
"gulp": "^3.9.1",
"gulp-typescript": "^3.1.7",
"jasmine": "^2.6.0",
"jasmine-core": "^2.6.4",
"karma": "^1.7.0",
"karma-generic-preprocessor": "^1.1.0",
"karma-htmlfile-reporter": "^0.3.5",
"karma-jasmine": "^1.1.0",
"karma-phantomjs-launcher": "^1.0.4",
"karma-requirejs": "^1.1.0",
"phantomjs-prebuilt": "^2.1.14",
"requirejs": "^2.3.3",
"ts-loader": "^2.1.0",
"typescript": "2.3.4",
"webpack": "2.5.1",
"webpack-stream": "^3.2.0"
},
"scripts": {
"start": "gulp serve",
"test": "gulp test"
}
}

3
spec/index.spec.ts Normal file
Просмотреть файл

@ -0,0 +1,3 @@
describe('Test', () => {
it('Hello world', () => expect('Hello World').toEqual('Hello World'));
});

92
src/app/index.html Normal file
Просмотреть файл

@ -0,0 +1,92 @@
<!DOCTYPE html>
<html lang="en">
<head>
<title>Essential JS2</title>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no" />
<meta name="description" content="Essential JS2" />
<meta name="author" content="Syncfusion" />
<link rel="shortcut icon" href="resource/favicon.ico" />
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet" />
<!--style reference from node_modules/@syncfusion/ej2/-->
<link href="button/material.css" rel="stylesheet" />
</head>
<body>
<div class="row">
<div class="col-xs-6 col-sm-6 col-lg-6 col-md-6">
<div class="col-xs-12 col-sm-12 col-lg-6 col-md-6">
<button id="primarybtn">Primary</button>
</div>
<div class="col-xs-12 col-sm-12 col-lg-6 col-md-6">
<button id="normalbtn">Normal</button>
</div>
</div>
<div class="col-xs-6 col-sm-6 col-lg-6 col-md-6">
<div class="col-xs-12 col-sm-12 col-lg-6 col-md-6">
<button id="outlinebtn">Outline</button>
</div>
<div class="col-xs-12 col-sm-12 col-lg-6 col-md-6">
<button id="flatbtn">Flat</button>
</div>
</div>
</div>
<div class="row">
<div class="col-xs-6 col-sm-6 col-lg-6 col-md-6">
<div class="col-xs-12 col-sm-12 col-lg-6 col-md-6">
<button id="successbtn">Success</button>
</div>
<div class="col-xs-12 col-sm-12 col-lg-6 col-md-6">
<button id="warningbtn">Warning</button>
</div>
</div>
<div class="col-xs-6 col-sm-6 col-lg-6 col-md-6">
<div class="col-xs-12 col-sm-12 col-lg-6 col-md-6">
<button id="dangerbtn">Danger</button>
</div>
<div class="col-xs-12 col-sm-12 col-lg-6 col-md-6">
<button id="infobtn">Info</button>
</div>
</div>
</div>
<div class="row">
<div class="col-xs-6 col-sm-6 col-lg-6 col-md-6">
<div class="col-xs-12 col-sm-12 col-lg-6 col-md-6">
<button id="playiconbtn"></button>
</div>
<div class="col-xs-12 col-sm-12 col-lg-6 col-md-6">
<button id="pauseiconbtn">Pause</button>
</div>
</div>
<div class="col-xs-6 col-sm-6 col-lg-6 col-md-6">
<div class="col-xs-12 col-sm-12 col-lg-6 col-md-6">
<button id="openiconbtn">Open</button>
</div>
<div class="col-xs-12 col-sm-12 col-lg-6 col-md-6">
<button id="smallbtn">Small</button>
</div>
</div>
</div>
<style>
.e-play-icon::before {
content: '\e798';
}
.e-pause-icon::before {
content: '\e753';
}
.e-open-icon::before {
content: '\e782';
}
.row {
margin: 50px;
}
</style>
<script src="index.js" type="text/javascript"></script>
</body>
</html>

37
src/app/index.ts Normal file
Просмотреть файл

@ -0,0 +1,37 @@
import { Button } from '@syncfusion/ej2/button';
let button: Button = new Button();
button.appendTo('#normalbtn');
button = new Button({ isPrimary: true });
button.appendTo('#primarybtn');
button = new Button({ cssClass: 'e-flat' });
button.appendTo('#flatbtn');
button = new Button({ cssClass: 'e-outline', isPrimary: true });
button.appendTo('#outlinebtn');
button = new Button({ iconCss: 'e-icons e-play-icon', cssClass: 'e-flat' });
button.appendTo('#playiconbtn');
button = new Button({ iconCss: 'e-icons e-pause-icon', cssClass: 'e-flat' });
button.appendTo('#pauseiconbtn');
button = new Button({ iconCss: 'e-icons e-open-icon', cssClass: 'e-flat', iconPosition: 'right' });
button.appendTo('#openiconbtn');
button = new Button({ cssClass: 'e-success' });
button.appendTo('#successbtn');
button = new Button({ cssClass: 'e-info' });
button.appendTo('#infobtn');
button = new Button({ cssClass: 'e-warning' });
button.appendTo('#warningbtn');
button = new Button({ cssClass: 'e-danger' });
button.appendTo('#dangerbtn');
button = new Button({ cssClass: 'e-small' });
button.appendTo('#smallbtn');

Двоичные данные
src/resource/favicon.ico Normal file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 6.4 KiB

27
test-main.js Normal file
Просмотреть файл

@ -0,0 +1,27 @@
var allTestFiles = [];
var TEST_REGEXP = /(spec|test)\.js$/i;
// Get a list of all the test files to include
Object.keys(window.__karma__.files).forEach(function(file) {
if (TEST_REGEXP.test(file)) {
// Normalize paths to RequireJS module names.
// If you require sub-dependencies of test files to be loaded as-is (requiring file extension)
// then do not normalize the paths
var normalizedTestModule = file.replace(/^\/base\/|\.js$/g, '');
allTestFiles.push(normalizedTestModule);
}
});
require.config({
// Karma serves files under /base, which is the basePath from your config file
baseUrl: '/base',
// dynamically load all test files
deps: allTestFiles,
// we have to kickoff jasmine, as it is asynchronous
callback: window.__karma__.start,
// number of seconds to wait before giving up on loading a script
waitSeconds: 30,
});

22
tsconfig.json Normal file
Просмотреть файл

@ -0,0 +1,22 @@
{
"compilerOptions": {
"target": "es5",
"module": "amd",
"removeComments": true,
"noLib": false,
"sourceMap": true,
"pretty": true,
"allowUnreachableCode": false,
"allowUnusedLabels": false,
"noImplicitAny": true,
"noImplicitReturns": true,
"noImplicitUseStrict": false,
"noFallthroughCasesInSwitch": true,
"allowJs": false,
"noEmitOnError": true,
"forceConsistentCasingInFileNames": true,
"moduleResolution": "node",
"suppressImplicitAnyIndexErrors": true
},
"compileOnSave": false
}