Skip to content

Commit

Permalink
feat: prepare for TS defs generation
Browse files Browse the repository at this point in the history
resolves #71
  • Loading branch information
pekam committed May 14, 2020
1 parent 893d5ef commit b4fa283
Show file tree
Hide file tree
Showing 6 changed files with 33 additions and 5 deletions.
7 changes: 2 additions & 5 deletions bower.json
Expand Up @@ -27,18 +27,15 @@
],
"dependencies": {
"polymer": "^2.0.0",
"vaadin-themable-mixin": "vaadin/vaadin-themable-mixin#^1.2.1",
"vaadin-themable-mixin": "vaadin/vaadin-themable-mixin#^1.6.1",
"vaadin-lumo-styles": "vaadin/vaadin-lumo-styles#^1.1.0",
"vaadin-material-styles": "vaadin/vaadin-material-styles#^1.1.0",
"vaadin-element-mixin": "vaadin/vaadin-element-mixin#^2.0.0"
"vaadin-element-mixin": "vaadin/vaadin-element-mixin#^2.4.1"
},
"devDependencies": {
"iron-component-page": "^3.0.0",
"webcomponentsjs": "^1.0.0",
"web-component-tester": "^6.1.5",
"vaadin-demo-helpers": "vaadin/vaadin-demo-helpers#^3.0.0"
},
"resolutions": {
"vaadin-element-mixin": "^2.0.0"
}
}
9 changes: 9 additions & 0 deletions gen-tsd.json
@@ -0,0 +1,9 @@
{
"excludeFiles": [
"wct.conf.js",
"index.html",
"demo/**/*",
"test/**/*",
"theme/**/*"
]
}
11 changes: 11 additions & 0 deletions magi-p3-post.js
@@ -0,0 +1,11 @@
module.exports = {
files: [
'vaadin-progress-bar.js'
],
from: [
/import '\.\/theme\/lumo\/vaadin-(.+)\.js';/
],
to: [
`import './theme/lumo/vaadin-$1.js';\nexport * from './src/vaadin-$1.js';`
]
};
1 change: 1 addition & 0 deletions package.json
Expand Up @@ -19,6 +19,7 @@
},
"homepage": "https://vaadin.com/components",
"files": [
"vaadin-*.d.ts",
"vaadin-*.js",
"src",
"theme"
Expand Down
1 change: 1 addition & 0 deletions src/vaadin-progress-bar.html
Expand Up @@ -82,6 +82,7 @@
* @memberof Vaadin
* @mixes Vaadin.ProgressMixin
* @mixes Vaadin.ThemableMixin
* @mixes Vaadin.ElementMixin
* @demo demo/index.html
*/
class ProgressBarElement extends Vaadin.ElementMixin(Vaadin.ThemableMixin(Vaadin.ProgressMixin(Polymer.Element))) {
Expand Down
9 changes: 9 additions & 0 deletions src/vaadin-progress-mixin.html
Expand Up @@ -27,6 +27,7 @@
},
/**
* Minimum bound of the progress bar.
* @type {number}
*/
min: {
type: Number,
Expand All @@ -35,6 +36,7 @@
},
/**
* Maximum bound of the progress bar.
* @type {number}
*/
max: {
type: Number,
Expand All @@ -44,6 +46,7 @@
/**
* Indeterminate state of the progress bar.
* This property takes precedence over other state properties (min, max, value).
* @type {boolean}
*/
indeterminate: {
type: Boolean,
Expand All @@ -59,12 +62,14 @@
];
}

/** @protected */
ready() {
super.ready();

this.setAttribute('role', 'progressbar');
}

/** @private */
_normalizedValueChanged(value, min, max) {
const newNormalizedValue = this._normalizeValue(value, min, max);

Expand All @@ -75,20 +80,24 @@
});
}

/** @private */
_valueChanged(newV, oldV) {
this.setAttribute('aria-valuenow', newV);
}

/** @private */
_minChanged(newV, oldV) {
this.setAttribute('aria-valuemin', newV);
}

/** @private */
_maxChanged(newV, oldV) {
this.setAttribute('aria-valuemax', newV);
}

/**
* Percent of current progress relative to whole progress bar (max - min)
* @private
*/
_normalizeValue(value, min, max) {
let nV;
Expand Down

0 comments on commit b4fa283

Please sign in to comment.