Skip to content

Commit

Permalink
Merge pull request #31 from Neovici/gh28-3
Browse files Browse the repository at this point in the history
refs #28 - Update to Polymer 2.x - part 3
  • Loading branch information
Wurper committed Nov 16, 2018
2 parents be39cdc + 43d163c commit 37d1b22
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 61 deletions.
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"dependencies": {
"polymer": "Polymer/polymer#^2.6.1",
"paper-autocomplete": "ellipticaljs/paper-autocomplete#^3.7.0",
"iron-icon": "PolymerElements/iron-icon#1 - 2",
"iron-icon": "PolymerElements/iron-icon#^2.1.0",
"cosmoz-i18next": "Neovici/cosmoz-i18next#^1.0.0"
},
"devDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion demo/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<link rel="import" href="../../paper-dialog/paper-dialog.html">
<link rel="import" href="../../paper-dialog-scrollable/paper-dialog-scrollable.html">
<custom-style>
<style is="custom-style" include="demo-pages-shared-styles">
<style include="demo-pages-shared-styles">
div {
max-width: 1200px !important;
}
Expand Down
23 changes: 3 additions & 20 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 3 additions & 6 deletions paper-autocomplete-chips.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
<link rel="import" href="../paper-item/paper-item.html">
<link rel="import" href="../paper-ripple/paper-ripple.html">
<link rel="import" href="../cosmoz-i18next/cosmoz-i18next.html">
<link rel="import" href="/bower_components/polymer/lib/utils/async.html">

