diff --git a/.gitignore b/.gitignore index 1333a01f04..4e8e6a33ab 100644 --- a/.gitignore +++ b/.gitignore @@ -20,8 +20,6 @@ project.lock.json .tsdrc .idea /Content/survey.css -/src/knockout/template.window.ko.html.ts -/src/knockout/template.ko.html.ts /packages/survey-react/**/*.js /packages/survey-react/package.json /packages/survey-react/css/survey.css @@ -30,6 +28,7 @@ project.lock.json /packages/survey-knockout/**/*.js /packages/survey-knockout/package.json /packages/survey-knockout/css/survey.css +/packages/survey-knockout /.gitattributes /packages/survey-knockout/README.md /travis_code.txt diff --git a/.travis.yml b/.travis.yml index e1ca879125..a50e7ed292 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,15 +3,11 @@ node_js: - "4" before_script: - - npm install -g gulp - - npm install -g typescript - - npm install -g typings + - npm install -g concurrently script: - - typings install - - gulp copyfiles - - gulp makedist - - gulp test_ci -before_deploy: "tar -zcvf surveyjs.tar.gz dist" + - npm run build_prod + - karma start +before_deploy: "tar -zcvf surveyjs.tar.gz packages" deploy: provider: releases api_key: diff --git a/README.md b/README.md index c14e0dfe41..922f01c4e2 100644 --- a/README.md +++ b/README.md @@ -44,31 +44,23 @@ To build library yourself: 2. **Acquire build dependencies.** Make sure you have [Node.js](http://nodejs.org/) installed on your workstation. This is only needed to _build_ surveyjs from sources. ``` - npm install -g gulp - npm install -g typings + npm install -g karma-cli npm install ``` The first `npm` command sets up the popular [Gulp](http://gulpjs.com/) build tool. The second `npm` command sets up the Typescript Definition Manager [Typings](https://github.com/typings/typings). - 3. **Create TypeScript definition files** + 3. **Build the library** ``` - typings install - ``` - Typescript definition files should be located at 'typings' directory. - - 4. **Build the library** - ``` - gulp makedist + npm run build_prod ``` After that you should have the library at 'dist' directory. - 5. **Run unit tests** + 4. **Run unit tests** ``` - gulp copyfiles - gulp test_ci + karma start ``` - The first command will copy all required files to 'wwwroot' directory and the last command will run unit tests usign [Karma](https://karma-runner.github.io/0.13/index.html) + This command will run unit tests usign [Karma](https://karma-runner.github.io/0.13/index.html) ##Create your own question type. Explore the [example](https://github.com/surveyjs/surveyjs/tree/master/src/plugins) of adding a new question type into your survey library. diff --git a/global.json b/global.json deleted file mode 100644 index a1e5cd2f51..0000000000 --- a/global.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "projects": [ "src", "test" ], - "sdk": { - "version": "1.0.0-rc1-update1", - "runtime": "clr", - "architecture": "x86" - } -} diff --git a/gulpfile.js b/gulpfile.js deleted file mode 100644 index eabab6c70f..0000000000 --- a/gulpfile.js +++ /dev/null @@ -1,348 +0,0 @@ -/*global require*/ -var gulp = require('gulp'), - concat = require("gulp-concat-util"), - ts = require('gulp-typescript'), - insert = require('gulp-insert'), - gnf = require('gulp-npm-files'), - sass = require('gulp-sass'), - qunit = require("gulp-qunit"), - serve = require("gulp-serve"), - uglify = require("gulp-uglify"), - rename = require("gulp-rename"), - html2ts = require("gulp-html-to-ts"), - sequence = require("gulp-sequence"), - jsonTransform = require('gulp-json-transform'), - project = require("./project.json"), - webpackStream = require('webpack-stream'), - getWebpackConfig = require('./webpack/webpack.config'), - getWebpackUniversalConfig = require('./webpack/webpack.universal.config'); - -var Server = require("karma").Server; - -var libraryVersion = "0.10.4"; - -var paths = { - webroot: "./" + project.webroot + "/", - dist: "./dist/", - dist_dts: "./dist/typings/", - tsTests: "./tests/*.ts", - package_ko: "./packages/survey-knockout/", - package_react: "./packages/survey-react/", - package_angular: "./packages/survey-angular/", - package_jquery: "./packages/survey-jquery/", - typings: "./typings/**/*.d.ts", - styles: "./src/*.scss", -}; -paths.jsFolder = paths.webroot + "js/"; -paths.testsFolder = paths.webroot + "tests/"; - -var copyright = ["/*!", - "* surveyjs - Survey JavaScript library v" + libraryVersion, - "* (c) Devsoft Baltic OÜ - http://surveyjs.io/", - "* License: MIT (http://www.opensource.org/licenses/mit-license.php)", - "*/", "", ""].join("\n"); - -var tdHeader = ["// Type definitions for Survey JavaScript library v" + libraryVersion, - "// Project: http://surveyjs.org/", - "// Definitions by: tdHeader ", - "",""].join("\n"); - -var config_ko = { - name: "survey-knockout", - keywords: ["Knockout"], - dependencies: {"knockout": "^3.4.0"}, - templates: [{ path: ["./src/knockout/templates/*.html", "./src/plugins/knockout/templates/*.html"], fileName: "template.ko.html", dest: "./src/knockout/" }, - { path: "./src/knockout/templates/window/*.html", fileName: "template.window.ko.html", dest: "./src/knockout/" }], - src: [ - "./src/*.ts", - "./src/localization/*.ts", - "./src/defaultCss/cssstandard.ts", - "./src/defaultCss/cssbootstrap.ts", - "./src/knockout/*.ts", - "./src/entries/chunks/**/*.ts", - "./src/plugins/*.ts", - "./src/plugins/knockout/*.ts", - "./src/entries/ko.ts" - ], - mainJSfile: "survey.ko.js", - dtsfile: "ko.d.ts", - packagePath: "./packages/survey-knockout/", - bundleName: "survey.ko", - entryPoint: "../src/entries/ko" -}; - -var config_react = { - name: "survey-react", - keywords: ["react", "react-component"], - dependencies: { "react": "^15.0.1", "react-dom": "^15.0.1" }, - src: [ - "./src/*.ts", - "./src/localization/*.ts", - "./src/defaultCss/*.ts", - "./src/react/*.tsx", - "./src/entries/chunks/**/*.ts", - "./src/plugins/*.ts", - "./src/plugins/react/*.tsx", - "./src/entries/react.ts" - ], - mainJSfile: "survey.react.js", - dtsfile: "react.d.ts", - packagePath: "./packages/survey-react/", - bundleName: "survey.react", - entryPoint: "../src/entries/react" -}; - -var config_angular = { - name: "survey-angular", - keywords: ["angular", "angular-component"], - dependencies: { "@types/react": "0.0.0" }, - src: [ - "./src/*.ts", - "./src/localization/*.ts", - "./src/defaultCss/*.ts", - "./src/entries/chunks/**/*.ts", - "./src/react/*.tsx", - "./src/angular/*.ts", - "./src/angular/*.tsx", - "./src/entries/react.ts", - "./src/entries/angular.ts" - ], - mainJSfile: "survey.angular.js", - dtsfile: "angular.d.ts", - packagePath: "./packages/survey-angular/", - bundleName: "survey.angular", - entryPoint: "../src/entries/angular" -}; - -var config_jquery = { - name: "survey-jquery", - keywords: ["jquery", "jquery-plugin"], - dependencies: { "jquery": ">=1.12.4", "@types/react": "0.0.0" }, - src: [ - "./src/*.ts", - "./src/localization/*.ts", - "./src/defaultCss/*.ts", - "./src/entries/chunks/**/*.ts", - "./src/react/*.tsx", - "./src/angular/*.ts", - "./src/angular/*.tsx", - "./src/entries/react.ts", - "./src/entries/jquery.tsx" - ], - mainJSfile: "survey.jquery.js", - dtsfile: "jquery.d.ts", - packagePath: "./packages/survey-jquery/", - bundleName: "survey.jquery", - entryPoint: "../src/entries/jquery" -}; - -var config_test_ko = { - dtsfile: "survey.d.ts", - src: "./tests/ko/*.ts", - entryPoint: "../tests/entries/testKo", - bundleName: "survey.tests.ko", - htmlFile: "./tests/ko/index_tests_ko.html" -}; - -var configs = {}; -configs["ko"] = config_ko; -configs["react"] = config_react; -configs["angular"] = config_angular; -configs["jquery"] = config_jquery; -var testconfigs = {}; -testconfigs["ko"] = config_test_ko; - - -function buildTemplates(configName, index) { - var curConfig = configs[configName]; - var curTemplate = curConfig.templates[index]; - return gulp.src(curTemplate.path) - .pipe(concat(curTemplate.fileName)) - .pipe(html2ts()) - .pipe(insert.transform(function(contents, file) { - contents = contents.slice(0, -1); //remove last symbol '}' - contents = contents.replace('module template.window.ko { ', ''); - contents = contents.replace('export var html', 'export var koTemplate = { html : ""}; koTemplate.html'); - return contents.replace('module template.ko { ', ''); - })) - .pipe(gulp.dest(curTemplate.dest)); -} - -function buildFromSources(configName) { - var curConfig = configs[configName]; - var tsResult = gulp.src(curConfig.entryPoint) - .pipe(webpackStream(configName !== "react" && configName !== "ko"? getWebpackUniversalConfig(curConfig) : getWebpackConfig(curConfig))); - return tsResult - .pipe(concat(curConfig.mainJSfile)) - .pipe(insert.prepend(copyright)) - .pipe(gulp.dest(paths.dist)) - .pipe(gulp.dest(paths.jsFolder)) - .pipe(gulp.dest(curConfig.packagePath + "dist/")); -} - -function buildTypeDefinition(configName) { - var curConfig = configs[configName]; - //Build js file - //Build typescript definition - var tscResult = gulp.src([ - paths.webroot + "/lib/survey/**/*.d.ts", - paths.typings - ].concat(curConfig.src)) - .pipe(ts({ - target: "ES5", - noExternalResolve: true, - allowSyntheticDefaultImports: true, - outDir: "./some/dir/TODO/", // TODO we need any value of outDir for save folders structure for d.ts. BUT WHY? - declaration: true, - jsx: "react" - })); - return tscResult.dts - .pipe(concat.header(tdHeader)) - .pipe(gulp.dest(paths.dist_dts)) - .pipe(gulp.dest(curConfig.packagePath + "dist/typings")); -} - -function compressMainJS(configName) { - var curConfig = configs[configName]; - gulp.src(paths.dist + curConfig.mainJSfile) - .pipe(uglify()) - .pipe(rename({ - extname: ".min.js" - })) - .pipe(concat.header(copyright)) - .pipe(gulp.dest(curConfig.packagePath + "dist/")) - .pipe(gulp.dest(curConfig.packagePath + "js/")) - .pipe(gulp.dest(paths.dist)); -} - -function buildTests(configName) { - var curConfig = testconfigs[configName]; - var tsResult = gulp.src(curConfig.entryPoint) - .pipe(webpackStream(configName !== "react" && configName !== "ko"? getWebpackUniversalConfig(curConfig) : getWebpackConfig(curConfig))); - return tsResult - .pipe(concat(curConfig.mainJSfile)) - .pipe(gulp.dest(paths.testsFolder)); -} - -function createPackageJson(configName) { - var curConfig = configs[configName]; - return gulp.src("packagetemplate.json") - .pipe(jsonTransform(function (data) { - data.name = curConfig.name; - data.version = libraryVersion; - if (curConfig.keywords) { - for (var i = 0; i < curConfig.keywords.length; i++) { - data.keywords.push(curConfig.keywords[i]); - } - } - data.main = './js/' + curConfig.mainJSfile.replace(".js", ".min.js"); - data.typings = './dist/typings/entries/' + curConfig.dtsfile; - if (curConfig.dependencies) { - for (var key in curConfig.dependencies) { - data.dependencies[key] = curConfig.dependencies[key]; - } - } - return data; - }, " ")) - .pipe(rename("package.json")) - .pipe(gulp.dest(curConfig.packagePath)); -} - -gulp.task("ko_tempates", function () { - return buildTemplates("ko", 0); -}); -gulp.task("ko_windowtempates", function () { - return buildTemplates("ko", 1); -}); -gulp.task("ko_source", function () { - buildTypeDefinition("ko"); - return buildFromSources("ko"); -}); -gulp.task("ko_compress", function () { - compressMainJS("ko"); -}); -gulp.task("ko_createPackageJson", function () { - createPackageJson("ko"); -}); - -gulp.task("build_ko", sequence("ko_tempates", "ko_windowtempates", "ko_source", "ko_compress", "ko_createPackageJson")); - -gulp.task("buildTests_ko", function () { - return buildTests("ko"); -}); - -gulp.task("react_source", function () { - buildTypeDefinition("react"); - return buildFromSources("react"); -}); -gulp.task("react_compress", function () { - compressMainJS("react"); -}); -gulp.task("react_createPackageJson", function () { - createPackageJson("react"); -}); -gulp.task("build_react", sequence("react_source", "react_compress", "react_createPackageJson")); - -gulp.task("angular_source", function () { - buildTypeDefinition("angular"); - return buildFromSources("angular"); -}); -gulp.task("angular_compress", function () { - compressMainJS("angular"); -}); -gulp.task("angular_createPackageJson", function () { - createPackageJson("angular"); -}); -gulp.task("build_angular", sequence("angular_source", "angular_compress", "angular_createPackageJson")); - - -gulp.task("jquery_source", function () { - buildTypeDefinition("jquery"); - return buildFromSources("jquery"); -}); -gulp.task("jquery_compress", function () { - compressMainJS("jquery"); -}); -gulp.task("jquery_createPackageJson", function () { - createPackageJson("jquery"); -}); -gulp.task("build_jquery", sequence("jquery_source", "jquery_compress", "jquery_createPackageJson")); - -gulp.task('copyfiles', function (callback) { - gulp.src(gnf(null, 'package.json'), { base: './' }) - .pipe(rename(function (path) { - path.dirname = ""; - path.basename = path.basename.replace("-latest", ""); - })) - .pipe(gulp.dest(paths.jsFolder)); -}); - -gulp.task('sass', function () { - "use strict"; - gulp.src(paths.styles) - .pipe(sass.sync().on('error', sass.logError)) - .pipe(concat("survey.css")) - .pipe(gulp.dest(paths.webroot + 'css')) - .pipe(gulp.dest(paths.package_ko + 'dist/css')) - .pipe(gulp.dest(paths.package_ko + 'css')) - .pipe(gulp.dest(paths.package_react + 'dist/css')) - .pipe(gulp.dest(paths.package_react + 'css')) - .pipe(gulp.dest(paths.package_angular + 'dist/css')) - .pipe(gulp.dest(paths.package_angular + 'css')) - .pipe(gulp.dest(paths.package_jquery + 'dist/css')) - .pipe(gulp.dest(paths.package_jquery + 'css')) - .pipe(gulp.dest(paths.dist + 'css')); -}); -gulp.task("makedist", sequence(["sass", "build_ko"], "buildTests_ko", "build_react", "build_angular", "build_jquery")); - -gulp.task("test_ci", function (done) { - new Server({ - configFile: __dirname + "/karma.conf.js", - singleRun: true - }, done).start(); -}); - -gulp.task("server", serve({ - root: ["wwwroot"], - port: 30001 -})); \ No newline at end of file diff --git a/karma.conf.js b/karma.conf.js index 106db79685..d88feecea2 100644 --- a/karma.conf.js +++ b/karma.conf.js @@ -1,69 +1,45 @@ -// Karma configuration +var webpackConfigCreator = require('./webpack.config'); +var webpackConfig = webpackConfigCreator({ platform: "knockout", buildType: "dev" }); -module.exports = function (config) { +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: ['qunit'], - - // list of files / patterns to load in the browser + frameworks: ['qunit', 'commonjs'], files: [ - "wwwroot/js/qunit.css", - "wwwroot/js/knockout.js", - - "wwwroot/js/survey.ko.js", - - "wwwroot/tests/survey.tests.ko.js", - ], - - // list of files to exclude + 'tests/entries/*.ts' + ], exclude: [ ], - - // preprocess matching files before serving them to the browser - // available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor - preprocessors: { - 'wwwroot/js/survey.ko.js': ['coverage'] + mime: { + 'text/x-typescript': ['ts','tsx'] + }, + coverageReporter: { + dir:'tmp/coverage/', + reporters: [ + { type: 'json', subdir: 'report-json' }, + { type: 'html', subdir: 'report-html' }, + { type: 'lcov', subdir: 'report-lcov' } + ] }, - - // test results reporter to use - // possible values: 'dots', 'progress' - // available reporters: https://npmjs.org/browse/keyword/karma-reporter - reporters: ['progress', 'dots', 'junit', 'coverage'], - junitReporter: { - outputDir: 'shippable/testresults/', + outputDir: 'tmp/testresults/', outputFile: 'test-results.xml' }, - - coverageReporter: { - type: 'cobertura', - dir: 'shippable/codecoverage/' + preprocessors: { + '**/*.ts': ['webpack', 'sourcemap', 'commonjs', 'coverage'] }, - - // web server port - port: 9876, - - // enable / disable colors in the output (reporters and logs) + webpack: { + devtool: 'inline-source-map', + module: webpackConfig.module, + resolve: webpackConfig.resolve + }, + reporters: ['progress', 'dots', 'junit', 'coverage'], + browsers: ['PhantomJS'], 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 + logLevel: config.LOG_WARN, autoWatch: false, - - // 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 + singleRun: true, + concurrency: Infinity }) -} \ No newline at end of file +}; \ No newline at end of file diff --git a/lib_typings/base.d.ts b/lib_typings/base.d.ts deleted file mode 100644 index cbf7b40049..0000000000 --- a/lib_typings/base.d.ts +++ /dev/null @@ -1,69 +0,0 @@ -// Type definitions for Survey JavaScript library v0.9.12 -// Project: http://surveyjs.org/ -// Definitions by: Andrew Telnov - -export interface HashTable { - [key: string]: T; -} -export interface ISurveyData { - getValue(name: string): any; - setValue(name: string, newValue: any): any; - getComment(name: string): string; - setComment(name: string, newValue: string): any; -} -export interface ISurvey extends ISurveyData { - currentPage: IPage; - pageVisibilityChanged(page: IPage, newValue: boolean): any; - questionVisibilityChanged(question: IQuestion, newValue: boolean): any; - questionAdded(question: IQuestion, index: number): any; - questionRemoved(question: IQuestion): any; - validateQuestion(name: string): SurveyError; - processHtml(html: string): string; - processText(text: string): string; - isDesignMode: boolean; - requiredText: string; - questionStartIndex: string; - questionTitleTemplate: string; - storeOthersAsComment: boolean; - uploadFile(name: string, file: File, storeDataAsText: boolean, uploadingCallback: (status: string) => any): boolean; -} -export interface IConditionRunner { - runCondition(values: HashTable): any; -} -export interface IQuestion extends IConditionRunner { - name: string; - visible: boolean; - hasTitle: boolean; - setVisibleIndex(value: number): any; - onSurveyValueChanged(newValue: any): any; - onSurveyLoad(): any; - supportGoNextPageAutomatic(): boolean; -} -export interface IPage extends IConditionRunner { - visible: boolean; -} -export declare class ItemValue { - static Separator: string; - static setData(items: Array, values: Array): void; - static getData(items: Array): any; - private itemValue; - private itemText; - constructor(value: any, text?: string); - getType(): string; - value: any; - hasText: boolean; - text: string; -} -export declare class Base { - getType(): string; -} -export declare class SurveyError { - getText(): string; -} -export declare class Event { - private callbacks; - isEmpty: boolean; - fire(sender: any, options: Options): void; - add(func: T): void; - remove(func: T): void; -} diff --git a/lib_typings/choicesRestfull.d.ts b/lib_typings/choicesRestfull.d.ts deleted file mode 100644 index 60e661e107..0000000000 --- a/lib_typings/choicesRestfull.d.ts +++ /dev/null @@ -1,25 +0,0 @@ -// Type definitions for Survey JavaScript library v0.9.12 -// Project: http://surveyjs.org/ -// Definitions by: Andrew Telnov - -import { Base, ItemValue, SurveyError } from "./base"; -export declare class ChoicesRestfull extends Base { - url: string; - path: string; - valueName: string; - titleName: string; - getResultCallback: (items: Array) => void; - error: SurveyError; - constructor(); - run(): void; - getType(): string; - isEmpty: boolean; - setData(json: any): void; - clear(): void; - protected onLoad(result: any): void; - private onError(status, response); - private getResultAfterPath(result); - private getPathes(); - private getValue(item); - private getTitle(item); -} diff --git a/lib_typings/conditions.d.ts b/lib_typings/conditions.d.ts deleted file mode 100644 index cb38faa542..0000000000 --- a/lib_typings/conditions.d.ts +++ /dev/null @@ -1,35 +0,0 @@ -// Type definitions for Survey JavaScript library v0.9.12 -// Project: http://surveyjs.org/ -// Definitions by: Andrew Telnov - -import { HashTable } from './base'; -export declare class Condition { - static operatorsValue: HashTable; - static operators: HashTable; - private opValue; - left: any; - right: any; - operator: string; - perform(left?: any, right?: any): boolean; - private getPureValue(val); -} -export declare class ConditionNode { - private connectiveValue; - children: Array; - constructor(); - connective: string; - isEmpty: boolean; - clear(): void; -} -export declare class ConditionRunner { - private expressionValue; - private root; - private values; - constructor(expression: string); - expression: string; - run(values: HashTable): boolean; - private runNode(node); - private runNodeCondition(value); - private runCondition(condition); - private getValueName(nodeValue); -} diff --git a/lib_typings/conditionsParser.d.ts b/lib_typings/conditionsParser.d.ts deleted file mode 100644 index 6e44d90fa2..0000000000 --- a/lib_typings/conditionsParser.d.ts +++ /dev/null @@ -1,38 +0,0 @@ -// Type definitions for Survey JavaScript library v0.9.12 -// Project: http://surveyjs.org/ -// Definitions by: Andrew Telnov - -import { ConditionNode } from "./conditions"; -export declare class ConditionsParser { - private text; - private root; - private expressionNodes; - private node; - private at; - private length; - parse(text: string, root: ConditionNode): boolean; - toString(root: ConditionNode): string; - private toStringCore(value); - private nodeToString(node); - private conditionToString(condition); - private operationToString(op); - private isNumeric(value); - private parseText(); - private readConditions(); - private readCondition(); - private readExpression(); - private ch; - private skip(); - private isSpace(c); - private isQuotes(c); - private isOperatorChar(c); - private isBrackets(c); - private readString(); - private isNoRightOperation(op); - private readOperator(); - private readConnective(); - private pushExpression(); - private popExpression(); - private addCondition(c); - private addConnective(con); -} diff --git a/lib_typings/defaultCss/cssbootstrap.d.ts b/lib_typings/defaultCss/cssbootstrap.d.ts deleted file mode 100644 index 2435a3407a..0000000000 --- a/lib_typings/defaultCss/cssbootstrap.d.ts +++ /dev/null @@ -1,74 +0,0 @@ -// Type definitions for Survey JavaScript library v0.9.12 -// Project: http://surveyjs.org/ -// Definitions by: Andrew Telnov - -export declare var defaultBootstrapCss: { - root: string; - header: string; - body: string; - footer: string; - navigationButton: string; - navigation: { - complete: string; - prev: string; - next: string; - }; - progress: string; - progressBar: string; - pageTitle: string; - row: string; - question: { - root: string; - title: string; - comment: string; - indent: number; - }; - error: { - root: string; - icon: string; - item: string; - }; - checkbox: { - root: string; - item: string; - other: string; - }; - comment: string; - dropdown: string; - matrix: { - root: string; - }; - matrixdropdown: { - root: string; - }; - matrixdynamic: { - root: string; - button: string; - }; - multipletext: { - root: string; - itemTitle: string; - itemValue: string; - }; - radiogroup: { - root: string; - item: string; - other: string; - }; - rating: { - root: string; - item: string; - }; - text: string; - window: { - root: string; - body: string; - header: { - root: string; - title: string; - button: string; - buttonExpanded: string; - buttonCollapsed: string; - }; - }; -}; diff --git a/lib_typings/defaultCss/cssstandard.d.ts b/lib_typings/defaultCss/cssstandard.d.ts deleted file mode 100644 index 9c7cf8610c..0000000000 --- a/lib_typings/defaultCss/cssstandard.d.ts +++ /dev/null @@ -1,78 +0,0 @@ -// Type definitions for Survey JavaScript library v0.9.12 -// Project: http://surveyjs.org/ -// Definitions by: Andrew Telnov - -export declare var surveyCss: { - currentType: string; - getCss: () => any; -}; -export declare var defaultStandardCss: { - root: string; - header: string; - body: string; - footer: string; - navigationButton: string; - navigation: { - complete: string; - prev: string; - next: string; - }; - progress: string; - progressBar: string; - pageTitle: string; - row: string; - question: { - root: string; - title: string; - comment: string; - indent: number; - }; - error: { - root: string; - icon: string; - item: string; - }; - checkbox: { - root: string; - item: string; - other: string; - }; - comment: string; - dropdown: string; - matrix: { - root: string; - }; - matrixdropdown: { - root: string; - }; - matrixdynamic: { - root: string; - button: string; - }; - multipletext: { - root: string; - itemTitle: string; - itemValue: string; - }; - radiogroup: { - root: string; - item: string; - other: string; - }; - rating: { - root: string; - item: string; - }; - text: string; - window: { - root: string; - body: string; - header: { - root: string; - title: string; - button: string; - buttonExpanded: string; - buttonCollapsed: string; - }; - }; -}; diff --git a/lib_typings/dxSurveyService.d.ts b/lib_typings/dxSurveyService.d.ts deleted file mode 100644 index b264647483..0000000000 --- a/lib_typings/dxSurveyService.d.ts +++ /dev/null @@ -1,13 +0,0 @@ -// Type definitions for Survey JavaScript library v0.9.12 -// Project: http://surveyjs.org/ -// Definitions by: Andrew Telnov - -export declare class dxSurveyService { - static serviceUrl: string; - constructor(); - loadSurvey(surveyId: string, onLoad: (success: boolean, result: string, response: any) => void): void; - sendResult(postId: string, result: JSON, onSendResult: (success: boolean, response: any) => void, clientId?: string, isPartialCompleted?: boolean): void; - sendFile(postId: string, file: File, onSendFile: (success: boolean, response: any) => void): void; - getResult(resultId: string, name: string, onGetResult: (success: boolean, data: any, dataList: Array, response: any) => void): void; - isCompleted(resultId: string, clientId: string, onIsCompleted: (success: boolean, result: string, response: any) => void): void; -} diff --git a/lib_typings/entries/chunks/cssFrameworks.d.ts b/lib_typings/entries/chunks/cssFrameworks.d.ts deleted file mode 100644 index b9f57dd162..0000000000 --- a/lib_typings/entries/chunks/cssFrameworks.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -// Type definitions for Survey JavaScript library v0.9.12 -// Project: http://surveyjs.org/ -// Definitions by: Andrew Telnov - -import '../../defaultCss/cssbootstrap'; diff --git a/lib_typings/entries/chunks/localization.d.ts b/lib_typings/entries/chunks/localization.d.ts deleted file mode 100644 index 9f924c6f9c..0000000000 --- a/lib_typings/entries/chunks/localization.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -// Type definitions for Survey JavaScript library v0.9.12 -// Project: http://surveyjs.org/ -// Definitions by: Andrew Telnov - -import '../../localization/russian'; -import '../../localization/french'; -import '../../localization/finnish'; -import '../../localization/german'; diff --git a/lib_typings/entries/chunks/model.d.ts b/lib_typings/entries/chunks/model.d.ts deleted file mode 100644 index cd18821ff6..0000000000 --- a/lib_typings/entries/chunks/model.d.ts +++ /dev/null @@ -1,35 +0,0 @@ -// Type definitions for Survey JavaScript library v0.9.12 -// Project: http://surveyjs.org/ -// Definitions by: Andrew Telnov - -export { AnswerCountValidator, EmailValidator, NumericValidator, RegexValidator, SurveyValidator, TextValidator, ValidatorResult, ValidatorRunner } from "../../validator"; -export { Base, Event, ItemValue, SurveyError, ISurvey } from "../../base"; -export { ChoicesRestfull } from "../../choicesRestfull"; -export { Condition, ConditionNode, ConditionRunner } from "../../conditions"; -export { ConditionsParser } from "../../conditionsParser"; -export { CustomError, ExceedSizeError, RequreNumericError } from "../../error"; -export { JsonError, JsonIncorrectTypeError, JsonMetadata, JsonMetadataClass, JsonMissingTypeError, JsonMissingTypeErrorBase, JsonObject, JsonObjectProperty, JsonRequiredPropertyError, JsonUnknownPropertyError } from "../../jsonobject"; -export { MatrixDropdownCell, MatrixDropdownColumn, MatrixDropdownRowModelBase, QuestionMatrixDropdownModelBase } from "../../question_matrixdropdownbase"; -export { MatrixDropdownRowModel, QuestionMatrixDropdownModel } from "../../question_matrixdropdown"; -export { MatrixDynamicRowModel, QuestionMatrixDynamicModel } from "../../question_matrixdynamic"; -export { MatrixRowModel, QuestionMatrixModel } from "../../question_matrix"; -export { MultipleTextItemModel, QuestionMultipleTextModel } from "../../question_multipletext"; -export { PageModel, QuestionRowModel } from "../../page"; -export { Question } from "../../question"; -export { QuestionBase } from "../../questionbase"; -export { QuestionCheckboxBase, QuestionSelectBase } from "../../question_baseselect"; -export { QuestionCheckboxModel } from "../../question_checkbox"; -export { QuestionCommentModel } from "../../question_comment"; -export { QuestionDropdownModel } from "../../question_dropdown"; -export { QuestionFactory } from "../../questionfactory"; -export { QuestionFileModel } from "../../question_file"; -export { QuestionHtmlModel } from "../../question_html"; -export { QuestionRadiogroupModel } from "../../question_radiogroup"; -export { QuestionRatingModel } from "../../question_rating"; -export { QuestionTextModel } from "../../question_text"; -export { SurveyModel } from "../../survey"; -export { SurveyTrigger, SurveyTriggerComplete, SurveyTriggerSetValue, SurveyTriggerVisible, Trigger } from "../../trigger"; -export { SurveyWindowModel } from "../../surveyWindow"; -export { TextPreProcessor } from "../../textPreProcessor"; -export { dxSurveyService } from "../../dxSurveyService"; -export { surveyLocalization, surveyStrings } from "../../surveyStrings"; diff --git a/lib_typings/entries/ko.d.ts b/lib_typings/entries/ko.d.ts deleted file mode 100644 index 15d4723151..0000000000 --- a/lib_typings/entries/ko.d.ts +++ /dev/null @@ -1,29 +0,0 @@ -// Type definitions for Survey JavaScript library v0.9.12 -// Project: http://surveyjs.org/ -// Definitions by: Andrew Telnov - -export * from "./chunks/model"; -import './chunks/localization'; -export { defaultStandardCss } from "../defaultCss/cssstandard"; -import './chunks/cssFrameworks'; -export { Survey } from "../knockout/kosurvey"; -export { QuestionRow, Page } from "../knockout/kopage"; -export { QuestionImplementorBase } from "../knockout/koquestionbase"; -export { QuestionImplementor } from "../knockout/koquestion"; -export { QuestionSelectBaseImplementor } from "../knockout/koquestion_baseselect"; -export { QuestionCheckboxBaseImplementor } from "../knockout/koquestion_baseselect"; -export { QuestionCheckbox } from "../knockout/koquestion_checkbox"; -export { QuestionComment } from "../knockout/koquestion_comment"; -export { QuestionDropdown } from "../knockout/koquestion_dropdown"; -export { QuestionFile } from "../knockout/koquestion_file"; -export { QuestionHtml } from "../knockout/koquestion_html"; -export { MatrixRow, QuestionMatrix } from "../knockout/koquestion_matrix"; -export { QuestionMatrixDropdown } from "../knockout/koquestion_matrixdropdown"; -export { QuestionMatrixDynamicImplementor, QuestionMatrixDynamic } from "../knockout/koquestion_matrixdynamic"; -export { MultipleTextItem, QuestionMultipleTextImplementor, QuestionMultipleText } from "../knockout/koquestion_multipletext"; -export { QuestionRadiogroup } from "../knockout/koquestion_radiogroup"; -export { QuestionRating } from "../knockout/koquestion_rating"; -export { QuestionText } from "../knockout/koquestion_text"; -export { SurveyWindow } from "../knockout/koSurveyWindow"; -export { SurveyTemplateText } from "../knockout/templateText"; -export { __extends } from "../extends"; diff --git a/lib_typings/entries/react.d.ts b/lib_typings/entries/react.d.ts deleted file mode 100644 index 1105d80d2c..0000000000 --- a/lib_typings/entries/react.d.ts +++ /dev/null @@ -1,28 +0,0 @@ -// Type definitions for Survey JavaScript library v0.9.12 -// Project: http://surveyjs.org/ -// Definitions by: Andrew Telnov - -export * from "./chunks/model"; -import './chunks/localization'; -export { defaultStandardCss } from "../defaultCss/cssstandard"; -import './chunks/cssFrameworks'; -export { Survey } from "../react/reactSurvey"; -export { ReactSurveyModel } from "../react/reactsurveymodel"; -export { SurveyNavigation } from "../react/reactSurveyNavigation"; -export { SurveyPage, SurveyRow } from "../react/reactpage"; -export { SurveyQuestion, SurveyQuestionErrors } from "../react/reactquestion"; -export { SurveyQuestionCommentItem, SurveyQuestionComment } from "../react/reactquestioncomment"; -export { SurveyQuestionCheckbox, SurveyQuestionCheckboxItem } from "../react/reactquestioncheckbox"; -export { SurveyQuestionDropdown } from "../react/reactquestiondropdown"; -export { SurveyQuestionMatrixDropdown, SurveyQuestionMatrixDropdownRow } from "../react/reactquestionmatrixdropdown"; -export { SurveyQuestionMatrix, SurveyQuestionMatrixRow } from "../react/reactquestionmatrix"; -export { SurveyQuestionHtml } from "../react/reactquestionhtml"; -export { SurveyQuestionFile } from "../react/reactquestionfile"; -export { SurveyQuestionMultipleText, SurveyQuestionMultipleTextItem } from "../react/reactquestionmultipletext"; -export { SurveyQuestionRadiogroup } from "../react/reactquestionradiogroup"; -export { SurveyQuestionText } from "../react/reactquestiontext"; -export { SurveyQuestionMatrixDynamic, SurveyQuestionMatrixDynamicRow } from "../react/reactquestionmatrixdynamic"; -export { SurveyProgress } from "../react/reactSurveyProgress"; -export { SurveyQuestionRating } from "../react/reactquestionrating"; -export { SurveyWindow } from "../react/reactSurveyWindow"; -export { __extends } from "../extends"; diff --git a/lib_typings/error.d.ts b/lib_typings/error.d.ts deleted file mode 100644 index 2c858bb11b..0000000000 --- a/lib_typings/error.d.ts +++ /dev/null @@ -1,24 +0,0 @@ -// Type definitions for Survey JavaScript library v0.9.12 -// Project: http://surveyjs.org/ -// Definitions by: Andrew Telnov - -import { SurveyError } from "./base"; -export declare class AnswerRequiredError extends SurveyError { - constructor(); - getText(): string; -} -export declare class RequreNumericError extends SurveyError { - constructor(); - getText(): string; -} -export declare class ExceedSizeError extends SurveyError { - private maxSize; - constructor(maxSize: number); - getText(): string; - private getTextSize(); -} -export declare class CustomError extends SurveyError { - private text; - constructor(text: string); - getText(): string; -} diff --git a/lib_typings/extends.d.ts b/lib_typings/extends.d.ts deleted file mode 100644 index 821f245da1..0000000000 --- a/lib_typings/extends.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -// Type definitions for Survey JavaScript library v0.9.12 -// Project: http://surveyjs.org/ -// Definitions by: Andrew Telnov - -export declare function __extends(d: any, b: any): void; diff --git a/lib_typings/jsonobject.d.ts b/lib_typings/jsonobject.d.ts deleted file mode 100644 index 54bafb03f7..0000000000 --- a/lib_typings/jsonobject.d.ts +++ /dev/null @@ -1,110 +0,0 @@ -// Type definitions for Survey JavaScript library v0.9.12 -// Project: http://surveyjs.org/ -// Definitions by: Andrew Telnov - -export declare class JsonObjectProperty { - name: string; - private typeValue; - private choicesValue; - private choicesfunc; - className: string; - classNamePart: string; - baseClassName: string; - defaultValue: any; - onGetValue: (obj: any) => any; - onSetValue: (obj: any, value: any, jsonConv: JsonObject) => any; - constructor(name: string); - type: string; - hasToUseGetValue: (obj: any) => any; - isDefaultValue(value: any): boolean; - getValue(obj: any): any; - hasToUseSetValue: (obj: any, value: any, jsonConv: JsonObject) => any; - setValue(obj: any, value: any, jsonConv: JsonObject): void; - getObjType(objType: string): string; - getClassName(className: string): string; - choices: Array; - setChoices(value: Array, valueFunc: () => Array): void; -} -export declare class JsonMetadataClass { - name: string; - creator: () => any; - parentName: string; - static requiredSymbol: string; - static typeSymbol: string; - properties: Array; - requiredProperties: Array; - constructor(name: string, properties: Array, creator?: () => any, parentName?: string); - find(name: string): JsonObjectProperty; - private createProperty(propInfo); - private getPropertyName(propertyName); - private makePropertyRequired(propertyName); -} -export declare class JsonMetadata { - private classes; - private childrenClasses; - private classProperties; - private classRequiredProperties; - addClass(name: string, properties: Array, creator?: () => any, parentName?: string): JsonMetadataClass; - overrideClassCreatore(name: string, creator: () => any): void; - getProperties(name: string): Array; - createClass(name: string): any; - getChildrenClasses(name: string, canBeCreated?: boolean): Array; - getRequiredProperties(name: string): Array; - private fillChildrenClasses(name, canBeCreated, result); - private findClass(name); - private fillProperties(name, list); - private addProperty(property, list, endIndex); - private fillRequiredProperties(name, list); -} -export declare class JsonError { - type: string; - message: string; - description: string; - at: Number; - constructor(type: string, message: string); - getFullDescription(): string; -} -export declare class JsonUnknownPropertyError extends JsonError { - propertyName: string; - className: string; - constructor(propertyName: string, className: string); -} -export declare class JsonMissingTypeErrorBase extends JsonError { - baseClassName: string; - type: string; - message: string; - constructor(baseClassName: string, type: string, message: string); -} -export declare class JsonMissingTypeError extends JsonMissingTypeErrorBase { - propertyName: string; - baseClassName: string; - constructor(propertyName: string, baseClassName: string); -} -export declare class JsonIncorrectTypeError extends JsonMissingTypeErrorBase { - propertyName: string; - baseClassName: string; - constructor(propertyName: string, baseClassName: string); -} -export declare class JsonRequiredPropertyError extends JsonError { - propertyName: string; - className: string; - constructor(propertyName: string, className: string); -} -export declare class JsonObject { - private static typePropertyName; - private static positionPropertyName; - private static metaDataValue; - static metaData: JsonMetadata; - errors: JsonError[]; - toJsonObject(obj: any): any; - toObject(jsonObj: any, obj: any): void; - protected toJsonObjectCore(obj: any, property: JsonObjectProperty): any; - protected valueToJson(obj: any, result: any, property: JsonObjectProperty): void; - protected valueToObj(value: any, obj: any, key: any, property: JsonObjectProperty): void; - private isValueArray(value); - private createNewObj(value, property); - private checkNewObjectOnErrors(newObj, value, property, className); - private addNewError(error, jsonObj); - private valueToArray(value, obj, key, property); - private findProperty(properties, key); -} diff --git a/lib_typings/knockout/koSurveyWindow.d.ts b/lib_typings/knockout/koSurveyWindow.d.ts deleted file mode 100644 index 28cf191d41..0000000000 --- a/lib_typings/knockout/koSurveyWindow.d.ts +++ /dev/null @@ -1,22 +0,0 @@ -// Type definitions for Survey JavaScript library v0.9.12 -// Project: http://surveyjs.org/ -// Definitions by: Andrew Telnov - -import { SurveyWindowModel } from "../surveyWindow"; -import { SurveyModel } from "../survey"; -export declare class SurveyWindow extends SurveyWindowModel { - koExpanded: any; - koExpandedCss: any; - doExpand: any; - constructor(jsonObj: any); - protected createSurvey(jsonObj: any): SurveyModel; - protected expandcollapse(value: boolean): void; - protected template: string; - show(): void; - protected getDefaultTemplate(): string; - hide(): void; - css: any; - private changeExpanded(); - private onComplete(); - private getButtonCss(); -} diff --git a/lib_typings/knockout/kopage.d.ts b/lib_typings/knockout/kopage.d.ts deleted file mode 100644 index c7e63edd22..0000000000 --- a/lib_typings/knockout/kopage.d.ts +++ /dev/null @@ -1,21 +0,0 @@ -// Type definitions for Survey JavaScript library v0.9.12 -// Project: http://surveyjs.org/ -// Definitions by: Andrew Telnov - -import { PageModel, QuestionRowModel } from "../page"; -import { QuestionBase } from "../questionbase"; -export declare class QuestionRow extends QuestionRowModel { - page: PageModel; - question: QuestionBase; - koVisible: any; - constructor(page: PageModel, question: QuestionBase); - protected onVisibleChanged(): void; - koAfterRender(el: any, con: any): void; -} -export declare class Page extends PageModel { - koNo: any; - constructor(name?: string); - protected createRow(question: QuestionBase): QuestionRowModel; - protected onCreating(): void; - protected onNumChanged(value: number): void; -} diff --git a/lib_typings/knockout/koquestion.d.ts b/lib_typings/knockout/koquestion.d.ts deleted file mode 100644 index 391dfbd1a1..0000000000 --- a/lib_typings/knockout/koquestion.d.ts +++ /dev/null @@ -1,25 +0,0 @@ -// Type definitions for Survey JavaScript library v0.9.12 -// Project: http://surveyjs.org/ -// Definitions by: Andrew Telnov - -import { QuestionImplementorBase } from "./koquestionbase"; -import { Question } from "../question"; -export declare class QuestionImplementor extends QuestionImplementorBase { - question: Question; - private isUpdating; - private koDummy; - koValue: any; - koComment: any; - koTitle: any; - constructor(question: Question); - protected onValueChanged(): void; - protected onCommentChanged(): void; - protected onVisibilityChanged(): void; - protected onVisibleIndexChanged(): void; - protected onErrorsChanged(): void; - protected createkoValue(): any; - protected setkoValue(newValue: any): void; - protected updateValue(newValue: any): void; - protected updateComment(newValue: any): void; - protected getNo(): string; -} diff --git a/lib_typings/knockout/koquestion_baseselect.d.ts b/lib_typings/knockout/koquestion_baseselect.d.ts deleted file mode 100644 index 690b9aecee..0000000000 --- a/lib_typings/knockout/koquestion_baseselect.d.ts +++ /dev/null @@ -1,19 +0,0 @@ -// Type definitions for Survey JavaScript library v0.9.12 -// Project: http://surveyjs.org/ -// Definitions by: Andrew Telnov - -import { QuestionImplementor } from "./koquestion"; -import { Question } from "../question"; -export declare class QuestionSelectBaseImplementor extends QuestionImplementor { - koOtherVisible: any; - koVisibleChoices: any; - constructor(question: Question); - protected isOtherSelected: boolean; -} -export declare class QuestionCheckboxBaseImplementor extends QuestionSelectBaseImplementor { - koWidth: any; - constructor(question: Question); - protected onColCountChanged(): void; - protected colWidth: string; - private koAfterRender(el, con); -} diff --git a/lib_typings/knockout/koquestion_checkbox.d.ts b/lib_typings/knockout/koquestion_checkbox.d.ts deleted file mode 100644 index d3c70ce25d..0000000000 --- a/lib_typings/knockout/koquestion_checkbox.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -// Type definitions for Survey JavaScript library v0.9.12 -// Project: http://surveyjs.org/ -// Definitions by: Andrew Telnov - -import { QuestionCheckboxModel } from "../question_checkbox"; -export declare class QuestionCheckbox extends QuestionCheckboxModel { - name: string; - constructor(name: string); -} diff --git a/lib_typings/knockout/koquestion_comment.d.ts b/lib_typings/knockout/koquestion_comment.d.ts deleted file mode 100644 index 22a87a8a7e..0000000000 --- a/lib_typings/knockout/koquestion_comment.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -// Type definitions for Survey JavaScript library v0.9.12 -// Project: http://surveyjs.org/ -// Definitions by: Andrew Telnov - -import { QuestionCommentModel } from "../question_comment"; -export declare class QuestionComment extends QuestionCommentModel { - name: string; - constructor(name: string); -} diff --git a/lib_typings/knockout/koquestion_dropdown.d.ts b/lib_typings/knockout/koquestion_dropdown.d.ts deleted file mode 100644 index b91b8a4b93..0000000000 --- a/lib_typings/knockout/koquestion_dropdown.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -// Type definitions for Survey JavaScript library v0.9.12 -// Project: http://surveyjs.org/ -// Definitions by: Andrew Telnov - -import { QuestionDropdownModel } from "../question_dropdown"; -export declare class QuestionDropdown extends QuestionDropdownModel { - name: string; - constructor(name: string); -} diff --git a/lib_typings/knockout/koquestion_file.d.ts b/lib_typings/knockout/koquestion_file.d.ts deleted file mode 100644 index 09a60de530..0000000000 --- a/lib_typings/knockout/koquestion_file.d.ts +++ /dev/null @@ -1,19 +0,0 @@ -// Type definitions for Survey JavaScript library v0.9.12 -// Project: http://surveyjs.org/ -// Definitions by: Andrew Telnov - -import { QuestionFileModel } from "../question_file"; -import { QuestionImplementor } from "./koquestion"; -import { Question } from "../question"; -export declare class QuestionFileImplementor extends QuestionImplementor { - koDataUpdater: any; - koData: any; - koHasValue: any; - constructor(question: Question); - private onChange(src); - private onLoadPreview(); -} -export declare class QuestionFile extends QuestionFileModel { - name: string; - constructor(name: string); -} diff --git a/lib_typings/knockout/koquestion_html.d.ts b/lib_typings/knockout/koquestion_html.d.ts deleted file mode 100644 index 6acadbb818..0000000000 --- a/lib_typings/knockout/koquestion_html.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -// Type definitions for Survey JavaScript library v0.9.12 -// Project: http://surveyjs.org/ -// Definitions by: Andrew Telnov - -import { QuestionHtmlModel } from "../question_html"; -export declare class QuestionHtml extends QuestionHtmlModel { - name: string; - constructor(name: string); -} diff --git a/lib_typings/knockout/koquestion_matrix.d.ts b/lib_typings/knockout/koquestion_matrix.d.ts deleted file mode 100644 index bc60563e56..0000000000 --- a/lib_typings/knockout/koquestion_matrix.d.ts +++ /dev/null @@ -1,19 +0,0 @@ -// Type definitions for Survey JavaScript library v0.9.12 -// Project: http://surveyjs.org/ -// Definitions by: Andrew Telnov - -import { QuestionMatrixModel, MatrixRowModel, IMatrixData } from "../question_matrix"; -export declare class MatrixRow extends MatrixRowModel { - name: any; - text: string; - fullName: string; - private isValueUpdating; - koValue: any; - constructor(name: any, text: string, fullName: string, data: IMatrixData, value: any); - protected onValueChanged(): void; -} -export declare class QuestionMatrix extends QuestionMatrixModel { - name: string; - constructor(name: string); - protected createMatrixRow(name: any, text: string, fullName: string, value: any): MatrixRowModel; -} diff --git a/lib_typings/knockout/koquestion_matrixdropdown.d.ts b/lib_typings/knockout/koquestion_matrixdropdown.d.ts deleted file mode 100644 index ac60c2c502..0000000000 --- a/lib_typings/knockout/koquestion_matrixdropdown.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -// Type definitions for Survey JavaScript library v0.9.12 -// Project: http://surveyjs.org/ -// Definitions by: Andrew Telnov - -import { QuestionMatrixDropdownModel } from "../question_matrixdropdown"; -export declare class QuestionMatrixDropdown extends QuestionMatrixDropdownModel { - name: string; - constructor(name: string); -} diff --git a/lib_typings/knockout/koquestion_matrixdynamic.d.ts b/lib_typings/knockout/koquestion_matrixdynamic.d.ts deleted file mode 100644 index f876d2ccf5..0000000000 --- a/lib_typings/knockout/koquestion_matrixdynamic.d.ts +++ /dev/null @@ -1,25 +0,0 @@ -// Type definitions for Survey JavaScript library v0.9.12 -// Project: http://surveyjs.org/ -// Definitions by: Andrew Telnov - -import { QuestionImplementor } from "./koquestion"; -import { QuestionMatrixDynamicModel } from "../question_matrixdynamic"; -import { Question } from "../question"; -import { MatrixDynamicRowModel } from "../question_matrixdynamic"; -export declare class QuestionMatrixDynamicImplementor extends QuestionImplementor { - koRows: any; - koRecalc: any; - koAddRowClick: any; - koRemoveRowClick: any; - koOverflowX: any; - constructor(question: Question); - protected onUpdateCells(): void; - protected onColumnChanged(): void; - protected onRowCountChanged(): void; - protected addRow(): void; - protected removeRow(row: MatrixDynamicRowModel): void; -} -export declare class QuestionMatrixDynamic extends QuestionMatrixDynamicModel { - name: string; - constructor(name: string); -} diff --git a/lib_typings/knockout/koquestion_multipletext.d.ts b/lib_typings/knockout/koquestion_multipletext.d.ts deleted file mode 100644 index 54b551cec0..0000000000 --- a/lib_typings/knockout/koquestion_multipletext.d.ts +++ /dev/null @@ -1,24 +0,0 @@ -// Type definitions for Survey JavaScript library v0.9.12 -// Project: http://surveyjs.org/ -// Definitions by: Andrew Telnov - -import { QuestionMultipleTextModel, MultipleTextItemModel } from "../question_multipletext"; -import { QuestionImplementor } from "./koquestion"; -import { Question } from "../question"; -export declare class MultipleTextItem extends MultipleTextItemModel { - name: any; - private isKOValueUpdating; - koValue: any; - constructor(name?: any, title?: string); - onValueChanged(newValue: any): void; -} -export declare class QuestionMultipleTextImplementor extends QuestionImplementor { - koRows: any; - constructor(question: Question); - protected onColCountChanged(): void; -} -export declare class QuestionMultipleText extends QuestionMultipleTextModel { - name: string; - constructor(name: string); - protected createTextItem(name: string, title: string): MultipleTextItemModel; -} diff --git a/lib_typings/knockout/koquestion_radiogroup.d.ts b/lib_typings/knockout/koquestion_radiogroup.d.ts deleted file mode 100644 index a4a5b3690c..0000000000 --- a/lib_typings/knockout/koquestion_radiogroup.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -// Type definitions for Survey JavaScript library v0.9.12 -// Project: http://surveyjs.org/ -// Definitions by: Andrew Telnov - -import { QuestionRadiogroupModel } from "../question_radiogroup"; -export declare class QuestionRadiogroup extends QuestionRadiogroupModel { - name: string; - constructor(name: string); -} diff --git a/lib_typings/knockout/koquestion_rating.d.ts b/lib_typings/knockout/koquestion_rating.d.ts deleted file mode 100644 index 3bf2c11937..0000000000 --- a/lib_typings/knockout/koquestion_rating.d.ts +++ /dev/null @@ -1,11 +0,0 @@ -// Type definitions for Survey JavaScript library v0.9.12 -// Project: http://surveyjs.org/ -// Definitions by: Andrew Telnov - -import { QuestionRatingModel } from "../question_rating"; -export declare class QuestionRating extends QuestionRatingModel { - name: string; - itemCss: string; - constructor(name: string); - protected onSetData(): void; -} diff --git a/lib_typings/knockout/koquestion_text.d.ts b/lib_typings/knockout/koquestion_text.d.ts deleted file mode 100644 index 98b855a747..0000000000 --- a/lib_typings/knockout/koquestion_text.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -// Type definitions for Survey JavaScript library v0.9.12 -// Project: http://surveyjs.org/ -// Definitions by: Andrew Telnov - -import { QuestionTextModel } from "../question_text"; -export declare class QuestionText extends QuestionTextModel { - name: string; - constructor(name: string); -} diff --git a/lib_typings/knockout/koquestionbase.d.ts b/lib_typings/knockout/koquestionbase.d.ts deleted file mode 100644 index 273b8dc953..0000000000 --- a/lib_typings/knockout/koquestionbase.d.ts +++ /dev/null @@ -1,17 +0,0 @@ -// Type definitions for Survey JavaScript library v0.9.12 -// Project: http://surveyjs.org/ -// Definitions by: Andrew Telnov - -import { QuestionBase } from "../questionbase"; -export declare class QuestionImplementorBase { - question: QuestionBase; - koVisible: any; - koErrors: any; - koMarginLeft: any; - koPaddingRight: any; - koRenderWidth: any; - constructor(question: QuestionBase); - protected onVisibilityChanged(): void; - protected onRenderWidthChanged(): void; - private getIndentSize(indent); -} diff --git a/lib_typings/knockout/kosurvey.d.ts b/lib_typings/knockout/kosurvey.d.ts deleted file mode 100644 index 71b828eb34..0000000000 --- a/lib_typings/knockout/kosurvey.d.ts +++ /dev/null @@ -1,37 +0,0 @@ -// Type definitions for Survey JavaScript library v0.9.12 -// Project: http://surveyjs.org/ -// Definitions by: Andrew Telnov - -import { SurveyModel } from "../survey"; -import { Event } from "../base"; -import { Page } from "./kopage"; -import { PageModel } from "../page"; -export declare class Survey extends SurveyModel { - static cssType: string; - private renderedElement; - onRendered: Event<(sender: SurveyModel) => any, any>; - koCurrentPage: any; - koIsFirstPage: any; - koIsLastPage: any; - dummyObservable: any; - koState: any; - koProgress: any; - koProgressText: any; - constructor(jsonObj?: any, renderedElement?: any, css?: any); - cssNavigationComplete: string; - cssNavigationPrev: string; - cssNavigationNext: string; - private getNavigationCss(main, btn); - css: any; - render(element?: any): void; - loadSurveyFromService(surveyId?: string, renderedElement?: any): void; - protected setCompleted(): void; - protected createNewPage(name: string): Page; - protected getTemplate(): string; - protected onBeforeCreating(): void; - protected currentPageChanged(newValue: PageModel, oldValue: PageModel): void; - protected onLoadSurveyFromService(): void; - protected onLoadingSurveyFromService(): void; - private applyBinding(); - private updateKoCurrentPage(); -} diff --git a/lib_typings/knockout/template.ko.html.d.ts b/lib_typings/knockout/template.ko.html.d.ts deleted file mode 100644 index b49fb863b5..0000000000 --- a/lib_typings/knockout/template.ko.html.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -// Type definitions for Survey JavaScript library v0.9.12 -// Project: http://surveyjs.org/ -// Definitions by: Andrew Telnov - -export declare var koTemplate: { - html: string; -}; diff --git a/lib_typings/knockout/template.window.ko.html.d.ts b/lib_typings/knockout/template.window.ko.html.d.ts deleted file mode 100644 index b49fb863b5..0000000000 --- a/lib_typings/knockout/template.window.ko.html.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -// Type definitions for Survey JavaScript library v0.9.12 -// Project: http://surveyjs.org/ -// Definitions by: Andrew Telnov - -export declare var koTemplate: { - html: string; -}; diff --git a/lib_typings/knockout/templateText.d.ts b/lib_typings/knockout/templateText.d.ts deleted file mode 100644 index de4f67628f..0000000000 --- a/lib_typings/knockout/templateText.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -// Type definitions for Survey JavaScript library v0.9.12 -// Project: http://surveyjs.org/ -// Definitions by: Andrew Telnov - -export declare class SurveyTemplateText { - constructor(); - replaceText(replaceText: string, id: string, questionType?: string): void; - protected getId(id: string, questionType: string): string; - protected text: string; -} diff --git a/lib_typings/localization/dutch.d.ts b/lib_typings/localization/dutch.d.ts deleted file mode 100644 index a6f4b5e824..0000000000 --- a/lib_typings/localization/dutch.d.ts +++ /dev/null @@ -1,26 +0,0 @@ -// Type definitions for Survey JavaScript library v0.9.12 -// Project: http://surveyjs.org/ -// Definitions by: Andrew Telnov - -export declare var dutchSurveyStrings: { - pagePrevText: string; - pageNextText: string; - completeText: string; - otherItemText: string; - progressText: string; - emptySurvey: string; - completingSurvey: string; - loadingSurvey: string; - optionsCaption: string; - requiredError: string; - numericError: string; - textMinLength: string; - minSelectError: string; - maxSelectError: string; - numericMinMax: string; - numericMin: string; - numericMax: string; - invalidEmail: string; - exceedMaxSize: string; - otherRequiredError: string; -}; diff --git a/lib_typings/localization/finnish.d.ts b/lib_typings/localization/finnish.d.ts deleted file mode 100644 index b383f03288..0000000000 --- a/lib_typings/localization/finnish.d.ts +++ /dev/null @@ -1,25 +0,0 @@ -// Type definitions for Survey JavaScript library v0.9.12 -// Project: http://surveyjs.org/ -// Definitions by: Andrew Telnov - -export declare var finnishSurveyStrings: { - pagePrevText: string; - pageNextText: string; - completeText: string; - otherItemText: string; - progressText: string; - emptySurvey: string; - completingSurvey: string; - loadingSurvey: string; - optionsCaption: string; - requiredError: string; - numericError: string; - textMinLength: string; - minSelectError: string; - maxSelectError: string; - numericMinMax: string; - numericMin: string; - numericMax: string; - invalidEmail: string; - otherRequiredError: string; -}; diff --git a/lib_typings/localization/french.d.ts b/lib_typings/localization/french.d.ts deleted file mode 100644 index 8331dfab7c..0000000000 --- a/lib_typings/localization/french.d.ts +++ /dev/null @@ -1,26 +0,0 @@ -// Type definitions for Survey JavaScript library v0.9.12 -// Project: http://surveyjs.org/ -// Definitions by: Andrew Telnov - -export declare var frenchSurveyStrings: { - pagePrevText: string; - pageNextText: string; - completeText: string; - otherItemText: string; - progressText: string; - emptySurvey: string; - completingSurvey: string; - loadingSurvey: string; - optionsCaption: string; - requiredError: string; - numericError: string; - textMinLength: string; - minSelectError: string; - maxSelectError: string; - numericMinMax: string; - numericMin: string; - numericMax: string; - invalidEmail: string; - exceedMaxSize: string; - otherRequiredError: string; -}; diff --git a/lib_typings/localization/german.d.ts b/lib_typings/localization/german.d.ts deleted file mode 100644 index 6ce47d0585..0000000000 --- a/lib_typings/localization/german.d.ts +++ /dev/null @@ -1,26 +0,0 @@ -// Type definitions for Survey JavaScript library v0.9.12 -// Project: http://surveyjs.org/ -// Definitions by: Andrew Telnov - -export declare var germanSurveyStrings: { - pagePrevText: string; - pageNextText: string; - completeText: string; - progressText: string; - emptySurvey: string; - completingSurvey: string; - loadingSurvey: string; - otherItemText: string; - optionsCaption: string; - requiredError: string; - numericError: string; - textMinLength: string; - minSelectError: string; - maxSelectError: string; - numericMinMax: string; - numericMin: string; - numericMax: string; - invalidEmail: string; - exceedMaxSize: string; - otherRequiredError: string; -}; diff --git a/lib_typings/localization/russian.d.ts b/lib_typings/localization/russian.d.ts deleted file mode 100644 index b88ee2c034..0000000000 --- a/lib_typings/localization/russian.d.ts +++ /dev/null @@ -1,25 +0,0 @@ -// Type definitions for Survey JavaScript library v0.9.12 -// Project: http://surveyjs.org/ -// Definitions by: Andrew Telnov - -export declare var russianSurveyStrings: { - pagePrevText: string; - pageNextText: string; - completeText: string; - progressText: string; - emptySurvey: string; - completingSurvey: string; - loadingSurvey: string; - otherItemText: string; - optionsCaption: string; - requiredError: string; - numericError: string; - textMinLength: string; - minSelectError: string; - maxSelectError: string; - numericMinMax: string; - numericMin: string; - numericMax: string; - invalidEmail: string; - otherRequiredError: string; -}; diff --git a/lib_typings/localization/turkish.d.ts b/lib_typings/localization/turkish.d.ts deleted file mode 100644 index 14e0c24881..0000000000 --- a/lib_typings/localization/turkish.d.ts +++ /dev/null @@ -1,32 +0,0 @@ -// Type definitions for Survey JavaScript library v0.9.12 -// Project: http://surveyjs.org/ -// Definitions by: Andrew Telnov - -export declare var turkishSurveyStrings: { - pagePrevText: string; - pageNextText: string; - completeText: string; - otherItemText: string; - progressText: string; - emptySurvey: string; - completingSurvey: string; - loadingSurvey: string; - optionsCaption: string; - requiredError: string; - numericError: string; - textMinLength: string; - minRowCountError: string; - minSelectError: string; - maxSelectError: string; - numericMinMax: string; - numericMin: string; - numericMax: string; - invalidEmail: string; - urlRequestError: string; - urlGetChoicesError: string; - exceedMaxSize: string; - otherRequiredError: string; - uploadingFile: string; - addRow: string; - removeRow: string; -}; diff --git a/lib_typings/page.d.ts b/lib_typings/page.d.ts deleted file mode 100644 index 53b626f37b..0000000000 --- a/lib_typings/page.d.ts +++ /dev/null @@ -1,56 +0,0 @@ -// Type definitions for Survey JavaScript library v0.9.12 -// Project: http://surveyjs.org/ -// Definitions by: Andrew Telnov - -import { Base, IPage, IConditionRunner, ISurvey, IQuestion, HashTable } from "./base"; -import { QuestionBase } from "./questionbase"; -export declare class QuestionRowModel { - page: PageModel; - question: QuestionBase; - private visibleValue; - visibilityChangedCallback: () => void; - constructor(page: PageModel, question: QuestionBase); - questions: Array; - visible: boolean; - updateVisible(): void; - addQuestion(q: QuestionBase): void; - protected onVisibleChanged(): void; - setWidth(): void; - private onRowVisibilityChanged(); - private getVisibleCount(); - private isQuestionVisible(q); - private calcVisible(); -} -export declare class PageModel extends Base implements IPage, IConditionRunner { - name: string; - private rowValues; - private conditionRunner; - questions: Array; - data: ISurvey; - visibleIf: string; - title: string; - visibleIndex: number; - private numValue; - private visibleValue; - constructor(name?: string); - rows: Array; - isActive: boolean; - isQuestionVisible(question: QuestionBase): boolean; - protected createRow(question: QuestionBase): QuestionRowModel; - private isDesignMode; - private buildRows(); - onRowVisibilityChanged(row: QuestionRowModel): void; - processedTitle: string; - num: number; - visible: boolean; - getType(): string; - isVisible: boolean; - addQuestion(question: QuestionBase, index?: number): void; - addNewQuestion(questionType: string, name: string): QuestionBase; - removeQuestion(question: QuestionBase): void; - scrollToFirstQuestion(): void; - hasErrors(fireCallback?: boolean, focuseOnFirstError?: boolean): boolean; - addQuestionsToList(list: Array, visibleOnly?: boolean): void; - runCondition(values: HashTable): void; - protected onNumChanged(value: number): void; -} diff --git a/lib_typings/question.d.ts b/lib_typings/question.d.ts deleted file mode 100644 index 7bc14cbe47..0000000000 --- a/lib_typings/question.d.ts +++ /dev/null @@ -1,62 +0,0 @@ -// Type definitions for Survey JavaScript library v0.9.12 -// Project: http://surveyjs.org/ -// Definitions by: Andrew Telnov - -import { QuestionBase } from './questionbase'; -import { SurveyError } from "./base"; -import { SurveyValidator, IValidatorOwner } from "./validator"; -export declare class Question extends QuestionBase implements IValidatorOwner { - name: string; - private titleValue; - private questionValue; - private questionComment; - private isRequiredValue; - private hasCommentValue; - private hasOtherValue; - private commentTextValue; - private textPreProcessor; - errors: Array; - validators: Array; - valueChangedCallback: () => void; - commentChangedCallback: () => void; - errorsChangedCallback: () => void; - titleChangedCallback: () => void; - constructor(name: string); - hasTitle: boolean; - title: string; - processedTitle: string; - fullTitle: string; - protected canProcessedTextValues(name: string): boolean; - protected getProcessedTextValue(name: string): any; - supportComment(): boolean; - supportOther(): boolean; - isRequired: boolean; - hasComment: boolean; - commentText: string; - hasOther: boolean; - protected hasOtherChanged(): void; - protected no: string; - protected onSetData(): void; - value: any; - comment: string; - protected getComment(): string; - protected setComment(newValue: string): void; - isEmpty(): boolean; - hasErrors(fireCallback?: boolean): boolean; - requiredText: string; - private checkForErrors(fireCallback); - protected onCheckForErrors(errors: Array): void; - protected hasRequiredError(): boolean; - protected runValidators(): SurveyError; - private isValueChangedInSurvey; - protected setNewValue(newValue: any): void; - protected setNewValueInData(newValue: any): void; - private getValueCore(); - private setValueCore(newValue); - protected valueFromData(val: any): any; - protected valueToData(val: any): any; - protected onValueChanged(): void; - protected setNewComment(newValue: string): void; - onSurveyValueChanged(newValue: any): void; - getValidatorTitle(): string; -} diff --git a/lib_typings/question_baseselect.d.ts b/lib_typings/question_baseselect.d.ts deleted file mode 100644 index f0294ff0b2..0000000000 --- a/lib_typings/question_baseselect.d.ts +++ /dev/null @@ -1,53 +0,0 @@ -// Type definitions for Survey JavaScript library v0.9.12 -// Project: http://surveyjs.org/ -// Definitions by: Andrew Telnov - -import { Question } from "./question"; -import { ItemValue, SurveyError } from "./base"; -import { ChoicesRestfull } from "./choicesRestfull"; -export declare class QuestionSelectBase extends Question { - private commentValue; - protected cachedValue: any; - otherItem: ItemValue; - private choicesFromUrl; - private choicesValues; - choicesByUrl: ChoicesRestfull; - otherErrorText: string; - storeOthersAsComment: boolean; - choicesOrderValue: string; - choicesChangedCallback: () => void; - constructor(name: string); - isOtherSelected: boolean; - protected getHasOther(val: any): boolean; - protected createRestfull(): ChoicesRestfull; - protected getComment(): string; - private isSettingComment; - protected setComment(newValue: string): void; - protected valueFromData(val: any): any; - protected valueToData(val: any): any; - protected valueFromDataCore(val: any): any; - protected valueToDataCore(val: any): any; - protected hasUnknownValue(val: any): boolean; - choices: Array; - protected hasOtherChanged(): void; - choicesOrder: string; - otherText: string; - visibleChoices: Array; - private activeChoices; - supportComment(): boolean; - supportOther(): boolean; - protected onCheckForErrors(errors: Array): void; - protected getStoreOthersAsComment(): boolean; - onSurveyLoad(): void; - private onLoadChoicesFromUrl(array); - private sortVisibleChoices(array); - private sortArray(array, mult); - private randomizeArray(array); -} -export declare class QuestionCheckboxBase extends QuestionSelectBase { - name: string; - private colCountValue; - colCountChangedCallback: () => void; - constructor(name: string); - colCount: number; -} diff --git a/lib_typings/question_checkbox.d.ts b/lib_typings/question_checkbox.d.ts deleted file mode 100644 index adda8ade13..0000000000 --- a/lib_typings/question_checkbox.d.ts +++ /dev/null @@ -1,13 +0,0 @@ -// Type definitions for Survey JavaScript library v0.9.12 -// Project: http://surveyjs.org/ -// Definitions by: Andrew Telnov - -import { QuestionCheckboxBase } from "./question_baseselect"; -export declare class QuestionCheckboxModel extends QuestionCheckboxBase { - name: string; - constructor(name: string); - protected getHasOther(val: any): boolean; - protected valueFromDataCore(val: any): any; - protected valueToDataCore(val: any): any; - getType(): string; -} diff --git a/lib_typings/question_comment.d.ts b/lib_typings/question_comment.d.ts deleted file mode 100644 index b7bafb791f..0000000000 --- a/lib_typings/question_comment.d.ts +++ /dev/null @@ -1,13 +0,0 @@ -// Type definitions for Survey JavaScript library v0.9.12 -// Project: http://surveyjs.org/ -// Definitions by: Andrew Telnov - -import { Question } from "./question"; -export declare class QuestionCommentModel extends Question { - name: string; - rows: number; - cols: number; - constructor(name: string); - getType(): string; - isEmpty(): boolean; -} diff --git a/lib_typings/question_dropdown.d.ts b/lib_typings/question_dropdown.d.ts deleted file mode 100644 index 5ec4d3297a..0000000000 --- a/lib_typings/question_dropdown.d.ts +++ /dev/null @@ -1,13 +0,0 @@ -// Type definitions for Survey JavaScript library v0.9.12 -// Project: http://surveyjs.org/ -// Definitions by: Andrew Telnov - -import { QuestionSelectBase } from "./question_baseselect"; -export declare class QuestionDropdownModel extends QuestionSelectBase { - name: string; - private optionsCaptionValue; - constructor(name: string); - optionsCaption: string; - getType(): string; - supportGoNextPageAutomatic(): boolean; -} diff --git a/lib_typings/question_file.d.ts b/lib_typings/question_file.d.ts deleted file mode 100644 index 637e82973b..0000000000 --- a/lib_typings/question_file.d.ts +++ /dev/null @@ -1,25 +0,0 @@ -// Type definitions for Survey JavaScript library v0.9.12 -// Project: http://surveyjs.org/ -// Definitions by: Andrew Telnov - -import { Question } from "./question"; -import { SurveyError } from "./base"; -export declare class QuestionFileModel extends Question { - name: string; - private showPreviewValue; - private isUploading; - previewValueLoadedCallback: () => void; - imageHeight: string; - imageWidth: string; - storeDataAsText: boolean; - maxSize: number; - constructor(name: string); - getType(): string; - showPreview: boolean; - loadFile(file: File): void; - previewValue: any; - protected setFileValue(file: File): void; - protected onCheckForErrors(errors: Array): void; - private checkFileForErrors(file); - private isFileImage(file); -} diff --git a/lib_typings/question_html.d.ts b/lib_typings/question_html.d.ts deleted file mode 100644 index c5a2ba7797..0000000000 --- a/lib_typings/question_html.d.ts +++ /dev/null @@ -1,13 +0,0 @@ -// Type definitions for Survey JavaScript library v0.9.12 -// Project: http://surveyjs.org/ -// Definitions by: Andrew Telnov - -import { QuestionBase } from "./questionbase"; -export declare class QuestionHtmlModel extends QuestionBase { - name: string; - private htmlValue; - constructor(name: string); - getType(): string; - html: string; - processedHtml: string; -} diff --git a/lib_typings/question_matrix.d.ts b/lib_typings/question_matrix.d.ts deleted file mode 100644 index 38db0e3113..0000000000 --- a/lib_typings/question_matrix.d.ts +++ /dev/null @@ -1,39 +0,0 @@ -// Type definitions for Survey JavaScript library v0.9.12 -// Project: http://surveyjs.org/ -// Definitions by: Andrew Telnov - -import { Base } from "./base"; -import { Question } from "./question"; -import { SurveyError } from "./base"; -export interface IMatrixData { - onMatrixRowChanged(row: MatrixRowModel): any; -} -export declare class MatrixRowModel extends Base { - name: any; - text: string; - fullName: string; - private data; - protected rowValue: any; - constructor(name: any, text: string, fullName: string, data: IMatrixData, value: any); - value: any; - protected onValueChanged(): void; -} -export declare class QuestionMatrixModel extends Question implements IMatrixData { - name: string; - private columnsValue; - private rowsValue; - private isRowChanging; - private generatedVisibleRows; - isAllRowRequired: boolean; - constructor(name: string); - getType(): string; - hasRows: boolean; - columns: Array; - rows: Array; - visibleRows: Array; - protected onCheckForErrors(errors: Array): void; - private hasErrorInRows(); - protected createMatrixRow(name: any, text: string, fullName: string, value: any): MatrixRowModel; - protected onValueChanged(): void; - onMatrixRowChanged(row: MatrixRowModel): void; -} diff --git a/lib_typings/question_matrixdropdown.d.ts b/lib_typings/question_matrixdropdown.d.ts deleted file mode 100644 index 8c0cd3168a..0000000000 --- a/lib_typings/question_matrixdropdown.d.ts +++ /dev/null @@ -1,20 +0,0 @@ -// Type definitions for Survey JavaScript library v0.9.12 -// Project: http://surveyjs.org/ -// Definitions by: Andrew Telnov - -import { QuestionMatrixDropdownModelBase, MatrixDropdownRowModelBase, IMatrixDropdownData } from "./question_matrixdropdownbase"; -export declare class MatrixDropdownRowModel extends MatrixDropdownRowModelBase { - name: any; - text: string; - constructor(name: any, text: string, data: IMatrixDropdownData, value: any); - rowName: any; -} -export declare class QuestionMatrixDropdownModel extends QuestionMatrixDropdownModelBase implements IMatrixDropdownData { - name: string; - private rowsValue; - constructor(name: string); - getType(): string; - rows: Array; - protected generateRows(): Array; - protected createMatrixRow(name: any, text: string, value: any): MatrixDropdownRowModel; -} diff --git a/lib_typings/question_matrixdropdownbase.d.ts b/lib_typings/question_matrixdropdownbase.d.ts deleted file mode 100644 index f00e520dd9..0000000000 --- a/lib_typings/question_matrixdropdownbase.d.ts +++ /dev/null @@ -1,102 +0,0 @@ -// Type definitions for Survey JavaScript library v0.9.12 -// Project: http://surveyjs.org/ -// Definitions by: Andrew Telnov - -import { Question } from "./question"; -import { Base, ISurveyData } from "./base"; -import { QuestionDropdownModel } from "./question_dropdown"; -import { QuestionCheckboxModel } from "./question_checkbox"; -import { QuestionRadiogroupModel } from "./question_radiogroup"; -import { QuestionTextModel } from "./question_text"; -import { QuestionCommentModel } from "./question_comment"; -export interface IMatrixDropdownData { - onRowChanged(cell: MatrixDropdownRowModelBase, newRowValue: any): any; - columns: Array; - createQuestion(row: MatrixDropdownRowModelBase, column: MatrixDropdownColumn): Question; -} -export declare class MatrixDropdownColumn extends Base { - name: string; - private choicesValue; - private titleValue; - optionsCaption: string; - isRequired: boolean; - hasOther: boolean; - minWidth: string; - cellType: string; - private colCountValue; - constructor(name: string, title?: string); - getType(): string; - title: string; - choices: Array; - colCount: number; -} -export declare class MatrixDropdownCell { - column: MatrixDropdownColumn; - row: MatrixDropdownRowModelBase; - private questionValue; - constructor(column: MatrixDropdownColumn, row: MatrixDropdownRowModelBase, data: IMatrixDropdownData); - question: Question; - value: any; -} -export declare class MatrixDropdownRowModelBase implements ISurveyData { - protected data: IMatrixDropdownData; - private rowValues; - private rowComments; - private isSettingValue; - cells: Array; - constructor(data: IMatrixDropdownData, value: any); - rowName: any; - value: any; - getValue(name: string): any; - setValue(name: string, newValue: any): void; - getComment(name: string): string; - setComment(name: string, newValue: string): void; - isEmpty: boolean; - private buildCells(); - protected createCell(column: MatrixDropdownColumn): MatrixDropdownCell; -} -export declare class QuestionMatrixDropdownModelBase extends Question implements IMatrixDropdownData { - name: string; - private columnsValue; - private choicesValue; - private optionsCaptionValue; - private isRowChanging; - protected generatedVisibleRows: Array; - private cellTypeValue; - private columnColCountValue; - columnMinWidth: string; - horizontalScroll: boolean; - columnsChangedCallback: () => void; - updateCellsCallbak: () => void; - constructor(name: string); - getType(): string; - columns: Array; - cellType: string; - columnColCount: number; - getColumnTitle(column: MatrixDropdownColumn): string; - getColumnWidth(column: MatrixDropdownColumn): string; - choices: Array; - optionsCaption: string; - addColumn(name: string, title?: string): MatrixDropdownColumn; - visibleRows: Array; - protected generateRows(): Array; - protected createMatrixRow(name: any, text: string, value: any): MatrixDropdownRowModelBase; - protected createNewValue(curValue: any): any; - protected getRowValue(row: MatrixDropdownRowModelBase, questionValue: any, create?: boolean): any; - protected onValueChanged(): void; - hasErrors(fireCallback?: boolean): boolean; - private hasErrorInColumns(fireCallback); - createQuestion(row: MatrixDropdownRowModelBase, column: MatrixDropdownColumn): Question; - protected createQuestionCore(row: MatrixDropdownRowModelBase, column: MatrixDropdownColumn): Question; - protected getQuestionName(row: MatrixDropdownRowModelBase, column: MatrixDropdownColumn): string; - protected getColumnChoices(column: MatrixDropdownColumn): Array; - protected getColumnOptionsCaption(column: MatrixDropdownColumn): string; - protected createDropdown(name: string, column: MatrixDropdownColumn): QuestionDropdownModel; - protected createCheckbox(name: string, column: MatrixDropdownColumn): QuestionCheckboxModel; - protected createRadiogroup(name: string, column: MatrixDropdownColumn): QuestionRadiogroupModel; - protected createText(name: string, column: MatrixDropdownColumn): QuestionTextModel; - protected createComment(name: string, column: MatrixDropdownColumn): QuestionCommentModel; - protected createCellQuestion(questionType: string, name: string): Question; - protected deleteRowValue(newValue: any, row: MatrixDropdownRowModelBase): any; - onRowChanged(row: MatrixDropdownRowModelBase, newRowValue: any): void; -} diff --git a/lib_typings/question_matrixdynamic.d.ts b/lib_typings/question_matrixdynamic.d.ts deleted file mode 100644 index 7a7e29ac5b..0000000000 --- a/lib_typings/question_matrixdynamic.d.ts +++ /dev/null @@ -1,37 +0,0 @@ -// Type definitions for Survey JavaScript library v0.9.12 -// Project: http://surveyjs.org/ -// Definitions by: Andrew Telnov - -import { QuestionMatrixDropdownModelBase, MatrixDropdownRowModelBase, IMatrixDropdownData } from "./question_matrixdropdownbase"; -import { SurveyError } from "./base"; -export declare class MatrixDynamicRowModel extends MatrixDropdownRowModelBase { - index: number; - constructor(index: number, data: IMatrixDropdownData, value: any); - rowName: string; -} -export declare class QuestionMatrixDynamicModel extends QuestionMatrixDropdownModelBase implements IMatrixDropdownData { - name: string; - static MaxRowCount: number; - private rowCounter; - private rowCountValue; - private addRowTextValue; - private removeRowTextValue; - minRowCount: number; - rowCountChangedCallback: () => void; - constructor(name: string); - getType(): string; - rowCount: number; - addRow(): void; - removeRow(index: number): void; - addRowText: string; - removeRowText: string; - cachedVisibleRows: Array; - protected onCheckForErrors(errors: Array): void; - private hasErrorInRows(); - protected generateRows(): Array; - protected createMatrixRow(value: any): MatrixDynamicRowModel; - protected createNewValue(curValue: any): any; - protected deleteRowValue(newValue: any, row: MatrixDropdownRowModelBase): any; - private getRowValueByIndex(questionValue, index); - protected getRowValue(row: MatrixDropdownRowModelBase, questionValue: any, create?: boolean): any; -} diff --git a/lib_typings/question_multipletext.d.ts b/lib_typings/question_multipletext.d.ts deleted file mode 100644 index 5f5a9e873c..0000000000 --- a/lib_typings/question_multipletext.d.ts +++ /dev/null @@ -1,45 +0,0 @@ -// Type definitions for Survey JavaScript library v0.9.12 -// Project: http://surveyjs.org/ -// Definitions by: Andrew Telnov - -import { Base } from "./base"; -import { SurveyValidator, IValidatorOwner } from "./validator"; -import { Question } from "./question"; -import { SurveyError } from "./base"; -export interface IMultipleTextData { - getMultipleTextValue(name: string): any; - setMultipleTextValue(name: string, value: any): any; -} -export declare class MultipleTextItemModel extends Base implements IValidatorOwner { - name: any; - private data; - private titleValue; - validators: Array; - constructor(name?: any, title?: string); - getType(): string; - setData(data: IMultipleTextData): void; - title: string; - value: any; - onValueChanged(newValue: any): void; - getValidatorTitle(): string; -} -export declare class QuestionMultipleTextModel extends Question implements IMultipleTextData { - name: string; - private colCountValue; - colCountChangedCallback: () => void; - itemSize: number; - private itemsValues; - constructor(name: string); - getType(): string; - items: Array; - AddItem(name: string, title?: string): MultipleTextItemModel; - colCount: number; - getRows(): Array; - private isMultipleItemValueChanging; - protected onValueChanged(): void; - protected createTextItem(name: string, title: string): MultipleTextItemModel; - protected onItemValueChanged(): void; - protected runValidators(): SurveyError; - getMultipleTextValue(name: string): any; - setMultipleTextValue(name: string, value: any): void; -} diff --git a/lib_typings/question_radiogroup.d.ts b/lib_typings/question_radiogroup.d.ts deleted file mode 100644 index 507e150d2a..0000000000 --- a/lib_typings/question_radiogroup.d.ts +++ /dev/null @@ -1,11 +0,0 @@ -// Type definitions for Survey JavaScript library v0.9.12 -// Project: http://surveyjs.org/ -// Definitions by: Andrew Telnov - -import { QuestionCheckboxBase } from "./question_baseselect"; -export declare class QuestionRadiogroupModel extends QuestionCheckboxBase { - name: string; - constructor(name: string); - getType(): string; - supportGoNextPageAutomatic(): boolean; -} diff --git a/lib_typings/question_rating.d.ts b/lib_typings/question_rating.d.ts deleted file mode 100644 index 5fe11a823b..0000000000 --- a/lib_typings/question_rating.d.ts +++ /dev/null @@ -1,21 +0,0 @@ -// Type definitions for Survey JavaScript library v0.9.12 -// Project: http://surveyjs.org/ -// Definitions by: Andrew Telnov - -import { ItemValue } from "./base"; -import { Question } from "./question"; -export declare class QuestionRatingModel extends Question { - name: string; - static defaultRateValues: ItemValue[]; - private rates; - mininumRateDescription: string; - maximumRateDescription: string; - rateValuesChangedCallback: () => void; - constructor(name: string); - rateValues: Array; - visibleRateValues: ItemValue[]; - getType(): string; - supportComment(): boolean; - supportOther(): boolean; - supportGoNextPageAutomatic(): boolean; -} diff --git a/lib_typings/question_text.d.ts b/lib_typings/question_text.d.ts deleted file mode 100644 index a1cf36d0eb..0000000000 --- a/lib_typings/question_text.d.ts +++ /dev/null @@ -1,13 +0,0 @@ -// Type definitions for Survey JavaScript library v0.9.12 -// Project: http://surveyjs.org/ -// Definitions by: Andrew Telnov - -import { Question } from "./question"; -export declare class QuestionTextModel extends Question { - name: string; - size: number; - constructor(name: string); - getType(): string; - isEmpty(): boolean; - supportGoNextPageAutomatic(): boolean; -} diff --git a/lib_typings/questionbase.d.ts b/lib_typings/questionbase.d.ts deleted file mode 100644 index 1a309f221b..0000000000 --- a/lib_typings/questionbase.d.ts +++ /dev/null @@ -1,46 +0,0 @@ -// Type definitions for Survey JavaScript library v0.9.12 -// Project: http://surveyjs.org/ -// Definitions by: Andrew Telnov - -import { Base, IQuestion, IConditionRunner, ISurveyData, ISurvey, HashTable } from './base'; -export declare class QuestionBase extends Base implements IQuestion, IConditionRunner { - name: string; - private static questionCounter; - private static getQuestionId(); - protected data: ISurveyData; - protected survey: ISurvey; - private conditionRunner; - visibleIf: string; - private idValue; - private visibleValue; - startWithNewLine: boolean; - private visibleIndexValue; - width: string; - private renderWidthValue; - private rightIndentValue; - indent: number; - focusCallback: () => void; - renderWidthChangedCallback: () => void; - rowVisibilityChangedCallback: () => void; - visibilityChangedCallback: () => void; - visibleIndexChangedCallback: () => void; - constructor(name: string); - visible: boolean; - visibleIndex: number; - hasErrors(fireCallback?: boolean): boolean; - hasTitle: boolean; - hasComment: boolean; - id: string; - renderWidth: string; - rightIndent: number; - focus(): void; - setData(newValue: ISurveyData): void; - protected fireCallback(callback: () => void): void; - protected onSetData(): void; - protected onCreating(): void; - runCondition(values: HashTable): void; - onSurveyValueChanged(newValue: any): void; - onSurveyLoad(): void; - setVisibleIndex(value: number): void; - supportGoNextPageAutomatic(): boolean; -} diff --git a/lib_typings/questionfactory.d.ts b/lib_typings/questionfactory.d.ts deleted file mode 100644 index 2447d73ed5..0000000000 --- a/lib_typings/questionfactory.d.ts +++ /dev/null @@ -1,13 +0,0 @@ -// Type definitions for Survey JavaScript library v0.9.12 -// Project: http://surveyjs.org/ -// Definitions by: Andrew Telnov - -import { QuestionBase } from './questionbase'; -export declare class QuestionFactory { - static Instance: QuestionFactory; - static DefaultChoices: string[]; - private creatorHash; - registerQuestion(questionType: string, questionCreator: (name: string) => QuestionBase): void; - getAllTypes(): Array; - createQuestion(questionType: string, name: string): QuestionBase; -} diff --git a/lib_typings/react/reactSurvey.d.ts b/lib_typings/react/reactSurvey.d.ts deleted file mode 100644 index c5771c1306..0000000000 --- a/lib_typings/react/reactSurvey.d.ts +++ /dev/null @@ -1,29 +0,0 @@ -// Type definitions for Survey JavaScript library v0.9.12 -// Project: http://surveyjs.org/ -// Definitions by: Andrew Telnov - -import * as React from "react"; -import { ReactSurveyModel } from "./reactsurveymodel"; -import { QuestionBase } from "../questionbase"; -import { ISurveyCreator } from "./reactquestion"; -export declare class Survey extends React.Component implements ISurveyCreator { - static cssType: string; - protected survey: ReactSurveyModel; - constructor(props: any); - componentWillReceiveProps(nextProps: any): void; - render(): JSX.Element; - css: any; - protected renderCompleted(): JSX.Element; - protected renderLoading(): JSX.Element; - protected renderSurvey(): JSX.Element; - protected renderTitle(): JSX.Element; - protected renderPage(): JSX.Element; - protected renderProgress(isTop: boolean): JSX.Element; - protected renderNavigation(): JSX.Element; - protected renderEmptySurvey(): JSX.Element; - protected updateSurvey(newProps: any): void; - protected setSurveyEvents(newProps: any): void; - createQuestionElement(question: QuestionBase): JSX.Element; - renderError(key: string, errorText: string): JSX.Element; - questionTitleLocation(): string; -} diff --git a/lib_typings/react/reactSurveyNavigation.d.ts b/lib_typings/react/reactSurveyNavigation.d.ts deleted file mode 100644 index 7475b4ec83..0000000000 --- a/lib_typings/react/reactSurveyNavigation.d.ts +++ /dev/null @@ -1,16 +0,0 @@ -// Type definitions for Survey JavaScript library v0.9.12 -// Project: http://surveyjs.org/ -// Definitions by: Andrew Telnov - -import * as React from 'react'; -export declare class SurveyNavigation extends React.Component { - private survey; - protected css: any; - constructor(props: any); - componentWillReceiveProps(nextProps: any): void; - handlePrevClick(event: any): void; - handleNextClick(event: any): void; - handleCompleteClick(event: any): void; - render(): JSX.Element; - protected renderButton(click: any, text: string, btnClassName: string): JSX.Element; -} diff --git a/lib_typings/react/reactSurveyProgress.d.ts b/lib_typings/react/reactSurveyProgress.d.ts deleted file mode 100644 index fd8fb55c38..0000000000 --- a/lib_typings/react/reactSurveyProgress.d.ts +++ /dev/null @@ -1,15 +0,0 @@ -// Type definitions for Survey JavaScript library v0.9.12 -// Project: http://surveyjs.org/ -// Definitions by: Andrew Telnov - -import * as React from 'react'; -export declare class SurveyProgress extends React.Component { - private survey; - protected isTop: boolean; - protected css: any; - constructor(props: any); - componentWillReceiveProps(nextProps: any): void; - protected progress: number; - protected progressText: string; - render(): JSX.Element; -} diff --git a/lib_typings/react/reactSurveyWindow.d.ts b/lib_typings/react/reactSurveyWindow.d.ts deleted file mode 100644 index 64e3f340c2..0000000000 --- a/lib_typings/react/reactSurveyWindow.d.ts +++ /dev/null @@ -1,14 +0,0 @@ -// Type definitions for Survey JavaScript library v0.9.12 -// Project: http://surveyjs.org/ -// Definitions by: Andrew Telnov - -import { Survey } from "./reactSurvey"; -export declare class SurveyWindow extends Survey { - private title; - constructor(props: any); - handleOnExpanded(event: any): void; - render(): JSX.Element; - protected renderHeader(): JSX.Element; - protected renderBody(): JSX.Element; - protected updateSurvey(newProps: any): void; -} diff --git a/lib_typings/react/reactpage.d.ts b/lib_typings/react/reactpage.d.ts deleted file mode 100644 index d567a9a5c0..0000000000 --- a/lib_typings/react/reactpage.d.ts +++ /dev/null @@ -1,29 +0,0 @@ -// Type definitions for Survey JavaScript library v0.9.12 -// Project: http://surveyjs.org/ -// Definitions by: Andrew Telnov - -import * as React from 'react'; -import { QuestionRowModel } from "../page"; -import { QuestionBase } from "../questionbase"; -export declare class SurveyPage extends React.Component { - private page; - private survey; - private creator; - protected css: any; - constructor(props: any); - componentWillReceiveProps(nextProps: any): void; - render(): JSX.Element; - protected createRow(row: QuestionRowModel, index: number): JSX.Element; - protected renderTitle(): JSX.Element; -} -export declare class SurveyRow extends React.Component { - private row; - private survey; - private creator; - protected css: any; - constructor(props: any); - componentWillReceiveProps(nextProps: any): void; - private setProperties(props); - render(): JSX.Element; - protected createQuestion(question: QuestionBase): JSX.Element; -} diff --git a/lib_typings/react/reactquestion.d.ts b/lib_typings/react/reactquestion.d.ts deleted file mode 100644 index a8dfcc4636..0000000000 --- a/lib_typings/react/reactquestion.d.ts +++ /dev/null @@ -1,34 +0,0 @@ -// Type definitions for Survey JavaScript library v0.9.12 -// Project: http://surveyjs.org/ -// Definitions by: Andrew Telnov - -import * as React from 'react'; -import { QuestionBase } from '../questionbase'; -import { Question } from '../question'; -export interface ISurveyCreator { - createQuestionElement(question: QuestionBase): JSX.Element; - renderError(key: string, errorText: string): JSX.Element; - questionTitleLocation(): string; -} -export declare class SurveyQuestion extends React.Component { - private questionBase; - protected question: Question; - private creator; - protected css: any; - constructor(props: any); - componentWillReceiveProps(nextProps: any): void; - private setQuestion(question); - render(): JSX.Element; - protected renderTitle(): JSX.Element; - protected renderComment(): JSX.Element; - protected renderErrors(): JSX.Element; -} -export declare class SurveyQuestionErrors extends React.Component { - protected question: Question; - private creator; - protected css: any; - constructor(props: any); - componentWillReceiveProps(nextProps: any): void; - private setQuestion(question); - render(): JSX.Element; -} diff --git a/lib_typings/react/reactquestioncheckbox.d.ts b/lib_typings/react/reactquestioncheckbox.d.ts deleted file mode 100644 index 2f7e8ea0c9..0000000000 --- a/lib_typings/react/reactquestioncheckbox.d.ts +++ /dev/null @@ -1,32 +0,0 @@ -// Type definitions for Survey JavaScript library v0.9.12 -// Project: http://surveyjs.org/ -// Definitions by: Andrew Telnov - -import * as React from 'react'; -import { QuestionCheckboxModel } from "../question_checkbox"; -import { ItemValue } from "../base"; -export declare class SurveyQuestionCheckbox extends React.Component { - protected question: QuestionCheckboxModel; - protected css: any; - protected rootCss: any; - constructor(props: any); - componentWillReceiveProps(nextProps: any): void; - render(): JSX.Element; - protected getItems(): Array; - protected textStyle: any; - protected renderItem(key: string, item: any): JSX.Element; -} -export declare class SurveyQuestionCheckboxItem extends React.Component { - protected question: QuestionCheckboxModel; - protected item: ItemValue; - protected css: any; - protected rootCss: any; - protected textStyle: any; - constructor(props: any); - componentWillReceiveProps(nextProps: any): void; - handleOnChange(event: any): void; - render(): JSX.Element; - protected inputStyle: any; - protected renderCheckbox(isChecked: boolean, divStyle: any, otherItem: JSX.Element): JSX.Element; - protected renderOther(): JSX.Element; -} diff --git a/lib_typings/react/reactquestioncomment.d.ts b/lib_typings/react/reactquestioncomment.d.ts deleted file mode 100644 index 9335f00198..0000000000 --- a/lib_typings/react/reactquestioncomment.d.ts +++ /dev/null @@ -1,23 +0,0 @@ -// Type definitions for Survey JavaScript library v0.9.12 -// Project: http://surveyjs.org/ -// Definitions by: Andrew Telnov - -import * as React from 'react'; -export declare class SurveyQuestionComment extends React.Component { - private question; - protected css: any; - constructor(props: any); - handleOnChange(event: any): void; - componentWillReceiveProps(nextProps: any): void; - render(): JSX.Element; -} -export declare class SurveyQuestionCommentItem extends React.Component { - private question; - private comment; - protected css: any; - constructor(props: any); - handleOnChange(event: any): void; - handleOnBlur(event: any): void; - componentWillReceiveProps(nextProps: any): void; - render(): JSX.Element; -} diff --git a/lib_typings/react/reactquestiondropdown.d.ts b/lib_typings/react/reactquestiondropdown.d.ts deleted file mode 100644 index 5b0cae4bdd..0000000000 --- a/lib_typings/react/reactquestiondropdown.d.ts +++ /dev/null @@ -1,15 +0,0 @@ -// Type definitions for Survey JavaScript library v0.9.12 -// Project: http://surveyjs.org/ -// Definitions by: Andrew Telnov - -import * as React from 'react'; -export declare class SurveyQuestionDropdown extends React.Component { - private question; - protected css: any; - protected rootCss: any; - constructor(props: any); - handleOnChange(event: any): void; - componentWillReceiveProps(nextProps: any): void; - render(): JSX.Element; - protected renderOther(): JSX.Element; -} diff --git a/lib_typings/react/reactquestionfactory.d.ts b/lib_typings/react/reactquestionfactory.d.ts deleted file mode 100644 index 007d92ea04..0000000000 --- a/lib_typings/react/reactquestionfactory.d.ts +++ /dev/null @@ -1,12 +0,0 @@ -// Type definitions for Survey JavaScript library v0.9.12 -// Project: http://surveyjs.org/ -// Definitions by: Andrew Telnov - -export declare class ReactQuestionFactory { - static Instance: ReactQuestionFactory; - static DefaultChoices: string[]; - private creatorHash; - registerQuestion(questionType: string, questionCreator: (name: string) => JSX.Element): void; - getAllTypes(): Array; - createQuestion(questionType: string, params: any): JSX.Element; -} diff --git a/lib_typings/react/reactquestionfile.d.ts b/lib_typings/react/reactquestionfile.d.ts deleted file mode 100644 index d1789d4bfa..0000000000 --- a/lib_typings/react/reactquestionfile.d.ts +++ /dev/null @@ -1,14 +0,0 @@ -// Type definitions for Survey JavaScript library v0.9.12 -// Project: http://surveyjs.org/ -// Definitions by: Andrew Telnov - -import * as React from 'react'; -export declare class SurveyQuestionFile extends React.Component { - private question; - protected css: any; - constructor(props: any); - handleOnChange(event: any): void; - componentWillReceiveProps(nextProps: any): void; - render(): JSX.Element; - protected renderImage(): JSX.Element; -} diff --git a/lib_typings/react/reactquestionhtml.d.ts b/lib_typings/react/reactquestionhtml.d.ts deleted file mode 100644 index 7f0e774f46..0000000000 --- a/lib_typings/react/reactquestionhtml.d.ts +++ /dev/null @@ -1,11 +0,0 @@ -// Type definitions for Survey JavaScript library v0.9.12 -// Project: http://surveyjs.org/ -// Definitions by: Andrew Telnov - -import * as React from 'react'; -export declare class SurveyQuestionHtml extends React.Component { - private question; - constructor(props: any); - componentWillReceiveProps(nextProps: any): void; - render(): JSX.Element; -} diff --git a/lib_typings/react/reactquestionmatrix.d.ts b/lib_typings/react/reactquestionmatrix.d.ts deleted file mode 100644 index 3b57078a25..0000000000 --- a/lib_typings/react/reactquestionmatrix.d.ts +++ /dev/null @@ -1,20 +0,0 @@ -// Type definitions for Survey JavaScript library v0.9.12 -// Project: http://surveyjs.org/ -// Definitions by: Andrew Telnov - -import * as React from 'react'; -export declare class SurveyQuestionMatrix extends React.Component { - private question; - protected css: any; - constructor(props: any); - componentWillReceiveProps(nextProps: any): void; - render(): JSX.Element; -} -export declare class SurveyQuestionMatrixRow extends React.Component { - private question; - private row; - constructor(props: any); - handleOnChange(event: any): void; - componentWillReceiveProps(nextProps: any): void; - render(): JSX.Element; -} diff --git a/lib_typings/react/reactquestionmatrixdropdown.d.ts b/lib_typings/react/reactquestionmatrixdropdown.d.ts deleted file mode 100644 index 6622b35c8e..0000000000 --- a/lib_typings/react/reactquestionmatrixdropdown.d.ts +++ /dev/null @@ -1,28 +0,0 @@ -// Type definitions for Survey JavaScript library v0.9.12 -// Project: http://surveyjs.org/ -// Definitions by: Andrew Telnov - -import * as React from 'react'; -import { ISurveyCreator } from "./reactquestion"; -import { MatrixDropdownCell } from "../question_matrixdropdownbase"; -export declare class SurveyQuestionMatrixDropdown extends React.Component { - private question; - protected css: any; - protected rootCss: any; - protected creator: ISurveyCreator; - constructor(props: any); - componentWillReceiveProps(nextProps: any): void; - private setProperties(nextProps); - render(): JSX.Element; -} -export declare class SurveyQuestionMatrixDropdownRow extends React.Component { - private row; - protected css: any; - protected rootCss: any; - protected creator: ISurveyCreator; - constructor(props: any); - componentWillReceiveProps(nextProps: any): void; - private setProperties(nextProps); - render(): JSX.Element; - protected renderSelect(cell: MatrixDropdownCell): JSX.Element; -} diff --git a/lib_typings/react/reactquestionmatrixdynamic.d.ts b/lib_typings/react/reactquestionmatrixdynamic.d.ts deleted file mode 100644 index 39be0b0c9d..0000000000 --- a/lib_typings/react/reactquestionmatrixdynamic.d.ts +++ /dev/null @@ -1,34 +0,0 @@ -// Type definitions for Survey JavaScript library v0.9.12 -// Project: http://surveyjs.org/ -// Definitions by: Andrew Telnov - -import * as React from 'react'; -import { ISurveyCreator } from "./reactquestion"; -import { MatrixDropdownCell } from "../question_matrixdropdownbase"; -export declare class SurveyQuestionMatrixDynamic extends React.Component { - private question; - protected css: any; - protected rootCss: any; - protected creator: ISurveyCreator; - constructor(props: any); - componentWillReceiveProps(nextProps: any): void; - private setProperties(nextProps); - handleOnRowAddClick(event: any): void; - render(): JSX.Element; - protected renderAddRowButton(): JSX.Element; -} -export declare class SurveyQuestionMatrixDynamicRow extends React.Component { - private row; - private question; - private index; - protected css: any; - protected rootCss: any; - protected creator: ISurveyCreator; - constructor(props: any); - componentWillReceiveProps(nextProps: any): void; - private setProperties(nextProps); - handleOnRowRemoveClick(event: any): void; - render(): JSX.Element; - protected renderQuestion(cell: MatrixDropdownCell): JSX.Element; - protected renderButton(): JSX.Element; -} diff --git a/lib_typings/react/reactquestionmultipletext.d.ts b/lib_typings/react/reactquestionmultipletext.d.ts deleted file mode 100644 index 0ed3ca3e27..0000000000 --- a/lib_typings/react/reactquestionmultipletext.d.ts +++ /dev/null @@ -1,24 +0,0 @@ -// Type definitions for Survey JavaScript library v0.9.12 -// Project: http://surveyjs.org/ -// Definitions by: Andrew Telnov - -import * as React from 'react'; -import { MultipleTextItemModel } from "../question_multipletext"; -export declare class SurveyQuestionMultipleText extends React.Component { - private question; - protected css: any; - constructor(props: any); - componentWillReceiveProps(nextProps: any): void; - render(): JSX.Element; - protected renderRow(key: string, items: Array): JSX.Element; - protected renderItem(item: MultipleTextItemModel): JSX.Element; -} -export declare class SurveyQuestionMultipleTextItem extends React.Component { - private item; - protected css: any; - constructor(props: any); - handleOnChange(event: any): void; - componentWillReceiveProps(nextProps: any): void; - render(): JSX.Element; - protected mainClassName: string; -} diff --git a/lib_typings/react/reactquestionradiogroup.d.ts b/lib_typings/react/reactquestionradiogroup.d.ts deleted file mode 100644 index 781e1ec6df..0000000000 --- a/lib_typings/react/reactquestionradiogroup.d.ts +++ /dev/null @@ -1,21 +0,0 @@ -// Type definitions for Survey JavaScript library v0.9.12 -// Project: http://surveyjs.org/ -// Definitions by: Andrew Telnov - -import * as React from 'react'; -import { QuestionRadiogroupModel } from "../question_radiogroup"; -import { ItemValue } from "../base"; -export declare class SurveyQuestionRadiogroup extends React.Component { - protected question: QuestionRadiogroupModel; - protected css: any; - protected rootCss: any; - constructor(props: any); - componentWillReceiveProps(nextProps: any): void; - handleOnChange(event: any): void; - render(): JSX.Element; - protected getItems(): Array; - protected textStyle: any; - private renderItem(key, item); - protected renderRadio(key: string, item: ItemValue, isChecked: boolean, divStyle: any, otherItem: JSX.Element): JSX.Element; - protected renderOther(): JSX.Element; -} diff --git a/lib_typings/react/reactquestionrating.d.ts b/lib_typings/react/reactquestionrating.d.ts deleted file mode 100644 index 22f2aa63ff..0000000000 --- a/lib_typings/react/reactquestionrating.d.ts +++ /dev/null @@ -1,17 +0,0 @@ -// Type definitions for Survey JavaScript library v0.9.12 -// Project: http://surveyjs.org/ -// Definitions by: Andrew Telnov - -import * as React from 'react'; -import { ItemValue } from "../base"; -export declare class SurveyQuestionRating extends React.Component { - private question; - protected css: any; - protected rootCss: any; - constructor(props: any); - handleOnChange(event: any): void; - componentWillReceiveProps(nextProps: any): void; - render(): JSX.Element; - protected renderItem(key: string, item: ItemValue, minText: string, maxText: string): JSX.Element; - protected renderOther(): JSX.Element; -} diff --git a/lib_typings/react/reactquestiontext.d.ts b/lib_typings/react/reactquestiontext.d.ts deleted file mode 100644 index dfd77bf078..0000000000 --- a/lib_typings/react/reactquestiontext.d.ts +++ /dev/null @@ -1,13 +0,0 @@ -// Type definitions for Survey JavaScript library v0.9.12 -// Project: http://surveyjs.org/ -// Definitions by: Andrew Telnov - -import * as React from 'react'; -export declare class SurveyQuestionText extends React.Component { - private question; - protected css: any; - constructor(props: any); - handleOnChange(event: any): void; - componentWillReceiveProps(nextProps: any): void; - render(): JSX.Element; -} diff --git a/lib_typings/react/reactsurveymodel.d.ts b/lib_typings/react/reactsurveymodel.d.ts deleted file mode 100644 index a052d7e396..0000000000 --- a/lib_typings/react/reactsurveymodel.d.ts +++ /dev/null @@ -1,13 +0,0 @@ -// Type definitions for Survey JavaScript library v0.9.12 -// Project: http://surveyjs.org/ -// Definitions by: Andrew Telnov - -import { SurveyModel } from "../survey"; -export declare class ReactSurveyModel extends SurveyModel { - renderCallback: () => void; - constructor(jsonObj?: any); - render(): void; - mergeCss(src: any, dest: any): void; - protected onLoadSurveyFromService(): void; - protected onLoadingSurveyFromService(): void; -} diff --git a/lib_typings/survey.d.ts b/lib_typings/survey.d.ts deleted file mode 100644 index bcc3723eac..0000000000 --- a/lib_typings/survey.d.ts +++ /dev/null @@ -1,153 +0,0 @@ -// Type definitions for Survey JavaScript library v0.9.12 -// Project: http://surveyjs.org/ -// Definitions by: Andrew Telnov - -import { Base, ISurvey, IQuestion, IPage, SurveyError, Event } from "./base"; -import { ISurveyTriggerOwner, SurveyTrigger } from "./trigger"; -import { PageModel } from "./page"; -import { JsonError } from "./jsonobject"; -export declare class SurveyModel extends Base implements ISurvey, ISurveyTriggerOwner { - surveyId: string; - surveyPostId: string; - clientId: string; - cookieName: string; - sendResultOnPageNext: boolean; - commentPrefix: string; - title: string; - showNavigationButtons: boolean; - showTitle: boolean; - showPageTitles: boolean; - completedHtml: string; - requiredText: string; - questionStartIndex: string; - questionTitleTemplate: string; - showProgressBar: string; - storeOthersAsComment: boolean; - goNextPageAutomatic: boolean; - pages: Array; - triggers: Array; - clearInvisibleValues: boolean; - private currentPageValue; - private valuesHash; - private variablesHash; - private pagePrevTextValue; - private pageNextTextValue; - private completeTextValue; - private showPageNumbersValue; - private showQuestionNumbersValue; - private questionTitleLocationValue; - private localeValue; - private isCompleted; - private isLoading; - private processedTextValues; - private textPreProcessor; - onComplete: Event<(sender: SurveyModel) => any, any>; - onPartialSend: Event<(sender: SurveyModel) => any, any>; - onCurrentPageChanged: Event<(sender: SurveyModel, options: any) => any, any>; - onValueChanged: Event<(sender: SurveyModel, options: any) => any, any>; - onVisibleChanged: Event<(sender: SurveyModel, options: any) => any, any>; - onPageVisibleChanged: Event<(sender: SurveyModel, options: any) => any, any>; - onQuestionAdded: Event<(sender: SurveyModel, options: any) => any, any>; - onQuestionRemoved: Event<(sender: SurveyModel, options: any) => any, any>; - onValidateQuestion: Event<(sender: SurveyModel, options: any) => any, any>; - onProcessHtml: Event<(sender: SurveyModel, options: any) => any, any>; - onSendResult: Event<(sender: SurveyModel, options: any) => any, any>; - onGetResult: Event<(sender: SurveyModel, options: any) => any, any>; - onUploadFile: Event<(sender: SurveyModel, options: any) => any, any>; - jsonErrors: Array; - mode: string; - constructor(jsonObj?: any); - getType(): string; - locale: string; - getLocString(str: string): any; - emptySurveyText: string; - pagePrevText: string; - pageNextText: string; - completeText: string; - showPageNumbers: boolean; - showQuestionNumbers: string; - questionTitleLocation: string; - data: any; - comments: any; - visiblePages: Array; - isEmpty: boolean; - PageCount: number; - visiblePageCount: number; - currentPage: PageModel; - state: string; - clear(): void; - protected mergeValues(src: any, dest: any): void; - protected currentPageChanged(newValue: PageModel, oldValue: PageModel): void; - getProgress(): number; - isDesignMode: boolean; - hasCookie: boolean; - setCookie(): void; - deleteCookie(): void; - nextPage(): boolean; - isCurrentPageHasErrors: boolean; - prevPage(): boolean; - completeLastPage(): boolean; - isFirstPage: boolean; - isLastPage: boolean; - doComplete(): void; - protected setCompleted(): void; - processedCompletedHtml: string; - processedLoadingHtml: string; - progressText: string; - uploadFile(name: string, file: File, storeDataAsText: boolean, uploadingCallback: (status: string) => any): boolean; - protected uploadFileCore(name: string, file: File, uploadingCallback: (status: string) => any): void; - getPage(index: number): PageModel; - addPage(page: PageModel): void; - addNewPage(name: string): PageModel; - removePage(page: PageModel): void; - getQuestionByName(name: string, caseInsensitive?: boolean): IQuestion; - getQuestionsByNames(names: string[], caseInsensitive?: boolean): IQuestion[]; - getPageByQuestion(question: IQuestion): PageModel; - getPageByName(name: string): PageModel; - getPagesByNames(names: string[]): PageModel[]; - getAllQuestions(visibleOnly?: boolean): Array; - protected createNewPage(name: string): PageModel; - private notifyQuestionOnValueChanged(name, newValue); - private notifyAllQuestionsOnValueChanged(); - protected doSurveyValueChanged(question: IQuestion, newValue: any): void; - private checkOnPageTriggers(); - private getCurrentPageQuestions(); - private checkTriggers(name, newValue, isOnNextPage); - private doQuestionsOnLoad(); - private runConditions(); - private runConditionsForList(list); - sendResult(postId?: string, clientId?: string, isPartialCompleted?: boolean): void; - getResult(resultId: string, name: string): void; - loadSurveyFromService(surveyId?: string): void; - protected onLoadingSurveyFromService(): void; - protected onLoadSurveyFromService(): void; - private updateVisibleIndexes(); - private updatePageVisibleIndexes(showIndex); - private updateQuestionVisibleIndexes(questions, showIndex); - private setJsonObject(jsonObj); - protected onBeforeCreating(): void; - protected onCreating(): void; - private updateProcessedTextValues(); - private addQuestionToProcessedTextValues(question); - private getProcessedTextValue(name); - private clearInvisibleQuestionValues(); - getVariable(name: string): any; - setVariable(name: string, newValue: any): void; - private getUnbindValue(value); - getValue(name: string): any; - setValue(name: string, newValue: any): void; - private isValueEqual(name, newValue); - private isTwoValueEquals(x, y); - private tryGoNextPageAutomatic(name); - getComment(name: string): string; - setComment(name: string, newValue: string): void; - questionVisibilityChanged(question: IQuestion, newValue: boolean): void; - pageVisibilityChanged(page: IPage, newValue: boolean): void; - questionAdded(question: IQuestion, index: number): void; - questionRemoved(question: IQuestion): void; - validateQuestion(name: string): SurveyError; - processHtml(html: string): string; - processText(text: string): string; - getObjects(pages: string[], questions: string[]): any[]; - setTriggerValue(name: string, value: any, isVariable: boolean): void; -} diff --git a/lib_typings/surveyStrings.d.ts b/lib_typings/surveyStrings.d.ts deleted file mode 100644 index 8bee42b1b0..0000000000 --- a/lib_typings/surveyStrings.d.ts +++ /dev/null @@ -1,39 +0,0 @@ -// Type definitions for Survey JavaScript library v0.9.12 -// Project: http://surveyjs.org/ -// Definitions by: Andrew Telnov - -export declare var surveyLocalization: { - currentLocale: string; - locales: {}; - getString: (strName: string) => any; - getLocales: () => string[]; -}; -export declare var surveyStrings: { - pagePrevText: string; - pageNextText: string; - completeText: string; - otherItemText: string; - progressText: string; - emptySurvey: string; - completingSurvey: string; - loadingSurvey: string; - optionsCaption: string; - requiredError: string; - requiredInAllRowsError: string; - numericError: string; - textMinLength: string; - minRowCountError: string; - minSelectError: string; - maxSelectError: string; - numericMinMax: string; - numericMin: string; - numericMax: string; - invalidEmail: string; - urlRequestError: string; - urlGetChoicesError: string; - exceedMaxSize: string; - otherRequiredError: string; - uploadingFile: string; - addRow: string; - removeRow: string; -}; diff --git a/lib_typings/surveyWindow.d.ts b/lib_typings/surveyWindow.d.ts deleted file mode 100644 index e7136c1d1e..0000000000 --- a/lib_typings/surveyWindow.d.ts +++ /dev/null @@ -1,25 +0,0 @@ -// Type definitions for Survey JavaScript library v0.9.12 -// Project: http://surveyjs.org/ -// Definitions by: Andrew Telnov - -import { Base } from "./base"; -import { SurveyModel } from "./survey"; -export declare class SurveyWindowModel extends Base { - static surveyElementName: string; - surveyValue: SurveyModel; - windowElement: HTMLDivElement; - isShowingValue: boolean; - isExpandedValue: boolean; - titleValue: string; - templateValue: string; - constructor(jsonObj: any); - getType(): string; - survey: SurveyModel; - isShowing: boolean; - isExpanded: boolean; - title: string; - expand(): void; - collapse(): void; - protected createSurvey(jsonObj: any): SurveyModel; - protected expandcollapse(value: boolean): void; -} diff --git a/lib_typings/textPreProcessor.d.ts b/lib_typings/textPreProcessor.d.ts deleted file mode 100644 index 4798675165..0000000000 --- a/lib_typings/textPreProcessor.d.ts +++ /dev/null @@ -1,17 +0,0 @@ -// Type definitions for Survey JavaScript library v0.9.12 -// Project: http://surveyjs.org/ -// Definitions by: Andrew Telnov - -export declare class TextPreProcessorItem { - start: number; - end: number; -} -export declare class TextPreProcessor { - onProcess: (name: string) => any; - onHasValue: (name: string) => boolean; - constructor(); - process(text: string): string; - private getItems(text); - private getName(name); - private canProcessName(name); -} diff --git a/lib_typings/trigger.d.ts b/lib_typings/trigger.d.ts deleted file mode 100644 index cfbe8cf77c..0000000000 --- a/lib_typings/trigger.d.ts +++ /dev/null @@ -1,53 +0,0 @@ -// Type definitions for Survey JavaScript library v0.9.12 -// Project: http://surveyjs.org/ -// Definitions by: Andrew Telnov - -import { Base, HashTable } from "./base"; -export declare class Trigger extends Base { - static operatorsValue: HashTable; - static operators: HashTable; - private opValue; - value: any; - constructor(); - operator: string; - check(value: any): void; - protected onSuccess(): void; - protected onFailure(): void; -} -export interface ISurveyTriggerOwner { - getObjects(pages: string[], questions: string[]): any[]; - doComplete(): any; - setTriggerValue(name: string, value: any, isVariable: boolean): any; -} -export declare class SurveyTrigger extends Trigger { - name: string; - protected owner: ISurveyTriggerOwner; - constructor(); - setOwner(owner: ISurveyTriggerOwner): void; - isOnNextPage: boolean; -} -export declare class SurveyTriggerVisible extends SurveyTrigger { - pages: string[]; - questions: string[]; - constructor(); - getType(): string; - protected onSuccess(): void; - protected onFailure(): void; - private onTrigger(func); - protected onItemSuccess(item: any): void; - protected onItemFailure(item: any): void; -} -export declare class SurveyTriggerComplete extends SurveyTrigger { - constructor(); - getType(): string; - isOnNextPage: boolean; - protected onSuccess(): void; -} -export declare class SurveyTriggerSetValue extends SurveyTrigger { - setToName: string; - setValue: any; - isVariable: boolean; - constructor(); - getType(): string; - protected onSuccess(): void; -} diff --git a/lib_typings/validator.d.ts b/lib_typings/validator.d.ts deleted file mode 100644 index 0e04a32efd..0000000000 --- a/lib_typings/validator.d.ts +++ /dev/null @@ -1,62 +0,0 @@ -// Type definitions for Survey JavaScript library v0.9.12 -// Project: http://surveyjs.org/ -// Definitions by: Andrew Telnov - -import { Base, SurveyError } from "./base"; -export declare class ValidatorResult { - value: any; - error: SurveyError; - constructor(value: any, error?: SurveyError); -} -export declare class SurveyValidator extends Base { - text: string; - constructor(); - protected getErrorText(name: string): string; - protected getDefaultErrorText(name: string): string; - validate(value: any, name?: string): ValidatorResult; -} -export interface IValidatorOwner { - validators: Array; - value: any; - getValidatorTitle(): string; -} -export declare class ValidatorRunner { - run(owner: IValidatorOwner): SurveyError; -} -export declare class NumericValidator extends SurveyValidator { - minValue: number; - maxValue: number; - constructor(minValue?: number, maxValue?: number); - getType(): string; - validate(value: any, name?: string): ValidatorResult; - protected getDefaultErrorText(name: string): any; - private isNumber(value); -} -export declare class TextValidator extends SurveyValidator { - minLength: number; - constructor(minLength?: number); - getType(): string; - validate(value: any, name?: string): ValidatorResult; - protected getDefaultErrorText(name: string): any; -} -export declare class AnswerCountValidator extends SurveyValidator { - minCount: number; - maxCount: number; - constructor(minCount?: number, maxCount?: number); - getType(): string; - validate(value: any, name?: string): ValidatorResult; - protected getDefaultErrorText(name: string): string; -} -export declare class RegexValidator extends SurveyValidator { - regex: string; - constructor(regex?: string); - getType(): string; - validate(value: any, name?: string): ValidatorResult; -} -export declare class EmailValidator extends SurveyValidator { - private re; - constructor(); - getType(): string; - validate(value: any, name?: string): ValidatorResult; - protected getDefaultErrorText(name: string): any; -} diff --git a/npmREADME.md b/npmREADME.md new file mode 100644 index 0000000000..7cf14d6a02 --- /dev/null +++ b/npmREADME.md @@ -0,0 +1,18 @@ +survey.js is a JavaScript Survey Library. It is a modern way to add a survey to your website. It uses JSON for survey metadata and results. +[![Build Status](https://travis-ci.org/surveyjs/surveyjs.svg?branch=master)](https://travis-ci.org/surveyjs/surveyjs) +##Getting started +[![Join the chat at https://gitter.im/surveyjs/surveyjs](https://badges.gitter.im/surveyjs/surveyjs.svg)](https://gitter.im/surveyjs/surveyjs?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) + +To find our more about the library go +* to the [surveyjs.org site](http://surveyjs.org) +* explore the live [Examples](http://surveyjs.org/examples/) +* and build a survey JSON using [Visual Editor](http://surveyjs.org/builder/) + +##License + +MIT license - [http://www.opensource.org/licenses/mit-license.php](http://www.opensource.org/licenses/mit-license.php) + + +##Visual Editor + +Visual Editor sources are [here](https://github.com/surveyjs/editor) \ No newline at end of file diff --git a/package.json b/package.json index e746eef75f..29d49e487a 100644 --- a/package.json +++ b/package.json @@ -1,59 +1,64 @@ { "scripts": { - "testcafe": "testcafe chrome testCafe/tests", - "test": "concurrently \"http-server\" \"testcafe chrome testCafe/tests/\"" + "testcafe": "concurrently \"http-server\" \"testcafe chrome testCafe/tests/\"", + "build_knockout_dev": "webpack --env.buildType dev --env.platform knockout", + "build_react_dev": "webpack --env.buildType dev --env.platform react", + "build_angular_dev": "webpack --env.buildType dev --env.platform angular", + "build_jquery_dev": "webpack --env.buildType dev --env.platform jquery", + "build_dev": "concurrently \"npm run build_knockout_dev\" \"npm run build_react_dev\" \"npm run build_angular_dev\" \"npm run build_jquery_dev\"", + "build_knockout_prod": "webpack --env.buildType prod --env.platform knockout", + "build_react_prod": "webpack --env.buildType prod --env.platform react", + "build_angular_prod": "webpack --env.buildType prod --env.platform angular", + "build_jquery_prod": "webpack --env.buildType prod --env.platform jquery", + "build_prod": "npm run build_dev && concurrently \"npm run build_knockout_prod\" \"npm run build_react_prod\" \"npm run build_angular_prod\" \"npm run build_jquery_prod\"" }, "version": "0.9.5", "name": "surveyjs", "private": true, "devDependencies": { - "babel-core": "^6.14.0", - "babel-loader": "^6.2.5", - "babel-plugin-transform-runtime": "^6.15.0", - "babel-preset-es2015": "^6.14.0", - "babel-preset-react": "^6.11.1", - "babel-plugin-transform-react-constant-elements": "^6.9.1", - "babel-plugin-transform-react-remove-prop-types": "^0.2.11", - "babel-preset-latest": "^6.16.0", - "babel-preset-stage-0": "^6.16.0", - "gulp": "^3.9.1", - "gulp-concat-util": "^0.5.5", - "gulp-cssmin": "^0.1.7", - "gulp-html-to-ts": "^0.1.3", - "gulp-insert": "^0.5.0", - "gulp-json-transform": "^0.3.2", - "gulp-load-plugins": "^1.2.4", - "gulp-npm-files": "^0.1.3", - "gulp-qunit": "^1.4.0", - "gulp-rename": "^1.2.2", - "gulp-sass": "^2.3.2", - "gulp-sequence": "^0.4.5", - "gulp-serve": "^1.2.0", - "gulp-typescript": "^2.13.6", - "gulp-uglify": "^1.5.3", - "gulp-util": "^3.0.7", - "karma": "^0.13.22", + "@types/angular": "^1.6.2", + "@types/jquery": "^2.0.39", + "@types/knockout": "^3.4.39", + "@types/node": "^7.0.4", + "@types/qunit": "^2.0.31", + "@types/react": "^15.0.4", + "@types/react-dom": "^0.14.21", + "ajv": "^4.11.2", + "babel-loader": "^6.2.10", + "babel-preset-latest": "^6.22.0", + "concurrently": "^3.1.0", + "css-loader": "^0.26.1", + "dts-bundle": "^0.7.1", + "extract-text-webpack-plugin": "^2.0.0-beta", + "generate-json-webpack-plugin": "^0.2.1", + "html-loader": "^0.4.4", + "jquery": "^3.1.1", + "karma": "^1.4.0", + "karma-chrome-launcher": "^2.0.0", + "karma-commonjs": "^1.0.0", "karma-coverage": "^1.0.0", "karma-junit-reporter": "^1.0.0", "karma-phantomjs-launcher": "^1.0.0", "karma-qunit": "^1.0.0", + "karma-sourcemap-loader": "^0.3.7", + "karma-webpack": "^2.0.2", + "knockout": "^3.4.0", + "node-sass": "^4.4.0", "node-uuid": "^1.4.7", + "phantomjs-prebuilt": "^2.1.14", "preact": "^7.1.0", - "preact-compat": "^3.9.4", - "qunit": "^0.9.1", + "preact-compat": "^3.11.0", "qunitjs": "^2.0.1", - "jquery": "^3.1.1", - "rimraf": "^2.5.2", - "source-map-loader": "^0.1.5", - "testcafe": "^0.10.0", - "ts-loader": "^0.8.2", - "typescript": "~2.0.6", - "webpack": "^1.13.2", - "webpack-stream": "^3.2.0" - }, - "dependencies": { - "knockout": "^3.4.0", "react": "^15.0.1", - "react-dom": "^15.0.1" + "react-dom": "^15.0.1", + "rimraf": "^2.5.4", + "sass-loader": "^4.1.1", + "style-loader": "^0.13.1", + "testcafe": "^0.10.0", + "ts-loader": "^2.0.0", + "tslib": "^1.5.0", + "typescript": "^2.1.5", + "val-loader": "^0.5.0", + "webpack": "^2.2.0" } } diff --git a/packagetemplate.json b/packagetemplate.json deleted file mode 100644 index 8063d06d2a..0000000000 --- a/packagetemplate.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "name": "name", - "version": "ver", - "description": "survey.js is a JavaScript Survey Library. It is a modern way to add a survey to your website. It uses JSON for survey metadata and results.", - "keywords": [ - "Survey", - "JavaScript", - "Bootstrap", - "Library" - ], - "homepage": "http://surveyjs.org/", - "license": "MIT", - "files": [ - "dist/", - "js/", - "css/" - ], - "main": "fileName", - "repository": { - "type": "git", - "url": "http://github.com/surveyjs/surveyjs.git" - }, - "engines": { - "node": ">=0.10.0" - }, - "dependencies": { - } -} \ No newline at end of file diff --git a/project.json b/project.json deleted file mode 100644 index a3ac6c1b14..0000000000 --- a/project.json +++ /dev/null @@ -1,42 +0,0 @@ -{ - "webroot": "wwwroot", - "version": "1.0.0-*", - - "dependencies": { - "Microsoft.AspNet.Diagnostics": "1.0.0-rc1-final", - "Microsoft.AspNet.IISPlatformHandler": "1.0.0-rc1-final", - "Microsoft.AspNet.Server.Kestrel": "1.0.0-rc1-final", - "Microsoft.AspNet.StaticFiles": "1.0.0-rc1-final", - "Microsoft.Extensions.Configuration.FileProviderExtensions": "1.0.0-rc1-final", - "Microsoft.Extensions.Configuration.Json": "1.0.0-rc1-final", - "Microsoft.VisualStudio.Web.BrowserLink.Loader": "14.0.0-rc1-final" - }, - - "commands": { - "web": "Microsoft.AspNet.Server.Kestrel" - }, - - "frameworks": { - "dnx451": { }, - "dnxcore50": { } - }, - - "publishExclude": [ - "node_modules", - "bower_components", - "shippable", - "typings", - "**.xproj", - "**.user", - "**.vspscc" - ], - "exclude": [ - "wwwroot", - "node_modules", - "bower_components" - ], - "scripts": { - "postrestore": [ "npm install", "bower install", "node node_modules\\bower-installer\\bower-installer.js" ], - "prepare": [ ] - } -} \ No newline at end of file diff --git a/src/assign.ts b/src/assign.ts deleted file mode 100644 index 138b74fc11..0000000000 --- a/src/assign.ts +++ /dev/null @@ -1,15 +0,0 @@ -export function __assign (t) { - for (var s, i = 1, n = arguments.length; i < n; i++) { - s = arguments[i]; - for (var p in s) { - if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; - } - } - return t; -}; - -if (typeof module !== 'undefined' && module.exports) { - exports = module.exports = __assign; -} - -exports.__assign = __assign; \ No newline at end of file diff --git a/src/conditionsParser.ts b/src/conditionsParser.ts index 31f1bcc262..f3256916d0 100644 --- a/src/conditionsParser.ts +++ b/src/conditionsParser.ts @@ -106,7 +106,7 @@ export class ConditionsParser { var res = this.readConditions(); if (res) { this.skip(); - res = this.ch == ')'; + res = this.ch == ')'; this.at++; this.popExpression(); } diff --git a/src/entries/angular.ts b/src/entries/angular.ts index 9b857d2bf1..0e42cb41dd 100644 --- a/src/entries/angular.ts +++ b/src/entries/angular.ts @@ -1,4 +1,3 @@ export * from "./react"; -export {__assign} from "../assign"; export {SurveyNG} from "../angular/SurveyNG"; -export {SurveyWindowNG} from "../angular/SurveyNG"; +export {SurveyWindowNG} from "../angular/SurveyNG"; \ No newline at end of file diff --git a/src/entries/chunks/helpers.ts b/src/entries/chunks/helpers.ts new file mode 100644 index 0000000000..1d502e65ef --- /dev/null +++ b/src/entries/chunks/helpers.ts @@ -0,0 +1,5 @@ +//TODO may be we shouldn't export helpers +import {__extends as ____extends, __assign as ___assign} from "tslib"; + +export var __extends = ____extends; +export var __assign = ___assign; \ No newline at end of file diff --git a/src/entries/chunks/model.ts b/src/entries/chunks/model.ts index cf7a8baa80..a3e2795514 100644 --- a/src/entries/chunks/model.ts +++ b/src/entries/chunks/model.ts @@ -1,3 +1,6 @@ +// styles +import "../../main.scss"; + export { AnswerCountValidator, EmailValidator, NumericValidator, RegexValidator, SurveyValidator, TextValidator, ValidatorResult, ValidatorRunner diff --git a/src/entries/jquery.tsx b/src/entries/jquery.tsx index c0889e365d..a78a71f559 100644 --- a/src/entries/jquery.tsx +++ b/src/entries/jquery.tsx @@ -26,5 +26,4 @@ jQuery["fn"].extend({ } }); -export * from "./react"; -export {__assign} from "../assign"; \ No newline at end of file +export * from "./react"; \ No newline at end of file diff --git a/src/entries/ko.ts b/src/entries/knockout.ts similarity index 96% rename from src/entries/ko.ts rename to src/entries/knockout.ts index c77b908df4..9428a5694a 100644 --- a/src/entries/ko.ts +++ b/src/entries/knockout.ts @@ -4,10 +4,16 @@ export * from "./chunks/model"; // localization import './chunks/localization'; +// helpers +import './chunks/helpers'; + + // css standard export {defaultStandardCss} from "../defaultCss/cssstandard"; // css bootstrap export {defaultBootstrapCss} from "../defaultCss/cssbootstrap"; +// styles +import "../main.scss"; // knockout export {Survey} from "../knockout/kosurvey"; // TODO need to remove someday @@ -38,7 +44,5 @@ export {QuestionText} from "../knockout/koquestion_text"; export {SurveyWindow} from "../knockout/koSurveyWindow"; export {SurveyTemplateText} from "../knockout/templateText"; -export {__extends} from "../extends"; - //Uncomment to include the "date" question type. //export {QuestionDate} from "../plugins/knockout/koquestion_date"; \ No newline at end of file diff --git a/src/entries/react.ts b/src/entries/react.ts index a7bf73a83d..5e91b54503 100644 --- a/src/entries/react.ts +++ b/src/entries/react.ts @@ -4,6 +4,9 @@ export * from "./chunks/model"; // localization import './chunks/localization'; +// helpers +import './chunks/helpers'; + // css standard export {defaultStandardCss} from "../defaultCss/cssstandard"; // css bootstrap @@ -35,7 +38,5 @@ export {SurveyWindow} from "../react/reactSurveyWindow"; export {ReactQuestionFactory} from "../react/reactquestionfactory"; // TODO need to remove someday export {ReactQuestionFactory as QuestionFactory} from "../react/reactquestionfactory"; -export {__extends} from "../extends"; - //Uncomment to include the "date" question type. //export {default as SurveyQuestionDate} from "../plugins/react/reactquestiondate"; \ No newline at end of file diff --git a/src/extends.ts b/src/extends.ts deleted file mode 100644 index 2e6f7f403b..0000000000 --- a/src/extends.ts +++ /dev/null @@ -1,11 +0,0 @@ -export function __extends (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -} - -if (typeof module !== 'undefined' && module.exports) { - exports = module.exports = __extends; -} - -exports.__extends = __extends; \ No newline at end of file diff --git a/src/knockout/koSurveyWindow.ts b/src/knockout/koSurveyWindow.ts index ac36a66ea8..181d73a500 100644 --- a/src/knockout/koSurveyWindow.ts +++ b/src/knockout/koSurveyWindow.ts @@ -2,7 +2,7 @@ import {SurveyWindowModel} from "../surveyWindow"; import {SurveyModel} from "../survey"; import {Survey} from "./kosurvey"; -import {koTemplate} from './template.window.ko.html' +var koTemplate = require("html-loader?interpolate!val-loader!./templates/window/window.html"); export class SurveyWindow extends SurveyWindowModel { koExpanded: any; @@ -33,7 +33,7 @@ export class SurveyWindow extends SurveyWindowModel { (this.survey).render(SurveyWindow.surveyElementName); this.isShowingValue = true; } - protected getDefaultTemplate(): string { return koTemplate.html } + protected getDefaultTemplate(): string { return koTemplate } public hide() { document.body.removeChild(this.windowElement); this.windowElement.innerHTML = ""; diff --git a/src/knockout/kosurvey.ts b/src/knockout/kosurvey.ts index 4a661a6c48..79ffedd922 100644 --- a/src/knockout/kosurvey.ts +++ b/src/knockout/kosurvey.ts @@ -4,7 +4,7 @@ import {IPage, Event} from "../base"; import {Page} from "./kopage"; import {PageModel} from "../page"; import {surveyCss} from "../defaultCss/cssstandard"; -import {koTemplate} from "./template.ko.html"; +var koTemplate = require("html-loader?interpolate!val-loader!./templates/entry.html"); export class Survey extends SurveyModel { public static get cssType(): string { return surveyCss.currentType; } @@ -65,7 +65,7 @@ export class Survey extends SurveyModel { this.updateKoCurrentPage(); } protected createNewPage(name: string) { return new Page(name); } - protected getTemplate(): string { return koTemplate.html; } + protected getTemplate(): string { return koTemplate; } protected onBeforeCreating() { var self = this; this.dummyObservable = ko.observable(0); diff --git a/src/knockout/templateText.ts b/src/knockout/templateText.ts index a8ffd2a0e1..72f7bd8b95 100644 --- a/src/knockout/templateText.ts +++ b/src/knockout/templateText.ts @@ -1,4 +1,4 @@ -import {koTemplate} from "./template.ko.html"; +var koTemplate = require("html-loader?interpolate!val-loader!./templates/entry.html"); export class SurveyTemplateText { constructor() { @@ -23,6 +23,6 @@ export class SurveyTemplateText { } return result + '"'; } - protected get text(): string { return koTemplate.html; } - protected set text(value: string) { koTemplate.html = value; } + protected get text(): string { return koTemplate; } + protected set text(value: string) { koTemplate = value; } } \ No newline at end of file diff --git a/src/knockout/templates/entry.html b/src/knockout/templates/entry.html new file mode 100644 index 0000000000..9e8442e342 --- /dev/null +++ b/src/knockout/templates/entry.html @@ -0,0 +1,18 @@ +${require('./index.html')} +${require('./comment.html')} +${require('./page.html')} +${require('./progress.html')} +${require('./question.html')} +${require('./question-checkbox.html')} +${require('./question-comment.html')} +${require('./question-dropdown.html')} +${require('./question-errors.html')} +${require('./question-file.html')} +${require('./question-html.html')} +${require('./question-matrix.html')} +${require('./question-matrixdropdown.html')} +${require('./question-matrixdynamic.html')} +${require('./question-multipletext.html')} +${require('./question-radiogroup.html')} +${require('./question-rating.html')} +${require('./question-text.html')} \ No newline at end of file diff --git a/src/react/reactSurveyWindow.tsx b/src/react/reactSurveyWindow.tsx index a964439787..3b8b994655 100644 --- a/src/react/reactSurveyWindow.tsx +++ b/src/react/reactSurveyWindow.tsx @@ -36,7 +36,7 @@ export class SurveyWindow extends Survey { ; } protected renderBody(): JSX.Element { - return
+ return
{this.renderSurvey() }
} diff --git a/testCafe/knockout/bootstrap.html b/testCafe/knockout/bootstrap.html index 3d92bc6c77..844ab3a745 100644 --- a/testCafe/knockout/bootstrap.html +++ b/testCafe/knockout/bootstrap.html @@ -16,8 +16,8 @@ - - + + diff --git a/testCafe/knockout/standard.html b/testCafe/knockout/standard.html index 2a1794c2f4..dad160adac 100644 --- a/testCafe/knockout/standard.html +++ b/testCafe/knockout/standard.html @@ -13,8 +13,8 @@ - - + + diff --git a/testCafe/react/bootstrap.html b/testCafe/react/bootstrap.html index 6cec8cd050..00453cbfb9 100644 --- a/testCafe/react/bootstrap.html +++ b/testCafe/react/bootstrap.html @@ -19,8 +19,8 @@ - - + + diff --git a/testCafe/react/standard.html b/testCafe/react/standard.html index a4a0cb3b27..77ed10b427 100644 --- a/testCafe/react/standard.html +++ b/testCafe/react/standard.html @@ -15,8 +15,8 @@ - - + + diff --git a/tests/basetests.ts b/tests/basetests.ts index ee5fa1135c..e28b6a845e 100644 --- a/tests/basetests.ts +++ b/tests/basetests.ts @@ -1,6 +1,6 @@ import {ItemValue, Event} from "../src/base"; -QUnit.module("Base"); +export default QUnit.module("Base"); QUnit.test("Event hasEvents property", function (assert) { var event = new Event<() => any, any>(); diff --git a/tests/choicesRestfulltests.ts b/tests/choicesRestfulltests.ts index 5fc8ea90ed..f6cfd72678 100644 --- a/tests/choicesRestfulltests.ts +++ b/tests/choicesRestfulltests.ts @@ -2,7 +2,7 @@ import {QuestionDropdownModel} from "../src/question_dropdown"; import {ItemValue} from "../src/base"; -QUnit.module("choicesRestfull"); +export default QUnit.module("choicesRestfull"); class ChoicesRestfullTester extends ChoicesRestfull { public runJson(json: any) { diff --git a/tests/conditionstests.ts b/tests/conditionstests.ts index 39d7c8be67..6857474a57 100644 --- a/tests/conditionstests.ts +++ b/tests/conditionstests.ts @@ -1,7 +1,7 @@ import {ConditionsParser} from "../src/conditionsParser"; import {Condition, ConditionNode, ConditionRunner} from "../src/conditions"; -QUnit.module("Conditions"); +export default QUnit.module("Conditions"); QUnit.test("Condition", function (assert) { var op = new Condition(); diff --git a/tests/jsonobjecttests.ts b/tests/jsonobjecttests.ts index d15e5ca7be..a9f63a8b42 100644 --- a/tests/jsonobjecttests.ts +++ b/tests/jsonobjecttests.ts @@ -93,7 +93,7 @@ JsonObject.metaData.addClass("shouldnotcreate", ["A"], function () { return new JsonObject.metaData.addClass("container", [{ name: "obj", className: "shouldnotcreate" }, { name: "items", className: "shouldnotcreate"}]); JsonObject.metaData.overrideClassCreatore("shouldnotcreate", function () { return new CreatingObject(); }); -QUnit.module("JsonSerializationTests"); +export default QUnit.module("JsonSerializationTests"); QUnit.test("Metadata for non inherited class", function (assert) { assert.equal(JsonObject.metaData.getProperties("dealer").length, 9, "Flat properties list"); diff --git a/tests/ko/kosurveymodeltests.ts b/tests/ko/kosurveymodeltests.ts index 4065de997c..8899ba9066 100644 --- a/tests/ko/kosurveymodeltests.ts +++ b/tests/ko/kosurveymodeltests.ts @@ -2,7 +2,7 @@ import {QuestionRating} from "../../src/knockout/koquestion_rating"; import {Survey} from "../../src/knockout/kosurvey"; -QUnit.module("koTests"); +export default QUnit.module("koTests"); QUnit.test("Serialize two pages", function (assert) { var survey = new Survey(); diff --git a/tests/ko/survey_kotests.ts b/tests/ko/survey_kotests.ts index 942216abec..4652157170 100644 --- a/tests/ko/survey_kotests.ts +++ b/tests/ko/survey_kotests.ts @@ -9,7 +9,7 @@ import {MatrixDropdownColumn} from "../../src/question_matrixdropdownbase"; import {QuestionMultipleText, MultipleTextItem} from "../../src/knockout/koquestion_multipletext"; import {Page} from "../../src/knockout/kopage"; -QUnit.module("koTests"); +export default QUnit.module("koTests"); QUnit.test("Survey.koCurrentPage", function (assert) { var survey = new Survey(); diff --git a/tests/ko/templatetexttests.ts b/tests/ko/templatetexttests.ts index 1912a48b6a..3fa01a5472 100644 --- a/tests/ko/templatetexttests.ts +++ b/tests/ko/templatetexttests.ts @@ -1,8 +1,8 @@ import {SurveyTemplateText} from "../../src/knockout/templateText"; -QUnit.module("Template Text"); +export default QUnit.module("Template Text"); - export class SurveyTemplateTextTest extends SurveyTemplateText { + class SurveyTemplateTextTest extends SurveyTemplateText { constructor(public template: string) { super(); } protected get text(): string { return this.template; } protected set text(value: string) { this.template = value; } diff --git a/tests/surveyLocalizationTests.ts b/tests/surveyLocalizationTests.ts index 0c84447ff0..a1040480d5 100644 --- a/tests/surveyLocalizationTests.ts +++ b/tests/surveyLocalizationTests.ts @@ -1,7 +1,12 @@ import {surveyLocalization} from "../src/surveyStrings"; import {SurveyModel} from "../src/survey"; -QUnit.module("LocalizationsTests"); +import '../src/localization/russian'; +import '../src/localization/french'; +import '../src/localization/finnish'; +import '../src/localization/german'; + +export default QUnit.module("LocalizationsTests"); QUnit.test("get default strings", function (assert) { assert.equal(surveyLocalization.getString("pageNextText"), "Next"); diff --git a/tests/surveyquestiontests.ts b/tests/surveyquestiontests.ts index c71daef57e..83b7f21598 100644 --- a/tests/surveyquestiontests.ts +++ b/tests/surveyquestiontests.ts @@ -13,7 +13,7 @@ import {MatrixDropdownColumn} from "../src/question_matrixdropdownbase"; import {QuestionDropdownModel} from "../src/question_dropdown"; import {QuestionMatrixDynamicModel} from "../src/question_matrixdynamic"; -QUnit.module("Survey_Questions"); +export default QUnit.module("Survey_Questions"); QUnit.test("Only some questions support comment", function (assert) { var questionText = QuestionFactory.Instance.createQuestion("text", "textQuestion"); diff --git a/tests/surveyserializationtests.ts b/tests/surveyserializationtests.ts index 657628c95b..5b1a6f5c82 100644 --- a/tests/surveyserializationtests.ts +++ b/tests/surveyserializationtests.ts @@ -7,7 +7,7 @@ import {Question} from "../src/question"; import {QuestionMultipleTextModel, MultipleTextItemModel} from "../src/question_multipletext"; import {QuestionDropdownModel} from "../src/question_dropdown"; -QUnit.module("SurveySerialization"); +export default QUnit.module("SurveySerialization"); QUnit.test("Serialize two pages", function (assert) { var survey = new SurveyModel(); diff --git a/tests/surveytests.ts b/tests/surveytests.ts index 64b42ef130..927b303bc2 100644 --- a/tests/surveytests.ts +++ b/tests/surveytests.ts @@ -20,7 +20,7 @@ import {QuestionMatrixDropdownModel} from "../src/question_matrixdropdown"; import {QuestionMatrixDynamicModel} from "../src/question_matrixdynamic"; import {QuestionRatingModel} from "../src/question_rating"; -QUnit.module("Survey"); +export default QUnit.module("Survey"); QUnit.test("set data property", function (assert) { var survey = new SurveyModel(); diff --git a/tests/surveytriggertests.ts b/tests/surveytriggertests.ts index 807f7a7793..a9796e3f37 100644 --- a/tests/surveytriggertests.ts +++ b/tests/surveytriggertests.ts @@ -1,6 +1,6 @@ import {Trigger, ISurveyTriggerOwner, SurveyTriggerVisible} from "../src/trigger"; -QUnit.module("Triggers"); +export default QUnit.module("Triggers"); class TriggerTester extends Trigger { constructor(public succFunc: Function = null, public failureFunc: Function = null) { diff --git a/tests/surveyvalidatortests.ts b/tests/surveyvalidatortests.ts index eefc81adae..ee024565b4 100644 --- a/tests/surveyvalidatortests.ts +++ b/tests/surveyvalidatortests.ts @@ -1,6 +1,6 @@ import {NumericValidator, EmailValidator} from "../src/validator"; -QUnit.module("Validators"); +export default QUnit.module("Validators"); QUnit.test("Numeric validator", function (assert) { var validator = new NumericValidator(); diff --git a/tests/textPreprocessorTests.ts b/tests/textPreprocessorTests.ts index 6c4e1ecd05..fc098b812c 100644 --- a/tests/textPreprocessorTests.ts +++ b/tests/textPreprocessorTests.ts @@ -1,7 +1,7 @@ import {TextPreProcessor} from "../src/textPreProcessor"; import {ProcessValue} from "../src/conditionProcessValue"; -QUnit.module("TextPreprocessorTests"); +export default QUnit.module("TextPreprocessorTests"); QUnit.test("Replace simple names", function (assert) { var processor = new TextPreProcessor(); diff --git a/tsconfig.json b/tsconfig.json index b6ef79ef65..240767e0de 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -4,16 +4,12 @@ "module": "es2015", "sourceMap": true, "noImplicitAny": false, - "noEmitHelpers": true, + "importHelpers": true, + "moduleResolution": "node", "allowSyntheticDefaultImports": true, "jsx": "react" }, "include": [ - "typings/index.d.ts", "src/**/*.ts" - ], - "exclude": [ - "node_modules", - "**/*.spec.ts" ] } \ No newline at end of file diff --git a/typings.json b/typings.json deleted file mode 100644 index 0fb864c897..0000000000 --- a/typings.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "name": "surveyjs", - "globalDependencies": { - "jquery": "registry:dt/jquery#1.10.0+20161119044246", - "knockout": "github:DefinitelyTyped/DefinitelyTyped/knockout/knockout.d.ts#08ed4e9f1869e37e29514d862e0158b40e550232", - "node": "registry:dt/node#6.0.0+20161019125345", - "qunit": "github:DefinitelyTyped/DefinitelyTyped/qunit/qunit.d.ts#08ed4e9f1869e37e29514d862e0158b40e550232", - "react": "github:DefinitelyTyped/DefinitelyTyped/react/react.d.ts#08ed4e9f1869e37e29514d862e0158b40e550232", - "react-addons-create-fragment": "github:DefinitelyTyped/DefinitelyTyped/react/react-addons-create-fragment.d.ts#08ed4e9f1869e37e29514d862e0158b40e550232", - "react-addons-css-transition-group": "github:DefinitelyTyped/DefinitelyTyped/react/react-addons-css-transition-group.d.ts#08ed4e9f1869e37e29514d862e0158b40e550232", - "react-addons-linked-state-mixin": "github:DefinitelyTyped/DefinitelyTyped/react/react-addons-linked-state-mixin.d.ts#08ed4e9f1869e37e29514d862e0158b40e550232", - "react-addons-perf": "github:DefinitelyTyped/DefinitelyTyped/react/react-addons-perf.d.ts#08ed4e9f1869e37e29514d862e0158b40e550232", - "react-addons-pure-render-mixin": "github:DefinitelyTyped/DefinitelyTyped/react/react-addons-pure-render-mixin.d.ts#08ed4e9f1869e37e29514d862e0158b40e550232", - "react-addons-test-utils": "github:DefinitelyTyped/DefinitelyTyped/react/react-addons-test-utils.d.ts#08ed4e9f1869e37e29514d862e0158b40e550232", - "react-addons-transition-group": "github:DefinitelyTyped/DefinitelyTyped/react/react-addons-transition-group.d.ts#08ed4e9f1869e37e29514d862e0158b40e550232", - "react-addons-update": "github:DefinitelyTyped/DefinitelyTyped/react/react-addons-update.d.ts#08ed4e9f1869e37e29514d862e0158b40e550232", - "react-dom": "github:DefinitelyTyped/DefinitelyTyped/react/react-dom.d.ts#08ed4e9f1869e37e29514d862e0158b40e550232", - "react-global": "github:DefinitelyTyped/DefinitelyTyped/react/react-global.d.ts#08ed4e9f1869e37e29514d862e0158b40e550232" - } -} diff --git a/webpack.config.js b/webpack.config.js new file mode 100644 index 0000000000..a7ff4160b3 --- /dev/null +++ b/webpack.config.js @@ -0,0 +1,222 @@ +'use strict'; + +var webpack = require('webpack'); +var path = require('path'); +var ExtractTextPlugin = require('extract-text-webpack-plugin'); +var dts = require('dts-bundle'); +var rimraf = require('rimraf'); +var GenerateJsonPlugin = require('generate-json-webpack-plugin'); +var packageJson = require('./package.json'); +var fs = require('fs'); + +var banner = [ + "surveyjs - Survey JavaScript library v" + packageJson.version, + "(c) Andrew Telnov - http://surveyjs.org/", + "License: MIT (http://www.opensource.org/licenses/mit-license.php)", +].join("\n"); + +// TODO add to dts_bundler +var dts_banner = ["Type definitions for Survey JavaScript library v" + packageJson.version, + "Project: http://surveyjs.org/", + "Definitions by: Andrew Telnov ", + ""].join("\n"); + +var platformOptions = { + 'react': { + externals: { + 'react': { + root: 'React', + commonjs2: 'react', + commonjs: 'react', + amd: 'react' + }, + 'react-dom': { + root: 'ReactDOM', + commonjs2: 'react-dom', + commonjs: 'react-dom', + amd: 'react-dom' + } + }, + keywords: ['react', 'react-component'], + dependencies: { 'react': '^15.0.1', 'react-dom': '^15.0.1' } + }, + 'knockout': { + externals: { + 'knockout': { + root: 'ko', + commonjs2: 'knockout', + commonjs: 'knockout', + amd: 'knockout' + } + }, + keywords: ['knockout'], + dependencies: {'knockout': '^3.4.0'} + }, + 'jquery': { + externals: { + 'jquery': { + root: 'jQuery', + commonjs2: 'jquery', + commonjs: 'jquery', + amd: 'jquery' + } + }, + keywords: ['jquery', 'jquery-plugin'], + dependencies: { 'jquery': '>=1.12.4', '@types/react': '0.0.0' } + }, + 'angular': { + externals: {}, + keywords: ['angular', 'angular-component'], + dependencies: { '@types/react': '0.0.0' } + } +}; + +module.exports = function(options) { + var packagePath = './packages/survey-' + options.platform + '/'; + var extractCSS = new ExtractTextPlugin({ filename: packagePath + 'survey.css' }); + + var percentage_handler = function handler(percentage, msg) { + if ( 0 == percentage ) { + console.log('Build started... good luck!'); + } else if ( 1 == percentage ) { + if (options.buildType === "prod") { + dts.bundle({ + name: '../../survey.' + options.platform, + main: packagePath + 'typings/entries/' + options.platform + '.d.ts', + outputAsModuleFolder: true, + headerText: dts_banner + }); + rimraf.sync(packagePath + 'typings'); + fs.createReadStream('./npmREADME.md').pipe(fs.createWriteStream(packagePath + 'README.md')); + } + //TODO someday need to remove + if (options.platform === "knockout") { + if (options.buildType === "prod") { + fs.rename('./packages/survey-knockout/survey.knockout.min.js', './packages/survey-knockout/survey.ko.min.js'); + fs.rename('./packages/survey-knockout/survey.knockout.d.ts', './packages/survey-knockout/survey.ko.d.ts'); + } else { + fs.rename('./packages/survey-knockout/survey.knockout.js', './packages/survey-knockout/survey.ko.js'); + } + } + } + }; + + var packagePlatformJson = { + 'name': 'survey-' + options.platform, + 'version': packageJson.version, + 'description': 'survey.js is a JavaScript Survey Library. It is a modern way to add a survey to your website. It uses JSON for survey metadata and results.', + 'keywords': [ + 'Survey', + 'JavaScript', + 'Bootstrap', + 'Library' + ].concat(platformOptions[options.platform].keywords), + 'homepage': 'https://surveyjs.org/', + 'license': 'MIT', + 'files': [ + 'survey.css', + 'survey.min.css', + 'survey.' + options.platform + '.js', + 'survey.' + options.platform + '.min.js' + ], + 'main': [ + 'survey.min.css', + 'survey.' + options.platform + '.min.js' + ], + 'repository': { + 'type': 'git', + 'url': 'https://github.com/andrewtelnov/surveyjs.git' + }, + 'typings': 'survey.' + options.platform + '.d.ts', + 'dependencies': platformOptions[options.platform].dependencies + }; + + var config = { + entry: {}, + resolve: { + extensions: ['.ts', '.tsx', '.scss'] + }, + module: { + rules: [ + { + test: /\.(ts|tsx)$/, + loader: 'ts-loader', + options: { + compilerOptions: { + 'declaration': options.buildType === 'prod', + 'outDir': packagePath + 'typings/' + } + } + }, + { + test: /\.scss$/, + loader: extractCSS.extract({ + fallbackLoader: 'style-loader', + loader: 'css-loader!sass-loader' + }) + }, + { + test: /\.html$/, + loader: 'html-loader' + } + ] + }, + output: { + filename: packagePath + '[name]' + (options.buildType === 'prod' ? '.min': '') + '.js', + library: 'Survey', + libraryTarget: 'umd', + umdNamedDefine: true + }, + externals: platformOptions[options.platform].externals, + plugins: [ + new webpack.ProgressPlugin(percentage_handler), + extractCSS + ], + devtool: 'inline-source-map' + }; + + if (options.platform === 'angular' || options.platform === 'jquery') { + config.resolve.alias = { + 'react': 'preact-compat', + 'react-dom': 'preact-compat' + }; + + // TODO because of preact-compat https://github.com/developit/preact-compat/issues/192 need to better decision + config.module.rules.push({ + loader: 'babel-loader', + include: [ + path.join(__dirname, './node_modules/preact-compat/src'), + ], + options: { + presets: [ + ['latest', { modules: false }], + ], + }, + }); + // EO TODO + } + + if (options.buildType === 'prod') { + config.devtool = false; + config.plugins = config.plugins.concat([ + new webpack.optimize.UglifyJsPlugin(), + new webpack.BannerPlugin(banner), + new GenerateJsonPlugin( + packagePath + 'package.json', + packagePlatformJson, + undefined, + 2 + ) + ]); + } + + if (options.buildType === 'dev') { + config.plugins = config.plugins.concat([ + new webpack.LoaderOptionsPlugin({ debug: true}) + ]); + } + + config.entry['survey.' + options.platform] = path.resolve(__dirname, './src/entries/' + options.platform); + + return config; +}; \ No newline at end of file diff --git a/webpack/webpack.config.js b/webpack/webpack.config.js deleted file mode 100644 index 69cda59d44..0000000000 --- a/webpack/webpack.config.js +++ /dev/null @@ -1,78 +0,0 @@ -'use strict'; - -var webpack = require('webpack'); -var path = require('path'); - -module.exports = function(options) { - var babelConfig = { - presets: [ - [require.resolve('babel-preset-es2015'), { loose: true }], - require.resolve('babel-preset-react') - ] - }; - - var config = { - resolveLoader: {root: path.join(__dirname, 'node_modules')}, - resolve: { - extensions: ['', '.ts', '.tsx'] - }, - entry: {}, - output: { - filename: '[name].js', - library: 'Survey', - libraryTarget: 'umd', - umdNamedDefine: true - }, - externals: { - 'react': { - root: 'React', - commonjs2: 'react', - commonjs: 'react', - amd: 'react' - }, - 'react-dom': { - root: 'ReactDOM', - commonjs2: 'react-dom', - commonjs: 'react-dom', - amd: 'react-dom' - }, - 'knockout': { - root: 'ko', - commonjs2: 'knockout', - commonjs: 'knockout', - amd: 'knockout' - } - }, - module: { - preLoaders: [ - { test: /\.(js|jsx)$/, loader: "source-map-loader" } - ], - loaders: [ - { - test: /\.(ts|tsx)$/, - loaders:[ - require.resolve('babel-loader') + '?' + JSON.stringify(babelConfig), // TODO why do we need it - require.resolve('ts-loader') - ] - }, - { - test: /\.(js|jsx)$/, - loader: require.resolve('babel-loader'), - query: babelConfig - } - ] - }, - debug: true, - plugins: [ - new webpack.NoErrorsPlugin(), - new webpack.ProvidePlugin({ - __extends: path.join(__dirname, '../src', 'extends.ts') - }) - ], - devtool: 'inline-source-map' - }; - - config.entry[options.bundleName] = path.resolve(__dirname, options.entryPoint); - - return config; -}; \ No newline at end of file diff --git a/webpack/webpack.universal.config.js b/webpack/webpack.universal.config.js deleted file mode 100644 index 11a2ea9a4a..0000000000 --- a/webpack/webpack.universal.config.js +++ /dev/null @@ -1,78 +0,0 @@ -'use strict'; - -var webpack = require('webpack'); -var path = require('path'); - -module.exports = function(options) { - var babelConfig = { - presets: [ - 'latest', - 'stage-0', - 'react' - ], - plugins: [ - 'transform-react-remove-prop-types', - 'transform-react-constant-elements' - ] - }; - - var config = { - resolveLoader: {root: path.join(__dirname, 'node_modules')}, - resolve: { - alias: { - 'react': 'preact-compat', - 'react-dom': 'preact-compat' - }, - extensions: ['', '.ts', '.tsx'] - }, - entry: {}, - output: { - filename: '[name].js', - library: 'Survey', - libraryTarget: 'umd', - umdNamedDefine: true - }, - externals: { - 'jquery': { - root: 'jQuery', - commonjs2: 'jquery', - commonjs: 'jquery', - amd: 'jquery' - } - }, - module: { - preLoaders: [ - { test: /\.(js|jsx)$/, loader: "source-map-loader" } - ], - loaders: [ - { - test: /\.(ts|tsx)$/, - exclude: /node_modules/, - loaders:[ - require.resolve('babel-loader') + '?' + JSON.stringify(babelConfig), // TODO why do we need it - require.resolve('ts-loader') - ] - }, - { - test: /\.(js|jsx)$/, - loader: require.resolve('babel-loader'), - exclude: /node_modules/, - query: babelConfig - } - ] - }, - debug: true, - plugins: [ - new webpack.NoErrorsPlugin(), - new webpack.ProvidePlugin({ - __extends: path.join(__dirname, '../src', 'extends.ts'), - __assign: path.join(__dirname, '../src', 'assign.ts') - }) - ], - devtool: 'inline-source-map' - }; - - config.entry[options.bundleName] = path.resolve(__dirname, options.entryPoint); - - return config; -}; \ No newline at end of file