Skip to content

Commit

Permalink
Merge branch 'polymer2-upgrade' of https://github.com/PredixDev/px-co…
Browse files Browse the repository at this point in the history
…ntext-browser into polymer2-upgrade
  • Loading branch information
talimarcus committed Dec 20, 2017
2 parents 8320839 + 60a0726 commit d51ac68
Show file tree
Hide file tree
Showing 6 changed files with 6,878 additions and 102 deletions.
31 changes: 8 additions & 23 deletions demo/px-context-browser-demo.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<!-- Demo DOM module -->
<dom-module id="px-context-browser-demo">
<template>
<style include="px-demo-styles" is="custom-style"></style>
<style include="px-demo-styles"></style>
<style>
.triggers {
display: flex;
Expand All @@ -37,15 +37,15 @@
<!-- Interactive -->
<px-demo-interactive>
<!-- Configs -->
<px-demo-configs configs="[[configs]]" props="{{props}}" chosen-config="{{chosenConfig}}"></px-demo-configs>
<px-demo-configs slot="px-demo-configs" configs="[[configs]]" props="{{props}}" chosen-config="{{chosenConfig}}"></px-demo-configs>

<!-- Props -->
<px-demo-props props="{{props}}" config="[[chosenConfig]]"></px-demo-props>
<px-demo-props slot="px-demo-props" props="{{props}}" config="[[chosenConfig]]"></px-demo-props>

<px-demo-code-editor props="{{props}}" config="[[chosenConfig]]"></px-demo-code-editor>
<px-demo-code-editor slot="px-demo-code-editor" props="{{props}}" config="[[chosenConfig]]"></px-demo-code-editor>

<!-- Component ---------------------------------------------------------->
<px-demo-component style="display:flex; width:600px">
<px-demo-component slot="px-demo-component" style="display:flex; width:600px">
<div>
<div class="triggers">
<px-context-browser-trigger trigger={{openTrigger}}></px-context-browser-trigger>
Expand Down Expand Up @@ -81,6 +81,7 @@
<!-- END Component ------------------------------------------------------>

<px-demo-component-snippet
slot="px-demo-component-snippet"
element-properties="{{props}}"
element-name="px-context-browser">
</px-demo-component-snippet>
Expand All @@ -95,29 +96,18 @@

<!-- Footer -->
<px-demo-footer></px-demo-footer>

</template>

</dom-module>
<script>
Polymer({
is: 'px-context-browser-demo',

properties: {

/**
* @property demoProps
* @type {Object}
*/
props: {
type: Object,
value: function(){ return this.demoProps; }
},

/**
* @property demoProps
* @type {Array}
*/
configs: {
type: Array,
value: function(){
Expand Down Expand Up @@ -152,15 +142,13 @@
"multiSelect"
]
}
},

}
},

/**
* A reference for `this.props`. Read the documentation there.
*/
demoProps: {

opened: {
type: Boolean,
defaultValue: false,
Expand Down Expand Up @@ -229,10 +217,7 @@
}
},

ready: function () {
},

attached: function () {
ready: function() {
var cb = document.querySelector('px-context-browser');
var dropdown = Polymer.dom(cb.root).querySelector('iron-dropdown');
dropdown.noCancelOnOutsideClick = true;
Expand Down
2 changes: 1 addition & 1 deletion demo/px-context-browser-trigger-demo.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<!-- Demo DOM module -->
<dom-module id="px-context-browser-trigger-demo">
<template>
<style include="px-demo-styles" is="custom-style"></style>
<style include="px-demo-styles"></style>

<!-- Header -->
<px-demo-header
Expand Down
25 changes: 12 additions & 13 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ const gulpif = require('gulp-if');
const combiner = require('stream-combiner2');
const bump = require('gulp-bump');
const argv = require('yargs').argv;
const exec = require('child_process').exec;

const sassOptions = {
importer: importOnce,
Expand Down Expand Up @@ -44,7 +45,7 @@ function buildCSS(){
}

gulp.task('sass', function() {
return gulp.src(['./sass/*.scss', '!./sass/*sketch.scss', '!./sass/*-demo.scss'])
return gulp.src(['./sass/*.scss', '!./sass/*sketch.scss'])
.pipe(buildCSS())
.pipe(gulpif(/.*predix/,
$.rename(function(path){
Expand All @@ -60,16 +61,16 @@ gulp.task('sass', function() {
.pipe(browserSync.stream({match: 'css/*.html'}));
});

gulp.task('demosass', function() {
return gulp.src(['./sass/*-demo.scss'])
.pipe(buildCSS())
.pipe(gulp.dest('css'))
.pipe(browserSync.stream({match: '**/*.css'}));
gulp.task('generate-api', function (cb) {
exec(`node_modules/.bin/polymer analyze ${pkg.name}.html px-context-browser-trigger.html > ${pkg.name}-api.json`, function (err, stdout, stderr) {
console.log(stdout);
console.log(stderr);
cb(err);
});
});

gulp.task('watch', function() {
gulp.watch(['!sass/*-demo.scss', 'sass/*.scss'], ['sass']);
gulp.watch('sass/*-demo.scss', ['demosass']);
gulp.watch(['sass/*.scss'], ['sass']);
});

gulp.task('serve', function() {
Expand All @@ -82,10 +83,8 @@ gulp.task('serve', function() {
server: ['./', 'bower_components'],
});

gulp.watch(['css/*-styles.html', 'css/*-demo.css', '*.html', '*.js']).on('change', browserSync.reload);
gulp.watch(['sass/*.scss', '!sass/*-demo.scss'], ['sass']);
gulp.watch('sass/*-demo.scss', ['demosass']);

gulp.watch(['sass/*.scss'], ['sass']);
gulp.watch(['css/*-styles.html', '*.html', 'demo/*.html']).on('change', browserSync.reload);
});

gulp.task('bump:patch', function(){
Expand All @@ -107,5 +106,5 @@ gulp.task('bump:major', function(){
});

gulp.task('default', function(callback) {
gulpSequence('clean', 'sass', 'demosass')(callback);
gulpSequence('clean', 'sass', 'generate-api')(callback);
});
65 changes: 10 additions & 55 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Predix UI</title>
<link defer rel="icon" href="favicon.ico" type="image/x-icon">

<!--
Fast bootstrapping of the webcomponents-lite library. Only loads the library
Expand All @@ -30,7 +31,7 @@
if (!webComponentsSupported) {
var script = document.createElement('script');
script.async = true;
script.src = '../webcomponentsjs/webcomponents-lite.min.js';
script.src = '../webcomponentsjs/webcomponents-lite.js';
script.onload = onload;
document.head.appendChild(script);
} else {
Expand All @@ -39,69 +40,23 @@
})();
</script>

<!--
Load the Polymer library.
-->
<link rel="import" href="../polymer/polymer.html" />

<!--
Load theme files, apply default theme.
-->
<link rel="import" href="../px-theme/px-theme-styles.html">
<style include="px-theme-styles" is="custom-style"></style>

<!--
Load dark theme files for later use. Stamp dynamic theme switcher, which
listens for theme update messages from the parent page and applies them.
-->
<link defer rel="import" href="../px-dark-theme/px-dark-theme-styles.html">
<link defer rel="import" href="../px-dark-demo-theme/px-dark-demo-theme-styles.html">


<!--
Asynchronously import the px-catalog element, which is the entrypoint
for our application.
-->
<link
async
id="main-element-import"
rel="import"
href="demo/index.html">
<link rel="import" href="../polymer/polymer.html"/>
<link rel="import" href="../px-theme/px-theme-styles.html"/>
<link defer rel="import" href="../px-dark-theme/px-dark-theme-styles.html"/>
<link defer rel="import" href="../px-dark-demo-theme/px-dark-demo-theme-styles.html"/>
<link rel="import" href="demo/index.html"/>

<!--
Load the app icon and manifest for Android devices.
-->
<link defer rel="icon" href="favicon.ico" type="image/x-icon" />

<!--
Basic page styles.
-->
<style>
html, body {
margin: 0;
padding: 0;
}
</style>
<custom-style>
<style include="px-theme-styles" is="custom-style"></style>
</custom-style>
</head>

<body>
<!-- Elements wait on the page and are upgraded after demo/index.html is loaded. -->
<local-element-demo></local-element-demo>

<!--
Attempt to register a service worker with the correct scope. Fail quietly
if this doesn't work, but log the result to the console.
-->
<script type="text/javascript">
// if ('serviceWorker' in navigator) {
// navigator.serviceWorker.register('service-worker.js').then(function(registration) {
// // Registration was successful
// console.log('ServiceWorker registration successful with scope: ', registration.scope);
// }).catch(function(err) {
// // registration failed :(
// console.log('ServiceWorker registration failed: ', err);
// });
// }
</script>
</body>
</html>
Loading

0 comments on commit d51ac68

Please sign in to comment.