<!--
`paper-autocomplete-chips` is a multi-selection autocomplete element.
Expand Down Expand Up @@ -348,9 +349,6 @@

};
}
constructor() {
super();
}
/**
* Clear the selected items.
* @param {object} event Polymer event object.
Expand Down Expand Up @@ -389,16 +387,15 @@
return;
}
this.push('selectedItems', newSelection);
this.async(function () {
Polymer.Async.microTask.run(() => {
this.$.ac.clear();

// FIXME
this.$.ac.$.paperAutocompleteSuggestions._handleSuggestions({
target: {
value: ''
}
});
}.bind(this));
});
}
/**
* Check whether the input is valid or not.
Expand Down
11 changes: 5 additions & 6 deletions test/basic.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
<link rel="import" href="../../test-fixture/test-fixture.html">
<link rel="import" href="../../iron-test-helpers/iron-test-helpers.html">
<link rel="import" href="../paper-autocomplete-chips.html">
<link rel="import" href="/bower_components/polymer/lib/utils/async.html">
</head>
<body>
<test-fixture id="defaults">
Expand All @@ -30,7 +31,7 @@
// Set input value
autocomplete.text = value.toString();
// Trigger create suggestions
suggestions._input.fire('keyup');
suggestions._input.dispatchEvent(new CustomEvent('keyup', { bubbles: true, composed: true }));
// Select first result
suggestions._selection(0);
},
Expand All @@ -43,9 +44,7 @@
chips = fixture('defaults');
autocomplete = chips.$.ac;
suggestions = autocomplete.$.paperAutocompleteSuggestions;
Polymer.Base.async(() => {
done();
});
Polymer.Async.microTask.run(() => done());
});

test('Selecting string source', done => {
Expand Down Expand Up @@ -113,12 +112,12 @@
chips.textProperty = 'label';
autocomplete.text = 'a';

Polymer.Base.async(() => {
window.setTimeout(() => {
assert.equal(suggestions._suggestions.length, 3);
done();
}, 200);

suggestions._input.fire('focus', {});
suggestions._input.dispatchEvent(new CustomEvent('focus', { bubbles: true, composed: true }));

chips.source = [
{value: 0, label: 'ab'},
Expand Down
29 changes: 2 additions & 27 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2213,14 +2213,6 @@ cli-width@^2.0.0:
resolved "https://registry.yarnpkg.com/cli-width/-/cli-width-2.2.0.tgz#ff19ede8a9a5e579324147b0c11f0fbcbabed639"
integrity sha1-/xnt6Kml5XkyQUewwR8PvLq+1jk=

cli@^1.0.1:
version "1.0.1"
resolved "https://registry.yarnpkg.com/cli/-/cli-1.0.1.tgz#22817534f24bfa4950c34d532d48ecbc621b8c14"
integrity sha1-IoF1NPJL+klQw01TLUjsvGIbjBQ=
dependencies:
exit "0.1.2"
glob "^7.1.1"

clone-buffer@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/clone-buffer/-/clone-buffer-1.0.0.tgz#e3e25b207ac4e701af721e2cb5a16792cac3dc58"
Expand Down Expand Up @@ -3349,11 +3341,6 @@ exit-hook@^1.0.0:
resolved "https://registry.yarnpkg.com/exit-hook/-/exit-hook-1.1.1.tgz#f05ca233b48c05d54fff07765df8507e95c02ff8"
integrity sha1-8FyiM7SMBdVP/wd2XfhQfpXAL/g=

exit@0.1.2:
version "0.1.2"
resolved "https://registry.yarnpkg.com/exit/-/exit-0.1.2.tgz#0632638f8d877cc82107d30a0fff1a17cba1cd0c"
integrity sha1-BjJjj42HfMghB9MKD/8aF8uhzQw=

expand-brackets@^0.1.4:
version "0.1.5"
resolved "https://registry.yarnpkg.com/expand-brackets/-/expand-brackets-0.1.5.tgz#df07284e342a807cd733ac5af72411e581d1177b"
Expand Down Expand Up @@ -4997,7 +4984,7 @@ istanbul@0.3.*:
which "^1.1.1"
wordwrap "^1.0.0"

istanbul@^0.4.0, istanbul@^0.4.5:
istanbul@^0.4.0:
version "0.4.5"
resolved "https://registry.yarnpkg.com/istanbul/-/istanbul-0.4.5.tgz#65c7d73d4c4da84d4f3ac310b918fb0b8033733b"
integrity sha1-ZcfXPUxNqE1POsMQuRj7C4Azczs=
Expand Down Expand Up @@ -5318,7 +5305,7 @@ lodash@^3.0.0, lodash@^3.10.1:
resolved "https://registry.yarnpkg.com/lodash/-/lodash-3.10.1.tgz#5bf45e8e49ba4189e17d482789dfd15bd140b7b6"
integrity sha1-W/Rejkm6QYnhfUgnid/RW9FAt7Y=

lodash@^4.0.0, lodash@^4.11.1, lodash@^4.13.0, lodash@^4.16.6, lodash@^4.17.10, lodash@^4.17.2, lodash@^4.17.4, lodash@^4.3.0, lodash@^4.8.0:
lodash@^4.0.0, lodash@^4.11.1, lodash@^4.16.6, lodash@^4.17.10, lodash@^4.17.2, lodash@^4.17.4, lodash@^4.3.0, lodash@^4.8.0:
version "4.17.11"
resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.11.tgz#b39ea6229ef607ecd89e2c8df12536891cac9b8d"
integrity sha512-cQKh8igo5QUhZ7lg38DYWAxMvjSAKG0A8wGSVimP07SIUEK2UO+arSRKbRZWtelMtN5V0Hkwh5ryOto/SshYIg==
Expand Down Expand Up @@ -7174,13 +7161,6 @@ rollup@^0.64.1:
"@types/estree" "0.0.39"
"@types/node" "*"

ruby@^0.6.1:
version "0.6.1"
resolved "https://registry.yarnpkg.com/ruby/-/ruby-0.6.1.tgz#b3fee5787e4f9c0d5814d6166a5b5dbcfb24ba35"
integrity sha1-s/7leH5PnA1YFNYWaltdvPskujU=
dependencies:
lodash "^4.13.0"

run-async@^0.1.0:
version "0.1.0"
resolved "https://registry.yarnpkg.com/run-async/-/run-async-0.1.0.tgz#c8ad4a5e110661e402a7d21b530e009f25f8e389"
Expand Down Expand Up @@ -8158,11 +8138,6 @@ tr46@^1.0.1:
dependencies:
punycode "^2.1.0"

travis@^0.1.1:
version "0.1.1"
resolved "https://registry.yarnpkg.com/travis/-/travis-0.1.1.tgz#80fe1c36f6f3b739fce07e6063838ce436357d60"
integrity sha1-gP4cNvbztzn84H5gY4OM5DY1fWA=

trim-newlines@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/trim-newlines/-/trim-newlines-1.0.0.tgz#5887966bb582a4503a41eb524f7d35011815a613"
Expand Down

0 comments on commit 37d1b22

Please sign in to comment.