diff --git a/.env.development b/.env.development new file mode 100644 index 00000000..0e653624 --- /dev/null +++ b/.env.development @@ -0,0 +1,9 @@ +# This file is committed to git and should not contain any secrets. +# +# Vite recommends using .env.local or .env.[mode].local if you need to manage secrets +# SEE: https://vite.dev/guide/env-and-mode.html#env-files for more information. + + +# Default NODE_ENV with vite build --mode=test is production +NODE_ENV=development +# VITE_SHADOW_DOM_BUILD=true # Activate this option to run the demo app and all tests within the Shadow DOM. diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index bcb5236e..1961de91 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -13,7 +13,7 @@ concurrency: jobs: lint: - name: Lint + name: "Lints" runs-on: ubuntu-latest timeout-minutes: 10 @@ -22,125 +22,78 @@ jobs: - uses: pnpm/action-setup@v4 - uses: actions/setup-node@v4 with: - node-version: 20.x + node-version: 22 cache: pnpm - - - name: 'Install dependencies' + - name: Install Dependencies run: pnpm install --frozen-lockfile - - run: pnpm build - - run: pnpm i -f # re-sync injected deps - - name: Lint - run: pnpm --filter ember-basic-dropdown --filter test-app lint + run: pnpm lint test: name: "Tests" runs-on: ubuntu-latest - needs: lint + timeout-minutes: 10 + outputs: + matrix: ${{ steps.set-matrix.outputs.matrix }} steps: - uses: actions/checkout@v4 - uses: pnpm/action-setup@v4 - - - name: Install Node - uses: actions/setup-node@v4 + - uses: actions/setup-node@v4 with: - node-version: 20.x + node-version: 22 cache: pnpm - - name: Install Dependencies run: pnpm install --frozen-lockfile - - - run: pnpm build - - run: pnpm i -f # re-sync injected deps - - name: Run Tests - run: pnpm --filter test-app test:ember - - test-shadow-dom: - name: "Tests Shadow dom" - runs-on: ubuntu-latest - needs: lint - - steps: - - uses: actions/checkout@v4 - - uses: pnpm/action-setup@v4 - - - name: Install Node - uses: actions/setup-node@v4 - with: - node-version: 20.x - cache: 'pnpm' - - - name: Install Dependencies - run: pnpm install --frozen-lockfile - - - run: pnpm build - - run: pnpm i -f # re-sync injected deps - - - name: Run Tests - run: pnpm --filter test-app test:ember-shadow-dom + run: pnpm test + # For the Try Scenarios + - id: set-matrix + run: | + echo "matrix=$(pnpm -s dlx @embroider/try list)" >> $GITHUB_OUTPUT + floating: name: "Floating Dependencies" runs-on: ubuntu-latest - needs: lint + timeout-minutes: 10 steps: - uses: actions/checkout@v4 - uses: pnpm/action-setup@v4 - uses: actions/setup-node@v4 with: - node-version: 20.x + node-version: 22 cache: pnpm - - name: Install Dependencies - run: pnpm install --frozen-lockfile - - - run: pnpm build - - run: pnpm i -f # re-sync injected deps - + run: pnpm install --no-lockfile - name: Run Tests - run: pnpm --filter test-app test:ember + run: pnpm test try-scenarios: - name: ${{ matrix.try-scenario }} + name: ${{ matrix.name }} runs-on: ubuntu-latest - continue-on-error: true - needs: test - + needs: "test" + timeout-minutes: 10 strategy: fail-fast: false - matrix: - try-scenario: - - ember-lts-4.12 - - ember-lts-5.4 - - ember-lts-5.8 - - ember-lts-5.12 - - ember-lts-6.4 - - ember-lts-6.8 - - ember-release - - ember-beta - - ember-canary - - embroider-safe - - embroider-optimized + matrix: ${{fromJson(needs.test.outputs.matrix)}} steps: - uses: actions/checkout@v4 - uses: pnpm/action-setup@v4 - - - name: Install Node - uses: actions/setup-node@v4 + - uses: actions/setup-node@v4 with: - node-version: 20.x + node-version: 22 cache: pnpm - + - name: Apply Scenario + run: | + pnpm dlx @embroider/try apply ${{ matrix.name }} + - name: Install Dependencies - run: pnpm install --frozen-lockfile - - run: pnpm build - - run: pnpm i -f # re-sync injected deps - + run: pnpm install --no-lockfile - name: Run Tests - env: - EMBER_TRY_SCENARIO: ${{ matrix.try-scenario }} - run: pnpm --filter test-app test:ember-try $EMBER_TRY_SCENARIO --skip-cleanup + run: | + pnpm test + + env: ${{ matrix.env }} diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 1d9ea4fa..b8648eff 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -15,23 +15,21 @@ permissions: jobs: lint: - name: Lint + name: "Lints" runs-on: ubuntu-latest + timeout-minutes: 10 + steps: - uses: actions/checkout@v4 - uses: pnpm/action-setup@v4 - - uses: actions/setup-node@v4 with: - node-version: 20.x - cache: 'pnpm' - - - name: 'Install dependencies' + node-version: 22 + cache: pnpm + - name: Install Dependencies run: pnpm install --frozen-lockfile - - - run: pnpm build - - run: pnpm i -f # re-sync injected deps - + - name: Run Addon Build + run: pnpm build - name: Lint run: pnpm --filter docs lint @@ -43,19 +41,14 @@ jobs: steps: - uses: actions/checkout@v4 - uses: pnpm/action-setup@v4 - - - name: Install Node - uses: actions/setup-node@v4 + - uses: actions/setup-node@v4 with: - node-version: 20.x + node-version: 22 cache: pnpm - - name: Install Dependencies run: pnpm install --frozen-lockfile - - - run: pnpm build - - run: pnpm i -f # re-sync injected deps - + - name: Run Addon Build + run: pnpm build - name: Run Tests run: pnpm --filter docs test:ember @@ -68,30 +61,22 @@ jobs: steps: - uses: actions/checkout@v4 - uses: pnpm/action-setup@v4 - - - name: Install Node - uses: actions/setup-node@v4 + - uses: actions/setup-node@v4 with: - node-version: 20.x + node-version: 22 cache: pnpm - - name: Install Dependencies run: pnpm install --frozen-lockfile - - - run: pnpm build - - run: pnpm i -f # re-sync injected deps - + - name: Run Addon Build + run: pnpm build - name: Run Tests run: pnpm --filter docs build - - name: Copy 404 page run: cp ./docs/404.html ./docs/dist/404.html - - name: Setup Pages uses: actions/configure-pages@v5 - - name: Upload artifact - uses: actions/upload-pages-artifact@v3 + uses: actions/upload-pages-artifact@v4 with: path: './docs/dist' diff --git a/.github/workflows/push-dist.yml b/.github/workflows/push-dist.yml index ba6762f2..bdfa5b5d 100644 --- a/.github/workflows/push-dist.yml +++ b/.github/workflows/push-dist.yml @@ -1,4 +1,4 @@ -ο»Ώ# Because this library needs to be built, +# Because this library needs to be built, # we can't easily point package.json files at the git repo for easy cross-repo testing. # # This workflow brings back that capability by placing the compiled assets on a "dist" branch @@ -22,15 +22,13 @@ jobs: steps: - uses: actions/checkout@v4 - uses: pnpm/action-setup@v4 - - uses: actions/setup-node@v4 with: - node-version: 20 - cache: 'pnpm' + node-version: 22 + cache: pnpm - name: Install Dependencies run: pnpm install --frozen-lockfile - uses: kategengler/put-built-npm-package-contents-on-branch@v2.0.0 with: branch: dist token: ${{ secrets.GITHUB_TOKEN }} - working-directory: 'ember-basic-dropdown' diff --git a/.gitignore b/.gitignore index dbe5764f..47d8ce02 100644 --- a/.gitignore +++ b/.gitignore @@ -1,21 +1,18 @@ -# See https://help.github.com/ignore-files/ for more about ignoring files. +# compiled output +dist/ +dist-tests/ +declarations/ +src/vendor/ -# dependencies -node_modules/ +# from scenarios +tmp/ +config/optional-features.json +ember-cli-build.cjs -# misc -.env* -.pnp* -.pnpm-debug.log -.sass-cache -.eslintcache -coverage/ -npm-debug.log* -yarn-error.log +# npm/pnpm/yarn pack output +*.tgz -# ember-try -/.node_modules.ember-try/ -/package.json.ember-try -/package-lock.json.ember-try -/yarn.lock.ember-try -/pnpm-lock.ember-try.yaml +# deps & caches +node_modules/ +.eslintcache +.prettiercache diff --git a/.npmrc b/.npmrc deleted file mode 100644 index bc74982c..00000000 --- a/.npmrc +++ /dev/null @@ -1,9 +0,0 @@ -# Docs: https://pnpm.io/npmrc -# https://github.com/emberjs/rfcs/pull/907 - -# we don't want addons to be bad citizens of the ecosystem -auto-install-peers=false - -# we want true isolation, -# if a dependency is not declared, we want an error -resolve-peers-from-workspace-root=false diff --git a/.prettierignore b/.prettierignore new file mode 100644 index 00000000..279a1ac0 --- /dev/null +++ b/.prettierignore @@ -0,0 +1,18 @@ +# unconventional js +/blueprints/*/files/ + +# compiled output +/dist/ +/dist-*/ +/declarations/ +/src/vendor/ + +# misc +/coverage/ +pnpm-lock.yaml +config/ember-cli-update.json +*.yaml +*.yml +*.md +*.html +CHANGELOG.md diff --git a/.prettierrc.cjs b/.prettierrc.cjs deleted file mode 100644 index d6a52956..00000000 --- a/.prettierrc.cjs +++ /dev/null @@ -1,6 +0,0 @@ -'use strict'; - -module.exports = { - plugins: ['prettier-plugin-ember-template-tag'], - singleQuote: true, -}; diff --git a/ember-basic-dropdown/.prettierrc.cjs b/.prettierrc.mjs similarity index 86% rename from ember-basic-dropdown/.prettierrc.cjs rename to .prettierrc.mjs index 8e62a451..9cc6b3db 100644 --- a/ember-basic-dropdown/.prettierrc.cjs +++ b/.prettierrc.mjs @@ -1,6 +1,4 @@ -'use strict'; - -module.exports = { +export default { plugins: ['prettier-plugin-ember-template-tag'], overrides: [ { diff --git a/.template-lintrc.mjs b/.template-lintrc.mjs new file mode 100644 index 00000000..8b6625cd --- /dev/null +++ b/.template-lintrc.mjs @@ -0,0 +1,4 @@ +export default { + extends: 'recommended', + checkHbsTemplateLiterals: false, +}; diff --git a/.try.mjs b/.try.mjs new file mode 100644 index 00000000..939a6fc8 --- /dev/null +++ b/.try.mjs @@ -0,0 +1,132 @@ +// When building your addon for older Ember versions you need to have the required files +const compatFiles = { + 'ember-cli-build.cjs': `const EmberApp = require('ember-cli/lib/broccoli/ember-app'); +const { compatBuild } = require('@embroider/compat'); +module.exports = async function (defaults) { + const { buildOnce } = await import('@embroider/vite'); + let app = new EmberApp(defaults); + return compatBuild(app, buildOnce); +};`, + 'config/optional-features.json': JSON.stringify({ + 'application-template-wrapper': false, + 'default-async-observers': true, + 'jquery-integration': false, + 'template-only-glimmer-components': true, + 'no-implicit-route-model': true, + }), +}; + +const compatDeps = { + '@embroider/compat': '^4.0.3', + 'ember-cli': '^5.12.0', + 'ember-auto-import': '^2.10.0', + '@ember/optional-features': '^2.2.0', +}; + +export default { + scenarios: [ + { + name: 'ember-lts-4.12', + npm: { + devDependencies: { + 'ember-source': '~4.12.0', + ...compatDeps, + }, + }, + env: { + ENABLE_COMPAT_BUILD: true, + }, + files: compatFiles, + }, + { + name: 'ember-lts-5.4', + npm: { + devDependencies: { + 'ember-source': '~5.4.0', + ...compatDeps, + }, + }, + env: { + ENABLE_COMPAT_BUILD: true, + }, + files: compatFiles, + }, + { + name: 'ember-lts-5.8', + npm: { + devDependencies: { + 'ember-source': '~5.8.0', + ...compatDeps, + }, + }, + env: { + ENABLE_COMPAT_BUILD: true, + }, + files: compatFiles, + }, + { + name: 'ember-lts-5.12', + npm: { + devDependencies: { + 'ember-source': '~5.12.0', + ...compatDeps, + }, + }, + env: { + ENABLE_COMPAT_BUILD: true, + }, + files: compatFiles, + }, + { + name: 'ember-lts-6.4', + npm: { + devDependencies: { + 'ember-source': 'npm:ember-source@~6.4.0', + }, + }, + }, + { + name: 'ember-lts-6.8', + npm: { + devDependencies: { + 'ember-source': 'npm:ember-source@~6.8.0', + }, + }, + }, + { + name: 'ember-lts-6.8-shadow-dom', + npm: { + devDependencies: { + 'ember-source': 'npm:ember-source@~6.8.0', + }, + }, + env: { + VITE_SHADOW_DOM_BUILD: true, + }, + }, + { + name: 'ember-latest', + npm: { + devDependencies: { + 'ember-source': 'npm:ember-source@latest', + }, + }, + }, + { + name: 'ember-beta', + npm: { + devDependencies: { + 'ember-source': 'npm:ember-source@beta', + }, + }, + }, + { + name: 'ember-alpha', + npm: { + devDependencies: { + 'ember-source': 'npm:ember-source@alpha', + }, + }, + }, + ], +}; diff --git a/.vscode/settings.json b/.vscode/settings.json deleted file mode 100644 index 6f866365..00000000 --- a/.vscode/settings.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "eslint.probe": [ - "javascript", - "typescript", - "html", - "markdown", - "glimmer-js", - "glimmer-ts" - ], - "eslint.validate": [ - "javascript", - "glimmer-ts", - "glimmer-js" - ] -} \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md deleted file mode 120000 index 2ad82771..00000000 --- a/CHANGELOG.md +++ /dev/null @@ -1 +0,0 @@ -ember-basic-dropdown/CHANGELOG.md \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 00000000..c797e11c --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,1045 @@ + + + + + + + + + + + + + + + + +## v8.11.0 (2025-12-14) + +#### :rocket: Enhancement +* [#1038](https://github.com/cibernox/ember-basic-dropdown/pull/1038) Add `@contentHtmlTag` ([@mkszepp](https://github.com/mkszepp)) + +#### Committers: 1 +- Markus Sanin ([@mkszepp](https://github.com/mkszepp)) + +## v8.10.0 (2025-12-13) + +#### :rocket: Enhancement +* [#1033](https://github.com/cibernox/ember-basic-dropdown/pull/1033) Add `@triggerHtmlTag` and add workaround to resolve a typing issue when `@htmlTag="button"` is passed ([@mkszepp](https://github.com/mkszepp)) + +#### Committers: 1 +- Markus Sanin ([@mkszepp](https://github.com/mkszepp)) + +## v8.9.0 (2025-12-07) + +#### :rocket: Enhancement +* [#1020](https://github.com/cibernox/ember-basic-dropdown/pull/1020) Add `setConfig` and deprecate passing config via `environment.js` ([@mkszepp](https://github.com/mkszepp)) + +#### :memo: Documentation +* [#1021](https://github.com/cibernox/ember-basic-dropdown/pull/1021) Update installation docs and minor fixes in readme ([@mkszepp](https://github.com/mkszepp)) +* [#1019](https://github.com/cibernox/ember-basic-dropdown/pull/1019) Move docs to vite ([@mkszepp](https://github.com/mkszepp)) +* [#1018](https://github.com/cibernox/ember-basic-dropdown/pull/1018) Docs: Remove fastboot, ember-try & prember ([@mkszepp](https://github.com/mkszepp)) + +#### :house: Internal +* [#1022](https://github.com/cibernox/ember-basic-dropdown/pull/1022) Update to @embroider/addon-dev v8 ([@mkszepp](https://github.com/mkszepp)) + +#### Committers: 1 +- Markus Sanin ([@mkszepp](https://github.com/mkszepp)) + +## v8.8.0 (2025-10-12) + +#### :rocket: Enhancement +* [#1015](https://github.com/cibernox/ember-basic-dropdown/pull/1015) Support gts/gjs in blueprint ([@mkszepp](https://github.com/mkszepp)) +* [#1012](https://github.com/cibernox/ember-basic-dropdown/pull/1012) Add deprecation for `@dropdownId` (undocumented & not handled correctly) ([@mkszepp](https://github.com/mkszepp)) +* [#1005](https://github.com/cibernox/ember-basic-dropdown/pull/1005) Convert addon to gts ([@mkszepp](https://github.com/mkszepp)) + +#### :memo: Documentation +* [#1009](https://github.com/cibernox/ember-basic-dropdown/pull/1009) Convert docs to GTS ([@mkszepp](https://github.com/mkszepp)) +* [#1008](https://github.com/cibernox/ember-basic-dropdown/pull/1008) Remove broken v1 docs link ([@mkszepp](https://github.com/mkszepp)) +* [#1007](https://github.com/cibernox/ember-basic-dropdown/pull/1007) Update ember-concurrency tasks in docs ([@mkszepp](https://github.com/mkszepp)) + +#### :house: Internal +* [#1011](https://github.com/cibernox/ember-basic-dropdown/pull/1011) Activate test-app lint in CI ([@mkszepp](https://github.com/mkszepp)) +* [#1010](https://github.com/cibernox/ember-basic-dropdown/pull/1010) Convert test-app to TS ([@mkszepp](https://github.com/mkszepp)) + +#### Committers: 1 +- Markus Sanin ([@mkszepp](https://github.com/mkszepp)) + +## v8.7.0 (2025-09-16) + +#### :rocket: Enhancement +* [#1003](https://github.com/cibernox/ember-basic-dropdown/pull/1003) Allow `ember-truth-helpers` v5 as dependency ([@mkszepp](https://github.com/mkszepp)) +* [#1002](https://github.com/cibernox/ember-basic-dropdown/pull/1002) Remove use of `ember-lifeline` ([@bertdeblock](https://github.com/bertdeblock)) + +#### Committers: 2 +- Bert De Block ([@bertdeblock](https://github.com/bertdeblock)) +- Markus Sanin ([@mkszepp](https://github.com/mkszepp)) + +## v8.6.2 (2025-06-04) + +#### :bug: Bug Fix +* [#973](https://github.com/cibernox/ember-basic-dropdown/pull/973) Fix removing event listener for shadow root element ([@mkszepp](https://github.com/mkszepp)) + +#### Committers: 1 +- Markus Sanin ([@mkszepp](https://github.com/mkszepp)) + +## v8.6.1 (2025-05-13) + +#### :bug: Bug Fix +* [#948](https://github.com/cibernox/ember-basic-dropdown/pull/948) Remove ember-source and glimmer tracking as a peer dependency ([@runspired](https://github.com/runspired)) + +#### Committers: 2 +- Chris Thoburn ([@runspired](https://github.com/runspired)) +- Markus Sanin ([@mkszepp](https://github.com/mkszepp)) + +## v8.6.0 (2025-02-22) + +#### :rocket: Enhancement +* [#947](https://github.com/cibernox/ember-basic-dropdown/pull/947) Improve typing and reactivate eslint rules in addon ([@mkszepp](https://github.com/mkszepp)) +* [#946](https://github.com/cibernox/ember-basic-dropdown/pull/946) Test: Prefer `config.destination` and default `ember-basic-dropdown-wormhole` ([@dagroe](https://github.com/dagroe)) +* [#945](https://github.com/cibernox/ember-basic-dropdown/pull/945) Export interfaces `BasicDropdownSignature`, `BasicDropdownArgs` and `BasicDropdownDefaultBlock` ([@dagroe](https://github.com/dagroe)) + +#### :house: Internal +* [#947](https://github.com/cibernox/ember-basic-dropdown/pull/947) Improve typing and reactivate eslint rules in addon ([@mkszepp](https://github.com/mkszepp)) + +#### Committers: 2 +- Daniel GrΓΆger ([@dagroe](https://github.com/dagroe)) +- Markus Sanin ([@mkszepp](https://github.com/mkszepp)) + +## v8.5.0 (2025-01-27) + +#### :rocket: Enhancement +* [#944](https://github.com/cibernox/ember-basic-dropdown/pull/944) Allow `@ember/test-helpers` v5.x and update ember-cli to 6.1 ([@mkszepp](https://github.com/mkszepp)) + +#### :house: Internal +* [#944](https://github.com/cibernox/ember-basic-dropdown/pull/944) Allow `@ember/test-helpers` v5.x and update ember-cli to 6.1 ([@mkszepp](https://github.com/mkszepp)) + +#### Committers: 1 +- Markus Sanin ([@mkszepp](https://github.com/mkszepp)) + +## v8.4.0 (2024-11-12) + +#### :rocket: Enhancement +* [#941](https://github.com/cibernox/ember-basic-dropdown/pull/941) Allow `@glimmer/component` v2 ([@mkszepp](https://github.com/mkszepp)) + +#### :memo: Documentation +* [#940](https://github.com/cibernox/ember-basic-dropdown/pull/940) Remove `ember-prism`, use `primsjs` in docs ([@mkszepp](https://github.com/mkszepp)) + +#### :house: Internal +* [#938](https://github.com/cibernox/ember-basic-dropdown/pull/938) Replace scss to css compiler while rollup ([@mkszepp](https://github.com/mkszepp)) + +#### Committers: 1 +- Markus Sanin ([@mkszepp](https://github.com/mkszepp)) + +## v8.3.0 (2024-08-27) + +#### :rocket: Enhancement +* [#935](https://github.com/cibernox/ember-basic-dropdown/pull/935) Allow `@ember/test-helpers` v4 ([@mkszepp](https://github.com/mkszepp)) + +#### :bug: Bug Fix +* [#937](https://github.com/cibernox/ember-basic-dropdown/pull/937) Remove test-specific behaviour for BasicDropdownWormhole ([@rohitpaulk](https://github.com/rohitpaulk)) + +#### Committers: 2 +- Markus Sanin ([@mkszepp](https://github.com/mkszepp)) +- Paul Kuruvilla ([@rohitpaulk](https://github.com/rohitpaulk)) + +## v8.2.1 (2024-08-22) + +#### :bug: Bug Fix +* [#934](https://github.com/cibernox/ember-basic-dropdown/pull/934) Export interface `CalculatePositionOptions` ([@mkszepp](https://github.com/mkszepp)) + +#### Committers: 1 +- Markus Sanin ([@mkszepp](https://github.com/mkszepp)) + +## v8.2.0 (2024-07-31) + +#### :rocket: Enhancement +* [#910](https://github.com/cibernox/ember-basic-dropdown/pull/910) Improve `rootEventType` type and export for EPS ([@mkszepp](https://github.com/mkszepp)) + +#### :bug: Bug Fix +* [#930](https://github.com/cibernox/ember-basic-dropdown/pull/930) silence chrome warning for non-passive 'touchstart' event. ([@xomaczar](https://github.com/xomaczar)) +* [#927](https://github.com/cibernox/ember-basic-dropdown/pull/927) Fix dropdown not correctly positioned horizontally when body position is relative ([@ArnaudWeyts](https://github.com/ArnaudWeyts)) + +#### :memo: Documentation +* [#903](https://github.com/cibernox/ember-basic-dropdown/pull/903) Document @rootEventType ([@ArnaudWeyts](https://github.com/ArnaudWeyts)) + +#### :house: Internal +* [#929](https://github.com/cibernox/ember-basic-dropdown/pull/929) Add push dist workflow ([@mkszepp](https://github.com/mkszepp)) +* [#892](https://github.com/cibernox/ember-basic-dropdown/pull/892) Add missing addon blueprint config, fix vscode settings & package lint ([@mkszepp](https://github.com/mkszepp)) + +#### Committers: 3 +- Andrey Khomenko ([@xomaczar](https://github.com/xomaczar)) +- Arnaud Weyts ([@ArnaudWeyts](https://github.com/ArnaudWeyts)) +- Markus Sanin ([@mkszepp](https://github.com/mkszepp)) + +## v8.1.0 (2024-05-06) + +#### :rocket: Enhancement +* [#891](https://github.com/cibernox/ember-basic-dropdown/pull/891) Replace `@ember/runloop` with `ember-lifeline` ([@mkszepp](https://github.com/mkszepp)) + +#### :memo: Documentation +* [#888](https://github.com/cibernox/ember-basic-dropdown/pull/888) Remove last ember-array using in docs ([@mkszepp](https://github.com/mkszepp)) + +#### Committers: 1 +- Markus Sanin ([@mkszepp](https://github.com/mkszepp)) + +## v8.0.4 (2024-03-18) + +#### :bug: Bug Fix +* [#836](https://github.com/cibernox/ember-basic-dropdown/pull/836) Test Support Helpers: Make scope optional ([@andreyfel](https://github.com/andreyfel)) + +#### :house: Internal +* [#837](https://github.com/cibernox/ember-basic-dropdown/pull/837) Remove NodeJs info (not necessary for v2 addon) ([@mkszepp](https://github.com/mkszepp)) + +#### Committers: 2 +- Andrey Fel ([@andreyfel](https://github.com/andreyfel)) +- [@mkszepp](https://github.com/mkszepp) + +## v8.0.3 (2024-03-13) + +#### :bug: Bug Fix +* [#835](https://github.com/cibernox/ember-basic-dropdown/pull/835) Fix fastboot `ReferenceError: document is not defined` ([@mkszepp](https://github.com/mkszepp)) + +#### Committers: 1 +- [@mkszepp](https://github.com/mkszepp) + +## v8.0.2 (2024-03-13) + +#### :bug: Bug Fix +* [#834](https://github.com/cibernox/ember-basic-dropdown/pull/834) Fix fastboot `ReferenceError: document is not defined` ([@mkszepp](https://github.com/mkszepp)) + +#### Committers: 1 +- [@mkszepp](https://github.com/mkszepp) + +## v8.0.1 (2024-03-12) + +#### :bug: Bug Fix +* [#832](https://github.com/cibernox/ember-basic-dropdown/pull/832) Fix rollup config (style.js -> styles.js) ([@mkszepp](https://github.com/mkszepp)) + +#### Committers: 1 +- [@mkszepp](https://github.com/mkszepp) + +## v8.0.0 (2024-03-12) + +For upgrade from v7 to v8 see [here](https://ember-basic-dropdown.com/docs/migrate-7-0-to-8-0) + +#### :memo: Documentation +* [#819](https://github.com/cibernox/ember-basic-dropdown/pull/819) DOCS: Add `destinationElement` to api-reference ([@mkszepp](https://github.com/mkszepp)) + +#### Committers: 1 +- [@mkszepp](https://github.com/mkszepp) + +## v8.0.0-beta.8 (2024-03-05) + +#### :rocket: Enhancement +* [#791](https://github.com/cibernox/ember-basic-dropdown/pull/791) Add shadow DOM support ([@mkszepp](https://github.com/mkszepp)) + +#### :memo: Documentation +* [#814](https://github.com/cibernox/ember-basic-dropdown/pull/814) Fix snippets in docs ([@mkszepp](https://github.com/mkszepp)) + +#### :house: Internal +* [#813](https://github.com/cibernox/ember-basic-dropdown/pull/813) Remove ember-data (unused package) ([@mkszepp](https://github.com/mkszepp)) + +#### Committers: 1 +- [@mkszepp](https://github.com/mkszepp) + +## v8.0.0-beta.7 (2024-02-12) + +#### :bug: Bug Fix +* [#787](https://github.com/cibernox/ember-basic-dropdown/pull/787) Readd test-support in publicEntrypoints ([@mkszepp](https://github.com/mkszepp)) + +#### Committers: 1 +- [@mkszepp](https://github.com/mkszepp) + +## v8.0.0-beta.6 (2024-02-12) + +#### :rocket: Enhancement +* [#777](https://github.com/cibernox/ember-basic-dropdown/pull/777) Allow override `aria-owns` & `aria-controls` ([@mkszepp](https://github.com/mkszepp)) +* [#774](https://github.com/cibernox/ember-basic-dropdown/pull/774) Add `template-registry` and activate glint in `test-app` / `docs` ([@mkszepp](https://github.com/mkszepp)) +* [#753](https://github.com/cibernox/ember-basic-dropdown/pull/753) Introduce Horizontal and Vertical position union types ([@gwak](https://github.com/gwak)) + +#### :house: Internal +* [#776](https://github.com/cibernox/ember-basic-dropdown/pull/776) Stricter dep management ([@mkszepp](https://github.com/mkszepp)) +* [#775](https://github.com/cibernox/ember-basic-dropdown/pull/775) Update `babel.config.json` to latest blueprint ([@mkszepp](https://github.com/mkszepp)) + +#### Committers: 2 +- [@gwak](https://github.com/gwak) +- [@mkszepp](https://github.com/mkszepp) + +## v8.0.0-beta.5 (2024-01-18) + +#### :rocket: Enhancement +* [#739](https://github.com/cibernox/ember-basic-dropdown/pull/739) Allow passing attributes in wormhole component & add tests for wormhole ([@mkszepp](https://github.com/mkszepp)) +* [#736](https://github.com/cibernox/ember-basic-dropdown/pull/736) Types: Separate Args and Signature ([@mkszepp](https://github.com/mkszepp)) +* [#735](https://github.com/cibernox/ember-basic-dropdown/pull/735) Add option to use `ember-basic-dropdown.scss` ([@mkszepp](https://github.com/mkszepp)) + +#### :bug: Bug Fix +* [#738](https://github.com/cibernox/ember-basic-dropdown/pull/738) Update appReexports ([@mkszepp](https://github.com/mkszepp)) + +#### :memo: Documentation +* [#737](https://github.com/cibernox/ember-basic-dropdown/pull/737) DOCS: Fix typos ([@mkszepp](https://github.com/mkszepp)) +* [#734](https://github.com/cibernox/ember-basic-dropdown/pull/734) docs: Fix that code snippets were rendered as [object Object] ([@johanrd](https://github.com/johanrd)) + +#### :house: Internal +* [#743](https://github.com/cibernox/ember-basic-dropdown/pull/743) Remove ember-get-config ([@mkszepp](https://github.com/mkszepp)) + +#### Committers: 2 +- [@johanrd](https://github.com/johanrd) +- [@mkszepp](https://github.com/mkszepp) + +## v8.0.0-beta.4 (2024-01-04) + +#### :bug: Bug Fix +* [#733](https://github.com/cibernox/ember-basic-dropdown/pull/733) Fix less import & improve docs for less / css ([@mkszepp](https://github.com/mkszepp)) + +#### :memo: Documentation +* [#733](https://github.com/cibernox/ember-basic-dropdown/pull/733) Fix less import & improve docs for less / css ([@mkszepp](https://github.com/mkszepp)) + +#### Committers: 1 +- [@mkszepp](https://github.com/mkszepp) + +## v8.0.0-beta.3 (2024-01-02) + +## v8.0.0-beta.2 (2024-01-02) + +#### :bug: Bug Fix +* [#732](https://github.com/cibernox/ember-basic-dropdown/pull/732) Fix blueprint ([@mkszepp](https://github.com/mkszepp)) +* [#731](https://github.com/cibernox/ember-basic-dropdown/pull/731) docs: Bring back missing assets in docs after conversion to v2 addon ([@johanrd](https://github.com/johanrd)) + +#### Committers: 2 +- [@johanrd](https://github.com/johanrd) +- [@mkszepp](https://github.com/mkszepp) + +## v8.0.0-beta.1 (2024-01-02) + +#### :bug: Bug Fix +* [#730](https://github.com/cibernox/ember-basic-dropdown/pull/730) Fix blueprint export ([@mkszepp](https://github.com/mkszepp)) + +#### :house: Internal +* [#729](https://github.com/cibernox/ember-basic-dropdown/pull/729) Fix doc ([@mkszepp](https://github.com/mkszepp)) + +#### Committers: 1 +- [@mkszepp](https://github.com/mkszepp) + +## v8.0.0-beta.0 (2024-01-02) + +#### :boom: Breaking Change +* [#728](https://github.com/cibernox/ember-basic-dropdown/pull/728) Switch to v2 addon ([@mkszepp](https://github.com/mkszepp)) +* [#727](https://github.com/cibernox/ember-basic-dropdown/pull/727) Drop NodeJs v16 ([@mkszepp](https://github.com/mkszepp)) +* [#726](https://github.com/cibernox/ember-basic-dropdown/pull/726) Allow only latest version in dependencies ([@mkszepp](https://github.com/mkszepp)) +* [#725](https://github.com/cibernox/ember-basic-dropdown/pull/725) Update ember-cli to v5.4.0 (update ember-cli-babel to v8) ([@mkszepp](https://github.com/mkszepp)) + +#### :house: Internal +* [#725](https://github.com/cibernox/ember-basic-dropdown/pull/725) Update ember-cli to v5.4.0 (update ember-cli-babel to v8) ([@mkszepp](https://github.com/mkszepp)) +* [#724](https://github.com/cibernox/ember-basic-dropdown/pull/724) Drop `@types/ember-qunit` & `@types/ember__test-helpers` ([@mkszepp](https://github.com/mkszepp)) +* [#723](https://github.com/cibernox/ember-basic-dropdown/pull/723) Fix embroider-optimized ci build ([@mkszepp](https://github.com/mkszepp)) +* [#722](https://github.com/cibernox/ember-basic-dropdown/pull/722) Update devDependencies ([@mkszepp](https://github.com/mkszepp)) + +#### Committers: 1 +- [@mkszepp](https://github.com/mkszepp) + +## v7.3.0 (2023-11-16) + +#### :rocket: Enhancement +* [#714](https://github.com/cibernox/ember-basic-dropdown/pull/714) Drop `@ember/render-modifiers` ([@gilest](https://github.com/gilest)) + +#### :bug: Bug Fix +* [#721](https://github.com/cibernox/ember-basic-dropdown/pull/721) Fix peerDependency of ember-source in package.json ([@mkszepp](https://github.com/mkszepp)) + +#### :house: Internal +* [#720](https://github.com/cibernox/ember-basic-dropdown/pull/720) Add release-it ([@mkszepp](https://github.com/mkszepp)) +* [#718](https://github.com/cibernox/ember-basic-dropdown/pull/718) Remove `ember-cli-htmlbars` workaround in ember-try ([@mkszepp](https://github.com/mkszepp)) +* [#717](https://github.com/cibernox/ember-basic-dropdown/pull/717) Remove `ember-cli-memory-leak-detector` ([@mkszepp](https://github.com/mkszepp)) +* [#716](https://github.com/cibernox/ember-basic-dropdown/pull/716) Upgrade ember cli to 4.12.2 ([@mkszepp](https://github.com/mkszepp)) + +#### Committers: 2 +- Giles Thompson ([@gilest](https://github.com/gilest)) +- [@mkszepp](https://github.com/mkszepp) + +## 7.2.2 +- Update ember-element-helper + +## 7.2.0 +- Publish types to npm +- Fix reposition reset issue reported in #707 +- Make addon compatible with Ember 5 + +## 7.1.0 +- Many dependency updates and cleanups (ember-concurrency 3.0, ember 4.12, drop node 14...) #705 + +## 7.0.2 +- Improve typescript expertience for users using `exactOptionalPropertyTypes` and `noImplicitOverride` + +## 7.0.1 +- Receive `@animationEnabled` in the content component. + +## 7.0.0 +- Update ember-maybe-in-element for version that plays nicely with parallel compilation. +- [BREAKING] Update many dependencies, including qunit and ember-auto-import v2. Now the minimum version is 3.28+ + +## 6.0.2 +- Relax dependency on ember-style-modifier so version 1.0 is also allowed + +## 6.0.1 +- Allow ember-get-config v2 + +## 6.0.0 +- [MAYBE-BREAKING] The trigger component is now implemented internally as an element modifier. This should not be breaking, but a refactor this big is + always risky. This makes much easier to make any component the trigger of a dropdown, just applying that modifier to any element. +- Because of the element modifier change, not the minimum version of Ember supported is 3.24 + +## 5.0.0 +- [BREAKING] Co-locate component templates. This is breaking for anyone overriding the component's templates with their own, as the location of the template has changed. +- Typescript fix for configuration. + +## 4.0.4 +- [FEATURE] Improve compatibility with Embroider/Ember 4 + +## 4.0.3 +- Fix animation when component is not rendered in place. + +## 4.0.2 +- Update dependency in @ember/render-modifiers to 2.0.2 with fixes a bug with unnecessary recomputations. + +## 4.0.1 +- (#628) Fix issue, The `@animationClass` class don't get reset after the first render. + When the dropdown content first renders, it animates correctly, but on subsequent renders there is no animation - + cause `@animationClass` not being reset back to transitioning--in state. + +## 4.0.0 +- (#633) A11y improvements, changing aria-controls instead of aria-owns, which seems to be more correct. +- [BREAKING] Stop using a polyfill for `Object.assign`, which effectively removes support for Internet Exporer. But it's 2022, its about time. + +## 3.0.19 +- Update `ember-element-helper` to fix issues with CI. + +## 3.0.18 +- Relax dependencies on embroider packages + +## 3.0.17 +- Update ember-element-helper for better embroider compatibility + +## 3.0.16 +- Update ember and many other dependencies + +## 3.0.15 +- Fix conditional import for Embroider compatibility, using @embroider/macros. + +## 3.0.14 +- Import `htmlSafe` from `@ember/template` to fix deprecation warning. +- Migrate to github actions and fix stuff to make CI green again. + +## 3.0.13 +- Use `ember-style-modifier` in one more place. +- Migrate to github actions and fix CI on beta and canary. This was done by relaxing a dependency + on the embroider utils. + +## 3.0.12 +- Use `ember-style-modifier` for setting styles on element instead of using inline styles. This allows to + use the addon on webs that forbid inline styles on they CSP config. + +## 3.0.11 +- Relax dependency on ember-truth-helpers + +## 3.0.10 +- More IE11 fixes. + +## 3.0.9 +- Use `assign` polyfill for IE11 support. + +## 3.0.8 +- Update `ember-maybe-in-element` to 2.0.1, which fixes deprecation about `{{-in-element}}` usage. + +## 3.0.7 +- Add back `onXXX` event handlers to the trigger and content components, removed in the transition to angle bracket components, + because make some patterns easier as it allows to set handlers to those events when defining the contextual component, instead of + in invocation time + +## 3.0.6 +- [BUGFIX] Restore ability to change `horizontalPosition` and `verticalPosition` after initialization, lost + at some point in the transition to glimmer components. + +## 3.0.5 +- TS: Fix type definition: Allow touch events in `handleRootMouseDown` on another location. + +## 3.0.4 +- TS: Fix type definition: Allow touch events in `handleRootMouseDown`. + +## 3.0.3 +- A11y fix: When the component is not expanded, it must have `aria-expanded="false"`. + +## 3.0.2 +- Ensure `this._super` in invoked in the `included` hooks. + +## 3.0.0-beta.8 +- [BUGFIX] Ensure the `otherStyles` is initialized with a copied object. + +## 3.0.0-beta.7 +- [CHORE] Update to `@glimmer/component` 1.0.0 +- [BUGFIX] If there's no enough space for the dropdown above nor below the trigger, put it below. + +## 3.0.0-beta.6 +- [CHORE] Improve exported types + +## 3.0.0-beta.5 +- [BUGFIX] Don't use typescript in /app folder + +## 3.0.0-beta.4 +- [CHORE] Convert to typescript + +## 3.0.0-beta.3 +- [BUGFIX] Fix reposition of dropdown after scroll or window resize events + +## 3.0.0-beta.2 +- [CHORE] Update to @glimmer/component 1.0.0-beta.2 + +## 3.0.0-beta.1 +- No changes since alpha 1 + +## 3.0.0-alpha.1 +- [MAYBE-BREAKING] Update to glimmer components + +## 2.0.10 +- [BUGFIX] Use `set` when changing `previousVerticalPosition` and `previousHorizontalPosition`. + +## 2.0.9 +- [CHORE] Update some dependencies. More importantly `ember-element-modifiers` to 1.0.2 which changes its behavior. + +## 2.0.8 +- [BUGFIX] Correct condition in which the development assertion added in 2.0.6 is thrown. Logic was reversed. + +## 2.0.7 +- [BUGFIX] Update `ember-element-helper` to 0.2.0 to fix bug in engines + +## 2.0.6 +- [ENHANCEMENT] Add development assertion to help people understand the somewhat cryptic error message that + appeared when there was no element with id `ember-basic-dropdown-wormhole` in the document + +## 2.0.5 +- [CHORE] Update npm packages to tests pass in beta and canary +- [BUGFIX] Ensure Ember doesn't complain about not using `set` to update values. + +## 2.0.4 +- [ENHANCEMENT] Allow to pass a `@defaultClass` argument to the content. This is necessary to be able to + assign classes while the `{{component}}` helper does not allow to pass attributes like in angle-bracket syntax. + +## 2.0.3 +- [ENHANCEMENT] Allow to pass a `@defaultClass` argument to the trigger. This is necessary to be able to + assign classes while the `{{component}}` helper does not allow to pass attributes like in angle-bracket syntax. + +## 2.0.2 +- [BUGFIX] Move `ember-truth-helpers` to `dependencies`. + +## 2.0.1 +- [ENHANCEMENT] Expose `ember-basic-dropdown/utils/calculate-position` as public API. + +## 2.0.0 +- [CHORE] Setup/teardown mutation observer using dedicated element modifiers. +- [CHORE] Refactor animation logic to use `{{did-insert}}`/`{{will-destroy}}` element modifiers. + +## 2.0.0-beta.3 +- [BREAKING] Remove `onMouseDown`,`onClick`,`onKeyDown` and `onTouchEnd` attributes from the `` component. + Users can just use the `{{on}}` modifier to attach events now, although that means that to prevent the default event handler from being called for those events, + instead of `return false`, they must call `event.stopImmediatePropagation()` like they would with regular events. + +## 2.0.0-beta.2 +- [BREAKING] Remove `onMouseEnter`,`onMouseLeave`,`onFocus`,`onBlur`,`onFocusIn`,`onFocusOut` and `onKeyUp` from the `` component. + Users can just use the `{{on}}` modifier to attach any event they want. +- [BREAKING] Remove `onFocusIn`, `onFocusOut`, `onMouseEnter`, `onMouseLeave` and `onKeyDown` from the `` component. Users + can just use the `{{on}}` modifier to attach any event they want. + +## 2.0.0-beta.1 +- [CHORE] Now that Ember 3.11 is released, this can go to beta. + +## 2.0.0-alpha.X +- Because of some limitation of splattributes in AngleBracket components, the addons requires Ember 3.11+ +- Public API changed: Previously the contextual component of this addon were invoked with `{{#dd.trigger}}` and `{{#dd.content}}`. + Now they are expected to be invoked with `` and ``. Note that the names are capitalized. This is done + because the new convention that components start with a capital letter. +- Passing `@class`, `@defaultClass`, `aria-*` and most of those properties doesn't work anymore. This addon + now expects to be used with angle-bracket syntax. In angle bracket syntax there is a distinction between + component arguments (those preceded with an `@` sign) and html attributes, and the latter are a much + better way of passing any arbitrary attribute to any of the components and sub-components of this addon. +- The default `eventType` of the trigger changed from `"mousedown"` to `"click"`. That means that dropdown + used to open with the `mousedown` events will now open with `click` events, which is a saner default. + Since most of the time those events are fired together most people won't notice any difference, but + in testing if someone was explicitly firing mouseodown events tests would have to be updated. +- The default `rootEventType` has changed from `"mousedown"` to `"click"`. That means that before dropdowns would close + as soon as the user mousedowns outside the dropdown, but not it will listed to click events by default. + It's unlikely this change will be noticed by anyone. + +## 1.1.2 +- [ENHANCEMENT] Allow to bind the type attribute of the trigger. + +## 1.1.1 +- [ENHANCEMENT] Allow to customize the root event the component listens to in order to close when you + click outside it. It has historically been `mousedown`, but now it can be `click`. + This allows to scroll the page using a scrollbar. + In a future version `click` will become the default. + +## 1.1.0 +- [REAPPLY] Revert the revert in 1.0.6. Technically identical to 1.0.5 + +## 1.0.6 +- [REVERT] Revert change in 1.0.5 as it is a breaking change for Ember Power Select. Will fix EPS and apply again. + +## 1.0.5 +- [BUGFIX] A11y improvement: The trigger doesn't have an `aria-owns` attribute until the dropdown + is open, because it's illegal for an aria-owns to reference an element (the content) that it's not + in the page (yet). + +## 1.0.4 +- [BUGFIX] Fix code to find the destination element in fastboot. + +## 1.0.3 +- [FEATURE] Allow `onKeyUp` action to added to the trigger. + +## 1.0.2 +- [FEATURE] Allow `onKeyDown` action to the content component + +## 1.0.1 +- [DOCS] Document `eventType` option that has existed for a while now. +- [FEATURE] Add `stopPropagation` option to the trigger to prevent the propagation of the event + +## 1.0.0 +- NO NEW CHANGES, just version 1.0. It was about time. + +## 1.0.0-beta.8 +- [CLEANUP] Remove another reduntad `self.` prefix. + +## 1.0.0-beta.7 +- [CLEANUP] Remove unnecessary `self.` prefix to access a few globals like `document` or `window`. + +## 1.0.0-beta.6 +- [CLEANUP] Remove passing `to="id-of-destination"` that has been deprecated for a long time. + +## 1.0.0-beta.5 +- [BUGFIX] Fix event being fired on destroyed trigger in Ember 3.2 and beyond. + +## 1.0.0-beta.4 +- [FEATURE] Allow dropdowns with a custom `calculatePosition` function to return in the `styles` object + css properties other than `top`, `left`, `right`, `height` and `width`. Now users can set any arbitrary + properties. P.e. `max-height`, `z-index`, `transform`.... + +## 1.0.0-beta.3 +- [INTERNAL] Stop depending internally on `ember-native-dom-helpers`. Now the utilities in `ember-test-helpers` + have been ported to `@ember/test-helpers`, so they are not needed anymore. + +## 1.0.0-beta.0 +- [DEPRECATION] Deprecate global acceptance helpers `clickDropdown` and `tapDropdown`. Suggest to + explicitly import `clickTrigger`/`tapTrigger` or even better, just use `click`/`tap` from `@ember/test-helpers`. +- [BREAKING] Drop ember-wormhole addon, use `#-in-element` built-in instead. Less size, more performance. +- [BREAKING] Drop support for Ember <= 2.9. This addon will require Ember 2.10 or greater to work. + +## 0.34.0 +- [BREAKING] Delete the `/test-support` folder, use `addon-test-support` instead. That means people + should import helpers from `ember-basic-dropdown/test-support/helpers` instead of using relative paths + like `../../helpers/ember-basic-dropdown`, as they are brittle and change with nesting. +- [BUGFIX] Ensure that the dropdown is not open by the right button of the mouse. + +## 0.33.10 +- [ENHANCEMENT] Allow `horizontalPosition` to work when `renderInPlace=true` + +## 0.33.9 +- [ENHANCEMENT] Allow to bind the role attribute of the trigger +- [ENHANCEMENT] Added `preventScroll=true` option to the `dropdown.content` component to "frezze" all + mousewheel-triggered scrolling happening outside the component. Scrolling on touch devices using + touchmove can still occur. + +## 0.33.7 +- [ENHANCEMENT] Enable `renderInPlace=true` dropdowns to be dynamically repositioned. (#350) +- [BUGFIX] Ensure the inline `style` attribute does not output `undefinedpx` when some style is + undefined. Also, ensure that both `left` and `right` cannot be applied simultaneous, as it doesn't + make sense. + +## 0.33.6 +- [BUGFIX] Prevent dropdowns with `renderInPlace=true` from being incorrectly opened twice. This had + no evident effects, but lead to the events in the `dd.Content` component to be added twice. +- [BREAKING] Remove support for IE9/IE10. + +## 0.33.5 +- [ENHANCEMENT] Allow `transitioningInClass` and `transitioningOutClass` to be several classes by + passing a string with spaces in it. + +## 0.33.4 +- [BUGFIX] Allow to use `horizontalPosition="center"` along with `renderInPlace=true`. + +## 0.33.3 +- [BUGFIX] When the component is rendered in-place, it still has to have the `--below` class + needed. While not used for positioning, it was used for animations. + +## 0.33.2 +- [BUGFIX] Fix positioning problem when the body has position relative. + +## 0.33.1 +- [BUGFIX] Move test helpers to `/addon-test-support` and use `/test-support` only for reexporting + so apps don't require babel 6.6.0+ to work. + +## 0.33.0 +- [INTERNAL] Stop relying in `Ember.testing` to decide the wormhole destination. Not just uses + the environment. +- [ENHANCEMENT] This component by default opens with `mousedown` events, not with `click`. This + behavior has its reasons but it's also surprising for some users and it might not be adequate + sometimes. Now the trigger accepts an `eventType="mousedown" | "click"` (defaults to `"mousedown"` as today). This doesn't affect touch devices, as those are opened/closed + with the `touchend` event. +- [INTERNAL] Use the new import paths (e.g: `import Component from '@ember/component`) + +## 0.32.9 +- [ENHANCEMENT] Add `auto-right` option for horizontal position. It's like `auto`, but it defaults to + being anchored to the right unless there is not enough room towards the left for the content. + +## 0.32.8 +- [ENHANCEMENT] Update `ember-native-dom-helpers` to `^0.5.0`. + +## 0.32.7 +- [BUGFIX] Guard agains edge case where positioning could fail if the select close and opened extremely fast + +## 0.32.6 +- [BUGFIX] Add global events to the `document` instead of the `body`, so the dropdown works + even if the body is smaller than the height of the window + +## 0.32.5 +- [ENHANCEMENT] Update `ember-native-dom-helpers` to 0.4.0 + +## 0.32.4 +- [BUGFIX] Fix broken render in place after refactor for allowing dropdowns in scrollable + elements. + +## 0.32.3 +- [ENHANCEMENTE] Allow to nest dropdowns infinitely. Thanks to @alexander-alvarez + +## 0.32.2 +- [BUGFIX] Stop looking for scrollable ancestors on the BODY or HTML + +## 0.32.1 +- [BUGFIX] Allow to work if the container has no offsetParent. This happens if the body + is relative. + +## 0.32.0 +- No changes in previous beta + +## 0.32.0-beta.0 +- [ENHANCEMENT] Dropdowns inside elements with their own scroll are finally supported! It works + even inside elements with scroll inside another element with scroll inside pages with scroll. +- [BREAKING/BUGFIX] Closes #233. The positioning logic now accounts for the position of the + parent of container if it has position relative or absolute. The breaking part is that + custom `calculatePosition` functions now take the destination element as third arguments, + and the object with the options has now been moved to thr forth position. +- [BREAKING] Passing `to="id-of-elmnt"` to the `{{#dropdown.content}}` component is deprecated. + The way to specify a different destination for `ember-wormhole` is now by passing `destination=id-of-elmnt` + to the top-level `{{#basic-dropdown}}` component. The old method works but shows a deprecation message. + +## 0.31.5 +- [INTERNAL] Update ember-concurrency to a version that uses babel 6. + +## 0.31.4 +- [BUGFIX] Fix calculation of the screen's width when browser shows a scrollbar, which + affected dropdowns with `horizontalPosition="right"`. +- [BUGFIX] Fix initial CSS positioning flickering caused by refactor that removed jQuery. + +## 0.31.2 +- Now the addon is 100% jQuery-free. Docs page doesn't use jQuery either. Tests in CI run + without jquery so if anyone inadvertenly relies on it, tests will fail. +- Rewrite tests to use `async/await` with the latest `ember-native-dom-helpers` + +## 0.31.1 +- Update to ember-native-dom-helpers 0.3.4, which contains a new & simpler import path. + +## 0.31.0 +- [INTERNAL/BREAKING???] Update to Babel 6. This **shouldn't** be breaking, but you + never know. + +## 0.30.3 +- [BUFGIX] Fix unnecesary line break caused by the wormhole empty div. Solved + by making that div be `display: inline`. + +## 0.30.1 +- [ENHANCEMENT] Allow the `calculatePosition` function to also determine the height of the + dropdown's content. + +## 0.30.0 +- [BREAKING] Unify `calculatePosition` and `calculateInPlacePosition`. Now the function receives + an `renderInPlace` flag among its options, and based on that it uses a different logic. + This reduces the public API surface. This new function is the default export of `/utils/calculate-position`. + The individual functions used to reposition when rendered in the wormhole or in-place are + available as named exports: `calculateWormholedPosition` and `calculateInPlacePosition` + +## 0.24.5 +- [INTERNAL] Use `ember-native-dom-helpers`. + +## 0.24.4 +- [ENHANCEMENT] The trigger component now has a bound style property. + +## 0.24.3 +- [ENHANCEMENT] Rely on the new `ember-native-dom-helpers` to fire native events instead + or rolling out my own solution. + +## 0.24.2 +- [BUGFIX] Fix synthetic click on the trigger when happens in SVG items. + +## 0.24.1 +- [ENHANCEMENT] Bind `aria-autocomplete` and `aria-activedescendant`. +- [BUGFIX] Check if the component is destroyed after calling the `onClose` action, as it + might have been removed. + +## 0.24.0 +- [BREAKING] It is a problem for a11y to have `aria-owns/controls` to an element that it's not + in the DOM, so now there is a stable div with the right ID that gets moved to the root + of the body when the component opens. +- [BUGFIX] Fix `clickDropdown` test helper when the given selector is already the selector + of the trigger. + +## 0.23.0 +- [BREAKING] Don't display `aria-pressed` when the component is opened. The attribute is not + present by default, but can be bound from the outside. +- [BREAKING] Don't display `aria-haspopup` by default, but display it if passed in a truthy value. +- [BREAKING] Use `aria-owns` instead of `aria-controls` to link trigger and content together. + +## 0.22.3 +- [FEATURE] The `dropdown.content` now accepts a `defaultClass` property as a secondary way + of adding a class in contextual components that doesn't pollute the `class` property. + +## 0.22.2 +- [FEATURE] `clickTrigger` test helper also works when the given selector is the one of + the trigger (before it had to be an ancestor of the trigger). + +## 0.22.1 +- [FEATURE] It accepts an `onInit` action passed from the outside. Private-ish for now. + +## 0.22.0 +- [FEATURE/BREAKING] Allow to customize the ID of the trigger component. Now the dropdown + uses a new `data-ebd-id` attribute for query the trigger reliably. Unlikely to be + breaking tho. + +## 0.21.0 +- [FEATURE] Add LESS support, on pair with the SASS one. +- [FEATURE] Added `$ember-basic-dropdown-overlay-pointer-events` SASS variable. + +## 0.20.0 +- [BREAKING CHANGE] Renamed `onKeydown` event to `onKeyDown` to be consistent with the naming + of every other action in the component + +## 0.19.4 +- [FEATURE] Allow to pass `onMouseDown` and `onTouchEnd` options actions to subscribe to those + events. If the handler for those events returns `false`, the default behaviour (toggle the component) + is prevented. + +## 0.19.3 +- [FEATURE] Allow to pass `onMouseEnter` and `onMouseLeave` actions to the content, like + we allow with the trigger. + +## 0.19.2 +- [BUGFIX] Prevent the `touchend` that opens the trigger to trigger a click on the dropdown's content + when this appears over the trigger. Copied from hammertime. + +## 0.19.1 +- [CLEANUP] Update to `ember-cli-sass` ^6.0.0 and remove `node-sass` from dependencies. + +## 0.19.0 +- [BUGFIX] Call `registerAPI` will `null` on `willDestroy` to avoid memory leaks. + +## 0.18.1 +- [ENHANCEMENT] Pass the dropdown itself as an option to `calculatePosition` and `calculateInPlacePosition`, + so users have pretty much total freedom on that function. + +## 0.18.0 +- [ENHANCEMENT] Allow downdowns rendered in place to be positioned above the trigger, + and also to customize how they are positioned. + +## 0.17.4 +- [ENHANCEMENT] Update to ember-wormhole 0.5.1, which maximises Glimmer2 compatibility + +## 0.17.3 +- [BUGFIX] The fix in 0.17.2 that removed `e.preventDefault()` cause both `touchend` and a synthetic `mousedown` + events to be fired, which basically made the component to be opened and immediatly closed in touch devises. + +## 0.17.2 +- [BUGFIX] Remove `e.preventDefault()` that caused inputs inside the trigger to not be focusable in touch screens + +## 0.17.1 +- [BUGFIX] The positioning strategy takes into account the horizontal scroll and it's generally smarter. +- [BUGFIX] Fixed bug when a dropdown with `horizontalPosition="auto"` passed from left to right, it keeped + both properties, modifiying its width implicitly. + +## 0.17.0 +- [BREAKING] The object returned by `calculatePosition` now contains the offsets + of the dropdown as numbers instead of strings with "px" as unit. This makes easier for people + to modify those values in their own functions. + +## 0.16.4 +- [ENHANCEMENT] The default `calculatePosition` method is now inside `addon/utils/calculate-position`, so users can import it + to perhaps reuse some of the logic in their own positioning functions. + +## 0.16.3 +- [BUGFIX] Add forgotten `uniqueId` property to the publicAPI yielded to the block. The `publicAPI` object passes to actions had it + but the one in the block didn't. + +## 0.16.2 +- [ENHANCEMENT] Allows to customize how the dropdown is positioned by passing a `calculatePosition` function. + +## 0.16.1 +- [BUGFIX] Remove automatic transition detection. It never worked properly. It's fundamentally flawed. CSS animations are OK tho. + +## 0.16.0 +- [TESTING] Ensure the addon is tested in 2.4LTS +- [BUGFIX] Fix bug in versions of ember <= 2.6 + +## 0.16.0-beta.6 +- [BUGFIX] Remove `ember-get-config` entirely. It turns that there is a less hacky way of doing this. + +## 0.16.0-beta.5 +- [BUGFIX] Update `ember-get-config` to fix Fastboot compatibility. + +## 0.16.0-beta.4 +- [BUGFIX] Guard agains a possible action invocation after the component has been destroyed. + +## 0.16.0-beta.3 +- [BUGFIX] Fix broken `horizontalPosition="center"`. + +## 0.16.0-beta.2 +- [BUGFIX] Bind `title` attribute in the trigger. + +## 0.16.0-beta.1 +- [BUGFIX] Revert glimmer2 compatibility + +## 0.16.0-beta.0 +- [BUGFIX] Compatibility with glimmer2. + +## 0.15.0-beta.6 +- [BUGFIX] Fix bug detaching event in IE10. + +## 0.15.0-beta.5 +- [BUGFIX] The correct behaviour when a dropdown is disabled or the tabindex is `false` should be + to not have `tabindex` attribute, not to have a `tabindex` of -1. + +## 0.15.0-beta.4 +- [BUGFIX] Don't import `guidFor` from the shims. + +## 0.15.0-beta.3 +- [BUGFIX] Preventing the default behaviour from an event doesn't prevent the component from doing + the usual thing. + +## 0.15.0-beta.2 +- [BUGFIX] Fix edge case that made the component leak memory if the component is removed after a + mousedown but before the mouseup events of the trigger. This situation probably almost impossible + outside testing. + +## 0.15.0-beta.1 +- [ENHANCEMENT] The dropdown can have an overlay element if it receives `overlay=true`. + +## 0.15.0-beta.0 +- [BREAKING] `dropdown.uniqueId` is not a string like `ember1234` instead of the number `1234`. + +## 0.14.0-beta.1 +- [BUGFIX] Consider the scope of the select the entire body, even if the app is rendered inside an + specific element. + +## 0.14.0-beta.0 +- [BREAKING] Rename the `dropdown._id` to `dropdown.uniqueId` and promote it to public API. + +## 0.13.0-beta.6 +- [BUGFIX] Make the first reposition faster by applying the styles directly instead of using bindings. + This allows the dropdown to have components with autofocus inside without messing with the scroll. + +## 0.13.0-beta.5 +- [BUGFIX] Enabling the component after it has been disabled should trigger the `registerAPI` action. + +## 0.13.0-beta.4 +- [BUGFIX] Fix bug when the consumer app has a version of `ember-cli-shims` older than 0.1.3 + +## 0.13.0-beta.3 +- [BUGFIX] Stop importing `getOwner` from the shim, since many people doesn't have shims up to date + and it's trolling them. + +## 0.13.0-beta.2 +- [BUGFIX] Render more than one component with `renderInPlace=true` cases an exception and after that + mayhem happens. + +## 0.13.0-beta.1 +- [BUGFIX] Use `requestAnimationFrame` to wait one frame before checking if the component is being + animated. This makes this component fully compatible with Glimmer 2. + +## 0.13.0-beta.0 +- [ENHANCEMENT/BREAKING] Now the publicAPI object received sub-components and passed to actions is + immutable. That means that each change in the internal state of this component will generate a new + object. This allows userts to get rid of `Ember.Observe` to use some advanced patterns and makes + possible some advanced time-travel debugging. + +## 0.12.0-beta.26 +- [ENHANCEMENT] Allow to customize the classes used for animations with `transitioningInClass`, + `transitionedInClass` and `transitioningOutClass`. +- [BUGFIX] Property detect space on the right when `horizontalPosition="auto"` (the default) and + position the element anchored to the right of the dropdown if there is no enough space for it + to fit. + +## 0.12.0-beta.23 +- [BUGFIX] Correctly remove touchmove event on touch ends. +- [BUGFIX] Prevent DOM access in fastboot mode. + +## 0.12.0-beta.22 +- [ENHANCEMENT] If the component gets disabled while it's opened, it is closed automatically. + +## 0.12.0-beta.21 +- [ENHANCEMENT] Expose `clickDropdown` and `tapDropdown` acceptance helpers. +- [BUGFIX] Allow to nest a dropdown inside another dropdown without the second being rendered in place. + +## 0.12.0-beta.20 +- [BUGFIX] Apply enter animation after render. Otherwise it take place before the component + gains the `--above` or `--below` class, which is needed to know how to animate. + +## 0.12.0-beta.19 +- [BUGFIX] Allow `to` property of the content component to be undefined + +## 0.12.0-beta.18 +- [BUGFIX] Fix positioning of dropdowns rendered in-place due to a typo + +## 0.12.0-beta.17 +- [BUGFIX] Ensure the `disabled` property of the public API is updated properly + +## 0.12.0-beta.13 +- [BUGFIX] Ensure reposition is not applied in destroyed components + +## 0.12.0-beta.12 +- [BUGFIX] Fix animations + +## 0.12.0-beta.11 +- [INTERNAL] Update ember-cli to 2.6 +- [INTERNAL] Update ember-wormhole to 0.4.0 (fastboot support) +- [BUGFIX] Correct behaviour of `aria-disabled`, `aria-expanded`, `aria-invalid`, `aria-pressed` + and `aria-required` in Ember 2.7+ +- [ENHANCEMENT] Allow to customize componets for the trigger and the content, with the `triggerComponent` + and `contentComponent` properties. +- [BUGFIX] Stop relying in `this.elementId`, since it is not present in Ember 2.7+ on tagless components. +- [ENHANCEMENT] Add an `onBlur` action to the trigger +- [BUGFIX] Change repositioning logic so it doesn't sets properties from inside the `didInsertElement`, + which is deprecated and causes a performance penalty. + +## 0.12-beta.6 +- [ENHANCEMENT] Although the component is tagless by default, if the user passes `renderInPlace=true`, + a wrapper element with class `.ember-basic-dropdown` is added to be able to position the content + properly. +- [BUGFIX] The reposition function no longer sets any observable state, so it can be called at + any time without worring about the runloop and double renders. More performant and fixes a bug + when something inside gains the focus faster than the reposition. + +## 0.12-beta.5 +- [BUGFIX] Don't focus the trigger again when the dropdown is closed as consecuence of clicking outside it. +- [ENHANCEMENT] Allow to add focusin/out events to the trigger + +## 0.12-beta.4 +- [BUGFIX] Ensure that if the trigger receives `tabindex=null` it still defaults to 0. + +## 0.12-beta.3 +- [BUGFIX] Ensure that the `aria-controls` attribute of the trigger points to the content by default. + +## 0.12-beta.2 +- [BUGFIX] Focus the trigger when the component is closed +- [BUGFIX] Allow to attach `onFocusIn` and `onFocusOut` event the the dropdown content component. + +## 0.12-beta.1 +- [BUGFIX] Around half a docen regressions and changes, including add the proper classes to trigger + and content when the component is rendered above/below/right/left/center/in-place. Now those cases + are different between trigger and content for better granularity. + +## 0.12-beta.0 +- [BREAKING CHANGE] Brand new API diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index a6d7ac71..f481b8c9 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -13,18 +13,15 @@ ## Building the addon -- `cd ember-basic-dropdown` - `pnpm build` ## Running tests -- `cd test-app` - `pnpm test` – Runs the test suite on the current Ember version - `pnpm test:watch` – Runs the test suite in "watch mode" ## Running the test application -- `cd test-app` - `pnpm start` - Visit the test application at [http://localhost:4200](http://localhost:4200). diff --git a/LICENSE.md b/LICENSE.md deleted file mode 120000 index 2ba4d003..00000000 --- a/LICENSE.md +++ /dev/null @@ -1 +0,0 @@ -ember-basic-dropdown/LICENSE.md \ No newline at end of file diff --git a/LICENSE.md b/LICENSE.md new file mode 100644 index 00000000..8ba573fc --- /dev/null +++ b/LICENSE.md @@ -0,0 +1,9 @@ +The MIT License (MIT) + +Copyright (c) 2025 + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/README.md b/README.md deleted file mode 120000 index e289cb2d..00000000 --- a/README.md +++ /dev/null @@ -1 +0,0 @@ -ember-basic-dropdown/README.md \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 00000000..99c19f31 --- /dev/null +++ b/README.md @@ -0,0 +1,165 @@ +[![NPM](https://badge.fury.io/js/ember-basic-dropdown.svg)](https://www.npmjs.com/package/ember-basic-dropdown) +[![Ember Observer Score](https://emberobserver.com/badges/ember-basic-dropdown.svg)](https://emberobserver.com/addons/ember-basic-dropdown) +![Ember Version](https://img.shields.io/badge/ember-%3E%3D4.12-brightgreen?logo=emberdotjs&logoColor=white) +[![Discord](https://img.shields.io/badge/chat-discord-blue?style=flat&logo=discord)](https://discord.com/channels/480462759797063690/486202731766349824) +[![Build Status](https://github.com/cibernox/ember-basic-dropdown/actions/workflows/ci.yml/badge.svg?branch=master)](https://github.com/cibernox/ember-basic-dropdown) + +# ember-basic-dropdown + +This is a very minimal dropdown. That means that it is agnostic about what it is going to contain. + +It is intended to be a building block for more complex components but is perfectly usable. + +### Features + +- πŸ–Š **TypeScript support** – ships with type definitions for smooth TypeScript integration. +- ✨ **Glint support** – template type-checking out of the box for safer templates. +- πŸš€ **FastBoot compatible** – works in server-rendered Ember apps. +- πŸ•Ά **Shadow DOM support** – can be rendered inside shadow roots without breaking positioning or events. +- πŸ›  **Addon v2 ready** – modern Ember Addon v2 format. +- 🎯 **Headless & lightweight** – provides dropdown logic and accessibility without forcing styles. +- πŸ”§ **Flexible API** – fully customizable trigger and content; you control the markup and styling. +- 🧩 **Composable** – integrates seamlessly with other Ember addons (e.g. [ember-power-select](https://www.ember-power-select.com)). +- β™Ώ **Accessible by default** – full keyboard navigation, ARIA attributes, and focus management built-in. +- πŸ“± **Responsive positioning** – automatic repositioning on scroll and viewport boundaries. + +### Compatibility + +- Embroider or ember-auto-import v2 +- Ember.js v4.12 or above + +### Installation + +``` +pnpm install ember-basic-dropdown +``` + +For more installation details see [documentation](https://ember-basic-dropdown.com/docs/installation) + +### Usage + +This component leverages contextual components for its API: + +```glimmer-ts +import BasicDropdown from "ember-basic-dropdown/components/basic-dropdown"; + + +``` + +The yielded `dropdown` object is the public API of the component, and contains +properties and actions that you can use to control the component. + +```js +{ + uniqueId: , + disabled: , + isOpen: , + actions: { + open: , + close: , + toggle: , + reposition: , + registerTriggerElement: , + registerDropdownElement: , + getTriggerElement: + } +} +``` + +Check the full documentation with live examples in https://ember-basic-dropdown.com + +### Features + +#### Renders on the body or in place + +By default this component will render the dropdown in the body using `#in-element` and absolutely +position it to place it in the proper coordinates. + +You can opt out to this behavior by passing `renderInPlace=true`. That will add the dropdown just +below the trigger. + +#### Close automatically when clicking outside the component + +You don't need to care about adding or removing events, it does that for you. + +You can make the dropdown content standout a little more by adding `overlay=true` to the content options, see example below. This will add a semi transparent overlay covering the whole screen. Also this will stop bubbling the click/touch event which closed the dropdown. + +```glimmer-ts +import BasicDropdown from "ember-basic-dropdown/components/basic-dropdown"; + + +``` + +NOTE: If for some reason clicking outside a dropdown doesn't work, you might want to make sure the `` spans the entire viewport. Adding a css rule like `body {min-height: 100vh;}` would do the trick. It ensures that wherever you click on the page, it will close the dropdown. + +#### Close automatically when clicking inside the component + +If you'd like the dropdown to close itself after a user clicks on it, you can use `dd.actions.close` from our public API. + +```glimmer-ts +import BasicDropdown from 'ember-basic-dropdown/components/basic-dropdown'; +import { on } from '@ember/modifier'; + +