mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-20 12:29:55 +08:00
chore(docs): updating dgeni typescript package
This commit is contained in:
@ -67,8 +67,8 @@
|
||||
"core-js": "2.4.1",
|
||||
"cpr": "2.0.0",
|
||||
"del": "2.2.2",
|
||||
"dgeni": "0.4.2",
|
||||
"dgeni-packages": "0.16.0",
|
||||
"dgeni": "^0.4.7",
|
||||
"dgeni-packages": "^0.16.10",
|
||||
"event-stream": "3.3.4",
|
||||
"file-loader": "0.9.0",
|
||||
"fs-extra": "^2.0.0",
|
||||
|
@ -1,8 +1,8 @@
|
||||
var Package = require('dgeni').Package;
|
||||
var jsdocPackage = require('dgeni-packages/jsdoc');
|
||||
var nunjucksPackage = require('dgeni-packages/nunjucks');
|
||||
var typescriptPackage = require('./typescript-package');
|
||||
var linksPackage = require('./links-package');
|
||||
var typescriptPackage = require('dgeni-packages/typescript');
|
||||
var linksPackage = require('dgeni-packages/links');
|
||||
var gitPackage = require('dgeni-packages/git');
|
||||
var path = require('path');
|
||||
var semver = require('semver');
|
||||
@ -19,8 +19,8 @@ module.exports = function(currentVersion, initialVersionBuild) {
|
||||
|
||||
.processor(require('./processors/latest-version'))
|
||||
.processor(require('./processors/index-page'))
|
||||
.processor(require('./processors/jekyll'))
|
||||
.processor(require('./processors/remove-private-members'))
|
||||
.processor(require('./processors/jekyll'))
|
||||
.processor(require('./processors/hide-private-api'))
|
||||
.processor(require('./processors/collect-inputs-outputs'))
|
||||
.processor(require('./processors/parse-returns-object'))
|
||||
@ -103,8 +103,10 @@ module.exports = function(currentVersion, initialVersionBuild) {
|
||||
docPath += doc.name + '/index.md';
|
||||
var path = config.v2DocsDir + '/' + (versionData.current.folder || '') +
|
||||
'/api/' + docPath;
|
||||
path = path.replace('/home/ubuntu/ionic/src', '')
|
||||
return path;
|
||||
path = path.replace('/home/ubuntu/ionic/src', '')
|
||||
.replace(__dirname.replace('ionic/scripts/docs', ''),'')
|
||||
.replace('/ionic/src','');
|
||||
return path;
|
||||
}
|
||||
}];
|
||||
})
|
||||
|
@ -2,17 +2,18 @@ module.exports = function removePrivateApi() {
|
||||
return {
|
||||
name: 'remove-private-api',
|
||||
description: 'Prevent the private apis from being rendered',
|
||||
$runAfter: ['paths-computed'],
|
||||
$runBefore: ['rendering-docs'],
|
||||
$process: function(docs) {
|
||||
var publicDocs = [];
|
||||
docs.forEach(function(doc){
|
||||
if(!doc.private){
|
||||
docs.forEach(function(doc){
|
||||
if (!doc.private && (!doc.tags || !doc.tags.tagsByName.get('hidden'))){
|
||||
publicDocs.push(doc);
|
||||
return doc
|
||||
}
|
||||
})
|
||||
docs = publicDocs;
|
||||
return docs;
|
||||
docs = publicDocs;
|
||||
return docs;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
@ -1,4 +1,4 @@
|
||||
module.exports = function removePrivateApi() {
|
||||
module.exports = function parseReturnsObject() {
|
||||
|
||||
/*
|
||||
* This processor assumes the format:
|
||||
|
@ -8,12 +8,12 @@ module.exports = function removePrivateMembers() {
|
||||
docs.forEach(function(doc) {
|
||||
if (doc.members) {
|
||||
doc.members = doc.members.filter(function(member) {
|
||||
return !member.tags.tagsByName.get('private') && !member.tags.tagsByName.get('internal');
|
||||
return !member.tags.tagsByName.get('hidden') && !member.tags.tagsByName.get('internal');
|
||||
});
|
||||
}
|
||||
if (doc.statics) {
|
||||
doc.statics = doc.statics.filter(function(staticMethod) {
|
||||
return !staticMethod.tags.tagsByName.get('private') && !staticMethod.tags.tagsByName.get('internal')
|
||||
return !staticMethod.tags.tagsByName.get('hidden') && !staticMethod.tags.tagsByName.get('internal')
|
||||
});
|
||||
}
|
||||
});
|
||||
|
@ -2,5 +2,6 @@ module.exports = [
|
||||
{'name': 'advanced'},
|
||||
{'name': 'demo'},
|
||||
{'name': 'usage'},
|
||||
{'name': 'hidden'},
|
||||
{'name': 'internal'}
|
||||
];
|
||||
|
6
scripts/docs/templates/common.template.html
vendored
6
scripts/docs/templates/common.template.html
vendored
@ -204,8 +204,8 @@ angular_controller: APIDemoCtrl <@ endif @>
|
||||
<$ doc.name | dashCase $>
|
||||
<@ else @>
|
||||
<$ doc.name $>
|
||||
<@- if doc.directiveInfo @>
|
||||
<h3><code><$ doc.directiveInfo.properties[0].values $></code></h3>
|
||||
<@- if doc.decorators[0].argumentInfo[0].selector @>
|
||||
<h3><code><$ doc.decorators[0].argumentInfo[0].selector $></code></h3>
|
||||
<@ endif -@>
|
||||
<@ endif @>
|
||||
|
||||
@ -225,7 +225,7 @@ Delegate: <$ doc.delegate $>
|
||||
|
||||
</h1>
|
||||
|
||||
<a class="improve-v2-docs" href="http://github.com/driftyco/ionic/edit/master/<$ doc.fileInfo.relativePath|replace('/home/ubuntu/ionic', '')|replace('//','/') $>#L<$ doc.location.start.line $>">
|
||||
<a class="improve-v2-docs" href="http://github.com/driftyco/ionic/edit/master/<$ doc.fileInfo.projectRelativePath $>#L<$ doc.location.start.line $>">
|
||||
Improve this doc
|
||||
</a>
|
||||
|
||||
|
@ -1,74 +0,0 @@
|
||||
var basePackage = require('dgeni-packages/base');
|
||||
var Package = require('dgeni').Package;
|
||||
var path = require('canonical-path');
|
||||
|
||||
// Define the dgeni package for generating the docs
|
||||
module.exports = new Package('typescript-parsing', [basePackage])
|
||||
|
||||
// Register the services and file readers
|
||||
.factory(require('./services/modules'))
|
||||
.factory(require('./services/tsParser'))
|
||||
.factory(require('./services/tsParser/createCompilerHost'))
|
||||
.factory(require('./services/tsParser/getFileInfo'))
|
||||
.factory(require('./services/tsParser/getExportDocType'))
|
||||
.factory(require('./services/tsParser/getContent'))
|
||||
.factory(require('./services/tsParser/getDirectiveInfo'))
|
||||
|
||||
.factory(require('./services/convertPrivateClassesToInterfaces'))
|
||||
|
||||
.factory('EXPORT_DOC_TYPES', function() {
|
||||
return [
|
||||
'class',
|
||||
'interface',
|
||||
'function',
|
||||
'var',
|
||||
'const',
|
||||
'let',
|
||||
'enum',
|
||||
'type-alias'
|
||||
];
|
||||
})
|
||||
|
||||
|
||||
// Register the processors
|
||||
.processor(require('./processors/readTypeScriptModules'))
|
||||
|
||||
|
||||
// Configure the log service
|
||||
.config(function(log) {
|
||||
log.level = 'warn';
|
||||
})
|
||||
|
||||
|
||||
// Configure ids and paths
|
||||
.config(function(computeIdsProcessor, computePathsProcessor, EXPORT_DOC_TYPES) {
|
||||
|
||||
computeIdsProcessor.idTemplates.push({
|
||||
docTypes: ['member'],
|
||||
idTemplate: '${classDoc.id}.${name}',
|
||||
getAliases: function(doc) {
|
||||
return doc.classDoc.aliases.map(function(alias) { return alias + '.' + doc.name; });
|
||||
}
|
||||
});
|
||||
|
||||
computePathsProcessor.pathTemplates.push({
|
||||
docTypes: ['member'],
|
||||
pathTemplate: '${classDoc.path}#${name}',
|
||||
getOutputPath: function() {} // These docs are not written to their own file, instead they are part of their class doc
|
||||
});
|
||||
|
||||
var MODULES_DOCS_PATH = 'partials/modules';
|
||||
|
||||
computePathsProcessor.pathTemplates.push({
|
||||
docTypes: ['module'],
|
||||
pathTemplate: '/${id}',
|
||||
outputPathTemplate: MODULES_DOCS_PATH + '/${id}/index.html'
|
||||
});
|
||||
|
||||
computePathsProcessor.pathTemplates.push({
|
||||
docTypes: EXPORT_DOC_TYPES,
|
||||
pathTemplate: '${moduleDoc.path}/${name}',
|
||||
outputPathTemplate: MODULES_DOCS_PATH + '/${path}/index.html'
|
||||
});
|
||||
|
||||
});
|
@ -1,11 +0,0 @@
|
||||
var Package = require('dgeni').Package;
|
||||
|
||||
module.exports = function mockPackage() {
|
||||
|
||||
return new Package('mockPackage', [require('../')])
|
||||
|
||||
// provide a mock log service
|
||||
.factory('log', function() { return require('dgeni/lib/mocks/log')(false); })
|
||||
.factory('templateEngine', function() { return {}; });
|
||||
|
||||
};
|
@ -1,4 +0,0 @@
|
||||
export var __esModule = true;
|
||||
export class OKToExport {}
|
||||
export function _thisIsPrivate() {}
|
||||
export var thisIsOK = '!';
|
@ -1,5 +0,0 @@
|
||||
export interface MyInterface {
|
||||
optionalProperty? : string
|
||||
<T, U extends Findable<T>>(param: T) : U
|
||||
new (param: number) : MyInterface
|
||||
}
|
@ -1,6 +0,0 @@
|
||||
export class Test {
|
||||
firstItem;
|
||||
constructor() { this.doStuff(); }
|
||||
otherMethod() {}
|
||||
doStuff() {}
|
||||
}
|
@ -1 +0,0 @@
|
||||
export var x = 10;
|
@ -1,3 +0,0 @@
|
||||
export { x as y } from './privateModule';
|
||||
|
||||
export abstract class AbstractClass {}
|
@ -1 +0,0 @@
|
||||
export var x = 100;
|
@ -1,34 +0,0 @@
|
||||
/**
|
||||
* @module
|
||||
* @description
|
||||
* This is the module description
|
||||
*/
|
||||
|
||||
export * from 'importedSrc';
|
||||
|
||||
/**
|
||||
* This is some random other comment
|
||||
*/
|
||||
|
||||
/**
|
||||
* This is MyClass
|
||||
*/
|
||||
export class MyClass {
|
||||
message: String;
|
||||
|
||||
/**
|
||||
* Create a new MyClass
|
||||
* @param {String} name The name to say hello to
|
||||
*/
|
||||
constructor(name) { this.message = 'hello ' + name; }
|
||||
|
||||
/**
|
||||
* Return a greeting message
|
||||
*/
|
||||
greet() { return this.message; }
|
||||
}
|
||||
|
||||
/**
|
||||
* An exported function
|
||||
*/
|
||||
export var myFn = (val: number) => return val * 2;
|
@ -1,461 +0,0 @@
|
||||
var glob = require('glob');
|
||||
var path = require('canonical-path');
|
||||
var _ = require('lodash');
|
||||
var ts = require('typescript');
|
||||
|
||||
module.exports = function readTypeScriptModules(tsParser, modules, getFileInfo,
|
||||
getDirectiveInfo,
|
||||
getExportDocType, getContent,
|
||||
createDocMessage, log) {
|
||||
|
||||
return {
|
||||
$runAfter: ['files-read'],
|
||||
$runBefore: ['parsing-tags'],
|
||||
|
||||
$validate: {
|
||||
sourceFiles: {presence: true},
|
||||
basePath: {presence: true},
|
||||
hidePrivateMembers: {inclusion: [true, false]},
|
||||
sortClassMembers: {inclusion: [true, false]},
|
||||
ignoreExportsMatching: {}
|
||||
},
|
||||
|
||||
// A collection of globs that identify those modules for which we should create docs
|
||||
sourceFiles: [],
|
||||
// The base path from which to load the source files
|
||||
basePath: '.',
|
||||
// We can ignore members of classes that are private
|
||||
hidePrivateMembers: true,
|
||||
// We leave class members sorted in order of declaration
|
||||
sortClassMembers: false,
|
||||
// We can provide a collection of strings or regexes to ignore exports whose export names match
|
||||
ignoreExportsMatching: ['___esModule'],
|
||||
|
||||
$process: function(docs) {
|
||||
|
||||
// Convert ignoreExportsMatching to an array of regexes
|
||||
var ignoreExportsMatching = convertToRegexCollection(this.ignoreExportsMatching);
|
||||
|
||||
var hidePrivateMembers = this.hidePrivateMembers;
|
||||
var sortClassMembers = this.sortClassMembers;
|
||||
|
||||
var basePath = path.resolve(this.basePath);
|
||||
var filesPaths = expandSourceFiles(this.sourceFiles, basePath);
|
||||
var parseInfo = tsParser.parse(filesPaths, this.basePath);
|
||||
var moduleSymbols = parseInfo.moduleSymbols;
|
||||
|
||||
// Iterate through each of the modules that were parsed and generate a module doc
|
||||
// as well as docs for each module's exports.
|
||||
moduleSymbols.forEach(function(moduleSymbol) {
|
||||
|
||||
var moduleDoc = createModuleDoc(moduleSymbol, basePath);
|
||||
|
||||
// Add this module doc to the module lookup collection and the docs collection
|
||||
modules[moduleDoc.id] = moduleDoc;
|
||||
docs.push(moduleDoc);
|
||||
|
||||
// Iterate through this module's exports and generate a doc for each
|
||||
moduleSymbol.exportArray.forEach(function(exportSymbol) {
|
||||
|
||||
// Ignore exports starting with an underscore
|
||||
if (anyMatches(ignoreExportsMatching, exportSymbol.name)) return;
|
||||
|
||||
// If the symbol is an Alias then for most things we want the original resolved symbol
|
||||
var resolvedExport = exportSymbol.resolvedSymbol || exportSymbol;
|
||||
|
||||
// If the resolved symbol contains no declarations then it is invalid
|
||||
// (probably an abstract class)
|
||||
// For the moment we are just going to ignore such exports
|
||||
// TODO: find a way of generating docs for them
|
||||
if (!resolvedExport.declarations) return;
|
||||
|
||||
var exportDoc = createExportDoc(exportSymbol.name, resolvedExport, moduleDoc, basePath, parseInfo.typeChecker);
|
||||
|
||||
// Ignore exports marked as "@private" in jsDoc content
|
||||
var jsDocContainsPrivate = (exportDoc.content || '').split('\n').some(function(commentRow) {
|
||||
return commentRow.search(/@private|@access private/) >= 0;
|
||||
});
|
||||
if (jsDocContainsPrivate) return;
|
||||
|
||||
log.debug('>>>> EXPORT: ' + exportDoc.name + ' (' + exportDoc.docType + ') from ' + moduleDoc.id);
|
||||
|
||||
// Add this export doc to its module doc
|
||||
moduleDoc.exports.push(exportDoc);
|
||||
docs.push(exportDoc);
|
||||
|
||||
exportDoc.members = [];
|
||||
exportDoc.statics = [];
|
||||
|
||||
// Generate docs for each of the export's members
|
||||
if (resolvedExport.flags & ts.SymbolFlags.HasMembers) {
|
||||
|
||||
for(var memberName in resolvedExport.members) {
|
||||
// FIXME(alexeagle): why do generic type params appear in members?
|
||||
if (memberName === 'T') {
|
||||
continue;
|
||||
}
|
||||
log.silly('>>>>>> member: ' + memberName + ' from ' + exportDoc.id + ' in ' + moduleDoc.id);
|
||||
var memberSymbol = resolvedExport.members[memberName];
|
||||
var memberDoc = createMemberDoc(memberSymbol, exportDoc, basePath, parseInfo.typeChecker);
|
||||
|
||||
// We special case the constructor and sort the other members alphabetically
|
||||
if (memberSymbol.flags & ts.SymbolFlags.Constructor) {
|
||||
exportDoc.constructorDoc = memberDoc;
|
||||
docs.push(memberDoc);
|
||||
} else if (!hidePrivateMembers || memberSymbol.name.charAt(0) !== '_') {
|
||||
docs.push(memberDoc);
|
||||
exportDoc.members.push(memberDoc);
|
||||
} else if (memberSymbol.name === '__call' && memberSymbol.flags & ts.SymbolFlags.Signature) {
|
||||
docs.push(memberDoc);
|
||||
exportDoc.callMember = memberDoc;
|
||||
} else if (memberSymbol.name === '__new' && memberSymbol.flags & ts.SymbolFlags.Signature) {
|
||||
docs.push(memberDoc);
|
||||
exportDoc.newMember = memberDoc;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (exportDoc.docType === 'enum') {
|
||||
for(var memberName in resolvedExport.exports) {
|
||||
log.silly('>>>>>> member: ' + memberName + ' from ' + exportDoc.id + ' in ' + moduleDoc.id);
|
||||
var memberSymbol = resolvedExport.exports[memberName];
|
||||
var memberDoc = createMemberDoc(memberSymbol, exportDoc, basePath, parseInfo.typeChecker);
|
||||
docs.push(memberDoc);
|
||||
exportDoc.members.push(memberDoc);
|
||||
}
|
||||
} else if (resolvedExport.flags & ts.SymbolFlags.HasExports) {
|
||||
for (var exported in resolvedExport.exports) {
|
||||
if (exported === 'prototype') continue;
|
||||
if (hidePrivateMembers && exported.charAt(0) === '_') continue;
|
||||
var memberSymbol = resolvedExport.exports[exported];
|
||||
var memberDoc = createMemberDoc(memberSymbol, exportDoc, basePath, parseInfo.typeChecker);
|
||||
memberDoc.isStatic = true;
|
||||
docs.push(memberDoc);
|
||||
exportDoc.statics.push(memberDoc);
|
||||
}
|
||||
}
|
||||
|
||||
if (sortClassMembers) {
|
||||
exportDoc.members.sort(function(a, b) {
|
||||
if (a.name > b.name) return 1;
|
||||
if (a.name < b.name) return -1;
|
||||
return 0;
|
||||
});
|
||||
exportDoc.statics.sort(function(a, b) {
|
||||
if (a.name > b.name) return 1;
|
||||
if (a.name < b.name) return -1;
|
||||
return 0;
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
function createModuleDoc(moduleSymbol, basePath) {
|
||||
var id = moduleSymbol.name.replace(/^"|"$/g, '');
|
||||
var name = id.split('/').pop();
|
||||
var moduleDoc = {
|
||||
docType: 'module',
|
||||
name: name,
|
||||
id: id,
|
||||
aliases: [id, name],
|
||||
moduleTree: moduleSymbol,
|
||||
content: getContent(moduleSymbol),
|
||||
exports: [],
|
||||
fileInfo: getFileInfo(moduleSymbol, basePath),
|
||||
location: getLocation(moduleSymbol)
|
||||
};
|
||||
return moduleDoc;
|
||||
}
|
||||
|
||||
function createExportDoc(name, exportSymbol, moduleDoc, basePath, typeChecker) {
|
||||
var typeParamString = '';
|
||||
var heritageString = '';
|
||||
var typeDefinition = '';
|
||||
|
||||
exportSymbol.declarations.forEach(function(decl) {
|
||||
var sourceFile = ts.getSourceFileOfNode(decl);
|
||||
|
||||
if (decl.typeParameters) {
|
||||
typeParamString = '<' + getText(sourceFile, decl.typeParameters) + '>';
|
||||
}
|
||||
|
||||
if (decl.symbol.flags & ts.SymbolFlags.TypeAlias) {
|
||||
typeDefinition = getText(sourceFile, decl.type);
|
||||
}
|
||||
|
||||
if (decl.heritageClauses) {
|
||||
decl.heritageClauses.forEach(function(heritage) {
|
||||
|
||||
if (heritage.token == ts.SyntaxKind.ExtendsKeyword) {
|
||||
heritageString += " extends";
|
||||
heritage.types.forEach(function(typ, idx) {
|
||||
heritageString += (idx > 0 ? ',' : '') + typ.getFullText();
|
||||
});
|
||||
}
|
||||
|
||||
if (heritage.token == ts.SyntaxKind.ImplementsKeyword) {
|
||||
heritageString += " implements";
|
||||
heritage.types.forEach(function(typ, idx) {
|
||||
heritageString += (idx > 0 ? ', ' : '') + typ.getFullText();
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
//Make sure duplicate aliases aren't created, so "Ambiguous link" warnings are prevented
|
||||
var aliasNames = [name, moduleDoc.id + '/' + name];
|
||||
if (typeParamString) {
|
||||
aliasNames.push(name + typeParamString);
|
||||
aliasNames.push(moduleDoc.id + '/' + name + typeParamString);
|
||||
}
|
||||
|
||||
var exportDoc = {
|
||||
docType: getExportDocType(exportSymbol),
|
||||
exportSymbol: exportSymbol,
|
||||
name: name,
|
||||
id: moduleDoc.id + '/' + name,
|
||||
typeParams: typeParamString,
|
||||
heritage: heritageString,
|
||||
decorators: getDecorators(exportSymbol),
|
||||
aliases: aliasNames,
|
||||
moduleDoc: moduleDoc,
|
||||
content: getContent(exportSymbol),
|
||||
fileInfo: getFileInfo(exportSymbol, basePath),
|
||||
location: getLocation(exportSymbol),
|
||||
directiveInfo: getDirectiveInfo(exportSymbol)
|
||||
};
|
||||
|
||||
if (exportDoc.docType === 'var' || exportDoc.docType === 'const' || exportDoc.docType === 'let') {
|
||||
exportDoc.symbolTypeName = exportSymbol.valueDeclaration.type &&
|
||||
exportSymbol.valueDeclaration.type.typeName &&
|
||||
exportSymbol.valueDeclaration.type.typeName.text;
|
||||
}
|
||||
|
||||
if (exportDoc.docType === 'type-alias') {
|
||||
exportDoc.returnType = getReturnType(typeChecker, exportSymbol);
|
||||
}
|
||||
|
||||
if(exportSymbol.flags & ts.SymbolFlags.Function) {
|
||||
exportDoc.parameters = getParameters(typeChecker, exportSymbol);
|
||||
}
|
||||
if(exportSymbol.flags & ts.SymbolFlags.Value) {
|
||||
exportDoc.returnType = getReturnType(typeChecker, exportSymbol);
|
||||
}
|
||||
if (exportSymbol.flags & ts.SymbolFlags.TypeAlias) {
|
||||
exportDoc.typeDefinition = typeDefinition;
|
||||
}
|
||||
|
||||
// Compute the original module name from the relative file path
|
||||
exportDoc.originalModule = exportDoc.fileInfo.relativePath
|
||||
.replace(new RegExp('\.' + exportDoc.fileInfo.extension + '$'), '');
|
||||
|
||||
return exportDoc;
|
||||
}
|
||||
|
||||
function createMemberDoc(memberSymbol, classDoc, basePath, typeChecker) {
|
||||
var memberDoc = {
|
||||
docType: 'member',
|
||||
classDoc: classDoc,
|
||||
name: memberSymbol.name,
|
||||
decorators: getDecorators(memberSymbol),
|
||||
content: getContent(memberSymbol),
|
||||
fileInfo: getFileInfo(memberSymbol, basePath),
|
||||
location: getLocation(memberSymbol)
|
||||
};
|
||||
|
||||
memberDoc.typeParameters = getTypeParameters(typeChecker, memberSymbol);
|
||||
|
||||
if(memberSymbol.flags & (ts.SymbolFlags.Signature) ) {
|
||||
memberDoc.parameters = getParameters(typeChecker, memberSymbol);
|
||||
memberDoc.returnType = getReturnType(typeChecker, memberSymbol);
|
||||
switch(memberDoc.name) {
|
||||
case '__call':
|
||||
memberDoc.name = '';
|
||||
break;
|
||||
case '__new':
|
||||
memberDoc.name = 'new';
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (memberSymbol.flags & ts.SymbolFlags.Method) {
|
||||
// NOTE: we use the property name `parameters` here so we don't conflict
|
||||
// with the `params` property that will be updated by dgeni reading the
|
||||
// `@param` tags from the docs
|
||||
memberDoc.parameters = getParameters(typeChecker, memberSymbol);
|
||||
}
|
||||
|
||||
if (memberSymbol.flags & ts.SymbolFlags.Constructor) {
|
||||
memberDoc.parameters = getParameters(typeChecker, memberSymbol);
|
||||
memberDoc.name = 'constructor';
|
||||
}
|
||||
|
||||
if(memberSymbol.flags & ts.SymbolFlags.Value) {
|
||||
memberDoc.returnType = getReturnType(typeChecker, memberSymbol);
|
||||
}
|
||||
|
||||
if(memberSymbol.flags & ts.SymbolFlags.Optional) {
|
||||
memberDoc.optional = true;
|
||||
}
|
||||
|
||||
return memberDoc;
|
||||
}
|
||||
|
||||
|
||||
function getDecorators(symbol) {
|
||||
|
||||
var declaration = symbol.valueDeclaration || symbol.declarations[0];
|
||||
var sourceFile = ts.getSourceFileOfNode(declaration);
|
||||
|
||||
var decorators = declaration.decorators && declaration.decorators.map(function(decorator) {
|
||||
decorator = decorator.expression;
|
||||
return {
|
||||
name: decorator.expression ? decorator.expression.text : decorator.text,
|
||||
arguments: decorator.arguments && decorator.arguments.map(function(argument) {
|
||||
return getText(sourceFile, argument).trim();
|
||||
}),
|
||||
argumentInfo: decorator.arguments && decorator.arguments.map(function(argument) {
|
||||
return parseArgument(argument);
|
||||
}),
|
||||
expression: decorator
|
||||
};
|
||||
});
|
||||
return decorators;
|
||||
}
|
||||
|
||||
function parseProperties(properties) {
|
||||
var result = {};
|
||||
_.forEach(properties, function(property) {
|
||||
result[property.name.text] = parseArgument(property.initializer);
|
||||
});
|
||||
return result;
|
||||
}
|
||||
|
||||
function parseArgument(argument) {
|
||||
if (argument.text) return argument.text;
|
||||
if (argument.properties) return parseProperties(argument.properties);
|
||||
if (argument.elements) return argument.elements.map(function(element) { return element.text; });
|
||||
var sourceFile = ts.getSourceFileOfNode(argument);
|
||||
var text = getText(sourceFile, argument).trim();
|
||||
return text;
|
||||
}
|
||||
|
||||
function getParameters(typeChecker, symbol) {
|
||||
var declaration = symbol.valueDeclaration || symbol.declarations[0];
|
||||
var sourceFile = ts.getSourceFileOfNode(declaration);
|
||||
if (!declaration.parameters) {
|
||||
var location = getLocation(symbol);
|
||||
throw new Error('missing declaration parameters for "' + symbol.name +
|
||||
'" in ' + sourceFile.fileName +
|
||||
' at line ' + location.start.line);
|
||||
}
|
||||
return declaration.parameters.map(function(parameter) {
|
||||
var paramText = '';
|
||||
if (parameter.dotDotDotToken) {
|
||||
paramText += '...';
|
||||
}
|
||||
paramText += getText(sourceFile, parameter.name);
|
||||
if (parameter.questionToken || parameter.initializer) {
|
||||
paramText += '?';
|
||||
}
|
||||
if (parameter.type) {
|
||||
paramText += ':' + getType(sourceFile, parameter.type);
|
||||
} else {
|
||||
paramText += ': any';
|
||||
if (parameter.dotDotDotToken) {
|
||||
paramText += '[]';
|
||||
}
|
||||
}
|
||||
return paramText.trim();
|
||||
});
|
||||
}
|
||||
|
||||
function getTypeParameters(typeChecker, symbol) {
|
||||
var declaration = symbol.valueDeclaration || symbol.declarations[0];
|
||||
var sourceFile = ts.getSourceFileOfNode(declaration);
|
||||
if (!declaration.typeParameters) return;
|
||||
var typeParams = declaration.typeParameters.map(function(type) {
|
||||
return getText(sourceFile, type).trim();
|
||||
});
|
||||
return typeParams;
|
||||
}
|
||||
|
||||
function getReturnType(typeChecker, symbol) {
|
||||
var declaration = symbol.valueDeclaration || symbol.declarations[0];
|
||||
var sourceFile = ts.getSourceFileOfNode(declaration);
|
||||
if (declaration.type) {
|
||||
return getType(sourceFile, declaration.type).trim();
|
||||
} else if (declaration.initializer) {
|
||||
// The symbol does not have a "type" but it is being initialized
|
||||
// so we can deduce the type of from the initializer (mostly).
|
||||
if (declaration.initializer.expression) {
|
||||
return declaration.initializer.expression.text.trim();
|
||||
} else {
|
||||
return getType(sourceFile, declaration.initializer).trim();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function expandSourceFiles(sourceFiles, basePath) {
|
||||
var filePaths = [];
|
||||
sourceFiles.forEach(function(sourcePattern) {
|
||||
filePaths = filePaths.concat(glob.sync(sourcePattern, { cwd: basePath }));
|
||||
});
|
||||
return filePaths;
|
||||
}
|
||||
|
||||
|
||||
function getText(sourceFile, node) {
|
||||
return sourceFile.text.substring(node.pos, node.end);
|
||||
}
|
||||
|
||||
|
||||
// Strip any local renamed imports from the front of types
|
||||
function getType(sourceFile, type) {
|
||||
var text = getText(sourceFile, type);
|
||||
while (text.indexOf(".") >= 0) {
|
||||
// Keep namespaced symbols in RxNext
|
||||
if (text.match(/^\s*RxNext\./)) break;
|
||||
// handle the case List<thing.stuff> -> List<stuff>
|
||||
text = text.replace(/([^.<]*)\.([^>]*)/, "$2");
|
||||
}
|
||||
return text;
|
||||
}
|
||||
|
||||
function getLocation(symbol) {
|
||||
var node = symbol.valueDeclaration || symbol.declarations[0];
|
||||
var sourceFile = ts.getSourceFileOfNode(node);
|
||||
var location = {
|
||||
start: ts.getLineAndCharacterOfPosition(sourceFile, node.pos),
|
||||
end: ts.getLineAndCharacterOfPosition(sourceFile, node.end)
|
||||
};
|
||||
return location;
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
function convertToRegexCollection(items) {
|
||||
if (!items) return [];
|
||||
|
||||
// Must be an array
|
||||
if (!_.isArray(items)) {
|
||||
items = [items];
|
||||
}
|
||||
|
||||
// Convert string to exact matching regexes
|
||||
return items.map(function(item) {
|
||||
return _.isString(item) ? new RegExp('^' + item + '$') : item;
|
||||
});
|
||||
}
|
||||
|
||||
function anyMatches(regexes, item) {
|
||||
for(var i=0; i<regexes.length; ++i) {
|
||||
if ( item.match(regexes[i]) ) return true;
|
||||
}
|
||||
return false;
|
||||
}
|
@ -1,136 +0,0 @@
|
||||
var mockPackage = require('../mocks/mockPackage');
|
||||
var Dgeni = require('dgeni');
|
||||
var path = require('canonical-path');
|
||||
var _ = require('lodash');
|
||||
|
||||
describe('readTypeScriptModules', function() {
|
||||
var dgeni, injector, processor;
|
||||
|
||||
beforeEach(function() {
|
||||
dgeni = new Dgeni([mockPackage()]);
|
||||
injector = dgeni.configureInjector();
|
||||
processor = injector.get('readTypeScriptModules');
|
||||
processor.basePath = path.resolve(__dirname, '../mocks/readTypeScriptModules');
|
||||
});
|
||||
|
||||
describe('exportDocs', function() {
|
||||
it('should provide the original module if the export is re-exported', function() {
|
||||
processor.sourceFiles = [ 'publicModule.ts' ];
|
||||
var docs = [];
|
||||
processor.$process(docs);
|
||||
|
||||
var exportedDoc = docs[1];
|
||||
expect(exportedDoc.originalModule).toEqual('privateModule');
|
||||
});
|
||||
|
||||
it('should include exported abstract classes', function() {
|
||||
processor.sourceFiles = [ 'publicModule.ts' ];
|
||||
var docs = [];
|
||||
processor.$process(docs);
|
||||
|
||||
var exportedDoc = docs[2];
|
||||
expect(exportedDoc.name).toEqual('AbstractClass');
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
|
||||
describe('ignoreExportsMatching', function() {
|
||||
it('should ignore exports that match items in the `ignoreExportsMatching` property', function() {
|
||||
processor.sourceFiles = [ 'ignoreExportsMatching.ts'];
|
||||
processor.ignoreExportsMatching = [/^_/];
|
||||
var docs = [];
|
||||
processor.$process(docs);
|
||||
|
||||
var moduleDoc = docs[0];
|
||||
expect(moduleDoc.docType).toEqual('module');
|
||||
expect(moduleDoc.exports).toEqual([
|
||||
jasmine.objectContaining({ name: 'OKToExport' }),
|
||||
jasmine.objectContaining({ name: 'thisIsOK' })
|
||||
]);
|
||||
});
|
||||
|
||||
it('should only ignore `___esModule` exports by default', function() {
|
||||
processor.sourceFiles = [ 'ignoreExportsMatching.ts'];
|
||||
var docs = [];
|
||||
processor.$process(docs);
|
||||
|
||||
var moduleDoc = docs[0];
|
||||
expect(moduleDoc.docType).toEqual('module');
|
||||
expect(getNames(moduleDoc.exports)).toEqual([
|
||||
'OKToExport',
|
||||
'_thisIsPrivate',
|
||||
'thisIsOK'
|
||||
]);
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
describe('interfaces', function() {
|
||||
|
||||
it('should mark optional properties', function() {
|
||||
processor.sourceFiles = [ 'interfaces.ts'];
|
||||
var docs = [];
|
||||
processor.$process(docs);
|
||||
|
||||
var moduleDoc = docs[0];
|
||||
var exportedInterface = moduleDoc.exports[0];
|
||||
var member = exportedInterface.members[0];
|
||||
expect(member.name).toEqual('optionalProperty');
|
||||
expect(member.optional).toEqual(true);
|
||||
});
|
||||
|
||||
|
||||
it('should handle "call" type interfaces', function() {
|
||||
processor.sourceFiles = [ 'interfaces.ts'];
|
||||
var docs = [];
|
||||
processor.$process(docs);
|
||||
|
||||
var moduleDoc = docs[0];
|
||||
var exportedInterface = moduleDoc.exports[0];
|
||||
|
||||
expect(exportedInterface.callMember).toBeDefined();
|
||||
expect(exportedInterface.callMember.parameters).toEqual(['param: T']);
|
||||
expect(exportedInterface.callMember.returnType).toEqual('U');
|
||||
expect(exportedInterface.callMember.typeParameters).toEqual(['T', 'U extends Findable<T>']);
|
||||
expect(exportedInterface.newMember).toBeDefined();
|
||||
expect(exportedInterface.newMember.parameters).toEqual(['param: number']);
|
||||
expect(exportedInterface.newMember.returnType).toEqual('MyInterface');
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
describe('ordering of members', function() {
|
||||
it('should order class members in order of appearance (by default)', function() {
|
||||
processor.sourceFiles = ['orderingOfMembers.ts'];
|
||||
var docs = [];
|
||||
processor.$process(docs);
|
||||
var classDoc = _.find(docs, { docType: 'class' });
|
||||
expect(classDoc.docType).toEqual('class');
|
||||
expect(getNames(classDoc.members)).toEqual([
|
||||
'firstItem',
|
||||
'otherMethod',
|
||||
'doStuff',
|
||||
]);
|
||||
});
|
||||
|
||||
|
||||
it('should not order class members if not sortClassMembers is false', function() {
|
||||
processor.sourceFiles = ['orderingOfMembers.ts'];
|
||||
processor.sortClassMembers = false;
|
||||
var docs = [];
|
||||
processor.$process(docs);
|
||||
var classDoc = _.find(docs, { docType: 'class' });
|
||||
expect(classDoc.docType).toEqual('class');
|
||||
expect(getNames(classDoc.members)).toEqual([
|
||||
'firstItem',
|
||||
'otherMethod',
|
||||
'doStuff'
|
||||
]);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
function getNames(collection) {
|
||||
return collection.map(function(item) { return item.name; });
|
||||
}
|
@ -1,31 +0,0 @@
|
||||
var _ = require('lodash');
|
||||
|
||||
module.exports = function convertPrivateClassesToInterfaces() {
|
||||
return function(exportDocs, addInjectableReference) {
|
||||
_.forEach(exportDocs, function(exportDoc) {
|
||||
|
||||
// Search for classes with a constructor marked as `@internal`
|
||||
if (exportDoc.docType === 'class' && exportDoc.constructorDoc && exportDoc.constructorDoc.internal) {
|
||||
|
||||
// Convert this class to an interface with no constructor
|
||||
exportDoc.docType = 'interface';
|
||||
exportDoc.constructorDoc = null;
|
||||
|
||||
if (exportDoc.heritage) {
|
||||
// convert the heritage since interfaces use `extends` not `implements`
|
||||
exportDoc.heritage = exportDoc.heritage.replace('implements', 'extends');
|
||||
}
|
||||
|
||||
if (addInjectableReference) {
|
||||
// Add the `declare var SomeClass extends InjectableReference` construct
|
||||
exportDocs.push({
|
||||
docType: 'var',
|
||||
name: exportDoc.name,
|
||||
id: exportDoc.id,
|
||||
returnType: 'InjectableReference'
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
};
|
||||
};
|
@ -1,76 +0,0 @@
|
||||
var mockPackage = require('../mocks/mockPackage');
|
||||
var Dgeni = require('dgeni');
|
||||
var _ = require('lodash');
|
||||
|
||||
describe('readTypeScriptModules', function() {
|
||||
var dgeni, injector, convertPrivateClassesToInterfaces;
|
||||
|
||||
beforeEach(function() {
|
||||
dgeni = new Dgeni([mockPackage()]);
|
||||
injector = dgeni.configureInjector();
|
||||
convertPrivateClassesToInterfaces = injector.get('convertPrivateClassesToInterfaces');
|
||||
});
|
||||
|
||||
it('should convert private class docs to interface docs', function() {
|
||||
var docs = [
|
||||
{
|
||||
docType: 'class',
|
||||
name: 'privateClass',
|
||||
id: 'privateClass',
|
||||
constructorDoc: { internal: true }
|
||||
}
|
||||
];
|
||||
convertPrivateClassesToInterfaces(docs, false);
|
||||
expect(docs[0].docType).toEqual('interface');
|
||||
});
|
||||
|
||||
|
||||
it('should not touch non-private class docs', function() {
|
||||
var docs = [
|
||||
{
|
||||
docType: 'class',
|
||||
name: 'privateClass',
|
||||
id: 'privateClass',
|
||||
constructorDoc: { }
|
||||
}
|
||||
];
|
||||
convertPrivateClassesToInterfaces(docs, false);
|
||||
expect(docs[0].docType).toEqual('class');
|
||||
});
|
||||
|
||||
|
||||
it('should convert the heritage since interfaces use `extends` not `implements`', function() {
|
||||
var docs = [
|
||||
{
|
||||
docType: 'class',
|
||||
name: 'privateClass',
|
||||
id: 'privateClass',
|
||||
constructorDoc: { internal: true },
|
||||
heritage: 'implements parentInterface'
|
||||
}
|
||||
];
|
||||
convertPrivateClassesToInterfaces(docs, false);
|
||||
expect(docs[0].heritage).toEqual('extends parentInterface');
|
||||
});
|
||||
|
||||
|
||||
it('should add new injectable reference types, if specified, to the passed in collection', function() {
|
||||
var docs = [
|
||||
{
|
||||
docType: 'class',
|
||||
name: 'privateClass',
|
||||
id: 'privateClass',
|
||||
constructorDoc: { internal: true },
|
||||
heritage: 'implements parentInterface'
|
||||
}
|
||||
];
|
||||
convertPrivateClassesToInterfaces(docs, true);
|
||||
expect(docs[1]).toEqual({
|
||||
docType : 'var',
|
||||
name : 'privateClass',
|
||||
id : 'privateClass',
|
||||
returnType : 'InjectableReference'
|
||||
});
|
||||
});
|
||||
|
||||
});
|
@ -1,3 +0,0 @@
|
||||
module.exports = function modules() {
|
||||
return {};
|
||||
};
|
@ -1,80 +0,0 @@
|
||||
var ts = require('typescript');
|
||||
var fs = require('fs');
|
||||
var path = require('canonical-path');
|
||||
|
||||
// We need to provide our own version of CompilerHost because we want to set the
|
||||
// base directory and specify what extensions to consider when trying to load a source
|
||||
// file
|
||||
module.exports = function createCompilerHost(log) {
|
||||
|
||||
return function createCompilerHost(options, baseDir, extensions) {
|
||||
|
||||
return {
|
||||
getSourceFile: function(fileName, languageVersion, onError) {
|
||||
var text, resolvedPath, resolvedPathWithExt;
|
||||
|
||||
// Strip off the extension and resolve relative to the baseDir
|
||||
baseFilePath = fileName.replace(/\.[^.]+$/, '');
|
||||
resolvedPath = path.resolve(baseDir, baseFilePath);
|
||||
|
||||
// Iterate through each possible extension and return the first source file that is actually found
|
||||
for(var i=0; i<extensions.length; i++) {
|
||||
|
||||
// Try reading the content from files using each of the given extensions
|
||||
try {
|
||||
resolvedPathWithExt = resolvedPath + extensions[i];
|
||||
log.silly('getSourceFile:', resolvedPathWithExt);
|
||||
text = fs.readFileSync(resolvedPathWithExt, { encoding: options.charset });
|
||||
log.debug('found source file:', fileName, resolvedPathWithExt);
|
||||
return ts.createSourceFile(baseFilePath + extensions[i], text, languageVersion);
|
||||
}
|
||||
catch(e) {
|
||||
// Try again if the file simply did not exist, otherwise report the error as a warning
|
||||
if(e.code !== 'ENOENT') {
|
||||
if (onError) onError(e.message);
|
||||
log.warn('Error reading ' + resolvedPathWithExt + ' : ' + e.message);
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
getDefaultLibFileName: function(options) {
|
||||
return path.resolve(path.dirname(ts.sys.getExecutingFilePath()), ts.getDefaultLibFileName(options));
|
||||
},
|
||||
writeFile: function(fileName, data, writeByteOrderMark, onError) {
|
||||
// no-op
|
||||
},
|
||||
getCurrentDirectory: function() {
|
||||
return baseDir;
|
||||
},
|
||||
useCaseSensitiveFileNames: function() {
|
||||
return ts.sys.useCaseSensitiveFileNames;
|
||||
},
|
||||
getCanonicalFileName: function(fileName) {
|
||||
// if underlying system can distinguish between two files whose names differs only in cases then file name already in canonical form.
|
||||
// otherwise use toLowerCase as a canonical form.
|
||||
return ts.sys.useCaseSensitiveFileNames ? fileName : fileName.toLowerCase();
|
||||
},
|
||||
getNewLine: function() {
|
||||
return ts.sys.newLine;
|
||||
},
|
||||
fileExists: function(fileName) {
|
||||
var text, resolvedPath, resolvedPathWithExt;
|
||||
|
||||
// Strip off the extension and resolve relative to the baseDir
|
||||
baseFilePath = fileName.replace(/\.[^.]+$/, '');
|
||||
resolvedPath = path.resolve(baseDir, baseFilePath);
|
||||
|
||||
// Iterate through each possible extension and return the first source file that is actually found
|
||||
for(var i=0; i<extensions.length; i++) {
|
||||
// Try reading the content from files using each of the given extensions
|
||||
resolvedPathWithExt = resolvedPath + extensions[i];
|
||||
if (fs.existsSync(resolvedPathWithExt)) return true;
|
||||
}
|
||||
return false;
|
||||
},
|
||||
readFile: function(fileName) {
|
||||
console.log('readFile - NOT IMPLEMENTED', fileName);
|
||||
}
|
||||
};
|
||||
};
|
||||
};
|
@ -1,80 +0,0 @@
|
||||
var mockPackage = require('../../mocks/mockPackage');
|
||||
var Dgeni = require('dgeni');
|
||||
var path = require('canonical-path');
|
||||
var ts = require('typescript');
|
||||
|
||||
describe('createCompilerHost', function() {
|
||||
var dgeni, injector, options, host, baseDir, extensions;
|
||||
|
||||
beforeEach(function() {
|
||||
dgeni = new Dgeni([mockPackage()]);
|
||||
injector = dgeni.configureInjector();
|
||||
var createCompilerHost = injector.get('createCompilerHost');
|
||||
|
||||
options = { charset: 'utf8' };
|
||||
baseDir = path.resolve(__dirname, '../../mocks/tsParser');
|
||||
extensions = ['.ts', '.js'];
|
||||
|
||||
host = createCompilerHost(options, baseDir, extensions);
|
||||
});
|
||||
|
||||
describe('getSourceFile', function() {
|
||||
it('should return a SourceFile object for a given path, with fileName relative to baseDir', function() {
|
||||
var sourceFile = host.getSourceFile('testSrc.ts');
|
||||
expect(sourceFile.fileName).toEqual('testSrc.ts');
|
||||
expect(sourceFile.pos).toEqual(0);
|
||||
expect(sourceFile.text).toEqual(jasmine.any(String));
|
||||
});
|
||||
|
||||
it('should try each of the configured extensions and update the filename to the correct extension', function() {
|
||||
var sourceFile = host.getSourceFile('testSrc.js');
|
||||
expect(sourceFile.fileName).toEqual('testSrc.ts');
|
||||
|
||||
sourceFile = host.getSourceFile('../mockPackage.ts');
|
||||
expect(sourceFile.fileName).toEqual('../mockPackage.js');
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
describe('getDefaultLibFileName', function() {
|
||||
it('should return a path to the default library', function() {
|
||||
expect(host.getDefaultLibFileName(options)).toContain('typescript/lib/lib.d.ts');
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
describe('writeFile', function() {
|
||||
it('should do nothing', function() {
|
||||
host.writeFile();
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
describe('getCurrentDirectory', function() {
|
||||
it('should return the baseDir', function() {
|
||||
expect(host.getCurrentDirectory()).toEqual(baseDir);
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
describe('useCaseSensitiveFileNames', function() {
|
||||
it('should return true if the OS is case sensitive', function() {
|
||||
expect(host.useCaseSensitiveFileNames()).toBe(ts.sys.useCaseSensitiveFileNames);
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
describe('getCanonicalFileName', function() {
|
||||
it('should lower case the filename', function() {
|
||||
var expectedFilePath = host.useCaseSensitiveFileNames() ? 'SomeFile.ts' : 'somefile.ts';
|
||||
expect(host.getCanonicalFileName('SomeFile.ts')).toEqual(expectedFilePath);
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
describe('getNewLine', function() {
|
||||
it('should return the newline character for the OS', function() {
|
||||
expect(host.getNewLine()).toEqual(require('os').EOL);
|
||||
});
|
||||
});
|
||||
});
|
@ -1,49 +0,0 @@
|
||||
var ts = require('typescript');
|
||||
var LEADING_STAR = /^[^\S\r\n]*\*[^\S\n\r]?/gm;
|
||||
|
||||
module.exports = function getContent() {
|
||||
return function(symbol) {
|
||||
|
||||
var content = "";
|
||||
|
||||
if (!symbol.declarations) return content;
|
||||
|
||||
symbol.declarations.forEach(function(declaration) {
|
||||
|
||||
// If this is left side of dotted module declaration, there is no doc comment associated with this declaration
|
||||
if (declaration.kind === ts.SyntaxKind.ModuleDeclaration && declaration.body.kind === ts.SyntaxKind.ModuleDeclaration) {
|
||||
return content;
|
||||
}
|
||||
|
||||
// If this is dotted module name, get the doc comments from the parent
|
||||
while (declaration.kind === ts.SyntaxKind.ModuleDeclaration && declaration.parent.kind === ts.SyntaxKind.ModuleDeclaration) {
|
||||
declaration = declaration.parent;
|
||||
}
|
||||
|
||||
// If this is a variable declaration then we get the doc comments from the grand parent
|
||||
if (declaration.kind === ts.SyntaxKind.VariableDeclaration) {
|
||||
declaration = declaration.parent.parent;
|
||||
}
|
||||
|
||||
// Get the source file of this declaration
|
||||
var sourceFile = ts.getSourceFileOfNode(declaration);
|
||||
var commentRanges = ts.getJsDocComments(declaration, sourceFile);
|
||||
|
||||
if (commentRanges) {
|
||||
commentRanges.forEach(function(commentRange) {
|
||||
content += sourceFile.text
|
||||
.substring(commentRange.pos+ '/**'.length, commentRange.end - '*/'.length)
|
||||
.replace(LEADING_STAR, '')
|
||||
.trim();
|
||||
if (commentRange.hasTrailingNewLine) {
|
||||
content += '\n';
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
content += '\n';
|
||||
});
|
||||
|
||||
return content;
|
||||
};
|
||||
};
|
@ -1,34 +0,0 @@
|
||||
|
||||
module.exports = function getDirectiveInfo() {
|
||||
|
||||
return function (symbol) {
|
||||
var directiveInfo;
|
||||
if (symbol.valueDeclaration) {
|
||||
var decorators = symbol.valueDeclaration.decorators;
|
||||
decorators && decorators.forEach(function(decorator){
|
||||
try {
|
||||
var expr = decorator.expression;
|
||||
var type = expr.expression.text.match(/Component|Directive/);
|
||||
if (type) {
|
||||
// type is either Component or Directive
|
||||
// properties are selector, inputs and outputs
|
||||
directiveInfo = { type: type[0], properties: [] };
|
||||
|
||||
//Directive only takes one argument
|
||||
expr.arguments[0].properties.forEach(function(prop){
|
||||
var name = prop.name.text;
|
||||
if (name === "selector") {
|
||||
directiveInfo.properties.push({name: name, values: prop.initializer.text.split(",")});
|
||||
}
|
||||
if (name === "inputs" || name === "outputs") {
|
||||
var values = prop.initializer.elements.map(function(e){ return e.text });
|
||||
directiveInfo.properties.push({name: name, values: values });
|
||||
}
|
||||
});
|
||||
}
|
||||
} catch(e){}
|
||||
});
|
||||
}
|
||||
return directiveInfo;
|
||||
};
|
||||
};
|
@ -1,54 +0,0 @@
|
||||
var ts = require('typescript');
|
||||
|
||||
module.exports = function getExportDocType(log) {
|
||||
|
||||
return function(symbol) {
|
||||
if(symbol.flags & ts.SymbolFlags.Function) {
|
||||
return 'function';
|
||||
}
|
||||
if(symbol.flags & ts.SymbolFlags.Class) {
|
||||
return 'class';
|
||||
}
|
||||
if(symbol.flags & ts.SymbolFlags.Interface) {
|
||||
return 'interface';
|
||||
}
|
||||
if(symbol.flags & ts.SymbolFlags.ConstEnum) {
|
||||
return 'enum';
|
||||
}
|
||||
if(symbol.flags & ts.SymbolFlags.RegularEnum) {
|
||||
return 'enum';
|
||||
}
|
||||
if(symbol.flags & ts.SymbolFlags.Property) {
|
||||
return 'module-property';
|
||||
}
|
||||
if(symbol.flags & ts.SymbolFlags.TypeAlias) {
|
||||
return 'type-alias';
|
||||
}
|
||||
if(symbol.flags & ts.SymbolFlags.FunctionScopedVariable) {
|
||||
return 'var';
|
||||
}
|
||||
if(symbol.flags & ts.SymbolFlags.BlockScopedVariable) {
|
||||
return getBlockScopedVariableDocType(symbol);
|
||||
}
|
||||
|
||||
log.warn('getExportDocType(): Unknown symbol type', {
|
||||
symbolName: symbol.name,
|
||||
symbolType: symbol.flags,
|
||||
symbolTarget: symbol.target,
|
||||
file: ts.getSourceFileOfNode(symbol.declarations[0]).fileName
|
||||
});
|
||||
return 'unknown';
|
||||
};
|
||||
|
||||
function getBlockScopedVariableDocType(symbol) {
|
||||
|
||||
var node = symbol.valueDeclaration;
|
||||
while(node) {
|
||||
if ( node.flags & 0x2000 /* const */) {
|
||||
return 'const';
|
||||
}
|
||||
node = node.parent;
|
||||
}
|
||||
return 'let';
|
||||
}
|
||||
};
|
@ -1,20 +0,0 @@
|
||||
var path = require('canonical-path');
|
||||
var ts = require('typescript');
|
||||
|
||||
module.exports = function getFileInfo(log) {
|
||||
|
||||
return function (symbol, basePath) {
|
||||
var fileName = ts.getSourceFileOfNode(symbol.declarations[0]).fileName;
|
||||
|
||||
var file = path.resolve(basePath, fileName);
|
||||
var fileInfo = {
|
||||
filePath: file,
|
||||
baseName: path.basename(file, path.extname(file)),
|
||||
extension: path.extname(file).replace(/^\./, ''),
|
||||
basePath: basePath,
|
||||
relativePath: fileName,
|
||||
projectRelativePath: fileName
|
||||
};
|
||||
return fileInfo;
|
||||
};
|
||||
};
|
@ -1,74 +0,0 @@
|
||||
var ts = require('typescript');
|
||||
var path = require('canonical-path');
|
||||
|
||||
module.exports = function tsParser(createCompilerHost, log) {
|
||||
|
||||
return {
|
||||
|
||||
// These are the extension that we should consider when trying to load a module
|
||||
// During migration from Traceur, there is a mix of `.ts`, `.es6` and `.js` (atScript)
|
||||
// files in the project and the TypeScript compiler only looks for `.ts` files when trying
|
||||
// to load imports.
|
||||
extensions: ['.ts', '.js'],
|
||||
|
||||
// The options for the TS compiler
|
||||
options: {
|
||||
allowNonTsExtensions: true,
|
||||
charset: 'utf8'
|
||||
},
|
||||
|
||||
parse: function(fileNames, baseDir) {
|
||||
|
||||
// "Compile" a program from the given module filenames, to get hold of a
|
||||
// typeChecker that can be used to interrogate the modules, exports and so on.
|
||||
var host = createCompilerHost(this.options, baseDir, this.extensions);
|
||||
var program = ts.createProgram(fileNames, this.options, host);
|
||||
var typeChecker = program.getTypeChecker();
|
||||
|
||||
// Create an array of module symbols for each file we were given
|
||||
var moduleSymbols = [];
|
||||
fileNames.forEach(function(fileName) {
|
||||
var sourceFile = program.getSourceFile(fileName);
|
||||
|
||||
if (!sourceFile) {
|
||||
throw new Error('Invalid source file: ' + fileName);
|
||||
} else if (!sourceFile.symbol) {
|
||||
// Some files contain only a comment and no actual module code
|
||||
log.warn('No module code found in ' + fileName);
|
||||
} else {
|
||||
moduleSymbols.push(sourceFile.symbol);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
moduleSymbols.forEach(function(tsModule) {
|
||||
|
||||
// The type checker has a nice helper function that returns an array of Symbols
|
||||
// representing the exports for a given module
|
||||
tsModule.exportArray = typeChecker.getExportsOfModule(tsModule);
|
||||
|
||||
// Although 'star' imports (e.g. `export * from 'some/module';) get resolved automatically
|
||||
// by the compiler/binder, it seems that explicit imports (e.g. `export { SomeClass } from 'some/module'`)
|
||||
// do not so we have to do a little work.
|
||||
tsModule.exportArray.forEach(function(moduleExport) {
|
||||
if (moduleExport.flags & ts.SymbolFlags.Alias) {
|
||||
// To maintain the alias information (particularly the alias name)
|
||||
// we just attach the original "resolved" symbol to the alias symbol
|
||||
moduleExport.resolvedSymbol = typeChecker.getAliasedSymbol(moduleExport);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
moduleSymbols.typeChecker = typeChecker;
|
||||
|
||||
return {
|
||||
moduleSymbols: moduleSymbols,
|
||||
typeChecker: typeChecker,
|
||||
program: program,
|
||||
host: host
|
||||
};
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
};
|
@ -1,21 +0,0 @@
|
||||
var mockPackage = require('../../mocks/mockPackage');
|
||||
var Dgeni = require('dgeni');
|
||||
var path = require('canonical-path');
|
||||
|
||||
describe('tsParser', function() {
|
||||
var dgeni, injector, parser;
|
||||
|
||||
beforeEach(function() {
|
||||
dgeni = new Dgeni([mockPackage()]);
|
||||
injector = dgeni.configureInjector();
|
||||
parser = injector.get('tsParser');
|
||||
});
|
||||
|
||||
it("should parse a TS file", function() {
|
||||
var parseInfo = parser.parse(['testSrc.ts'], path.resolve(__dirname, '../../mocks/tsParser'));
|
||||
var tsModules = parseInfo.moduleSymbols;
|
||||
expect(tsModules.length).toEqual(1);
|
||||
expect(tsModules[0].exportArray.length).toEqual(3);
|
||||
expect(tsModules[0].exportArray.map(function(i) { return i.name; })).toEqual(['MyClass', 'myFn', 'x']);
|
||||
});
|
||||
});
|
@ -3,7 +3,7 @@ import { Platform } from '../platform/platform';
|
||||
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @hidden
|
||||
*/
|
||||
export class Animation {
|
||||
private _c: Animation[];
|
||||
@ -169,7 +169,7 @@ export class Animation {
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @hidden
|
||||
* NO DOM
|
||||
*/
|
||||
|
||||
@ -364,7 +364,7 @@ export class Animation {
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @hidden
|
||||
* DOM WRITE
|
||||
* RECURSION
|
||||
*/
|
||||
@ -396,7 +396,7 @@ export class Animation {
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @hidden
|
||||
* DOM WRITE
|
||||
* NO RECURSION
|
||||
* ROOT ANIMATION
|
||||
@ -428,7 +428,7 @@ export class Animation {
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @hidden
|
||||
* DOM WRITE
|
||||
* RECURSION
|
||||
*/
|
||||
@ -461,7 +461,7 @@ export class Animation {
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @hidden
|
||||
* DOM WRITE
|
||||
* RECURSION
|
||||
*/
|
||||
@ -482,7 +482,7 @@ export class Animation {
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @hidden
|
||||
* DOM WRITE
|
||||
* NO RECURSION
|
||||
* ROOT ANIMATION
|
||||
@ -533,7 +533,7 @@ export class Animation {
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @hidden
|
||||
* DOM WRITE
|
||||
* RECURSION
|
||||
*/
|
||||
@ -566,7 +566,7 @@ export class Animation {
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @hidden
|
||||
* NO DOM
|
||||
* RECURSION
|
||||
*/
|
||||
@ -585,7 +585,7 @@ export class Animation {
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @hidden
|
||||
* NO DOM
|
||||
* RECURSION
|
||||
*/
|
||||
@ -614,7 +614,7 @@ export class Animation {
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @hidden
|
||||
* NO DOM
|
||||
* NO RECURSION
|
||||
*/
|
||||
@ -625,7 +625,7 @@ export class Animation {
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @hidden
|
||||
* DOM WRITE
|
||||
* NO RECURSION
|
||||
*/
|
||||
@ -707,7 +707,7 @@ export class Animation {
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @hidden
|
||||
* DOM WRITE
|
||||
* NO RECURSION
|
||||
*/
|
||||
@ -746,7 +746,7 @@ export class Animation {
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @hidden
|
||||
* DOM READ
|
||||
* DOM WRITE
|
||||
* RECURSION
|
||||
@ -770,7 +770,7 @@ export class Animation {
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @hidden
|
||||
* DOM WRITE
|
||||
* RECURSION
|
||||
*/
|
||||
@ -823,7 +823,7 @@ export class Animation {
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @hidden
|
||||
* DOM READ
|
||||
* RECURSION
|
||||
*/
|
||||
@ -844,7 +844,7 @@ export class Animation {
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @hidden
|
||||
* DOM WRITE
|
||||
* RECURSION
|
||||
*/
|
||||
@ -865,7 +865,7 @@ export class Animation {
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @hidden
|
||||
* DOM WRITE
|
||||
*/
|
||||
_setAfterStyles() {
|
||||
@ -939,7 +939,7 @@ export class Animation {
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @hidden
|
||||
* DOM WRITE
|
||||
* NO RECURSION
|
||||
*/
|
||||
@ -983,7 +983,7 @@ export class Animation {
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @hidden
|
||||
* DOM WRITE
|
||||
* RECURSION
|
||||
*/
|
||||
@ -1063,7 +1063,7 @@ export class Animation {
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @hidden
|
||||
* DOM WRITE
|
||||
* RECURSION
|
||||
*/
|
||||
@ -1114,7 +1114,7 @@ export class Animation {
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @hidden
|
||||
* NO DOM
|
||||
* RECURSION
|
||||
*/
|
||||
@ -1130,7 +1130,7 @@ export class Animation {
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @hidden
|
||||
* NO RECURSION
|
||||
*/
|
||||
_didFinish(hasCompleted: boolean) {
|
||||
@ -1190,7 +1190,7 @@ export class Animation {
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @hidden
|
||||
* NO DOM
|
||||
*/
|
||||
_transEl(): HTMLElement {
|
||||
|
@ -10,7 +10,7 @@ import { NavOptions } from '../../navigation/nav-util';
|
||||
import { ViewController } from '../../navigation/view-controller';
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @hidden
|
||||
*/
|
||||
@Component({
|
||||
selector: 'ion-action-sheet',
|
||||
|
@ -9,7 +9,7 @@ import { ViewController } from '../../navigation/view-controller';
|
||||
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @hidden
|
||||
*/
|
||||
export class ActionSheet extends ViewController {
|
||||
private _app: App;
|
||||
@ -31,7 +31,7 @@ export class ActionSheet extends ViewController {
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @hidden
|
||||
*/
|
||||
getTransitionName(direction: string) {
|
||||
let key = 'actionSheet' + (direction === 'back' ? 'Leave' : 'Enter');
|
||||
|
@ -12,7 +12,7 @@ import { ViewController } from '../../navigation/view-controller';
|
||||
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @hidden
|
||||
*/
|
||||
@Component({
|
||||
selector: 'ion-alert',
|
||||
|
@ -9,7 +9,7 @@ import { ViewController } from '../../navigation/view-controller';
|
||||
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @hidden
|
||||
*/
|
||||
export class Alert extends ViewController {
|
||||
private _app: App;
|
||||
@ -32,7 +32,7 @@ export class Alert extends ViewController {
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @hidden
|
||||
*/
|
||||
getTransitionName(direction: string) {
|
||||
let key = (direction === 'back' ? 'alertLeave' : 'alertEnter');
|
||||
|
@ -11,7 +11,7 @@ import * as Constants from './app-constants';
|
||||
export const AppRootToken = new OpaqueToken('USERROOT');
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @hidden
|
||||
*/
|
||||
@Component({
|
||||
selector: 'ion-app',
|
||||
@ -91,7 +91,7 @@ export class IonicApp extends Ion implements OnInit {
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @hidden
|
||||
*/
|
||||
_getPortal(portal?: number): OverlayPortal {
|
||||
if (portal === Constants.PORTAL_LOADING) {
|
||||
|
@ -32,12 +32,12 @@ export class App {
|
||||
private _disableScrollAssist: boolean;
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @hidden
|
||||
*/
|
||||
_clickBlock: ClickBlock;
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @hidden
|
||||
*/
|
||||
_appRoot: IonicApp;
|
||||
|
||||
@ -116,14 +116,14 @@ export class App {
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @hidden
|
||||
*/
|
||||
setElementClass(className: string, isAdd: boolean) {
|
||||
this._appRoot.setElementClass(className, isAdd);
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @hidden
|
||||
* Sets if the app is currently enabled or not, meaning if it's
|
||||
* available to accept new user commands. For example, this is set to `false`
|
||||
* while views transition, a modal slides up, an action-sheet
|
||||
@ -150,7 +150,7 @@ export class App {
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @hidden
|
||||
* Toggles whether an application can be scrolled
|
||||
* @param {boolean} disableScroll when set to `false`, the application's
|
||||
* scrolling is enabled. When set to `true`, scrolling is disabled.
|
||||
@ -162,7 +162,7 @@ export class App {
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @hidden
|
||||
* Boolean if the app is actively enabled or not.
|
||||
* @return {boolean}
|
||||
*/
|
||||
@ -175,7 +175,7 @@ export class App {
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @hidden
|
||||
*/
|
||||
setScrolling() {
|
||||
this._scrollTime = Date.now() + ACTIVE_SCROLLING_TIME;
|
||||
@ -216,14 +216,14 @@ export class App {
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @hidden
|
||||
*/
|
||||
_setRootNav(nav: any) {
|
||||
this._rootNav = nav;
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @hidden
|
||||
*/
|
||||
present(enteringView: ViewController, opts: NavOptions, appPortal?: number): Promise<any> {
|
||||
const portal = this._appRoot._getPortal(appPortal);
|
||||
@ -250,7 +250,7 @@ export class App {
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @hidden
|
||||
*/
|
||||
goBack(): Promise<any> {
|
||||
if (this._menuCtrl && this._menuCtrl.isOpen()) {
|
||||
@ -270,7 +270,7 @@ export class App {
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @hidden
|
||||
*/
|
||||
navPop(): Promise<any> {
|
||||
if (!this._rootNav || !this.isEnabled()) {
|
||||
|
@ -1,7 +1,7 @@
|
||||
import { Directive, ElementRef, Renderer } from '@angular/core';
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @hidden
|
||||
*/
|
||||
@Directive({
|
||||
selector: 'ion-backdrop',
|
||||
|
@ -131,25 +131,25 @@ import { isTrueProperty } from '../../util/util';
|
||||
encapsulation: ViewEncapsulation.None,
|
||||
})
|
||||
export class Button extends Ion {
|
||||
/** @private */
|
||||
/** @hidden */
|
||||
_role: string = 'button'; // bar-button
|
||||
|
||||
/** @private */
|
||||
/** @hidden */
|
||||
_size: string; // large/small/default
|
||||
|
||||
/** @private */
|
||||
/** @hidden */
|
||||
_style: string = 'default'; // outline/clear/solid
|
||||
|
||||
/** @private */
|
||||
/** @hidden */
|
||||
_shape: string; // round/fab
|
||||
|
||||
/** @private */
|
||||
/** @hidden */
|
||||
_display: string; // block/full
|
||||
|
||||
/** @private */
|
||||
/** @hidden */
|
||||
_decorator: string; // strong
|
||||
|
||||
/** @private */
|
||||
/** @hidden */
|
||||
_init: boolean;
|
||||
|
||||
/**
|
||||
@ -245,7 +245,7 @@ export class Button extends Ion {
|
||||
this._assignCss(true);
|
||||
}
|
||||
|
||||
/** @private */
|
||||
/** @hidden */
|
||||
_attr(type: string, attrName: string, attrValue: boolean) {
|
||||
if (type === '_style') {
|
||||
this._updateColor(this._color, false);
|
||||
@ -297,14 +297,14 @@ export class Button extends Ion {
|
||||
}
|
||||
}
|
||||
|
||||
/** @private */
|
||||
/** @hidden */
|
||||
ngAfterContentInit() {
|
||||
this._init = true;
|
||||
this._assignCss(true);
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @hidden
|
||||
*/
|
||||
setRole(val: string) {
|
||||
this._assignCss(false);
|
||||
@ -313,7 +313,7 @@ export class Button extends Ion {
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @hidden
|
||||
*/
|
||||
_assignCss(assignCssClass: boolean) {
|
||||
let role = this._role;
|
||||
@ -331,7 +331,7 @@ export class Button extends Ion {
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @hidden
|
||||
*/
|
||||
_setClass(type: string, assignCssClass: boolean) {
|
||||
if (type && this._init) {
|
||||
@ -342,7 +342,7 @@ export class Button extends Ion {
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @hidden
|
||||
*/
|
||||
_updateColor(color: string, isAdd: boolean) {
|
||||
if (color && this._init) {
|
||||
|
@ -4,7 +4,7 @@ import { Config } from '../../config/config';
|
||||
import { Ion } from '../ion';
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @hidden
|
||||
*/
|
||||
@Directive({
|
||||
selector: 'ion-card-content'
|
||||
|
@ -4,7 +4,7 @@ import { Config } from '../../config/config';
|
||||
import { Ion } from '../ion';
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @hidden
|
||||
*/
|
||||
@Directive({
|
||||
selector: 'ion-card-header'
|
||||
|
@ -4,7 +4,7 @@ import { Config } from '../../config/config';
|
||||
import { Ion } from '../ion';
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @hidden
|
||||
*/
|
||||
@Directive({
|
||||
selector: 'ion-card-title'
|
||||
|
@ -5,7 +5,7 @@ import { Ion } from '../ion';
|
||||
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @hidden
|
||||
*/
|
||||
@Directive({
|
||||
selector: 'ion-card'
|
||||
|
@ -73,17 +73,17 @@ export const CHECKBOX_VALUE_ACCESSOR: any = {
|
||||
encapsulation: ViewEncapsulation.None,
|
||||
})
|
||||
export class Checkbox extends Ion implements IonicTapInput, AfterContentInit, ControlValueAccessor, OnDestroy {
|
||||
/** @private */
|
||||
/** @hidden */
|
||||
_checked: boolean = false;
|
||||
/** @private */
|
||||
/** @hidden */
|
||||
_init: boolean;
|
||||
/** @private */
|
||||
/** @hidden */
|
||||
_disabled: boolean = false;
|
||||
/** @private */
|
||||
/** @hidden */
|
||||
_labelId: string;
|
||||
/** @private */
|
||||
/** @hidden */
|
||||
_fn: Function;
|
||||
/** @private */
|
||||
/** @hidden */
|
||||
id: string;
|
||||
|
||||
/**
|
||||
@ -131,7 +131,7 @@ export class Checkbox extends Ion implements IonicTapInput, AfterContentInit, Co
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @hidden
|
||||
*/
|
||||
@HostListener('click', ['$event'])
|
||||
_click(ev: UIEvent) {
|
||||
@ -155,7 +155,7 @@ export class Checkbox extends Ion implements IonicTapInput, AfterContentInit, Co
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @hidden
|
||||
*/
|
||||
_setChecked(isChecked: boolean) {
|
||||
if (isChecked !== this._checked) {
|
||||
@ -168,14 +168,14 @@ export class Checkbox extends Ion implements IonicTapInput, AfterContentInit, Co
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @hidden
|
||||
*/
|
||||
writeValue(val: any) {
|
||||
this._setChecked(isTrueProperty(val));
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @hidden
|
||||
*/
|
||||
registerOnChange(fn: Function): void {
|
||||
this._fn = fn;
|
||||
@ -188,7 +188,7 @@ export class Checkbox extends Ion implements IonicTapInput, AfterContentInit, Co
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @hidden
|
||||
*/
|
||||
registerOnTouched(fn: any) { this.onTouched = fn; }
|
||||
|
||||
@ -206,7 +206,7 @@ export class Checkbox extends Ion implements IonicTapInput, AfterContentInit, Co
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @hidden
|
||||
*/
|
||||
onChange(isChecked: boolean) {
|
||||
// used when this input does not have an ngModel or formControlName
|
||||
@ -217,33 +217,33 @@ export class Checkbox extends Ion implements IonicTapInput, AfterContentInit, Co
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @hidden
|
||||
*/
|
||||
initFocus() {
|
||||
this._elementRef.nativeElement.querySelector('button').focus();
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @hidden
|
||||
*/
|
||||
onTouched() { }
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @hidden
|
||||
*/
|
||||
ngAfterContentInit() {
|
||||
this._init = true;
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @hidden
|
||||
*/
|
||||
setDisabledState(isDisabled: boolean) {
|
||||
this.disabled = isDisabled;
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @hidden
|
||||
*/
|
||||
ngOnDestroy() {
|
||||
this._form.deregister(this);
|
||||
|
@ -183,7 +183,7 @@ export class Content extends Ion implements OnDestroy, OnInit {
|
||||
private _imgRndBfr: number;
|
||||
private _imgVelMax: number;
|
||||
|
||||
/** @private */
|
||||
/** @hidden */
|
||||
statusbarPadding: boolean;
|
||||
|
||||
/**
|
||||
@ -372,7 +372,7 @@ export class Content extends Ion implements OnDestroy, OnInit {
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @hidden
|
||||
*/
|
||||
ngOnInit() {
|
||||
if (this._scrollEle) return;
|
||||
@ -410,7 +410,7 @@ export class Content extends Ion implements OnDestroy, OnInit {
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @hidden
|
||||
*/
|
||||
ngOnDestroy() {
|
||||
this._scLsn && this._scLsn();
|
||||
@ -422,14 +422,14 @@ export class Content extends Ion implements OnDestroy, OnInit {
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @hidden
|
||||
*/
|
||||
getScrollElement(): HTMLElement {
|
||||
return this._scrollEle;
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @hidden
|
||||
*/
|
||||
onScrollElementTransitionEnd(callback: {(ev: TransitionEvent): void}) {
|
||||
this._plt.transitionEnd(this._scrollEle, callback);
|
||||
@ -471,7 +471,7 @@ export class Content extends Ion implements OnDestroy, OnInit {
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @hidden
|
||||
*/
|
||||
enableJsScroll() {
|
||||
this._scroll.enableJsScroll(this._cTop, this._cBottom);
|
||||
@ -492,21 +492,21 @@ export class Content extends Ion implements OnDestroy, OnInit {
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @hidden
|
||||
*/
|
||||
addImg(img: Img) {
|
||||
this._imgs.push(img);
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @hidden
|
||||
*/
|
||||
removeImg(img: Img) {
|
||||
removeArrayItem(this._imgs, img);
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @hidden
|
||||
* DOM WRITE
|
||||
*/
|
||||
setScrollElementStyle(prop: string, val: any) {
|
||||
@ -559,7 +559,7 @@ export class Content extends Ion implements OnDestroy, OnInit {
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @hidden
|
||||
* DOM WRITE
|
||||
* Adds padding to the bottom of the scroll element when the keyboard is open
|
||||
* so content below the keyboard can be scrolled into view.
|
||||
@ -581,7 +581,7 @@ export class Content extends Ion implements OnDestroy, OnInit {
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @hidden
|
||||
* DOM WRITE
|
||||
*/
|
||||
clearScrollPaddingFocusOut() {
|
||||
@ -608,7 +608,7 @@ export class Content extends Ion implements OnDestroy, OnInit {
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @hidden
|
||||
* DOM READ
|
||||
*/
|
||||
private _readDimensions() {
|
||||
@ -754,7 +754,7 @@ export class Content extends Ion implements OnDestroy, OnInit {
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @hidden
|
||||
* DOM WRITE
|
||||
*/
|
||||
private _writeDimensions() {
|
||||
@ -842,7 +842,7 @@ export class Content extends Ion implements OnDestroy, OnInit {
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @hidden
|
||||
*/
|
||||
imgsUpdate() {
|
||||
if (this._scroll.initialized && this._imgs.length && this.isImgsUpdatable()) {
|
||||
@ -851,7 +851,7 @@ export class Content extends Ion implements OnDestroy, OnInit {
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @hidden
|
||||
*/
|
||||
isImgsUpdatable() {
|
||||
// an image is only "updatable" if the content isn't scrolling too fast
|
||||
|
@ -280,7 +280,7 @@ export class DateTime extends Ion implements AfterContentInit, ControlValueAcces
|
||||
_locale: LocaleData = {};
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @hidden
|
||||
*/
|
||||
id: string;
|
||||
|
||||
@ -473,7 +473,7 @@ export class DateTime extends Ion implements AfterContentInit, ControlValueAcces
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @hidden
|
||||
*/
|
||||
open() {
|
||||
if (this._disabled) {
|
||||
@ -520,7 +520,7 @@ export class DateTime extends Ion implements AfterContentInit, ControlValueAcces
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @hidden
|
||||
*/
|
||||
generate(picker: Picker) {
|
||||
// if a picker format wasn't provided, then fallback
|
||||
@ -588,7 +588,7 @@ export class DateTime extends Ion implements AfterContentInit, ControlValueAcces
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @hidden
|
||||
*/
|
||||
validate(picker: Picker) {
|
||||
let i: number;
|
||||
@ -679,7 +679,7 @@ export class DateTime extends Ion implements AfterContentInit, ControlValueAcces
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @hidden
|
||||
*/
|
||||
divyColumns(picker: Picker) {
|
||||
let pickerColumns = picker.getColumns();
|
||||
@ -712,21 +712,21 @@ export class DateTime extends Ion implements AfterContentInit, ControlValueAcces
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @hidden
|
||||
*/
|
||||
setValue(newData: any) {
|
||||
updateDate(this._value, newData);
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @hidden
|
||||
*/
|
||||
getValue(): DateTimeData {
|
||||
return this._value;
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @hidden
|
||||
*/
|
||||
checkHasValue(inputValue: any) {
|
||||
if (this._item) {
|
||||
@ -735,7 +735,7 @@ export class DateTime extends Ion implements AfterContentInit, ControlValueAcces
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @hidden
|
||||
*/
|
||||
updateText() {
|
||||
// create the text of the formatted data
|
||||
@ -744,7 +744,7 @@ export class DateTime extends Ion implements AfterContentInit, ControlValueAcces
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @hidden
|
||||
*/
|
||||
calcMinMax(now?: Date) {
|
||||
const todaysYear = (now || new Date()).getFullYear();
|
||||
@ -807,7 +807,7 @@ export class DateTime extends Ion implements AfterContentInit, ControlValueAcces
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @hidden
|
||||
*/
|
||||
writeValue(val: any) {
|
||||
console.debug('datetime, writeValue', val);
|
||||
@ -817,7 +817,7 @@ export class DateTime extends Ion implements AfterContentInit, ControlValueAcces
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @hidden
|
||||
*/
|
||||
ngAfterContentInit() {
|
||||
// first see if locale names were provided in the inputs
|
||||
@ -832,7 +832,7 @@ export class DateTime extends Ion implements AfterContentInit, ControlValueAcces
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @hidden
|
||||
*/
|
||||
registerOnChange(fn: Function): void {
|
||||
this._fn = fn;
|
||||
@ -850,12 +850,12 @@ export class DateTime extends Ion implements AfterContentInit, ControlValueAcces
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @hidden
|
||||
*/
|
||||
registerOnTouched(fn: any) { this.onTouched = fn; }
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @hidden
|
||||
*/
|
||||
onChange(val: any) {
|
||||
// onChange used when there is not an formControlName
|
||||
@ -867,19 +867,19 @@ export class DateTime extends Ion implements AfterContentInit, ControlValueAcces
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @hidden
|
||||
*/
|
||||
onTouched() { }
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @hidden
|
||||
*/
|
||||
setDisabledState(isDisabled: boolean) {
|
||||
this.disabled = isDisabled;
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @hidden
|
||||
*/
|
||||
ngOnDestroy() {
|
||||
this._form.deregister(this);
|
||||
@ -887,7 +887,7 @@ export class DateTime extends Ion implements AfterContentInit, ControlValueAcces
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @hidden
|
||||
* Use to convert a string of comma separated numbers or
|
||||
* an array of numbers, and clean up any user input
|
||||
*/
|
||||
@ -918,7 +918,7 @@ function convertToArrayOfNumbers(input: any, type: string): number[] {
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @hidden
|
||||
* Use to convert a string of comma separated strings or
|
||||
* an array of strings, and clean up any user input
|
||||
*/
|
||||
|
@ -93,22 +93,22 @@ import { FabList } from './fab-list';
|
||||
export class FabContainer {
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @hidden
|
||||
*/
|
||||
_events: UIEventManager;
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @hidden
|
||||
*/
|
||||
_listsActive: boolean = false;
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @hidden
|
||||
*/
|
||||
@ContentChild(FabButton) _mainButton: FabButton;
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @hidden
|
||||
*/
|
||||
@ContentChildren(FabList) _fabLists: QueryList<FabList>;
|
||||
|
||||
@ -117,7 +117,7 @@ export class FabContainer {
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @hidden
|
||||
*/
|
||||
ngAfterContentInit() {
|
||||
const mainButton = this._mainButton;
|
||||
@ -129,7 +129,7 @@ export class FabContainer {
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @hidden
|
||||
*/
|
||||
clickHandler(ev: any) {
|
||||
if (this.canActivateList(ev)) {
|
||||
@ -138,7 +138,7 @@ export class FabContainer {
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @hidden
|
||||
*/
|
||||
canActivateList(ev: any): boolean {
|
||||
if (this._fabLists.length > 0 && this._mainButton && ev.target) {
|
||||
@ -149,14 +149,14 @@ export class FabContainer {
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @hidden
|
||||
*/
|
||||
toggleList() {
|
||||
this.setActiveLists(!this._listsActive);
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @hidden
|
||||
*/
|
||||
setActiveLists(isActive: boolean) {
|
||||
if (isActive === this._listsActive) {
|
||||
@ -178,7 +178,7 @@ export class FabContainer {
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @hidden
|
||||
*/
|
||||
ngOnDestroy() {
|
||||
this._events.destroy();
|
||||
|
@ -58,7 +58,7 @@ export class FabList {
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @hidden
|
||||
*/
|
||||
setVisible(val: boolean) {
|
||||
let visible = isTrueProperty(val);
|
||||
|
@ -91,7 +91,7 @@ export class FabButton extends Ion {
|
||||
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @hidden
|
||||
*/
|
||||
setActiveClose(closeVisible: boolean) {
|
||||
this.setElementClass('fab-close-active', closeVisible);
|
||||
|
@ -43,17 +43,17 @@ import { Ion } from '../ion';
|
||||
}
|
||||
})
|
||||
export class Icon extends Ion {
|
||||
/** @private */
|
||||
/** @hidden */
|
||||
_iconMode: string;
|
||||
/** @private */
|
||||
/** @hidden */
|
||||
_isActive: boolean = true;
|
||||
/** @private */
|
||||
/** @hidden */
|
||||
_name: string = '';
|
||||
/** @private */
|
||||
/** @hidden */
|
||||
_ios: string = '';
|
||||
/** @private */
|
||||
/** @hidden */
|
||||
_md: string = '';
|
||||
/** @private */
|
||||
/** @hidden */
|
||||
_css: string = '';
|
||||
|
||||
/**
|
||||
@ -89,7 +89,7 @@ export class Icon extends Ion {
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @hidden
|
||||
*/
|
||||
ngOnDestroy() {
|
||||
if (this._css) {
|
||||
@ -160,12 +160,12 @@ export class Icon extends Ion {
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @hidden
|
||||
*/
|
||||
@HostBinding('class.hide') _hidden: boolean = false;
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @hidden
|
||||
*/
|
||||
update() {
|
||||
let iconName: string;
|
||||
|
@ -123,9 +123,9 @@ export class Img implements OnDestroy {
|
||||
/** @internal */
|
||||
_unreg: Function;
|
||||
|
||||
/** @private */
|
||||
/** @hidden */
|
||||
canRequest: boolean;
|
||||
/** @private */
|
||||
/** @hidden */
|
||||
canRender: boolean;
|
||||
|
||||
|
||||
@ -178,7 +178,7 @@ export class Img implements OnDestroy {
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @hidden
|
||||
*/
|
||||
reset() {
|
||||
if (this._requestingSrc) {
|
||||
@ -196,7 +196,7 @@ export class Img implements OnDestroy {
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @hidden
|
||||
*/
|
||||
update() {
|
||||
// only attempt an update if there is an active src
|
||||
@ -255,7 +255,7 @@ export class Img implements OnDestroy {
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @hidden
|
||||
*/
|
||||
get top(): number {
|
||||
const bounds = this._getBounds();
|
||||
@ -263,7 +263,7 @@ export class Img implements OnDestroy {
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @hidden
|
||||
*/
|
||||
get bottom(): number {
|
||||
const bounds = this._getBounds();
|
||||
@ -360,7 +360,7 @@ export class Img implements OnDestroy {
|
||||
@Input() alt: string = '';
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @hidden
|
||||
*/
|
||||
ngAfterContentInit() {
|
||||
this._img = this._elementRef.nativeElement.firstChild;
|
||||
@ -372,7 +372,7 @@ export class Img implements OnDestroy {
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @hidden
|
||||
*/
|
||||
ngOnDestroy() {
|
||||
this._unreg && this._unreg();
|
||||
|
@ -5,7 +5,7 @@ import { InfiniteScroll } from './infinite-scroll';
|
||||
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @hidden
|
||||
*/
|
||||
@Component({
|
||||
selector: 'ion-infinite-scroll-content',
|
||||
@ -36,7 +36,7 @@ export class InfiniteScrollContent {
|
||||
constructor(public inf: InfiniteScroll, private _config: Config) {}
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @hidden
|
||||
*/
|
||||
ngOnInit() {
|
||||
if (!this.loadingSpinner) {
|
||||
|
@ -239,7 +239,7 @@ export class InfiniteScroll {
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @hidden
|
||||
*/
|
||||
_setListeners(shouldListen: boolean) {
|
||||
if (this._init) {
|
||||
@ -257,7 +257,7 @@ export class InfiniteScroll {
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @hidden
|
||||
*/
|
||||
ngAfterContentInit() {
|
||||
this._init = true;
|
||||
@ -265,7 +265,7 @@ export class InfiniteScroll {
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @hidden
|
||||
*/
|
||||
ngOnDestroy() {
|
||||
this._setListeners(false);
|
||||
|
@ -115,7 +115,7 @@ export class TextInput extends Ion implements IonicFormInput {
|
||||
_usePadding: boolean;
|
||||
_value: any = '';
|
||||
|
||||
/** @private */
|
||||
/** @hidden */
|
||||
inputControl: NgControl;
|
||||
|
||||
constructor(
|
||||
@ -227,7 +227,7 @@ export class TextInput extends Ion implements IonicFormInput {
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @hidden
|
||||
*/
|
||||
setDisabled(val: boolean) {
|
||||
this._renderer.setElementAttribute(this._elementRef.nativeElement, 'disabled', val ? '' : null);
|
||||
@ -236,7 +236,7 @@ export class TextInput extends Ion implements IonicFormInput {
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @hidden
|
||||
*/
|
||||
setDisabledState(isDisabled: boolean) {
|
||||
this.disabled = isDisabled;
|
||||
@ -286,7 +286,7 @@ export class TextInput extends Ion implements IonicFormInput {
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @hidden
|
||||
*/
|
||||
setMin(val: any) {
|
||||
this._native && this._native.setMin(val);
|
||||
@ -304,7 +304,7 @@ export class TextInput extends Ion implements IonicFormInput {
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @hidden
|
||||
*/
|
||||
setMax(val: any) {
|
||||
this._native && this._native.setMax(val);
|
||||
@ -322,14 +322,14 @@ export class TextInput extends Ion implements IonicFormInput {
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @hidden
|
||||
*/
|
||||
setStep(val: any) {
|
||||
this._native && this._native.setStep(val);
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @hidden
|
||||
*/
|
||||
@ViewChild('input', { read: NativeInput })
|
||||
set _nativeInput(nativeInput: NativeInput) {
|
||||
@ -339,7 +339,7 @@ export class TextInput extends Ion implements IonicFormInput {
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @hidden
|
||||
*/
|
||||
@ViewChild('textarea', { read: NativeInput })
|
||||
set _nativeTextarea(nativeInput: NativeInput) {
|
||||
@ -349,7 +349,7 @@ export class TextInput extends Ion implements IonicFormInput {
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @hidden
|
||||
*/
|
||||
@ViewChild(NextInput)
|
||||
set _nextInput(nextInput: NextInput) {
|
||||
@ -371,7 +371,7 @@ export class TextInput extends Ion implements IonicFormInput {
|
||||
@Output() focus: EventEmitter<Event> = new EventEmitter<Event>();
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @hidden
|
||||
*/
|
||||
setNativeInput(nativeInput: NativeInput) {
|
||||
this._native = nativeInput;
|
||||
@ -446,7 +446,7 @@ export class TextInput extends Ion implements IonicFormInput {
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @hidden
|
||||
*/
|
||||
initFocus() {
|
||||
// begin the process of setting focus to the inner input element
|
||||
@ -523,7 +523,7 @@ export class TextInput extends Ion implements IonicFormInput {
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @hidden
|
||||
*/
|
||||
setFocus() {
|
||||
// immediately set focus
|
||||
@ -540,7 +540,7 @@ export class TextInput extends Ion implements IonicFormInput {
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @hidden
|
||||
*/
|
||||
scrollHideFocus(ev: ScrollEvent, shouldHideFocus: boolean) {
|
||||
// do not continue if there's no nav, or it's transitioning
|
||||
@ -553,21 +553,21 @@ export class TextInput extends Ion implements IonicFormInput {
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @hidden
|
||||
*/
|
||||
inputBlurred(ev: UIEvent) {
|
||||
this.blur.emit(ev);
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @hidden
|
||||
*/
|
||||
inputFocused(ev: UIEvent) {
|
||||
this.focus.emit(ev);
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @hidden
|
||||
*/
|
||||
writeValue(val: any) {
|
||||
this._value = val;
|
||||
@ -575,14 +575,14 @@ export class TextInput extends Ion implements IonicFormInput {
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @hidden
|
||||
*/
|
||||
onChange(val: any) {
|
||||
this.checkHasValue(val);
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @hidden
|
||||
*/
|
||||
onKeydown(val: any) {
|
||||
if (this._clearOnEdit) {
|
||||
@ -591,12 +591,12 @@ export class TextInput extends Ion implements IonicFormInput {
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @hidden
|
||||
*/
|
||||
onTouched(val: any) {}
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @hidden
|
||||
*/
|
||||
hasFocus(): boolean {
|
||||
// check if an input has focus or not
|
||||
@ -604,7 +604,7 @@ export class TextInput extends Ion implements IonicFormInput {
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @hidden
|
||||
*/
|
||||
hasValue(): boolean {
|
||||
const inputValue = this._value;
|
||||
@ -612,7 +612,7 @@ export class TextInput extends Ion implements IonicFormInput {
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @hidden
|
||||
*/
|
||||
checkHasValue(inputValue: any) {
|
||||
if (this._item) {
|
||||
@ -622,7 +622,7 @@ export class TextInput extends Ion implements IonicFormInput {
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @hidden
|
||||
*/
|
||||
focusChange(inputHasFocus: boolean) {
|
||||
if (this._item) {
|
||||
@ -637,7 +637,7 @@ export class TextInput extends Ion implements IonicFormInput {
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @hidden
|
||||
*/
|
||||
pointerStart(ev: UIEvent) {
|
||||
// input cover touchstart
|
||||
@ -654,7 +654,7 @@ export class TextInput extends Ion implements IonicFormInput {
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @hidden
|
||||
*/
|
||||
pointerEnd(ev: UIEvent) {
|
||||
// input cover touchend/mouseup
|
||||
@ -684,7 +684,7 @@ export class TextInput extends Ion implements IonicFormInput {
|
||||
this._coord = null;
|
||||
}
|
||||
/**
|
||||
* @private
|
||||
* @hidden
|
||||
*/
|
||||
setItemInputControlCss() {
|
||||
let item = this._item;
|
||||
@ -703,7 +703,7 @@ export class TextInput extends Ion implements IonicFormInput {
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @hidden
|
||||
*/
|
||||
ngOnInit() {
|
||||
const item = this._item;
|
||||
@ -722,14 +722,14 @@ export class TextInput extends Ion implements IonicFormInput {
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @hidden
|
||||
*/
|
||||
ngAfterContentChecked() {
|
||||
this.setItemInputControlCss();
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @hidden
|
||||
*/
|
||||
ngOnDestroy() {
|
||||
this._form.deregister(this);
|
||||
@ -742,7 +742,7 @@ export class TextInput extends Ion implements IonicFormInput {
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @hidden
|
||||
*/
|
||||
clearTextInput() {
|
||||
console.debug('Should clear input');
|
||||
@ -753,7 +753,7 @@ export class TextInput extends Ion implements IonicFormInput {
|
||||
|
||||
/**
|
||||
* Check if we need to clear the text input if clearOnEdit is enabled
|
||||
* @private
|
||||
* @hidden
|
||||
*/
|
||||
checkClearOnEdit(inputValue: string) {
|
||||
if (!this._clearOnEdit) {
|
||||
@ -771,7 +771,7 @@ export class TextInput extends Ion implements IonicFormInput {
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @hidden
|
||||
* Angular2 Forms API method called by the view (formControlName) to register the
|
||||
* onChange event handler that updates the model (Control).
|
||||
* @param {Function} fn the onChange event handler.
|
||||
@ -779,7 +779,7 @@ export class TextInput extends Ion implements IonicFormInput {
|
||||
registerOnChange(fn: any) { this.onChange = fn; }
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @hidden
|
||||
* Angular2 Forms API method called by the view (formControlName) to register
|
||||
* the onTouched event handler that marks model (Control) as touched.
|
||||
* @param {Function} fn onTouched event handler.
|
||||
@ -788,7 +788,7 @@ export class TextInput extends Ion implements IonicFormInput {
|
||||
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @hidden
|
||||
*/
|
||||
focusNext() {
|
||||
this._form.tabFocus(this);
|
||||
@ -848,7 +848,7 @@ const TEXT_TYPE_REGEX = /password|email|number|search|tel|url|date|month|time|we
|
||||
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @hidden
|
||||
*/
|
||||
export function getScrollData(inputOffsetTop: number, inputOffsetHeight: number, scrollViewDimensions: ContentDimensions, keyboardHeight: number, plaformHeight: number) {
|
||||
// compute input's Y values relative to the body
|
||||
|
@ -6,7 +6,7 @@ import { Platform } from '../../platform/platform';
|
||||
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @hidden
|
||||
*/
|
||||
@Directive({
|
||||
selector: '.text-input'
|
||||
|
@ -1,7 +1,7 @@
|
||||
import { Directive, EventEmitter, HostListener, Output } from '@angular/core';
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @hidden
|
||||
*/
|
||||
@Directive({
|
||||
selector: '[next-input]'
|
||||
|
@ -8,22 +8,22 @@ import { Config } from '../config/config';
|
||||
* sending/receiving app-level events.
|
||||
*/
|
||||
export class Ion {
|
||||
/** @private */
|
||||
/** @hidden */
|
||||
_config: Config;
|
||||
|
||||
/** @private */
|
||||
/** @hidden */
|
||||
_elementRef: ElementRef;
|
||||
|
||||
/** @private */
|
||||
/** @hidden */
|
||||
_renderer: Renderer;
|
||||
|
||||
/** @private */
|
||||
/** @hidden */
|
||||
_color: string;
|
||||
|
||||
/** @private */
|
||||
/** @hidden */
|
||||
_mode: string;
|
||||
|
||||
/** @private */
|
||||
/** @hidden */
|
||||
_componentName: string;
|
||||
|
||||
constructor(config: Config, elementRef: ElementRef, renderer: Renderer, componentName?: string) {
|
||||
@ -38,22 +38,22 @@ export class Ion {
|
||||
}
|
||||
}
|
||||
|
||||
/** @private */
|
||||
/** @hidden */
|
||||
setElementClass(className: string, isAdd: boolean) {
|
||||
this._renderer.setElementClass(this._elementRef.nativeElement, className, isAdd);
|
||||
}
|
||||
|
||||
/** @private */
|
||||
/** @hidden */
|
||||
setElementAttribute(attributeName: string, attributeValue: any) {
|
||||
this._renderer.setElementAttribute(this._elementRef.nativeElement, attributeName, attributeValue);
|
||||
}
|
||||
|
||||
/** @private */
|
||||
/** @hidden */
|
||||
setElementStyle(property: string, value: string) {
|
||||
this._renderer.setElementStyle(this._elementRef.nativeElement, property, value);
|
||||
}
|
||||
|
||||
/** @private */
|
||||
/** @hidden */
|
||||
_setColor(newColor: string, componentName?: string) {
|
||||
if (componentName) {
|
||||
// This is needed for the item-radio
|
||||
@ -68,7 +68,7 @@ export class Ion {
|
||||
}
|
||||
}
|
||||
|
||||
/** @private */
|
||||
/** @hidden */
|
||||
_setMode(newMode: string) {
|
||||
if (this._mode) {
|
||||
this.setElementClass(`${this._componentName}-${this._mode}`, false);
|
||||
@ -84,17 +84,17 @@ export class Ion {
|
||||
}
|
||||
}
|
||||
|
||||
/** @private */
|
||||
/** @hidden */
|
||||
_setComponentName() {
|
||||
this.setElementClass(this._componentName, true);
|
||||
}
|
||||
|
||||
/** @private */
|
||||
/** @hidden */
|
||||
getElementRef(): ElementRef {
|
||||
return this._elementRef;
|
||||
}
|
||||
|
||||
/** @private */
|
||||
/** @hidden */
|
||||
getNativeElement(): any {
|
||||
return this._elementRef.nativeElement;
|
||||
}
|
||||
|
@ -1,7 +1,7 @@
|
||||
import { Directive } from '@angular/core';
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @hidden
|
||||
*/
|
||||
@Directive({
|
||||
selector: 'ion-item,[ion-item]',
|
||||
|
@ -5,7 +5,7 @@ import { Form } from '../../util/form';
|
||||
import { Ion } from '../ion';
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @hidden
|
||||
*/
|
||||
@Directive({
|
||||
selector: 'ion-item-divider',
|
||||
|
@ -1,7 +1,7 @@
|
||||
import { Directive } from '@angular/core';
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @hidden
|
||||
*/
|
||||
@Directive({
|
||||
selector: 'ion-item-group'
|
||||
|
@ -42,7 +42,7 @@ export class ItemOptions {
|
||||
constructor(private _elementRef: ElementRef, private _renderer: Renderer) {}
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @hidden
|
||||
*/
|
||||
getSides(): number {
|
||||
if (isPresent(this.side) && this.side === 'left') {
|
||||
@ -52,7 +52,7 @@ export class ItemOptions {
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @hidden
|
||||
*/
|
||||
width() {
|
||||
return this._elementRef.nativeElement.offsetWidth;
|
||||
|
@ -5,7 +5,7 @@ import { UIEventManager } from '../../gestures/ui-event-manager';
|
||||
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @hidden
|
||||
*/
|
||||
export class ItemReorderGesture {
|
||||
private selectedItemEle: HTMLElement = null;
|
||||
@ -150,7 +150,7 @@ export class ItemReorderGesture {
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @hidden
|
||||
*/
|
||||
destroy() {
|
||||
this.onDragEnd(null);
|
||||
|
@ -1,19 +1,19 @@
|
||||
/**
|
||||
* @private
|
||||
* @hidden
|
||||
*/
|
||||
export function indexForItem(element: any): number {
|
||||
return element['$ionIndex'];
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @hidden
|
||||
*/
|
||||
export function reorderListForItem(element: any): any {
|
||||
return element['$ionReorderList'];
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @hidden
|
||||
*/
|
||||
export function findReorderItem(node: any, listNode: any): HTMLElement {
|
||||
let nested = 0;
|
||||
|
@ -170,7 +170,7 @@ export class ItemReorder implements ItemReorderGestureDelegate {
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @hidden
|
||||
*/
|
||||
ngOnDestroy() {
|
||||
this._element = null;
|
||||
@ -178,7 +178,7 @@ export class ItemReorder implements ItemReorderGestureDelegate {
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @hidden
|
||||
*/
|
||||
@Input()
|
||||
get reorder(): boolean {
|
||||
@ -287,14 +287,14 @@ export class ItemReorder implements ItemReorderGestureDelegate {
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @hidden
|
||||
*/
|
||||
setElementClass(classname: string, add: boolean) {
|
||||
this._rendered.setElementClass(this._element, classname, add);
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @hidden
|
||||
*/
|
||||
getNativeElement(): HTMLElement {
|
||||
return this._element;
|
||||
|
@ -7,7 +7,7 @@ import { Platform } from '../../platform/platform';
|
||||
import { pointerCoord } from '../../util/dom';
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @hidden
|
||||
*/
|
||||
export class ItemSlidingGesture extends PanGesture {
|
||||
|
||||
|
@ -133,7 +133,7 @@ export class ItemSliding {
|
||||
private _state: SlidingState = SlidingState.Disabled;
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @hidden
|
||||
*/
|
||||
@ContentChild(Item) item: Item;
|
||||
|
||||
@ -193,14 +193,14 @@ export class ItemSliding {
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @hidden
|
||||
*/
|
||||
getOpenAmount(): number {
|
||||
return this._openAmount;
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @hidden
|
||||
*/
|
||||
getSlidingPercent(): number {
|
||||
let openAmount = this._openAmount;
|
||||
@ -214,7 +214,7 @@ export class ItemSliding {
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @hidden
|
||||
*/
|
||||
startSliding(startX: number) {
|
||||
if (this._tmr) {
|
||||
@ -230,7 +230,7 @@ export class ItemSliding {
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @hidden
|
||||
*/
|
||||
moveSliding(x: number): number {
|
||||
if (this._optsDirty) {
|
||||
@ -263,7 +263,7 @@ export class ItemSliding {
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @hidden
|
||||
*/
|
||||
endSliding(velocity: number): number {
|
||||
let restingPoint = (this._openAmount > 0)
|
||||
@ -285,7 +285,7 @@ export class ItemSliding {
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @hidden
|
||||
*/
|
||||
private fireSwipeEvent() {
|
||||
if (this._state & SlidingState.SwipeRight) {
|
||||
@ -296,7 +296,7 @@ export class ItemSliding {
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @hidden
|
||||
*/
|
||||
private calculateOptsWidth() {
|
||||
if (!this._optsDirty) {
|
||||
@ -412,7 +412,7 @@ export class ItemSliding {
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @hidden
|
||||
*/
|
||||
setElementClass(cssClass: string, shouldAdd: boolean) {
|
||||
this._renderer.setElementClass(this._elementRef.nativeElement, cssClass, shouldAdd);
|
||||
|
@ -302,12 +302,12 @@ export class Item extends Ion {
|
||||
_hasReorder: boolean;
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @hidden
|
||||
*/
|
||||
id: string;
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @hidden
|
||||
*/
|
||||
labelId: string = null;
|
||||
|
||||
@ -357,7 +357,7 @@ export class Item extends Ion {
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @hidden
|
||||
*/
|
||||
registerInput(type: string) {
|
||||
this._inputs.push(type);
|
||||
@ -365,7 +365,7 @@ export class Item extends Ion {
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @hidden
|
||||
*/
|
||||
ngAfterContentInit() {
|
||||
if (this._viewLabel && this._inputs.length) {
|
||||
@ -379,7 +379,7 @@ export class Item extends Ion {
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @hidden
|
||||
*/
|
||||
_updateColor(newColor: string, componentName?: string) {
|
||||
componentName = componentName || 'item'; // item-radio
|
||||
@ -387,7 +387,7 @@ export class Item extends Ion {
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @hidden
|
||||
*/
|
||||
_setName(elementRef: ElementRef) {
|
||||
let nodeName = elementRef.nativeElement.nodeName.replace('ION-', '');
|
||||
@ -398,14 +398,14 @@ export class Item extends Ion {
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @hidden
|
||||
*/
|
||||
getLabelText(): string {
|
||||
return this._label ? this._label.text : '';
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @hidden
|
||||
*/
|
||||
@ContentChild(Label)
|
||||
set contentLabel(label: Label) {
|
||||
@ -420,7 +420,7 @@ export class Item extends Ion {
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @hidden
|
||||
*/
|
||||
@ViewChild(Label)
|
||||
set viewLabel(label: Label) {
|
||||
@ -430,7 +430,7 @@ export class Item extends Ion {
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @hidden
|
||||
*/
|
||||
@ContentChildren(Button)
|
||||
set _buttons(buttons: QueryList<Button>) {
|
||||
@ -442,7 +442,7 @@ export class Item extends Ion {
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @hidden
|
||||
*/
|
||||
@ContentChildren(Icon)
|
||||
set _icons(icons: QueryList<Icon>) {
|
||||
|
@ -3,7 +3,7 @@ import { Component, ElementRef, HostListener } from '@angular/core';
|
||||
import { findReorderItem } from './item-reorder-util';
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @hidden
|
||||
*/
|
||||
@Component({
|
||||
selector: 'ion-reorder',
|
||||
|
@ -81,7 +81,7 @@ export class Label extends Ion {
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @hidden
|
||||
*/
|
||||
type: string;
|
||||
|
||||
@ -99,7 +99,7 @@ export class Label extends Ion {
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @hidden
|
||||
*/
|
||||
@Input()
|
||||
get id(): string {
|
||||
@ -114,7 +114,7 @@ export class Label extends Ion {
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @hidden
|
||||
*/
|
||||
get text(): string {
|
||||
return this.getNativeElement().textContent || '';
|
||||
|
@ -4,7 +4,7 @@ import { Config } from '../../config/config';
|
||||
import { Ion } from '../ion';
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @hidden
|
||||
*/
|
||||
@Directive({
|
||||
selector: 'ion-list-header'
|
||||
|
@ -85,7 +85,7 @@ export class List extends Ion {
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @hidden
|
||||
*/
|
||||
containsSlidingItem(contains: boolean) {
|
||||
this._containsSlidingItems = contains;
|
||||
@ -114,7 +114,7 @@ export class List extends Ion {
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @hidden
|
||||
*/
|
||||
destroy() {
|
||||
this._slidingGesture && this._slidingGesture.destroy();
|
||||
|
@ -9,7 +9,7 @@ import { Platform } from '../../platform/platform';
|
||||
import { ViewController } from '../../navigation/view-controller';
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @hidden
|
||||
*/
|
||||
@Component({
|
||||
selector: 'ion-loading',
|
||||
|
@ -9,7 +9,7 @@ import { NavOptions } from '../../navigation/nav-util';
|
||||
import { ViewController } from '../../navigation/view-controller';
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @hidden
|
||||
*/
|
||||
export class Loading extends ViewController {
|
||||
private _app: App;
|
||||
@ -31,7 +31,7 @@ export class Loading extends ViewController {
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @hidden
|
||||
*/
|
||||
getTransitionName(direction: string) {
|
||||
let key = (direction === 'back' ? 'loadingLeave' : 'loadingEnter');
|
||||
|
@ -33,14 +33,14 @@ import { MenuController } from './menu-controller';
|
||||
export class MenuClose {
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @hidden
|
||||
*/
|
||||
@Input() menuClose: string;
|
||||
|
||||
constructor(private _menu: MenuController) {}
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @hidden
|
||||
*/
|
||||
@HostListener('click')
|
||||
close() {
|
||||
|
@ -286,7 +286,7 @@ export class MenuController {
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @hidden
|
||||
* @return {boolean} if any menu is currently animating
|
||||
*/
|
||||
isAnimating(): boolean {
|
||||
@ -294,7 +294,7 @@ export class MenuController {
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @hidden
|
||||
*/
|
||||
_register(menu: Menu) {
|
||||
assert(this._menus.indexOf(menu) < 0, 'menu was already registered');
|
||||
@ -302,7 +302,7 @@ export class MenuController {
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @hidden
|
||||
*/
|
||||
_unregister(menu: Menu) {
|
||||
assert(this._menus.indexOf(menu) >= 0, 'menu is not registered');
|
||||
@ -310,7 +310,7 @@ export class MenuController {
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @hidden
|
||||
*/
|
||||
_setActiveMenu(menu: Menu) {
|
||||
assert(menu.enabled, 'menu must be enabled');
|
||||
@ -327,14 +327,14 @@ export class MenuController {
|
||||
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @hidden
|
||||
*/
|
||||
static registerType(name: string, cls: new(...args: any[]) => MenuType) {
|
||||
menuTypes[name] = cls;
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @hidden
|
||||
*/
|
||||
static create(type: string, menuCmp: Menu, plt: Platform) {
|
||||
return new menuTypes[type](menuCmp, plt);
|
||||
|
@ -93,17 +93,17 @@ import { ViewController } from '../../navigation/view-controller';
|
||||
export class MenuToggle {
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @hidden
|
||||
*/
|
||||
@Input() menuToggle: string;
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @hidden
|
||||
*/
|
||||
private _isButton: boolean;
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @hidden
|
||||
*/
|
||||
private _inNavbar: boolean;
|
||||
|
||||
@ -125,7 +125,7 @@ export class MenuToggle {
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @hidden
|
||||
*/
|
||||
@HostListener('click')
|
||||
toggle() {
|
||||
@ -134,7 +134,7 @@ export class MenuToggle {
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @hidden
|
||||
*/
|
||||
get isHidden() {
|
||||
const menu = this._menu.get(this.menuToggle);
|
||||
|
@ -5,7 +5,7 @@ import { Platform } from '../../platform/platform';
|
||||
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @hidden
|
||||
* Menu Type
|
||||
* Base class which is extended by the various types. Each
|
||||
* type will provide their own animations for open and close
|
||||
@ -75,7 +75,7 @@ export class MenuType {
|
||||
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @hidden
|
||||
* Menu Reveal Type
|
||||
* The content slides over to reveal the menu underneath.
|
||||
* The menu itself, which is under the content, does not move.
|
||||
@ -94,7 +94,7 @@ MenuController.registerType('reveal', MenuRevealType);
|
||||
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @hidden
|
||||
* Menu Push Type
|
||||
* The content slides over to reveal the menu underneath.
|
||||
* The menu itself also slides over to reveal its bad self.
|
||||
@ -130,7 +130,7 @@ MenuController.registerType('push', MenuPushType);
|
||||
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @hidden
|
||||
* Menu Overlay Type
|
||||
* The menu slides over the content. The content
|
||||
* itself, which is under the menu, does not move.
|
||||
|
@ -207,22 +207,22 @@ export class Menu implements RootNode {
|
||||
private _isPane: boolean = false;
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @hidden
|
||||
*/
|
||||
isOpen: boolean = false;
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @hidden
|
||||
*/
|
||||
@ViewChild(Backdrop) backdrop: Backdrop;
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @hidden
|
||||
*/
|
||||
@ContentChild(Content) menuContent: Content;
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @hidden
|
||||
*/
|
||||
@ContentChild(Nav) menuNav: Nav;
|
||||
|
||||
@ -287,7 +287,7 @@ export class Menu implements RootNode {
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @hidden
|
||||
*/
|
||||
@Input() maxEdgeStart: number;
|
||||
|
||||
@ -325,7 +325,7 @@ export class Menu implements RootNode {
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @hidden
|
||||
*/
|
||||
ngOnInit() {
|
||||
this._init = true;
|
||||
@ -372,7 +372,7 @@ export class Menu implements RootNode {
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @hidden
|
||||
*/
|
||||
onBackdropClick(ev: UIEvent) {
|
||||
ev.preventDefault();
|
||||
@ -381,7 +381,7 @@ export class Menu implements RootNode {
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @hidden
|
||||
*/
|
||||
private _getType(): MenuType {
|
||||
if (!this._type) {
|
||||
@ -395,7 +395,7 @@ export class Menu implements RootNode {
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @hidden
|
||||
*/
|
||||
setOpen(shouldOpen: boolean, animated: boolean = true): Promise<boolean> {
|
||||
// If the menu is disabled or it is currenly being animated, let's do nothing
|
||||
@ -420,7 +420,7 @@ export class Menu implements RootNode {
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @hidden
|
||||
*/
|
||||
canSwipe(): boolean {
|
||||
return this._isSwipeEnabled &&
|
||||
@ -430,7 +430,7 @@ export class Menu implements RootNode {
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @hidden
|
||||
*/
|
||||
isAnimating(): boolean {
|
||||
return this._isAnimating;
|
||||
@ -536,21 +536,21 @@ export class Menu implements RootNode {
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @hidden
|
||||
*/
|
||||
open(): Promise<boolean> {
|
||||
return this.setOpen(true);
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @hidden
|
||||
*/
|
||||
close(): Promise<boolean> {
|
||||
return this.setOpen(false);
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @hidden
|
||||
*/
|
||||
resize() {
|
||||
const content: Content | Nav = this.menuContent
|
||||
@ -560,7 +560,7 @@ export class Menu implements RootNode {
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @hidden
|
||||
*/
|
||||
toggle(): Promise<boolean> {
|
||||
return this.setOpen(!this.isOpen);
|
||||
@ -571,7 +571,7 @@ export class Menu implements RootNode {
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @hidden
|
||||
*/
|
||||
_updateState() {
|
||||
const canOpen = this._canOpen();
|
||||
@ -611,7 +611,7 @@ export class Menu implements RootNode {
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @hidden
|
||||
*/
|
||||
enable(shouldEnable: boolean): Menu {
|
||||
this._isEnabled = shouldEnable;
|
||||
@ -636,7 +636,7 @@ export class Menu implements RootNode {
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @hidden
|
||||
*/
|
||||
swipeEnable(shouldEnable: boolean): Menu {
|
||||
this._isSwipeEnabled = shouldEnable;
|
||||
@ -645,70 +645,70 @@ export class Menu implements RootNode {
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @hidden
|
||||
*/
|
||||
getNativeElement(): HTMLElement {
|
||||
return this._elementRef.nativeElement;
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @hidden
|
||||
*/
|
||||
getMenuElement(): HTMLElement {
|
||||
return <HTMLElement>this.getNativeElement().querySelector('.menu-inner');
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @hidden
|
||||
*/
|
||||
getContentElement(): HTMLElement {
|
||||
return this._cntEle;
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @hidden
|
||||
*/
|
||||
getBackdropElement(): HTMLElement {
|
||||
return this.backdrop.getNativeElement();
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @hidden
|
||||
*/
|
||||
width(): number {
|
||||
return this.getMenuElement().offsetWidth;
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @hidden
|
||||
*/
|
||||
getMenuController(): MenuController {
|
||||
return this._menuCtrl;
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @hidden
|
||||
*/
|
||||
setElementClass(className: string, add: boolean) {
|
||||
this._renderer.setElementClass(this._elementRef.nativeElement, className, add);
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @hidden
|
||||
*/
|
||||
setElementAttribute(attributeName: string, value: string) {
|
||||
this._renderer.setElementAttribute(this._elementRef.nativeElement, attributeName, value);
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @hidden
|
||||
*/
|
||||
getElementRef(): ElementRef {
|
||||
return this._elementRef;
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @hidden
|
||||
*/
|
||||
ngOnDestroy() {
|
||||
this._menuCtrl._unregister(this);
|
||||
|
@ -9,7 +9,7 @@ import { ModuleLoader } from '../../util/module-loader';
|
||||
import { assert } from '../../util/util';
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @hidden
|
||||
*/
|
||||
@Component({
|
||||
selector: 'ion-modal',
|
||||
@ -49,7 +49,7 @@ export class ModalCmp {
|
||||
this._load(this._navParams.data.component);
|
||||
}
|
||||
|
||||
/** @private */
|
||||
/** @hidden */
|
||||
_load(component: any) {
|
||||
if (component) {
|
||||
|
||||
@ -80,7 +80,7 @@ export class ModalCmp {
|
||||
this._gestureBlocker.unblock();
|
||||
}
|
||||
|
||||
/** @private */
|
||||
/** @hidden */
|
||||
_setCssClass(componentRef: any, className: string) {
|
||||
this._renderer.setElementClass(componentRef.location.nativeElement, className, true);
|
||||
}
|
||||
|
@ -9,7 +9,7 @@ import { NavOptions } from '../../navigation/nav-util';
|
||||
import { ViewController } from '../../navigation/view-controller';
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @hidden
|
||||
*/
|
||||
export class ModalImpl extends ViewController {
|
||||
private _app: App;
|
||||
@ -37,7 +37,7 @@ export class ModalImpl extends ViewController {
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @hidden
|
||||
*/
|
||||
getTransitionName(direction: string): string {
|
||||
let key: string;
|
||||
|
@ -9,7 +9,7 @@ import { OverlayProxy } from '../../navigation/overlay-proxy';
|
||||
import { ModalImpl } from './modal-impl';
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @hidden
|
||||
*/
|
||||
export class Modal extends OverlayProxy {
|
||||
|
||||
|
@ -6,7 +6,7 @@ import { ViewController } from '../../navigation/view-controller';
|
||||
import { NavPop } from './nav-pop';
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @hidden
|
||||
*/
|
||||
@Directive({
|
||||
selector: 'a[navPop]',
|
||||
|
@ -35,7 +35,7 @@ export class NavPop {
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @hidden
|
||||
*/
|
||||
@HostListener('click')
|
||||
onClick(): boolean {
|
||||
|
@ -5,7 +5,7 @@ import { DeepLinker } from '../../navigation/deep-linker';
|
||||
import { NavPush } from './nav-push';
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @hidden
|
||||
*/
|
||||
@Directive({
|
||||
selector: 'a[navPush]',
|
||||
|
@ -67,7 +67,7 @@ export class NavPush {
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @hidden
|
||||
*/
|
||||
@HostListener('click')
|
||||
onClick(): boolean {
|
||||
|
@ -100,7 +100,7 @@ export class Nav extends NavControllerBase implements AfterViewInit, RootNode {
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @hidden
|
||||
*/
|
||||
@ViewChild('viewport', {read: ViewContainerRef})
|
||||
set _vp(val: ViewContainerRef) {
|
||||
@ -162,7 +162,7 @@ export class Nav extends NavControllerBase implements AfterViewInit, RootNode {
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @hidden
|
||||
*/
|
||||
ngOnDestroy() {
|
||||
this.destroy();
|
||||
|
@ -11,7 +11,7 @@ import { Platform } from '../../platform/platform';
|
||||
import { TransitionController } from '../../transitions/transition-controller';
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @hidden
|
||||
*/
|
||||
@Directive({
|
||||
selector: '[overlay-portal]',
|
||||
|
@ -66,23 +66,23 @@ import { ViewController } from '../../navigation/view-controller';
|
||||
})
|
||||
export class Navbar extends ToolbarBase {
|
||||
/**
|
||||
* @private
|
||||
* @hidden
|
||||
*/
|
||||
_backText: string;
|
||||
/**
|
||||
* @private
|
||||
* @hidden
|
||||
*/
|
||||
_bbIcon: string;
|
||||
/**
|
||||
* @private
|
||||
* @hidden
|
||||
*/
|
||||
_hidden: boolean = false;
|
||||
/**
|
||||
* @private
|
||||
* @hidden
|
||||
*/
|
||||
_hideBb: boolean = false;
|
||||
/**
|
||||
* @private
|
||||
* @hidden
|
||||
*/
|
||||
_sbPadding: boolean;
|
||||
|
||||
@ -150,7 +150,7 @@ export class Navbar extends ToolbarBase {
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @hidden
|
||||
*/
|
||||
didEnter() {
|
||||
try {
|
||||
@ -161,7 +161,7 @@ export class Navbar extends ToolbarBase {
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @hidden
|
||||
*/
|
||||
setHidden(isHidden: boolean) {
|
||||
// used to display none/block the navbar
|
||||
|
@ -64,7 +64,7 @@ export class Option {
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @hidden
|
||||
*/
|
||||
get text() {
|
||||
return this._elementRef.nativeElement.textContent;
|
||||
|
@ -10,7 +10,7 @@ import { pointerCoord } from '../../util/dom';
|
||||
import { UIEventManager } from '../../gestures/ui-event-manager';
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @hidden
|
||||
*/
|
||||
@Component({
|
||||
selector: '.picker-col',
|
||||
|
@ -13,7 +13,7 @@ import { ViewController } from '../../navigation/view-controller';
|
||||
import { PickerColumnCmp } from './picker-column';
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @hidden
|
||||
*/
|
||||
@Component({
|
||||
selector: 'ion-picker-cmp',
|
||||
|
@ -6,7 +6,7 @@ import { Picker } from './picker';
|
||||
import { PickerOptions } from './picker-options';
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @hidden
|
||||
* @name PickerController
|
||||
* @description
|
||||
*
|
||||
|
@ -11,7 +11,7 @@ import { ViewController } from '../../navigation/view-controller';
|
||||
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @hidden
|
||||
*/
|
||||
export class Picker extends ViewController {
|
||||
private _app: App;
|
||||
@ -34,7 +34,7 @@ export class Picker extends ViewController {
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @hidden
|
||||
*/
|
||||
getTransitionName(direction: string) {
|
||||
let key = (direction === 'back' ? 'pickerLeave' : 'pickerEnter');
|
||||
|
@ -10,7 +10,7 @@ import { ModuleLoader } from '../../util/module-loader';
|
||||
import { assert } from '../../util/util';
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @hidden
|
||||
*/
|
||||
@Component({
|
||||
selector: 'ion-popover',
|
||||
|
@ -9,7 +9,7 @@ import { ViewController } from '../../navigation/view-controller';
|
||||
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @hidden
|
||||
*/
|
||||
export class PopoverImpl extends ViewController {
|
||||
private _app: App;
|
||||
@ -31,7 +31,7 @@ export class PopoverImpl extends ViewController {
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @hidden
|
||||
*/
|
||||
getTransitionName(direction: string) {
|
||||
let key = (direction === 'back' ? 'popoverLeave' : 'popoverEnter');
|
||||
|
@ -9,7 +9,7 @@ import { OverlayProxy } from '../../navigation/overlay-proxy';
|
||||
import { PopoverImpl } from './popover-impl';
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @hidden
|
||||
*/
|
||||
export class Popover extends OverlayProxy {
|
||||
|
||||
|
@ -185,7 +185,7 @@ export class RadioButton extends Ion implements IonicTapInput, OnDestroy, OnInit
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @hidden
|
||||
*/
|
||||
initFocus() {
|
||||
this._elementRef.nativeElement.querySelector('button').focus();
|
||||
|
@ -77,32 +77,32 @@ export class RadioGroup {
|
||||
_disabled: boolean = false;
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @hidden
|
||||
*/
|
||||
_btns: RadioButton[] = [];
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @hidden
|
||||
*/
|
||||
_fn: Function;
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @hidden
|
||||
*/
|
||||
_ids: number = -1;
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @hidden
|
||||
*/
|
||||
_init: boolean = false;
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @hidden
|
||||
*/
|
||||
value: any;
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @hidden
|
||||
*/
|
||||
id: number;
|
||||
|
||||
@ -131,7 +131,7 @@ export class RadioGroup {
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @hidden
|
||||
*/
|
||||
ngAfterContentInit() {
|
||||
let activeButton = this._btns.find(b => b.checked);
|
||||
@ -141,7 +141,7 @@ export class RadioGroup {
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @hidden
|
||||
*/
|
||||
writeValue(val: any) {
|
||||
console.debug('radio group, writeValue', val);
|
||||
@ -157,7 +157,7 @@ export class RadioGroup {
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @hidden
|
||||
*/
|
||||
registerOnChange(fn: Function): void {
|
||||
this._fn = fn;
|
||||
@ -173,12 +173,12 @@ export class RadioGroup {
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @hidden
|
||||
*/
|
||||
registerOnTouched(fn: any) { this.onTouched = fn; }
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @hidden
|
||||
*/
|
||||
_update() {
|
||||
// loop through each of the radiobuttons
|
||||
@ -199,14 +199,14 @@ export class RadioGroup {
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @hidden
|
||||
*/
|
||||
_setActive(radioButton: RadioButton) {
|
||||
this._renderer.setElementAttribute(this._elementRef.nativeElement, 'aria-activedescendant', radioButton.id);
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @hidden
|
||||
*/
|
||||
add(button: RadioButton): string {
|
||||
this._btns.push(button);
|
||||
@ -221,7 +221,7 @@ export class RadioGroup {
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @hidden
|
||||
*/
|
||||
remove(button: RadioButton) {
|
||||
let index = this._btns.indexOf(button);
|
||||
@ -234,7 +234,7 @@ export class RadioGroup {
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @hidden
|
||||
*/
|
||||
@ContentChild(ListHeader)
|
||||
set _header(header: any) {
|
||||
@ -247,7 +247,7 @@ export class RadioGroup {
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @hidden
|
||||
*/
|
||||
onChange(val: any) {
|
||||
// onChange used when there is not an formControlName
|
||||
@ -260,12 +260,12 @@ export class RadioGroup {
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @hidden
|
||||
*/
|
||||
onTouched() {}
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @hidden
|
||||
*/
|
||||
setDisabledState(isDisabled: boolean) {
|
||||
this.disabled = isDisabled;
|
||||
|
@ -3,7 +3,7 @@ import { Component, EventEmitter, HostListener, Input, Output } from '@angular/c
|
||||
import { KEY_LEFT, KEY_RIGHT, KEY_UP, KEY_DOWN } from '../../platform/key';
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @hidden
|
||||
*/
|
||||
@Component({
|
||||
selector: '.range-knob-handle',
|
||||
|
@ -147,7 +147,7 @@ export class Range extends Ion implements AfterViewInit, ControlValueAccessor, O
|
||||
@ViewChild('slider') public _slider: ElementRef;
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @hidden
|
||||
*/
|
||||
value: any;
|
||||
|
||||
@ -172,7 +172,7 @@ export class Range extends Ion implements AfterViewInit, ControlValueAccessor, O
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @hidden
|
||||
*/
|
||||
id: string;
|
||||
|
||||
@ -331,7 +331,7 @@ export class Range extends Ion implements AfterViewInit, ControlValueAccessor, O
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @hidden
|
||||
*/
|
||||
ngAfterViewInit() {
|
||||
// add touchstart/mousedown listeners
|
||||
@ -539,7 +539,7 @@ export class Range extends Ion implements AfterViewInit, ControlValueAccessor, O
|
||||
}
|
||||
}
|
||||
|
||||
/** @private */
|
||||
/** @hidden */
|
||||
_keyChg(isIncrease: boolean, isKnobB: boolean) {
|
||||
const step = this._step;
|
||||
if (isKnobB) {
|
||||
@ -578,7 +578,7 @@ export class Range extends Ion implements AfterViewInit, ControlValueAccessor, O
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @hidden
|
||||
*/
|
||||
writeValue(val: any) {
|
||||
if (isPresent(val)) {
|
||||
@ -600,7 +600,7 @@ export class Range extends Ion implements AfterViewInit, ControlValueAccessor, O
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @hidden
|
||||
*/
|
||||
registerOnChange(fn: Function): void {
|
||||
this._fn = fn;
|
||||
@ -611,12 +611,12 @@ export class Range extends Ion implements AfterViewInit, ControlValueAccessor, O
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @hidden
|
||||
*/
|
||||
registerOnTouched(fn: any) { this.onTouched = fn; }
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @hidden
|
||||
*/
|
||||
onChange(val: any) {
|
||||
// used when this input does not have an ngModel or formControlName
|
||||
@ -625,19 +625,19 @@ export class Range extends Ion implements AfterViewInit, ControlValueAccessor, O
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @hidden
|
||||
*/
|
||||
onTouched() { }
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @hidden
|
||||
*/
|
||||
setDisabledState(isDisabled: boolean) {
|
||||
this.disabled = isDisabled;
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @hidden
|
||||
*/
|
||||
ngOnDestroy() {
|
||||
this._form.deregister(this);
|
||||
|
@ -5,7 +5,7 @@ import { Refresher } from './refresher';
|
||||
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @hidden
|
||||
*/
|
||||
@Component({
|
||||
selector: 'ion-refresher-content',
|
||||
@ -53,7 +53,7 @@ export class RefresherContent {
|
||||
constructor(public r: Refresher, private _config: Config) {}
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @hidden
|
||||
*/
|
||||
ngOnInit() {
|
||||
if (!this.pullingIcon) {
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user