mirror of
https://github.com/sstent/node.git
synced 2026-01-27 07:33:13 +00:00
updated app
This commit is contained in:
2
first-project/node_modules/derby/test/fixtures/components/ui/box.html
generated
vendored
Normal file
2
first-project/node_modules/derby/test/fixtures/components/ui/box.html
generated
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
<box:>
|
||||
<div class="box"></div>
|
||||
2
first-project/node_modules/derby/test/fixtures/components/ui/button.html
generated
vendored
Normal file
2
first-project/node_modules/derby/test/fixtures/components/ui/button.html
generated
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
<button: nonvoid>
|
||||
<button>{{{content}}}</button>
|
||||
15
first-project/node_modules/derby/test/fixtures/components/ui/dropdown/index.html
generated
vendored
Normal file
15
first-project/node_modules/derby/test/fixtures/components/ui/dropdown/index.html
generated
vendored
Normal file
@@ -0,0 +1,15 @@
|
||||
<dropdown:>
|
||||
<!-- a :self path alias is automatically created per component -->
|
||||
<!-- x-as can be used to pass a reference to an element to the script -->
|
||||
<div x-as="container" class="{#if :self.open}open{/}">
|
||||
<button x-bind="click: clickButton">{{{value}}} <i class="caret"></i></button>
|
||||
<menu x-bind="click: clickMenu">
|
||||
{{{#each list}}}
|
||||
{{#if separator}}
|
||||
<hr>
|
||||
{{else}}
|
||||
<li>{{text}}</li>
|
||||
{{/}}
|
||||
{{{/}}}
|
||||
</menu>
|
||||
</div>
|
||||
29
first-project/node_modules/derby/test/fixtures/components/ui/dropdown/index.js
generated
vendored
Normal file
29
first-project/node_modules/derby/test/fixtures/components/ui/dropdown/index.js
generated
vendored
Normal file
@@ -0,0 +1,29 @@
|
||||
// Components must export a create function
|
||||
|
||||
// Components are passed a scoped model underneath _$component.{uid}
|
||||
|
||||
exports.create = function(self, dom, elements) {
|
||||
var container = elements.container
|
||||
, open = self.at('open')
|
||||
|
||||
// Listeners added inside of a component should be automatically
|
||||
// removed when the instance is removed from the DOM
|
||||
dom.addListener(document.documentElement, 'click', function(e) {
|
||||
if (!container.contains(e.target)) {
|
||||
open.set(false)
|
||||
}
|
||||
})
|
||||
|
||||
exports.clickButton = function() {
|
||||
open.set(!open.get())
|
||||
}
|
||||
|
||||
exports.clickMenu = function(e, el) {
|
||||
var item = model.at(el)
|
||||
, value = item.get()
|
||||
open.set(false)
|
||||
if (value.text == null) return
|
||||
self.set('value', value.text)
|
||||
self.set('index', +item.leaf())
|
||||
}
|
||||
}
|
||||
11
first-project/node_modules/derby/test/fixtures/components/ui/index.js
generated
vendored
Normal file
11
first-project/node_modules/derby/test/fixtures/components/ui/index.js
generated
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
var scripts = {
|
||||
dropdown: require('./dropdown')
|
||||
}
|
||||
|
||||
module.exports = plugin
|
||||
plugin.decorate = 'derby'
|
||||
plugin.useWith = {server: true, browser: true}
|
||||
|
||||
function plugin(derby, options) {
|
||||
derby.createLibrary(module, scripts, options)
|
||||
}
|
||||
3
first-project/node_modules/derby/test/fixtures/styles/app/expected.less.css
generated
vendored
Normal file
3
first-project/node_modules/derby/test/fixtures/styles/app/expected.less.css
generated
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
#less {
|
||||
color: #4d926f;
|
||||
}
|
||||
3
first-project/node_modules/derby/test/fixtures/styles/app/expected.styl.css
generated
vendored
Normal file
3
first-project/node_modules/derby/test/fixtures/styles/app/expected.styl.css
generated
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
#styl {
|
||||
color: #4d926f;
|
||||
}
|
||||
5
first-project/node_modules/derby/test/fixtures/styles/app/index.less
generated
vendored
Normal file
5
first-project/node_modules/derby/test/fixtures/styles/app/index.less
generated
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
@color: #4D926F;
|
||||
|
||||
#less {
|
||||
color: @color;
|
||||
}
|
||||
2
first-project/node_modules/derby/test/fixtures/styles/app/index.styl
generated
vendored
Normal file
2
first-project/node_modules/derby/test/fixtures/styles/app/index.styl
generated
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
#styl
|
||||
color #4D926F
|
||||
Reference in New Issue
Block a user