Skip to content

Commit

Permalink
Use template for states dropdown
Browse files Browse the repository at this point in the history
  • Loading branch information
Hector Romero committed Jul 16, 2017
1 parent 5a79693 commit 58a8d5f
Show file tree
Hide file tree
Showing 54 changed files with 257 additions and 98 deletions.
3 changes: 2 additions & 1 deletion doc/build/export.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ module.exports = {
'jspm_packages/system-polyfills.js',
'jspm_packages/system-csp-production.js',
'styles/*',
'states.json'
'states.json',
'images/flags/*'
],
// this section lists any jspm packages that have
// unbundled resources that need to be exported.
Expand Down
204 changes: 190 additions & 14 deletions doc/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ System.config({
"vm-browserify": "npm:[email protected]"
},
"github:tochoromero/aurelia-bootstrap@master": {
"aurelia-pal": "npm:[email protected]",
"aurelia-templating-resources": "npm:[email protected]",
"tether": "npm:[email protected]",
"velocity-animate": "npm:[email protected]"
Expand All @@ -60,13 +61,13 @@ System.config({
},
"npm:[email protected]": {
"aurelia-metadata": "npm:[email protected]",
"aurelia-pal": "npm:aurelia-pal@1.2.0",
"aurelia-pal": "npm:aurelia-pal@1.3.0",
"aurelia-templating": "npm:[email protected]"
},
"npm:[email protected]": {
"aurelia-logging": "npm:[email protected]",
"aurelia-metadata": "npm:[email protected]",
"aurelia-pal": "npm:aurelia-pal@1.2.0",
"aurelia-pal": "npm:aurelia-pal@1.3.0",
"aurelia-task-queue": "npm:[email protected]"
},
"npm:[email protected]": {
Expand All @@ -76,7 +77,7 @@ System.config({
"aurelia-history-browser": "npm:[email protected]",
"aurelia-loader-default": "npm:[email protected]",
"aurelia-logging-console": "npm:[email protected]",
"aurelia-pal": "npm:aurelia-pal@1.2.0",
"aurelia-pal": "npm:aurelia-pal@1.3.0",
"aurelia-pal-browser": "npm:[email protected]",
"aurelia-polyfills": "npm:[email protected]",
"aurelia-router": "npm:[email protected]",
Expand All @@ -87,7 +88,7 @@ System.config({
},
"npm:[email protected]": {
"aurelia-metadata": "npm:[email protected]",
"aurelia-pal": "npm:aurelia-pal@1.2.0"
"aurelia-pal": "npm:aurelia-pal@1.3.0"
},
"npm:[email protected]": {
"aurelia-logging": "npm:[email protected]"
Expand All @@ -98,19 +99,19 @@ System.config({
"aurelia-loader": "npm:[email protected]",
"aurelia-logging": "npm:[email protected]",
"aurelia-metadata": "npm:[email protected]",
"aurelia-pal": "npm:aurelia-pal@1.2.0",
"aurelia-pal": "npm:aurelia-pal@1.3.0",
"aurelia-path": "npm:[email protected]",
"aurelia-task-queue": "npm:[email protected]",
"aurelia-templating": "npm:[email protected]"
},
"npm:[email protected]": {
"aurelia-history": "npm:[email protected]",
"aurelia-pal": "npm:aurelia-pal@1.2.0"
"aurelia-pal": "npm:aurelia-pal@1.3.0"
},
"npm:[email protected]": {
"aurelia-loader": "npm:[email protected]",
"aurelia-metadata": "npm:[email protected]",
"aurelia-pal": "npm:aurelia-pal@1.2.0"
"aurelia-pal": "npm:aurelia-pal@1.3.0"
},
"npm:[email protected]": {
"aurelia-metadata": "npm:[email protected]",
Expand All @@ -120,13 +121,13 @@ System.config({
"aurelia-logging": "npm:[email protected]"
},
"npm:[email protected]": {
"aurelia-pal": "npm:aurelia-pal@1.2.0"
"aurelia-pal": "npm:aurelia-pal@1.3.0"
},
"npm:[email protected]": {
"aurelia-pal": "npm:aurelia-pal@1.2.0"
"aurelia-pal": "npm:aurelia-pal@1.3.0"
},
"npm:[email protected]": {
"aurelia-pal": "npm:aurelia-pal@1.2.0"
"aurelia-pal": "npm:aurelia-pal@1.3.0"
},
"npm:[email protected]": {
"aurelia-path": "npm:[email protected]"
Expand All @@ -144,7 +145,7 @@ System.config({
"prismjs": "npm:[email protected]"
},
"npm:[email protected]": {
"aurelia-pal": "npm:aurelia-pal@1.2.0"
"aurelia-pal": "npm:aurelia-pal@1.3.0"
},
"npm:[email protected]": {
"aurelia-binding": "npm:[email protected]",
Expand All @@ -157,7 +158,7 @@ System.config({
"aurelia-loader": "npm:[email protected]",
"aurelia-logging": "npm:[email protected]",
"aurelia-metadata": "npm:[email protected]",
"aurelia-pal": "npm:aurelia-pal@1.2.0",
"aurelia-pal": "npm:aurelia-pal@1.3.0",
"aurelia-path": "npm:[email protected]",
"aurelia-task-queue": "npm:[email protected]",
"aurelia-templating": "npm:[email protected]"
Expand All @@ -166,7 +167,7 @@ System.config({
"aurelia-dependency-injection": "npm:[email protected]",
"aurelia-logging": "npm:[email protected]",
"aurelia-metadata": "npm:[email protected]",
"aurelia-pal": "npm:aurelia-pal@1.2.0",
"aurelia-pal": "npm:aurelia-pal@1.3.0",
"aurelia-path": "npm:[email protected]",
"aurelia-router": "npm:[email protected]",
"aurelia-templating": "npm:[email protected]"
Expand All @@ -177,7 +178,7 @@ System.config({
"aurelia-loader": "npm:[email protected]",
"aurelia-logging": "npm:[email protected]",
"aurelia-metadata": "npm:[email protected]",
"aurelia-pal": "npm:aurelia-pal@1.2.0",
"aurelia-pal": "npm:aurelia-pal@1.3.0",
"aurelia-path": "npm:[email protected]",
"aurelia-task-queue": "npm:[email protected]"
},
Expand Down Expand Up @@ -217,5 +218,180 @@ System.config({
"npm:[email protected]": {
"indexof": "npm:[email protected]"
}
},
bundles: {
"app-build.js": [
"accordion/accordion.html!github:systemjs/[email protected]",
"accordion/accordion.js",
"app.html!github:systemjs/[email protected]",
"app.js",
"buttons/buttons.html!github:systemjs/[email protected]",
"buttons/buttons.js",
"collapse/collapse.html!github:systemjs/[email protected]",
"collapse/collapse.js",
"dropdown/dropdown.html!github:systemjs/[email protected]",
"dropdown/dropdown.js",
"global-defaults/global-defaults.html!github:systemjs/[email protected]",
"global-defaults/global-defaults.js",
"introduction/introduction.html!github:systemjs/[email protected]",
"introduction/introduction.js",
"main.js",
"nav-bar.html!github:systemjs/[email protected]",
"pagination/pagination.html!github:systemjs/[email protected]",
"pagination/pagination.js",
"popover/popover.html!github:systemjs/[email protected]",
"popover/popover.js",
"resources/index.js",
"resources/settings-type/any.html!github:systemjs/[email protected]",
"resources/settings-type/boolean.html!github:systemjs/[email protected]",
"resources/settings-type/function.html!github:systemjs/[email protected]",
"resources/settings-type/markup.html!github:systemjs/[email protected]",
"resources/settings-type/number.html!github:systemjs/[email protected]",
"resources/settings-type/property.html!github:systemjs/[email protected]",
"resources/settings-type/ref.html!github:systemjs/[email protected]",
"resources/settings-type/string.html!github:systemjs/[email protected]",
"resources/settings-type/two-way.html!github:systemjs/[email protected]",
"tabs/tabs.html!github:systemjs/[email protected]",
"tabs/tabs.js",
"tooltip/tooltip.html!github:systemjs/[email protected]",
"tooltip/tooltip.js",
"typeahead/typeahead.html!github:systemjs/[email protected]",
"typeahead/typeahead.js"
],
"aurelia.js": [
"github:github/[email protected]",
"github:github/[email protected]/fetch.js",
"github:jspm/[email protected]",
"github:jspm/[email protected]/index.js",
"github:systemjs/[email protected]",
"github:systemjs/[email protected]/text.js",
"github:tochoromero/[email protected]",
"github:tochoromero/aurelia-bootstrap@master/accordion/aubs-accordion-group.html!github:systemjs/[email protected]",
"github:tochoromero/aurelia-bootstrap@master/accordion/aubs-accordion-group.js",
"github:tochoromero/aurelia-bootstrap@master/accordion/aubs-accordion.html!github:systemjs/[email protected]",
"github:tochoromero/aurelia-bootstrap@master/accordion/aubs-accordion.js",
"github:tochoromero/aurelia-bootstrap@master/buttons/aubs-btn-checkbox.js",
"github:tochoromero/aurelia-bootstrap@master/buttons/aubs-btn-loading.js",
"github:tochoromero/aurelia-bootstrap@master/buttons/aubs-btn-radio.js",
"github:tochoromero/aurelia-bootstrap@master/collapse/aubs-collapse.js",
"github:tochoromero/aurelia-bootstrap@master/dropdown/aubs-dropdown-toggle.js",
"github:tochoromero/aurelia-bootstrap@master/dropdown/aubs-dropdown.js",
"github:tochoromero/aurelia-bootstrap@master/index.js",
"github:tochoromero/aurelia-bootstrap@master/pagination/aubs-pagination.html!github:systemjs/[email protected]",
"github:tochoromero/aurelia-bootstrap@master/pagination/aubs-pagination.js",
"github:tochoromero/aurelia-bootstrap@master/popover/aubs-popover.js",
"github:tochoromero/aurelia-bootstrap@master/tabs/aubs-tab.html!github:systemjs/[email protected]",
"github:tochoromero/aurelia-bootstrap@master/tabs/aubs-tab.js",
"github:tochoromero/aurelia-bootstrap@master/tabs/aubs-tabset.html!github:systemjs/[email protected]",
"github:tochoromero/aurelia-bootstrap@master/tabs/aubs-tabset.js",
"github:tochoromero/aurelia-bootstrap@master/tooltip/aubs-tooltip.js",
"github:tochoromero/aurelia-bootstrap@master/typeahead/aubs-typeahead.html!github:systemjs/[email protected]",
"github:tochoromero/aurelia-bootstrap@master/typeahead/aubs-typeahead.js",
"github:tochoromero/aurelia-bootstrap@master/typeahead/typeahead-highlight.js",
"github:tochoromero/aurelia-bootstrap@master/utils/bootstrap-config.js",
"github:tochoromero/aurelia-bootstrap@master/utils/bootstrap-options.js",
"github:tochoromero/aurelia-bootstrap@master/utils/tooltip-service.js",
"npm:[email protected]",
"npm:[email protected]/aurelia-binding.js",
"npm:[email protected]",
"npm:[email protected]/aurelia-bootstrapper.js",
"npm:[email protected]",
"npm:[email protected]/aurelia-dependency-injection.js",
"npm:[email protected]",
"npm:[email protected]/aurelia-event-aggregator.js",
"npm:[email protected]",
"npm:[email protected]/aurelia-fetch-client.js",
"npm:[email protected]",
"npm:[email protected]/aurelia-framework.js",
"npm:[email protected]",
"npm:[email protected]/aurelia-history-browser.js",
"npm:[email protected]",
"npm:[email protected]/aurelia-history.js",
"npm:[email protected]",
"npm:[email protected]/aurelia-loader-default.js",
"npm:[email protected]",
"npm:[email protected]/aurelia-loader.js",
"npm:[email protected]",
"npm:[email protected]/aurelia-logging-console.js",
"npm:[email protected]",
"npm:[email protected]/aurelia-logging.js",
"npm:[email protected]",
"npm:[email protected]/aurelia-metadata.js",
"npm:[email protected]",
"npm:[email protected]/aurelia-pal-browser.js",
"npm:[email protected]",
"npm:[email protected]/aurelia-pal.js",
"npm:[email protected]",
"npm:[email protected]/aurelia-path.js",
"npm:[email protected]",
"npm:[email protected]/aurelia-polyfills.js",
"npm:[email protected]",
"npm:[email protected]/aurelia-route-recognizer.js",
"npm:[email protected]",
"npm:[email protected]/aurelia-router.js",
"npm:[email protected]",
"npm:[email protected]/index.js",
"npm:[email protected]/syntax-highlighter.js",
"npm:[email protected]",
"npm:[email protected]/aurelia-task-queue.js",
"npm:[email protected]",
"npm:[email protected]/aurelia-templating-binding.js",
"npm:[email protected]",
"npm:[email protected]/abstract-repeater.js",
"npm:[email protected]/analyze-view-factory.js",
"npm:[email protected]/array-repeat-strategy.js",
"npm:[email protected]/attr-binding-behavior.js",
"npm:[email protected]/aurelia-hide-style.js",
"npm:[email protected]/aurelia-templating-resources.js",
"npm:[email protected]/binding-mode-behaviors.js",
"npm:[email protected]/binding-signaler.js",
"npm:[email protected]/compose.js",
"npm:[email protected]/css-resource.js",
"npm:[email protected]/debounce-binding-behavior.js",
"npm:[email protected]/dynamic-element.js",
"npm:[email protected]/focus.js",
"npm:[email protected]/hide.js",
"npm:[email protected]/html-resource-plugin.js",
"npm:[email protected]/html-sanitizer.js",
"npm:[email protected]/if.js",
"npm:[email protected]/map-repeat-strategy.js",
"npm:[email protected]/null-repeat-strategy.js",
"npm:[email protected]/number-repeat-strategy.js",
"npm:[email protected]/repeat-strategy-locator.js",
"npm:[email protected]/repeat-utilities.js",
"npm:[email protected]/repeat.js",
"npm:[email protected]/replaceable.js",
"npm:[email protected]/sanitize-html.js",
"npm:[email protected]/set-repeat-strategy.js",
"npm:[email protected]/show.js",
"npm:[email protected]/signal-binding-behavior.js",
"npm:[email protected]/throttle-binding-behavior.js",
"npm:[email protected]/update-trigger-binding-behavior.js",
"npm:[email protected]/with.js",
"npm:[email protected]",
"npm:[email protected]/aurelia-templating-router.js",
"npm:[email protected]/route-href.js",
"npm:[email protected]/route-loader.js",
"npm:[email protected]/router-view.js",
"npm:[email protected]",
"npm:[email protected]/aurelia-templating.js",
"npm:[email protected]",
"npm:[email protected]/prism.js",
"npm:[email protected]",
"npm:[email protected]/browser.js",
"npm:[email protected]",
"npm:[email protected]/dist/js/tether.js",
"npm:[email protected]",
"npm:[email protected]/velocity.js"
]
},
depCache: {
"main.js": [
"fetch"
],
"typeahead/typeahead.js": [
"aurelia-framework",
"aurelia-fetch-client"
]
}
});
Binary file added doc/images/flags/ak.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added doc/images/flags/al.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added doc/images/flags/ar.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added doc/images/flags/az.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added doc/images/flags/ca.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added doc/images/flags/co.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added doc/images/flags/ct.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added doc/images/flags/de.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added doc/images/flags/fl.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added doc/images/flags/ga.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added doc/images/flags/hi.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added doc/images/flags/ia.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added doc/images/flags/id.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added doc/images/flags/il.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added doc/images/flags/in.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added doc/images/flags/ks.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added doc/images/flags/ky.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added doc/images/flags/la.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added doc/images/flags/ma.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added doc/images/flags/md.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added doc/images/flags/me.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added doc/images/flags/mi.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added doc/images/flags/mn.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added doc/images/flags/mo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added doc/images/flags/ms.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added doc/images/flags/mt.png
Binary file added doc/images/flags/nc.png
Binary file added doc/images/flags/nd.png
Binary file added doc/images/flags/ne.png
Binary file added doc/images/flags/nh.png
Binary file added doc/images/flags/nj.png
Binary file added doc/images/flags/nm.png
Binary file added doc/images/flags/nv.png
Binary file added doc/images/flags/ny.png
Binary file added doc/images/flags/oh.png
Binary file added doc/images/flags/ok.png
Binary file added doc/images/flags/or.png
Binary file added doc/images/flags/pa.png
Binary file added doc/images/flags/ri.png
Binary file added doc/images/flags/sc.png
Binary file added doc/images/flags/sd.png
Binary file added doc/images/flags/tn.png
Binary file added doc/images/flags/tx.png
Binary file added doc/images/flags/ut.png
Binary file added doc/images/flags/va.png
Binary file added doc/images/flags/vt.png
Binary file added doc/images/flags/wa.png
Binary file added doc/images/flags/wi.png
Binary file added doc/images/flags/wv.png
Binary file added doc/images/flags/wy.png
14 changes: 14 additions & 0 deletions doc/src/typeahead/typeahead.html
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,13 @@ <h4>Async Data</h4>
<div class="col-xs-6">
<aubs-typeahead data.call="getStates(filter, limit)" value.bind="state" debounce.bind="350" placeholder="States"
open-on-focus.bind="true" key="state" results-limit.bind="10" select-single-result.bind="true">
<template replace-part="item-template">
<a class="dropdown-item ${focusedItem === item ? 'active' : ''}" href="javascript:void(0)"
show.bind="!loading" click.delegate="itemSelected(item)">
<img src="images/flags/${item.short}.png" width="30px" style="margin-right: 10px"/>
${getName(item)}
</a>
</template>
</aubs-typeahead>
<br/>
<button class="btn btn-default" click.delegate="state = null" disabled.bind="!state">Clear State</button>
Expand Down Expand Up @@ -219,6 +226,13 @@ <h3>Options</h3>
&lt;div class="col-xs-6">
&lt;aubs-typeahead data.call="getStates(filter, limit)" value.bind="state" debounce.bind="350" placeholder="States"
open-on-focus.bind="true" key="state" results-limit.bind="10" select-single-result.bind="true">
&lt;template replace-part="item-template">
&lt;a class="dropdown-item ${open}focusedItem === item ? 'active' : ''}" href="javascript:void(0)"
show.bind="!loading" click.delegate="itemSelected(item)">
&lt;img src="images/flags/${open}item.short}.png" width="30px" style="margin-right: 10px"/>
${open}getName(item)}
&lt;/a>
&lt;/template>
&lt;/aubs-typeahead>
&lt;br/>
&lt;button class="btn btn-default" click.delegate="state = null" disabled.bind="!state">Clear State&lt;/button>
Expand Down
Loading

0 comments on commit 58a8d5f

Please sign in to comment.