Skip to content

Commit 1e676a4

Browse files
authored
feat: prepare for TS defs generation (#41)
1 parent 25592dd commit 1e676a4

6 files changed

+45
-4
lines changed

bower.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,9 @@
2626
],
2727
"dependencies": {
2828
"polymer": "^2.0.0",
29-
"vaadin-themable-mixin": "vaadin/vaadin-themable-mixin#^1.2.0",
30-
"vaadin-element-mixin": "vaadin/vaadin-element-mixin#^2.3.0",
31-
"vaadin-details": "vaadin/vaadin-details#^1.1.0",
29+
"vaadin-themable-mixin": "vaadin/vaadin-themable-mixin#^1.6.1",
30+
"vaadin-element-mixin": "vaadin/vaadin-element-mixin#^2.4.1",
31+
"vaadin-details": "vaadin/vaadin-details#^1.2.0-alpha1",
3232
"vaadin-lumo-styles": "vaadin/vaadin-lumo-styles#^1.4.1",
3333
"vaadin-material-styles": "vaadin/vaadin-material-styles#^1.2.0"
3434
},

gen-tsd.json

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"excludeFiles": [
3+
"wct.conf.js",
4+
"index.html",
5+
"demo/**/*",
6+
"test/**/*",
7+
"theme/**/*"
8+
]
9+
}

magi-p3-post.js

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
module.exports = {
2+
files: [
3+
'vaadin-accordion.js'
4+
],
5+
from: [
6+
/import '\.\/theme\/lumo\/vaadin-(.+)\.js';/
7+
],
8+
to: [
9+
`import './theme/lumo/vaadin-$1.js';\nexport * from './src/vaadin-$1.js';`
10+
]
11+
};

package.json

+1
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
},
1919
"homepage": "https://vaadin.com/components",
2020
"files": [
21+
"vaadin-*.d.ts",
2122
"vaadin-*.js",
2223
"src",
2324
"theme"

src/vaadin-accordion-panel.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
*
3636
* See [ThemableMixin – how to apply styles for shadow parts](https://github.com/vaadin/vaadin-themable-mixin/wiki)
3737
*
38-
* @memberof Vaadin
38+
* @extends Vaadin.DetailsElement
3939
*/
4040
class AccordionPanelElement extends Vaadin.DetailsElement {
4141
static get is() {

src/vaadin-accordion.html

+20
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@
8989
* The index of currently opened panel. First panel is opened by
9090
* default. Only one panel can be opened at the same time.
9191
* Setting null or undefined closes all the accordion panels.
92+
* @type {number}
9293
*/
9394
opened: {
9495
type: Number,
@@ -101,6 +102,7 @@
101102
* The list of `<vaadin-accordion-panel>` child elements.
102103
* It is populated from the elements passed to the light DOM,
103104
* and updated dynamically when adding or removing panels.
105+
* @type {!Array<!AccordionPanelElement>}
104106
*/
105107
items: {
106108
type: Array,
@@ -122,6 +124,7 @@
122124
}
123125

124126
/**
127+
* @return {Element | null}
125128
* @protected
126129
*/
127130
get focused() {
@@ -155,10 +158,16 @@
155158
});
156159
}
157160

161+
/**
162+
* @param {!Array<!Element>} array
163+
* @return {!Array<!AccordionPanelElement>}
164+
* @protected
165+
*/
158166
_filterItems(array) {
159167
return array.filter(el => el instanceof Vaadin.AccordionPanelElement);
160168
}
161169

170+
/** @private */
162171
_updateItems(items, opened) {
163172
if (items) {
164173
const itemToOpen = items[opened];
@@ -168,6 +177,10 @@
168177
}
169178
}
170179

180+
/**
181+
* @param {!KeyboardEvent} event
182+
* @protected
183+
*/
171184
_onKeydown(event) {
172185
// only check keyboard events on details toggle buttons
173186
const item = event.composedPath()[0];
@@ -211,6 +224,12 @@
211224
}
212225
}
213226

227+
/**
228+
* @param {number} index
229+
* @param {number} increment
230+
* @return {number}
231+
* @protected
232+
*/
214233
_getAvailableIndex(index, increment) {
215234
const totalItems = this.items.length;
216235
let idx = index;
@@ -229,6 +248,7 @@
229248
return -1;
230249
}
231250

251+
/** @private */
232252
_updateOpened(e) {
233253
const target = this._filterItems(e.composedPath())[0];
234254
const idx = this.items.indexOf(target);

0 commit comments

Comments
 (0)