2015-03-19 17:38:07 -07:00
|
|
|
<dom-module id="x-project">
|
|
|
|
|
<template>
|
|
|
|
|
x-project: [<content></content>]
|
|
|
|
|
</template>
|
|
|
|
|
</dom-module>
|
2014-12-21 17:08:50 -08:00
|
|
|
<script>
|
|
|
|
|
Polymer({
|
2015-01-14 15:10:11 -08:00
|
|
|
is: 'x-project'
|
2014-12-21 17:08:50 -08:00
|
|
|
});
|
|
|
|
|
</script>
|
|
|
|
|
|
2015-03-19 17:38:07 -07:00
|
|
|
<dom-module id="x-reproject">
|
|
|
|
|
<template>
|
|
|
|
|
<x-project>x-reproject: [<content></content>]</x-project>
|
|
|
|
|
</template>
|
|
|
|
|
</dom-module>
|
2014-12-21 17:08:50 -08:00
|
|
|
<script>
|
|
|
|
|
Polymer({
|
2015-01-14 15:10:11 -08:00
|
|
|
is: 'x-reproject'
|
2014-12-21 17:08:50 -08:00
|
|
|
});
|
|
|
|
|
</script>
|
|
|
|
|
|
2015-03-19 17:38:07 -07:00
|
|
|
<dom-module id='x-rereproject'>
|
|
|
|
|
<template>
|
|
|
|
|
<x-reproject>x-rereproject: [<content></content>]</x-reproject>
|
|
|
|
|
</template>
|
|
|
|
|
</dom-module>
|
2014-12-21 17:08:50 -08:00
|
|
|
<script>
|
|
|
|
|
Polymer({
|
2015-02-20 19:03:51 -08:00
|
|
|
is: 'x-rereproject',
|
|
|
|
|
attachedCount: 0,
|
|
|
|
|
attached: function() {
|
|
|
|
|
this.attachedCount++;
|
|
|
|
|
}
|
2014-12-21 17:08:50 -08:00
|
|
|
});
|
|
|
|
|
</script>
|
|
|
|
|
|
2015-03-19 17:38:07 -07:00
|
|
|
<dom-module id="x-test">
|
|
|
|
|
<template>
|
|
|
|
|
<x-rereproject><span id="projected">projected</span></x-rereproject>
|
|
|
|
|
</template>
|
|
|
|
|
</dom-module>
|
2014-12-21 17:08:50 -08:00
|
|
|
<script>
|
|
|
|
|
Polymer({
|
2015-01-14 15:10:11 -08:00
|
|
|
is: 'x-test'
|
2014-12-21 17:08:50 -08:00
|
|
|
});
|
2015-04-09 19:01:24 -07:00
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<dom-module id="x-test-no-distribute">
|
|
|
|
|
<template>
|
2015-05-22 14:16:40 -07:00
|
|
|
<span>Local dom without insertion point.</span>
|
2015-04-09 19:01:24 -07:00
|
|
|
</template>
|
|
|
|
|
</dom-module>
|
|
|
|
|
<script>
|
|
|
|
|
Polymer({
|
|
|
|
|
is: 'x-test-no-distribute'
|
|
|
|
|
});
|
2015-10-27 11:32:55 -07:00
|
|
|
</script>
|
2015-04-10 14:35:10 -07:00
|
|
|
|
|
|
|
|
<dom-module id="x-distribute">
|
2015-04-13 10:06:22 -07:00
|
|
|
<template>
|
|
|
|
|
<div>
|
|
|
|
|
<span>Elements without test attribute</span>
|
|
|
|
|
<div id="notTestContainer" style="color: white; background-color: green; min-height: 1em;">
|
|
|
|
|
<content id="notTestContent" select=":not([test])"></content>
|
|
|
|
|
</div>
|
|
|
|
|
<span>Elements with test attribute</span>
|
|
|
|
|
<div style="color: white; background-color: red; min-height: 1em;">
|
|
|
|
|
<div id="testContainer">
|
|
|
|
|
<content id="testContent" select="[test]"></content>
|
2015-04-10 14:35:10 -07:00
|
|
|
</div>
|
|
|
|
|
</div>
|
2015-04-13 10:06:22 -07:00
|
|
|
</div>
|
|
|
|
|
</template>
|
2015-07-15 16:40:00 -07:00
|
|
|
</dom-module>
|
2015-04-13 10:06:22 -07:00
|
|
|
|
|
|
|
|
<script>
|
|
|
|
|
Polymer({
|
2015-06-10 00:42:48 -07:00
|
|
|
is: "x-distribute"
|
2015-04-13 10:06:22 -07:00
|
|
|
});
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<dom-module id="x-compose">
|
|
|
|
|
<template><x-project id="project"></x-project></template>
|
|
|
|
|
</dom-module>
|
|
|
|
|
<script>
|
|
|
|
|
Polymer({
|
|
|
|
|
is: 'x-compose'
|
|
|
|
|
});
|
2015-05-10 10:03:52 -07:00
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<dom-module id="x-select3">
|
|
|
|
|
<template><content select="[s3]"></content></template>
|
|
|
|
|
<script>Polymer({is: 'x-select3'});</script>
|
|
|
|
|
</dom-module>
|
|
|
|
|
|
|
|
|
|
<dom-module id="x-select2">
|
|
|
|
|
<template><x-select3 id="select"><content select="[s2]"></content></x-select3></template>
|
|
|
|
|
<script>Polymer({is: 'x-select2'});</script>
|
|
|
|
|
</dom-module>
|
|
|
|
|
|
|
|
|
|
<dom-module id="x-select1">
|
|
|
|
|
<template><x-select2 id="select"><content select="[s1]"></content></x-select2></template>
|
|
|
|
|
<script>Polymer({is: 'x-select1'});</script>
|
|
|
|
|
</dom-module>
|
|
|
|
|
|
|
|
|
|
<dom-module id="x-select-class3">
|
|
|
|
|
<template><content select=".s3"></content></template>
|
|
|
|
|
<script>Polymer({is: 'x-select-class3'});</script>
|
|
|
|
|
</dom-module>
|
|
|
|
|
|
|
|
|
|
<dom-module id="x-select-class2">
|
|
|
|
|
<template><x-select-class3 id="select"><content select=".s2"></content></x-select-class3></template>
|
|
|
|
|
<script>Polymer({is: 'x-select-class2'});</script>
|
|
|
|
|
</dom-module>
|
|
|
|
|
|
|
|
|
|
<dom-module id="x-select-class1">
|
|
|
|
|
<template><x-select-class2 id="select"><content select=".s1"></content></x-select-class2></template>
|
|
|
|
|
<script>Polymer({is: 'x-select-class1'});</script>
|
2015-05-11 19:59:30 -07:00
|
|
|
</dom-module>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<dom-module id="x-echo">
|
|
|
|
|
<template><content></content></template>
|
|
|
|
|
<script>Polymer({is: 'x-echo'});</script>
|
|
|
|
|
</dom-module>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<dom-module id="x-redistribute-a-b">
|
|
|
|
|
<template>
|
|
|
|
|
<x-echo id="echo1"><content select=".a"></content></x-echo>
|
|
|
|
|
<x-echo id="echo2"><content select=".b"></content></x-echo>
|
|
|
|
|
</template>
|
|
|
|
|
<script>Polymer({is: 'x-redistribute-a-b'});</script>
|
2015-05-20 16:45:23 -07:00
|
|
|
</dom-module>
|
|
|
|
|
|
|
|
|
|
<dom-module id="x-attr">
|
2015-05-20 18:14:43 -07:00
|
|
|
<template>Attr1</template>
|
2015-05-20 16:45:23 -07:00
|
|
|
<script>Polymer({
|
|
|
|
|
is: 'x-attr',
|
|
|
|
|
hostAttributes: {
|
|
|
|
|
bar: 'bar'
|
|
|
|
|
},
|
|
|
|
|
properties: {
|
|
|
|
|
foo: {type: Boolean, reflectToAttribute: true, value: false}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
});</script>
|
|
|
|
|
</dom-module>
|
|
|
|
|
|
2015-05-20 18:14:43 -07:00
|
|
|
<dom-module id="x-attr2">
|
|
|
|
|
<template>Attr2</template>
|
|
|
|
|
<script>Polymer({
|
|
|
|
|
is: 'x-attr2',
|
|
|
|
|
properties: {
|
|
|
|
|
foo: {type: Boolean, reflectToAttribute: true, value: true}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
});</script>
|
|
|
|
|
</dom-module>
|
|
|
|
|
|
2015-05-20 16:45:23 -07:00
|
|
|
<dom-module id="x-select-attr">
|
|
|
|
|
<template>
|
|
|
|
|
Foo: [<content select="[foo]"></content>]
|
|
|
|
|
Bar: [<content select="[bar]"></content>]
|
|
|
|
|
</template>
|
|
|
|
|
<script>Polymer({is: 'x-select-attr'});</script>
|
|
|
|
|
</dom-module>
|
2015-05-20 18:14:43 -07:00
|
|
|
|
|
|
|
|
<dom-module id="x-compose-select-attr">
|
|
|
|
|
<template>
|
|
|
|
|
<x-select-attr id="select">
|
|
|
|
|
<x-attr id="attr1"></x-attr>
|
|
|
|
|
<x-attr2 id="attr2"></x-attr2>
|
|
|
|
|
</x-select-attr>
|
|
|
|
|
</template>
|
|
|
|
|
<script>Polymer({is: 'x-compose-select-attr'});</script>
|
2015-07-08 14:00:22 -07:00
|
|
|
</dom-module>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<dom-module id="x-clonate">
|
|
|
|
|
<template><span>[</span><content></content><span>]</span></template>
|
|
|
|
|
<script>Polymer({
|
|
|
|
|
is: 'x-clonate'
|
|
|
|
|
});</script>
|
2015-07-15 16:40:00 -07:00
|
|
|
</dom-module>
|
|
|
|
|
|
|
|
|
|
<dom-module id="x-attach3">
|
|
|
|
|
<style>
|
|
|
|
|
:host {
|
|
|
|
|
display: block;
|
|
|
|
|
border: 1px dashed orange;
|
|
|
|
|
padding: 4px;
|
|
|
|
|
box-sizing: border-box;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
:host ::content .add3 {
|
|
|
|
|
box-sizing: border-box;
|
|
|
|
|
height: 20px;
|
|
|
|
|
background: #333;
|
|
|
|
|
border: 2px solid yellow;
|
|
|
|
|
}
|
|
|
|
|
</style>
|
|
|
|
|
<template>
|
|
|
|
|
<content></content>
|
|
|
|
|
<template is="dom-if" if="{{shouldIf(done.count)}}">
|
|
|
|
|
<x-attach2></x-attach2>
|
|
|
|
|
</template>
|
|
|
|
|
</template>
|
|
|
|
|
<script>Polymer({
|
|
|
|
|
is: 'x-attach3',
|
|
|
|
|
properties: {
|
|
|
|
|
done: {value: {count: 0}}
|
|
|
|
|
},
|
|
|
|
|
ready: function() {
|
|
|
|
|
this.done.count++;
|
|
|
|
|
},
|
|
|
|
|
attached: function() {
|
|
|
|
|
var d = document.createElement('div');
|
|
|
|
|
d.className = 'add3';
|
|
|
|
|
Polymer.dom(this).appendChild(d);
|
|
|
|
|
},
|
|
|
|
|
shouldIf: function(x) {
|
|
|
|
|
return x < 3;
|
|
|
|
|
}
|
|
|
|
|
});</script>
|
|
|
|
|
</dom-module>
|
|
|
|
|
|
|
|
|
|
<dom-module id="x-attach2">
|
|
|
|
|
<style>
|
|
|
|
|
:host {
|
|
|
|
|
display: block;
|
|
|
|
|
border: 1px dashed tomato;
|
|
|
|
|
padding: 4px;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
:host ::content .add2 {
|
|
|
|
|
box-sizing: border-box;
|
|
|
|
|
height: 20px;
|
|
|
|
|
background: gray;
|
|
|
|
|
border: 2px solid yellow;
|
|
|
|
|
}
|
|
|
|
|
</style>
|
|
|
|
|
<template>
|
|
|
|
|
<x-attach3><content></content></x-attach3>
|
|
|
|
|
<template is="dom-if" if="{{shouldIf(done.count)}}">
|
|
|
|
|
<x-attach1></x-attach1>
|
|
|
|
|
</template>
|
|
|
|
|
</template>
|
|
|
|
|
<script>
|
|
|
|
|
Polymer({
|
|
|
|
|
is: 'x-attach2',
|
|
|
|
|
properties: {
|
|
|
|
|
done: {value: {count: 0}}
|
|
|
|
|
},
|
|
|
|
|
ready: function() {
|
|
|
|
|
this.done.count++;
|
|
|
|
|
},
|
|
|
|
|
attached: function() {
|
|
|
|
|
var d = document.createElement('div');
|
|
|
|
|
d.className = 'add2';
|
|
|
|
|
Polymer.dom(this).appendChild(d);
|
|
|
|
|
},
|
|
|
|
|
shouldIf: function(x) {
|
|
|
|
|
return x < 3;
|
|
|
|
|
}
|
|
|
|
|
});</script>
|
|
|
|
|
</dom-module>
|
|
|
|
|
|
|
|
|
|
<dom-module id="x-attach1">
|
|
|
|
|
<style>
|
|
|
|
|
:host {
|
|
|
|
|
display: block;
|
|
|
|
|
border: 1px dashed seagreen;
|
|
|
|
|
padding: 4px;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
:host ::content .add1 {
|
|
|
|
|
box-sizing: border-box;
|
|
|
|
|
height: 20px;
|
|
|
|
|
background: lightgray;
|
|
|
|
|
border: 2px solid yellow;
|
|
|
|
|
}
|
|
|
|
|
</style>
|
|
|
|
|
<template>
|
|
|
|
|
<x-attach2><content></content></x-attach2>
|
|
|
|
|
</template>
|
|
|
|
|
<script>Polymer({
|
|
|
|
|
is: 'x-attach1',
|
|
|
|
|
attached: function() {
|
|
|
|
|
var d = document.createElement('div');
|
|
|
|
|
d.className = 'add1';
|
|
|
|
|
Polymer.dom(this).appendChild(d);
|
|
|
|
|
}
|
|
|
|
|
});</script>
|
2015-07-17 18:19:25 -07:00
|
|
|
</dom-module>
|
|
|
|
|
|
2015-07-17 12:28:03 -07:00
|
|
|
<dom-module id="x-commented">
|
|
|
|
|
<template><span>[</span><!--comment--><content></content></span><span>]</span></content></template>
|
|
|
|
|
<script>Polymer({is: 'x-commented'});</script>
|
2015-08-18 12:10:42 -07:00
|
|
|
</dom-module>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<dom-module id="polymer-dom-repeat">
|
|
|
|
|
<template>
|
|
|
|
|
<div>
|
|
|
|
|
<div>
|
|
|
|
|
<div>
|
|
|
|
|
<div id="container">
|
|
|
|
|
<template is="dom-repeat" items="{{items}}">
|
|
|
|
|
<div>stuff</div>
|
|
|
|
|
</template>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
<script>
|
|
|
|
|
Polymer({
|
|
|
|
|
is: 'polymer-dom-repeat',
|
|
|
|
|
properties: {
|
|
|
|
|
items: {
|
|
|
|
|
value: function() {
|
|
|
|
|
return ['a', 'b', 'c', 'd', 'e'];
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
</script>
|
2015-10-27 11:32:55 -07:00
|
|
|
</dom-module>
|
|
|
|
|
|
|
|
|
|
<dom-module id="x-deep-contains">
|
|
|
|
|
<template>
|
|
|
|
|
<div id="shadowed"></div>
|
2015-10-29 14:29:49 -07:00
|
|
|
<content select="#light"></content>
|
2015-10-27 11:32:55 -07:00
|
|
|
</template>
|
|
|
|
|
<script>
|
|
|
|
|
Polymer({
|
|
|
|
|
is: 'x-deep-contains',
|
|
|
|
|
created: function() {
|
|
|
|
|
var e = document.createElement('div');
|
|
|
|
|
e.id = 'light';
|
|
|
|
|
Polymer.dom(this).appendChild(e);
|
2015-10-29 14:29:49 -07:00
|
|
|
e = document.createElement('div');
|
|
|
|
|
e.id = 'notdistributed';
|
|
|
|
|
Polymer.dom(this).appendChild(e);
|
2015-10-27 11:32:55 -07:00
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
</script>
|
|
|
|
|
</dom-module>
|
2015-11-11 15:50:16 -08:00
|
|
|
|
|
|
|
|
<dom-module id="x-wrapped">
|
|
|
|
|
<script>
|
|
|
|
|
Polymer({
|
|
|
|
|
is: 'x-wrapped'
|
|
|
|
|
});
|
|
|
|
|
</script>
|
|
|
|
|
</dom-module>
|