diff --git a/addon/components/pix-search-input.hbs b/addon/components/pix-search-input.hbs index 79459fcf5..2d773b90d 100644 --- a/addon/components/pix-search-input.hbs +++ b/addon/components/pix-search-input.hbs @@ -16,8 +16,8 @@ class="pix-search-input__input" name={{@inputName}} placeholder={{@placeholder}} - value={{@value}} - oninput={{this.onSearch}} + value={{this.initialValue}} + {{on "input" this.onSearch}} ...attributes /> diff --git a/addon/components/pix-search-input.js b/addon/components/pix-search-input.js index 4bed4053a..4e63bc191 100644 --- a/addon/components/pix-search-input.js +++ b/addon/components/pix-search-input.js @@ -1,14 +1,16 @@ import Component from '@glimmer/component'; import { action } from '@ember/object'; import { guidFor } from '@ember/object/internals'; -import debounce from 'lodash.debounce'; +import { debounceTask } from 'ember-lifeline'; export default class PixSearchInput extends Component { + initialValue = this.args.value; + constructor() { super(...arguments); this.debounceTimeBeforeSearch = parseInt(this.args.debounceTimeInMs); - if (isNaN(this.debounceTimeBeforeSearch)) { + if (Number.isNaN(this.debounceTimeBeforeSearch)) { throw new Error('ERROR in PixSearchInput component, @debounceTimeInMs param is not provided'); } if (!this.args.triggerFiltering) { @@ -21,10 +23,6 @@ export default class PixSearchInput extends Component { } this.searchInputId = this.args.id || guidFor(this); - this.debouncedTriggerFiltering = debounce( - this.args.triggerFiltering, - this.debounceTimeBeforeSearch, - ); } get label() { @@ -35,8 +33,17 @@ export default class PixSearchInput extends Component { return this.args.label ? null : this.args.ariaLabel; } + debouncedTriggerFiltering(value) { + this.args.triggerFiltering(this.searchInputId, value); + } + @action - async onSearch(event) { - await this.debouncedTriggerFiltering(this.searchInputId, event.target.value); + onSearch(event) { + debounceTask( + this, + 'debouncedTriggerFiltering', + event.target.value, + this.debounceTimeBeforeSearch, + ); } } diff --git a/package-lock.json b/package-lock.json index 88805097e..89d876750 100644 --- a/package-lock.json +++ b/package-lock.json @@ -16,9 +16,9 @@ "ember-cli-htmlbars": "^6.1.1", "ember-cli-sass": "^11.0.1", "ember-click-outside": "^6.0.1", + "ember-lifeline": "^7.0.0", "ember-popperjs": "^3.0.0", - "ember-truth-helpers": "^4.0.0", - "lodash.debounce": "^4.0.8" + "ember-truth-helpers": "^4.0.0" }, "devDependencies": { "@1024pix/ember-testing-library": "^1.0.0", @@ -3677,7 +3677,7 @@ "version": "3.3.0", "resolved": "https://registry.npmjs.org/@ember/test-helpers/-/test-helpers-3.3.0.tgz", "integrity": "sha512-HEI28wtjnQuEj9+DstHUEEKPtqPAEVN9AAVr4EifVCd3DyEDy0m6hFT4qbap1WxAIktLja2QXGJg50lVWzZc5g==", - "dev": true, + "devOptional": true, "dependencies": { "@ember/test-waiters": "^3.0.2", "@embroider/macros": "^1.10.0", @@ -3701,7 +3701,7 @@ "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-private-property-in-object/-/plugin-proposal-private-property-in-object-7.21.11.tgz", "integrity": "sha512-0QZ8qP/3RLDVBwBFoWAwCtgcDZJVwA5LUJRZU8x2YFfKNuFq161wK3cuGrALu5yiPu+vzwTAg/sMWVNeWeNyaw==", "deprecated": "This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-private-property-in-object instead.", - "dev": true, + "devOptional": true, "dependencies": { "@babel/helper-annotate-as-pure": "^7.18.6", "@babel/helper-create-class-features-plugin": "^7.21.0", @@ -3719,7 +3719,7 @@ "version": "7.12.18", "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.12.18.tgz", "integrity": "sha512-BogPQ7ciE6SYAUPtlm9tWbgI9+2AgqSam6QivMgXgAT+fKbgppaj4ZX15MHeLC1PVF5sNk70huBu20XxWOs8Cg==", - "dev": true, + "devOptional": true, "dependencies": { "regenerator-runtime": "^0.13.4" } @@ -3728,7 +3728,7 @@ "version": "5.1.0", "resolved": "https://registry.npmjs.org/@types/fs-extra/-/fs-extra-5.1.0.tgz", "integrity": "sha512-AInn5+UBFIK9FK5xc9yP5e3TQSPNNgjHByqYcj9g5elVBnDQcQL7PlO1CIRy2gWlbwK7UPYqi7vRvFA44dCmYQ==", - "dev": true, + "devOptional": true, "dependencies": { "@types/node": "*" } @@ -3737,7 +3737,7 @@ "version": "3.2.0", "resolved": "https://registry.npmjs.org/babel-plugin-module-resolver/-/babel-plugin-module-resolver-3.2.0.tgz", "integrity": "sha512-tjR0GvSndzPew/Iayf4uICWZqjBwnlMWjSx6brryfQ81F9rxBVqwDJtFCV8oOs0+vJeefK9TmdZtkIFdFe1UnA==", - "dev": true, + "devOptional": true, "dependencies": { "find-babel-config": "^1.1.0", "glob": "^7.1.2", @@ -3753,7 +3753,7 @@ "version": "1.3.1", "resolved": "https://registry.npmjs.org/broccoli-plugin/-/broccoli-plugin-1.3.1.tgz", "integrity": "sha512-DW8XASZkmorp+q7J4EeDEZz+LoyKLAd2XZULXyD9l4m9/hAKV3vjHmB1kiUshcWAYMgTP1m2i4NnqCE/23h6AQ==", - "dev": true, + "devOptional": true, "dependencies": { "promise-map-series": "^0.2.1", "quick-temp": "^0.1.3", @@ -3765,7 +3765,7 @@ "version": "2.7.1", "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.7.1.tgz", "integrity": "sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w==", - "dev": true, + "devOptional": true, "dependencies": { "glob": "^7.1.3" }, @@ -3777,7 +3777,7 @@ "version": "2.1.2", "resolved": "https://registry.npmjs.org/broccoli-source/-/broccoli-source-2.1.2.tgz", "integrity": "sha512-1lLayO4wfS0c0Sj50VfHJXNWf94FYY0WUhxj0R77thbs6uWI7USiOWFqQV5dRmhAJnoKaGN4WyLGQbgjgiYFwQ==", - "dev": true, + "devOptional": true, "engines": { "node": "6.* || 8.* || >= 10.*" } @@ -3786,7 +3786,7 @@ "version": "2.6.9", "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", - "dev": true, + "devOptional": true, "dependencies": { "ms": "2.0.0" } @@ -3795,7 +3795,7 @@ "version": "7.26.11", "resolved": "https://registry.npmjs.org/ember-cli-babel/-/ember-cli-babel-7.26.11.tgz", "integrity": "sha512-JJYeYjiz/JTn34q7F5DSOjkkZqy8qwFOOxXfE6pe9yEJqWGu4qErKxlz8I22JoVEQ/aBUO+OcKTpmctvykM9YA==", - "dev": true, + "devOptional": true, "dependencies": { "@babel/core": "^7.12.0", "@babel/helper-compilation-targets": "^7.12.0", @@ -3836,7 +3836,7 @@ "version": "2.0.2", "resolved": "https://registry.npmjs.org/broccoli-funnel/-/broccoli-funnel-2.0.2.tgz", "integrity": "sha512-/vDTqtv7ipjEZQOVqO4vGDVAOZyuYzQ/EgGoyewfOgh1M7IQAToBKZI0oAQPgMBeFPPlIbfMuAngk+ohPBuaHQ==", - "dev": true, + "devOptional": true, "dependencies": { "array-equal": "^1.0.0", "blank-object": "^1.0.1", @@ -3860,7 +3860,7 @@ "version": "2.7.1", "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.7.1.tgz", "integrity": "sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w==", - "dev": true, + "devOptional": true, "dependencies": { "glob": "^7.1.3" }, @@ -3872,7 +3872,7 @@ "version": "5.7.2", "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.2.tgz", "integrity": "sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g==", - "dev": true, + "devOptional": true, "bin": { "semver": "bin/semver" } @@ -3881,7 +3881,7 @@ "version": "4.1.1", "resolved": "https://registry.npmjs.org/ember-cli-version-checker/-/ember-cli-version-checker-4.1.1.tgz", "integrity": "sha512-bzEWsTMXUGEJfxcAGWPe6kI7oHEGD3jaxUWDYPTqzqGhNkgPwXTBgoWs9zG1RaSMaOPFnloWuxRcoHi4TrYS3Q==", - "dev": true, + "devOptional": true, "dependencies": { "resolve-package-path": "^2.0.0", "semver": "^6.3.0", @@ -3895,7 +3895,7 @@ "version": "2.0.0", "resolved": "https://registry.npmjs.org/resolve-package-path/-/resolve-package-path-2.0.0.tgz", "integrity": "sha512-/CLuzodHO2wyyHTzls5Qr+EFeG6RcW4u6//gjYvUfcfyuplIX1SSccU+A5A9A78Gmezkl3NBkFAMxLbzTY9TJA==", - "dev": true, + "devOptional": true, "dependencies": { "path-root": "^0.1.1", "resolve": "^1.13.1" @@ -3908,7 +3908,7 @@ "version": "2.1.0", "resolved": "https://registry.npmjs.org/find-up/-/find-up-2.1.0.tgz", "integrity": "sha512-NWzkk0jSJtTt08+FBFMvXoeZnOJD+jTtsRmBYbAIzJdX6l7dLgR7CTubCM5/eDdPUBvLCeVasP1brfVR/9/EZQ==", - "dev": true, + "devOptional": true, "dependencies": { "locate-path": "^2.0.0" }, @@ -3920,7 +3920,7 @@ "version": "1.3.0", "resolved": "https://registry.npmjs.org/fixturify/-/fixturify-1.3.0.tgz", "integrity": "sha512-tL0svlOy56pIMMUQ4bU1xRe6NZbFSa/ABTWMxW2mH38lFGc9TrNAKWcMBQ7eIjo3wqSS8f2ICabFaatFyFmrVQ==", - "dev": true, + "devOptional": true, "dependencies": { "@types/fs-extra": "^5.0.5", "@types/minimatch": "^3.0.3", @@ -3936,7 +3936,7 @@ "version": "1.10.0", "resolved": "https://registry.npmjs.org/fixturify-project/-/fixturify-project-1.10.0.tgz", "integrity": "sha512-L1k9uiBQuN0Yr8tA9Noy2VSQ0dfg0B8qMdvT7Wb5WQKc7f3dn3bzCbSrqlb+etLW+KDV4cBC7R1OvcMg3kcxmA==", - "dev": true, + "devOptional": true, "dependencies": { "fixturify": "^1.2.0", "tmp": "^0.0.33" @@ -3946,7 +3946,7 @@ "version": "7.0.1", "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-7.0.1.tgz", "integrity": "sha512-YJDaCJZEnBmcbw13fvdAM9AwNOJwOzrE4pqMqBq5nFiEqXUqHwlK4B+3pUw6JNvfSPtX05xFHtYy/1ni01eGCw==", - "dev": true, + "devOptional": true, "dependencies": { "graceful-fs": "^4.1.2", "jsonfile": "^4.0.0", @@ -3960,7 +3960,7 @@ "version": "4.0.0", "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz", "integrity": "sha512-m6F1R3z8jjlf2imQHS2Qez5sjKWQzbuuhuJ/FKYFRZvPE3PuHcSMVZzfsLhGVOkfd20obL5SWEBew5ShlquNxg==", - "dev": true, + "devOptional": true, "optionalDependencies": { "graceful-fs": "^4.1.6" } @@ -3969,7 +3969,7 @@ "version": "2.0.0", "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-2.0.0.tgz", "integrity": "sha512-NCI2kiDkyR7VeEKm27Kda/iQHyKJe1Bu0FlTbYp3CqJu+9IFe9bLyAjMxf5ZDDbEg+iMPzB5zYyUTSm8wVTKmA==", - "dev": true, + "devOptional": true, "dependencies": { "p-locate": "^2.0.0", "path-exists": "^3.0.0" @@ -3982,7 +3982,7 @@ "version": "1.2.8", "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.8.tgz", "integrity": "sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==", - "dev": true, + "devOptional": true, "funding": { "url": "https://github.com/sponsors/ljharb" } @@ -3991,7 +3991,7 @@ "version": "0.5.6", "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.6.tgz", "integrity": "sha512-FP+p8RB8OWpF3YZBCrP5gtADmtXApB5AMLn+vdyA+PyxCjrCs00mjyUozssO33cwDeT3wNGdLxJ5M//YqtHAJw==", - "dev": true, + "devOptional": true, "dependencies": { "minimist": "^1.2.6" }, @@ -4003,13 +4003,13 @@ "version": "2.0.0", "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==", - "dev": true + "devOptional": true }, "node_modules/@ember/test-helpers/node_modules/p-limit": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-1.3.0.tgz", "integrity": "sha512-vvcXsLAJ9Dr5rQOPk7toZQZJApBl2K4J6dANSsEuh6QI41JYcsS/qhTGa9ErIUUgK3WNQoJYvylxvjqmiqEA9Q==", - "dev": true, + "devOptional": true, "dependencies": { "p-try": "^1.0.0" }, @@ -4021,7 +4021,7 @@ "version": "2.0.0", "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-2.0.0.tgz", "integrity": "sha512-nQja7m7gSKuewoVRen45CtVfODR3crN3goVQ0DDZ9N3yHxgpkuBhZqsaiotSQRrADUrne346peY7kT3TSACykg==", - "dev": true, + "devOptional": true, "dependencies": { "p-limit": "^1.1.0" }, @@ -4033,7 +4033,7 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/p-try/-/p-try-1.0.0.tgz", "integrity": "sha512-U1etNYuMJoIz3ZXSrrySFjsXQTWOx2/jdi86L+2pRvph/qMKL6sbcCYdH23fqsbm8TH2Gn0OybpT4eSFlCVHww==", - "dev": true, + "devOptional": true, "engines": { "node": ">=4" } @@ -4042,7 +4042,7 @@ "version": "2.0.0", "resolved": "https://registry.npmjs.org/pkg-up/-/pkg-up-2.0.0.tgz", "integrity": "sha512-fjAPuiws93rm7mPUu21RdBnkeZNrbfCFCwfAhPWY+rR3zG0ubpe5cEReHOw5fIbfmsxEV/g2kSxGTATY3Bpnwg==", - "dev": true, + "devOptional": true, "dependencies": { "find-up": "^2.1.0" }, @@ -4054,7 +4054,7 @@ "version": "0.2.3", "resolved": "https://registry.npmjs.org/promise-map-series/-/promise-map-series-0.2.3.tgz", "integrity": "sha512-wx9Chrutvqu1N/NHzTayZjE1BgIwt6SJykQoCOic4IZ9yUDjKyVYrpLa/4YCNsV61eRENfs29hrEquVuB13Zlw==", - "dev": true, + "devOptional": true, "dependencies": { "rsvp": "^3.0.14" } @@ -4063,19 +4063,19 @@ "version": "0.13.11", "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.13.11.tgz", "integrity": "sha512-kY1AZVr2Ra+t+piVaJ4gxaFaReZVH40AKNo7UCX6W+dEwBo/2oZJzqfuN1qLq1oL45o56cPaTXELwrTh8Fpggg==", - "dev": true + "devOptional": true }, "node_modules/@ember/test-helpers/node_modules/reselect": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/reselect/-/reselect-3.0.1.tgz", "integrity": "sha512-b/6tFZCmRhtBMa4xGqiiRp9jh9Aqi2A687Lo265cN0/QohJQEBPiQ52f4QB6i0eF3yp3hmLL21LSGBcML2dlxA==", - "dev": true + "devOptional": true }, "node_modules/@ember/test-helpers/node_modules/resolve-package-path": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/resolve-package-path/-/resolve-package-path-3.1.0.tgz", "integrity": "sha512-2oC2EjWbMJwvSN6Z7DbDfJMnD8MYEouaLn5eIX0j8XwPsYCVIyY9bbnX88YHVkbr8XHqvZrYbxaLPibfTYKZMA==", - "dev": true, + "devOptional": true, "dependencies": { "path-root": "^0.1.1", "resolve": "^1.17.0" @@ -4088,7 +4088,7 @@ "version": "3.6.2", "resolved": "https://registry.npmjs.org/rsvp/-/rsvp-3.6.2.tgz", "integrity": "sha512-OfWGQTb9vnwRjwtA2QwpG2ICclHC3pgXZO5xt8H2EfgDquO0qVdSb5T88L4qJVAEugbS56pAuV4XZM58UX8ulw==", - "dev": true, + "devOptional": true, "engines": { "node": "0.12.* || 4.* || 6.* || >= 7.*" } @@ -4097,7 +4097,7 @@ "version": "0.1.2", "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz", "integrity": "sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==", - "dev": true, + "devOptional": true, "engines": { "node": ">= 4.0.0" } @@ -4106,7 +4106,7 @@ "version": "0.3.4", "resolved": "https://registry.npmjs.org/walk-sync/-/walk-sync-0.3.4.tgz", "integrity": "sha512-ttGcuHA/OBnN2pcM6johpYlEms7XpO5/fyKIr48541xXedan4roO8cS1Q2S/zbbjGH/BarYDAMeS2Mi9HE5Tig==", - "dev": true, + "devOptional": true, "dependencies": { "ensure-posix-path": "^1.0.0", "matcher-collection": "^1.0.0" @@ -4116,7 +4116,7 @@ "version": "1.1.2", "resolved": "https://registry.npmjs.org/matcher-collection/-/matcher-collection-1.1.2.tgz", "integrity": "sha512-YQ/teqaOIIfUHedRam08PB3NK7Mjct6BvzRnJmpGDm8uFXpNr1sbY4yuflI5JcEs6COpYA0FpRQhSDBf1tT95g==", - "dev": true, + "devOptional": true, "dependencies": { "minimatch": "^3.0.2" } @@ -4125,7 +4125,7 @@ "version": "3.1.0", "resolved": "https://registry.npmjs.org/@ember/test-waiters/-/test-waiters-3.1.0.tgz", "integrity": "sha512-bb9h95ktG2wKY9+ja1sdsFBdOms2lB19VWs8wmNpzgHv1NCetonBoV5jHBV4DHt0uS1tg9z66cZqhUVlYs96KQ==", - "dev": true, + "devOptional": true, "dependencies": { "calculate-cache-key-for-tree": "^2.0.0", "ember-cli-babel": "^7.26.6", @@ -4141,7 +4141,7 @@ "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-private-property-in-object/-/plugin-proposal-private-property-in-object-7.21.11.tgz", "integrity": "sha512-0QZ8qP/3RLDVBwBFoWAwCtgcDZJVwA5LUJRZU8x2YFfKNuFq161wK3cuGrALu5yiPu+vzwTAg/sMWVNeWeNyaw==", "deprecated": "This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-private-property-in-object instead.", - "dev": true, + "devOptional": true, "dependencies": { "@babel/helper-annotate-as-pure": "^7.18.6", "@babel/helper-create-class-features-plugin": "^7.21.0", @@ -4159,7 +4159,7 @@ "version": "7.12.18", "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.12.18.tgz", "integrity": "sha512-BogPQ7ciE6SYAUPtlm9tWbgI9+2AgqSam6QivMgXgAT+fKbgppaj4ZX15MHeLC1PVF5sNk70huBu20XxWOs8Cg==", - "dev": true, + "devOptional": true, "dependencies": { "regenerator-runtime": "^0.13.4" } @@ -4168,7 +4168,7 @@ "version": "5.1.0", "resolved": "https://registry.npmjs.org/@types/fs-extra/-/fs-extra-5.1.0.tgz", "integrity": "sha512-AInn5+UBFIK9FK5xc9yP5e3TQSPNNgjHByqYcj9g5elVBnDQcQL7PlO1CIRy2gWlbwK7UPYqi7vRvFA44dCmYQ==", - "dev": true, + "devOptional": true, "dependencies": { "@types/node": "*" } @@ -4177,7 +4177,7 @@ "version": "3.2.0", "resolved": "https://registry.npmjs.org/babel-plugin-module-resolver/-/babel-plugin-module-resolver-3.2.0.tgz", "integrity": "sha512-tjR0GvSndzPew/Iayf4uICWZqjBwnlMWjSx6brryfQ81F9rxBVqwDJtFCV8oOs0+vJeefK9TmdZtkIFdFe1UnA==", - "dev": true, + "devOptional": true, "dependencies": { "find-babel-config": "^1.1.0", "glob": "^7.1.2", @@ -4193,7 +4193,7 @@ "version": "2.0.2", "resolved": "https://registry.npmjs.org/broccoli-funnel/-/broccoli-funnel-2.0.2.tgz", "integrity": "sha512-/vDTqtv7ipjEZQOVqO4vGDVAOZyuYzQ/EgGoyewfOgh1M7IQAToBKZI0oAQPgMBeFPPlIbfMuAngk+ohPBuaHQ==", - "dev": true, + "devOptional": true, "dependencies": { "array-equal": "^1.0.0", "blank-object": "^1.0.1", @@ -4217,7 +4217,7 @@ "version": "2.7.1", "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.7.1.tgz", "integrity": "sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w==", - "dev": true, + "devOptional": true, "dependencies": { "glob": "^7.1.3" }, @@ -4229,7 +4229,7 @@ "version": "1.3.1", "resolved": "https://registry.npmjs.org/broccoli-plugin/-/broccoli-plugin-1.3.1.tgz", "integrity": "sha512-DW8XASZkmorp+q7J4EeDEZz+LoyKLAd2XZULXyD9l4m9/hAKV3vjHmB1kiUshcWAYMgTP1m2i4NnqCE/23h6AQ==", - "dev": true, + "devOptional": true, "dependencies": { "promise-map-series": "^0.2.1", "quick-temp": "^0.1.3", @@ -4241,7 +4241,7 @@ "version": "2.7.1", "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.7.1.tgz", "integrity": "sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w==", - "dev": true, + "devOptional": true, "dependencies": { "glob": "^7.1.3" }, @@ -4253,7 +4253,7 @@ "version": "2.1.2", "resolved": "https://registry.npmjs.org/broccoli-source/-/broccoli-source-2.1.2.tgz", "integrity": "sha512-1lLayO4wfS0c0Sj50VfHJXNWf94FYY0WUhxj0R77thbs6uWI7USiOWFqQV5dRmhAJnoKaGN4WyLGQbgjgiYFwQ==", - "dev": true, + "devOptional": true, "engines": { "node": "6.* || 8.* || >= 10.*" } @@ -4262,7 +4262,7 @@ "version": "2.6.9", "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", - "dev": true, + "devOptional": true, "dependencies": { "ms": "2.0.0" } @@ -4271,7 +4271,7 @@ "version": "7.26.11", "resolved": "https://registry.npmjs.org/ember-cli-babel/-/ember-cli-babel-7.26.11.tgz", "integrity": "sha512-JJYeYjiz/JTn34q7F5DSOjkkZqy8qwFOOxXfE6pe9yEJqWGu4qErKxlz8I22JoVEQ/aBUO+OcKTpmctvykM9YA==", - "dev": true, + "devOptional": true, "dependencies": { "@babel/core": "^7.12.0", "@babel/helper-compilation-targets": "^7.12.0", @@ -4312,7 +4312,7 @@ "version": "4.1.1", "resolved": "https://registry.npmjs.org/ember-cli-version-checker/-/ember-cli-version-checker-4.1.1.tgz", "integrity": "sha512-bzEWsTMXUGEJfxcAGWPe6kI7oHEGD3jaxUWDYPTqzqGhNkgPwXTBgoWs9zG1RaSMaOPFnloWuxRcoHi4TrYS3Q==", - "dev": true, + "devOptional": true, "dependencies": { "resolve-package-path": "^2.0.0", "semver": "^6.3.0", @@ -4326,7 +4326,7 @@ "version": "2.0.0", "resolved": "https://registry.npmjs.org/resolve-package-path/-/resolve-package-path-2.0.0.tgz", "integrity": "sha512-/CLuzodHO2wyyHTzls5Qr+EFeG6RcW4u6//gjYvUfcfyuplIX1SSccU+A5A9A78Gmezkl3NBkFAMxLbzTY9TJA==", - "dev": true, + "devOptional": true, "dependencies": { "path-root": "^0.1.1", "resolve": "^1.13.1" @@ -4339,7 +4339,7 @@ "version": "6.3.1", "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", - "dev": true, + "devOptional": true, "bin": { "semver": "bin/semver.js" } @@ -4348,7 +4348,7 @@ "version": "5.7.2", "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.2.tgz", "integrity": "sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g==", - "dev": true, + "devOptional": true, "bin": { "semver": "bin/semver" } @@ -4357,7 +4357,7 @@ "version": "2.1.0", "resolved": "https://registry.npmjs.org/find-up/-/find-up-2.1.0.tgz", "integrity": "sha512-NWzkk0jSJtTt08+FBFMvXoeZnOJD+jTtsRmBYbAIzJdX6l7dLgR7CTubCM5/eDdPUBvLCeVasP1brfVR/9/EZQ==", - "dev": true, + "devOptional": true, "dependencies": { "locate-path": "^2.0.0" }, @@ -4369,7 +4369,7 @@ "version": "1.3.0", "resolved": "https://registry.npmjs.org/fixturify/-/fixturify-1.3.0.tgz", "integrity": "sha512-tL0svlOy56pIMMUQ4bU1xRe6NZbFSa/ABTWMxW2mH38lFGc9TrNAKWcMBQ7eIjo3wqSS8f2ICabFaatFyFmrVQ==", - "dev": true, + "devOptional": true, "dependencies": { "@types/fs-extra": "^5.0.5", "@types/minimatch": "^3.0.3", @@ -4385,7 +4385,7 @@ "version": "1.10.0", "resolved": "https://registry.npmjs.org/fixturify-project/-/fixturify-project-1.10.0.tgz", "integrity": "sha512-L1k9uiBQuN0Yr8tA9Noy2VSQ0dfg0B8qMdvT7Wb5WQKc7f3dn3bzCbSrqlb+etLW+KDV4cBC7R1OvcMg3kcxmA==", - "dev": true, + "devOptional": true, "dependencies": { "fixturify": "^1.2.0", "tmp": "^0.0.33" @@ -4395,7 +4395,7 @@ "version": "7.0.1", "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-7.0.1.tgz", "integrity": "sha512-YJDaCJZEnBmcbw13fvdAM9AwNOJwOzrE4pqMqBq5nFiEqXUqHwlK4B+3pUw6JNvfSPtX05xFHtYy/1ni01eGCw==", - "dev": true, + "devOptional": true, "dependencies": { "graceful-fs": "^4.1.2", "jsonfile": "^4.0.0", @@ -4409,7 +4409,7 @@ "version": "4.0.0", "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz", "integrity": "sha512-m6F1R3z8jjlf2imQHS2Qez5sjKWQzbuuhuJ/FKYFRZvPE3PuHcSMVZzfsLhGVOkfd20obL5SWEBew5ShlquNxg==", - "dev": true, + "devOptional": true, "optionalDependencies": { "graceful-fs": "^4.1.6" } @@ -4418,7 +4418,7 @@ "version": "2.0.0", "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-2.0.0.tgz", "integrity": "sha512-NCI2kiDkyR7VeEKm27Kda/iQHyKJe1Bu0FlTbYp3CqJu+9IFe9bLyAjMxf5ZDDbEg+iMPzB5zYyUTSm8wVTKmA==", - "dev": true, + "devOptional": true, "dependencies": { "p-locate": "^2.0.0", "path-exists": "^3.0.0" @@ -4431,7 +4431,7 @@ "version": "6.0.0", "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", - "dev": true, + "devOptional": true, "dependencies": { "yallist": "^4.0.0" }, @@ -4443,7 +4443,7 @@ "version": "1.2.8", "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.8.tgz", "integrity": "sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==", - "dev": true, + "devOptional": true, "funding": { "url": "https://github.com/sponsors/ljharb" } @@ -4452,7 +4452,7 @@ "version": "0.5.6", "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.6.tgz", "integrity": "sha512-FP+p8RB8OWpF3YZBCrP5gtADmtXApB5AMLn+vdyA+PyxCjrCs00mjyUozssO33cwDeT3wNGdLxJ5M//YqtHAJw==", - "dev": true, + "devOptional": true, "dependencies": { "minimist": "^1.2.6" }, @@ -4464,13 +4464,13 @@ "version": "2.0.0", "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==", - "dev": true + "devOptional": true }, "node_modules/@ember/test-waiters/node_modules/p-limit": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-1.3.0.tgz", "integrity": "sha512-vvcXsLAJ9Dr5rQOPk7toZQZJApBl2K4J6dANSsEuh6QI41JYcsS/qhTGa9ErIUUgK3WNQoJYvylxvjqmiqEA9Q==", - "dev": true, + "devOptional": true, "dependencies": { "p-try": "^1.0.0" }, @@ -4482,7 +4482,7 @@ "version": "2.0.0", "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-2.0.0.tgz", "integrity": "sha512-nQja7m7gSKuewoVRen45CtVfODR3crN3goVQ0DDZ9N3yHxgpkuBhZqsaiotSQRrADUrne346peY7kT3TSACykg==", - "dev": true, + "devOptional": true, "dependencies": { "p-limit": "^1.1.0" }, @@ -4494,7 +4494,7 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/p-try/-/p-try-1.0.0.tgz", "integrity": "sha512-U1etNYuMJoIz3ZXSrrySFjsXQTWOx2/jdi86L+2pRvph/qMKL6sbcCYdH23fqsbm8TH2Gn0OybpT4eSFlCVHww==", - "dev": true, + "devOptional": true, "engines": { "node": ">=4" } @@ -4503,7 +4503,7 @@ "version": "2.0.0", "resolved": "https://registry.npmjs.org/pkg-up/-/pkg-up-2.0.0.tgz", "integrity": "sha512-fjAPuiws93rm7mPUu21RdBnkeZNrbfCFCwfAhPWY+rR3zG0ubpe5cEReHOw5fIbfmsxEV/g2kSxGTATY3Bpnwg==", - "dev": true, + "devOptional": true, "dependencies": { "find-up": "^2.1.0" }, @@ -4515,7 +4515,7 @@ "version": "0.2.3", "resolved": "https://registry.npmjs.org/promise-map-series/-/promise-map-series-0.2.3.tgz", "integrity": "sha512-wx9Chrutvqu1N/NHzTayZjE1BgIwt6SJykQoCOic4IZ9yUDjKyVYrpLa/4YCNsV61eRENfs29hrEquVuB13Zlw==", - "dev": true, + "devOptional": true, "dependencies": { "rsvp": "^3.0.14" } @@ -4524,19 +4524,19 @@ "version": "0.13.11", "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.13.11.tgz", "integrity": "sha512-kY1AZVr2Ra+t+piVaJ4gxaFaReZVH40AKNo7UCX6W+dEwBo/2oZJzqfuN1qLq1oL45o56cPaTXELwrTh8Fpggg==", - "dev": true + "devOptional": true }, "node_modules/@ember/test-waiters/node_modules/reselect": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/reselect/-/reselect-3.0.1.tgz", "integrity": "sha512-b/6tFZCmRhtBMa4xGqiiRp9jh9Aqi2A687Lo265cN0/QohJQEBPiQ52f4QB6i0eF3yp3hmLL21LSGBcML2dlxA==", - "dev": true + "devOptional": true }, "node_modules/@ember/test-waiters/node_modules/resolve-package-path": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/resolve-package-path/-/resolve-package-path-3.1.0.tgz", "integrity": "sha512-2oC2EjWbMJwvSN6Z7DbDfJMnD8MYEouaLn5eIX0j8XwPsYCVIyY9bbnX88YHVkbr8XHqvZrYbxaLPibfTYKZMA==", - "dev": true, + "devOptional": true, "dependencies": { "path-root": "^0.1.1", "resolve": "^1.17.0" @@ -4549,7 +4549,7 @@ "version": "3.6.2", "resolved": "https://registry.npmjs.org/rsvp/-/rsvp-3.6.2.tgz", "integrity": "sha512-OfWGQTb9vnwRjwtA2QwpG2ICclHC3pgXZO5xt8H2EfgDquO0qVdSb5T88L4qJVAEugbS56pAuV4XZM58UX8ulw==", - "dev": true, + "devOptional": true, "engines": { "node": "0.12.* || 4.* || 6.* || >= 7.*" } @@ -4558,7 +4558,7 @@ "version": "7.6.0", "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.0.tgz", "integrity": "sha512-EnwXhrlwXMk9gKu5/flx5sv/an57AkRplG3hTK68W7FRDN+k+OWBj65M7719OkA82XLBxrcX0KSHj+X5COhOVg==", - "dev": true, + "devOptional": true, "dependencies": { "lru-cache": "^6.0.0" }, @@ -4573,7 +4573,7 @@ "version": "0.1.2", "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz", "integrity": "sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==", - "dev": true, + "devOptional": true, "engines": { "node": ">= 4.0.0" } @@ -4582,7 +4582,7 @@ "version": "0.3.4", "resolved": "https://registry.npmjs.org/walk-sync/-/walk-sync-0.3.4.tgz", "integrity": "sha512-ttGcuHA/OBnN2pcM6johpYlEms7XpO5/fyKIr48541xXedan4roO8cS1Q2S/zbbjGH/BarYDAMeS2Mi9HE5Tig==", - "dev": true, + "devOptional": true, "dependencies": { "ensure-posix-path": "^1.0.0", "matcher-collection": "^1.0.0" @@ -4592,7 +4592,7 @@ "version": "1.1.2", "resolved": "https://registry.npmjs.org/matcher-collection/-/matcher-collection-1.1.2.tgz", "integrity": "sha512-YQ/teqaOIIfUHedRam08PB3NK7Mjct6BvzRnJmpGDm8uFXpNr1sbY4yuflI5JcEs6COpYA0FpRQhSDBf1tT95g==", - "dev": true, + "devOptional": true, "dependencies": { "minimatch": "^3.0.2" } @@ -4601,7 +4601,7 @@ "version": "4.0.0", "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", - "dev": true + "devOptional": true }, "node_modules/@embroider/addon-shim": { "version": "1.8.7", @@ -17399,7 +17399,7 @@ "version": "0.5.0", "resolved": "https://registry.npmjs.org/dom-element-descriptors/-/dom-element-descriptors-0.5.0.tgz", "integrity": "sha512-CVzntLid1oFVHTKdTp/Qu7Kz+wSm8uO30TSQyAJ6n4Dz09yTzVQn3S1oRhVhUubxdMuKs1DjDqt88pubHagbPw==", - "dev": true + "devOptional": true }, "node_modules/dom-serializer": { "version": "2.0.0", @@ -21883,6 +21883,25 @@ "minimatch": "^3.0.2" } }, + "node_modules/ember-lifeline": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/ember-lifeline/-/ember-lifeline-7.0.0.tgz", + "integrity": "sha512-2l51NzgH5vjN972zgbs+32rnXnnEFKB7qsSpJF+lBI4V5TG6DMy4SfowC72ZEuAtS58OVfwITbOO+RnM21EdpA==", + "dependencies": { + "@embroider/addon-shim": "^1.6.0" + }, + "engines": { + "node": "16.* || >= 18" + }, + "peerDependencies": { + "@ember/test-helpers": ">= 1.0.0" + }, + "peerDependenciesMeta": { + "@ember/test-helpers": { + "optional": true + } + } + }, "node_modules/ember-load-initializers": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/ember-load-initializers/-/ember-load-initializers-2.1.2.tgz", diff --git a/package.json b/package.json index 552dfe32f..4b73d8769 100644 --- a/package.json +++ b/package.json @@ -53,9 +53,9 @@ "ember-cli-htmlbars": "^6.1.1", "ember-cli-sass": "^11.0.1", "ember-click-outside": "^6.0.1", + "ember-lifeline": "^7.0.0", "ember-popperjs": "^3.0.0", - "ember-truth-helpers": "^4.0.0", - "lodash.debounce": "^4.0.8" + "ember-truth-helpers": "^4.0.0" }, "devDependencies": { "@1024pix/ember-testing-library": "^1.0.0", diff --git a/tests/integration/components/pix-search-input-test.js b/tests/integration/components/pix-search-input-test.js index 3f3a67238..8fdb29aa7 100644 --- a/tests/integration/components/pix-search-input-test.js +++ b/tests/integration/components/pix-search-input-test.js @@ -42,4 +42,26 @@ module('Integration | Component | search-input', function (hooks) { // then assert.ok(triggerFiltering.calledWith(123, 'Mangue')); }); + + test("doesn't update value when input value is udpated", async function (assert) { + // given + this.set('triggerFiltering', sinon.stub()); + this.set('dynamicValue', 'init'); + const screen = await render(hbs``); + + // when + await fillByLabel('Champ de recherche de fruits', 'Mangue'); + this.set('dynamicValue', 'dynamicValue'); + + // then + const inputFound = screen.getByLabelText('Champ de recherche de fruits'); + assert.dom(inputFound).exists(); + assert.strictEqual(inputFound.value, 'Mangue'); + }); }); diff --git a/tests/unit/components/pix-search-input-test.js b/tests/unit/components/pix-search-input-test.js index f3155bd1f..609a3c462 100644 --- a/tests/unit/components/pix-search-input-test.js +++ b/tests/unit/components/pix-search-input-test.js @@ -3,7 +3,7 @@ import { setupTest } from 'ember-qunit'; import createGlimmerComponent from '../../helpers/create-glimmer-component'; import sinon from 'sinon'; -module('Unit | Component | pix-search-select', function (hooks) { +module('Unit | Component | pix-search-input', function (hooks) { setupTest(hooks); module('when there are errors in params', function () {