-
Notifications
You must be signed in to change notification settings - Fork 125
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs: separated api properties into input/output (#769)
* compiler can now detect input tags by itself * separated input/output/properties * cleaned up * couple documentation fixes * fixed case where @input function would not appear
- Loading branch information
Showing
19 changed files
with
278 additions
and
109 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
module.exports = { | ||
ifEquals: function(value1, value2, options) { | ||
return value1 === value2 ? options.fn(this) : options.inverse(this); | ||
}, | ||
ifNotEquals: function(value1, value2, options) { | ||
return value1 !== value2 ? options.fn(this) : options.inverse(this); | ||
}, | ||
ifDecoratorsContain: function(element, compareValue, options) { | ||
if (!element || !element.decorators) { | ||
return options.inverse(this); | ||
} | ||
const found = element.decorators.find(item => item.name.toLocaleUpperCase() === compareValue.toLocaleUpperCase()); | ||
return found ? options.fn(this) : options.inverse(this); | ||
}, | ||
ifNoDecorators: function(element, options) { | ||
if (!element || !element.decorators) { | ||
return options.fn(this); | ||
} | ||
|
||
for (item of element.decorators) { | ||
if (item.name.toLocaleUpperCase() === 'OUTPUT' || item.name.toLocaleUpperCase() === 'INPUT') { | ||
return options.inverse(this); | ||
} | ||
} | ||
return options.fn(this); | ||
}, | ||
ifChildrenContainDecorator: function(array, compareValue, options) { | ||
if (!array || array.length === 0) { | ||
return options.inverse(this); | ||
} | ||
|
||
for (item of array) { | ||
if (item.decorators) { | ||
for (dec of item.decorators) { | ||
if (dec && dec.name.toLocaleUpperCase() === compareValue.toLocaleUpperCase()) { | ||
return options.fn(this); | ||
} | ||
} | ||
} | ||
} | ||
return options.inverse(this); | ||
}, | ||
ifChildrenContainNonDecorators: function(array, options) { | ||
if (!array || array.length === 0) { | ||
return options.inverse(this); | ||
} | ||
|
||
for (item of array) { | ||
if (item.decorators) { | ||
for (dec of item.decorators) { | ||
if (dec && (dec.name.toLocaleUpperCase() !== 'INPUT' && dec.name.toLocaleUpperCase() !== 'OUTPUT')) { | ||
return options.fn(this); | ||
} | ||
} | ||
} else { | ||
return options.fn(this); | ||
} | ||
} | ||
return options.inverse(this); | ||
}, | ||
parseSelector: function(str) { | ||
let selectorStr = str.match(/(selector: '(.*?)')/g) + ''; | ||
selectorStr = selectorStr.replace('selector: ', '').replace(/['\[\]]/g, ''); | ||
return selectorStr; | ||
}, | ||
getAllWithDecorator: function(groups, decorator, options) { | ||
if (!groups || !decorator) { | ||
return; | ||
} | ||
|
||
let total = []; | ||
groups.forEach(group => { | ||
if (group.children) | ||
group.children.forEach(child => { | ||
if (child.decorators) | ||
child.decorators.forEach(dec => { | ||
if (dec && dec.name.toLocaleUpperCase() === decorator.toLocaleUpperCase()) { | ||
total.push(child); | ||
} | ||
}); | ||
}) | ||
}); | ||
return options.fn(total); | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<section class="tsd-panel tsd-member {{cssClasses}}"> | ||
<a name="{{anchor}}" class="tsd-anchor"></a> | ||
{{#if name}} | ||
<h3>{{#each flags}}<span class="tsd-flag ts-flag{{this}}">{{this}}</span> {{/each}}{{{wbr name}}}</h3> | ||
{{/if}} | ||
|
||
<!-- {log decorators} --> | ||
|
||
{{#if signatures}} | ||
{{> member.signatures}} | ||
{{else}}{{#if hasGetterOrSetter}} | ||
{{> member.getterSetter}} | ||
{{else}} | ||
{{> member.declaration}} | ||
{{/if}}{{/if}} | ||
|
||
{{#each groups}} | ||
{{#each children}} | ||
{{#unless hasOwnDocument}} | ||
{{> member}} | ||
{{/unless}} | ||
{{/each}} | ||
{{/each}} | ||
</section> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{{#ifChildrenContainNonDecorators children}} | ||
<section class="tsd-panel-group tsd-member-group {{cssClasses}}"> | ||
<h2>{{title}}</h2> | ||
{{#each children}} | ||
{{#ifNoDecorators this}} | ||
{{#unless hasOwnDocument}} | ||
{{> member}} | ||
{{/unless}} | ||
{{/ifNoDecorators}} | ||
{{/each}} | ||
</section> | ||
{{/ifChildrenContainNonDecorators}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
{{#getAllWithDecorator groups 'Input'}} | ||
{{#if this}} | ||
<section class="tsd-panel-group tsd-member-group {{cssClasses}}"> | ||
<h2>Inputs</h2> | ||
{{#each this}} | ||
{{#unless hasOwnDocument}} | ||
{{> member}} | ||
{{/unless}} | ||
{{/each}} | ||
</section> | ||
{{/if}} | ||
{{/getAllWithDecorator}} | ||
|
||
{{#getAllWithDecorator groups 'Output'}} | ||
{{#if this}} | ||
<section class="tsd-panel-group tsd-member-group {{cssClasses}}"> | ||
<h2>Outputs</h2> | ||
{{#each this}} | ||
{{#unless hasOwnDocument}} | ||
{{> member}} | ||
{{/unless}} | ||
{{/each}} | ||
</section> | ||
{{/if}} | ||
{{/getAllWithDecorator}} | ||
|
||
{{#each groups}} | ||
{{#unless allChildrenHaveOwnDocument}} | ||
{{> members.group}} | ||
{{/unless}} | ||
{{/each}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.