From 825d722fd30d210a9363ed14c47cccd96811575f Mon Sep 17 00:00:00 2001 From: JesmoDev <26099018+JesmoDev@users.noreply.github.com> Date: Thu, 5 Oct 2023 23:33:02 +1300 Subject: [PATCH 1/6] fix: Modal close-end event, no more bubbling modal events (#598) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Niels Lyngsø --- packages/uui-modal/lib/uui-modal.element.ts | 9 +++++---- packages/uui-modal/lib/uui-modal.mdx | 4 ++++ 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/packages/uui-modal/lib/uui-modal.element.ts b/packages/uui-modal/lib/uui-modal.element.ts index 7e40ff27f..5c4e07c9e 100644 --- a/packages/uui-modal/lib/uui-modal.element.ts +++ b/packages/uui-modal/lib/uui-modal.element.ts @@ -18,11 +18,11 @@ export class UUIModalElement extends LitElement { private _transitionDuration = 250; - @property() + @property({ type: Number, attribute: 'transition-duration' }) public get transitionDuration() { return this._transitionDuration; } - public set transitionDuration(value) { + public set transitionDuration(value: number) { this._transitionDuration = value; this.style.setProperty( '--uui-modal-transition-duration', @@ -45,7 +45,6 @@ export class UUIModalElement extends LitElement { event?.stopImmediatePropagation(); const openEvent = new CustomEvent('open', { - bubbles: true, cancelable: true, }); @@ -60,7 +59,6 @@ export class UUIModalElement extends LitElement { event?.stopImmediatePropagation(); const closeEvent = new CustomEvent('close', { - bubbles: true, cancelable: true, }); this.dispatchEvent(closeEvent); @@ -80,6 +78,9 @@ export class UUIModalElement extends LitElement { this.isClosing = true; this.isOpen = false; this._dialogElement?.close(); + + this.dispatchEvent(new CustomEvent('close-end')); + this.remove(); } diff --git a/packages/uui-modal/lib/uui-modal.mdx b/packages/uui-modal/lib/uui-modal.mdx index 0dc818c25..2ee4a822a 100644 --- a/packages/uui-modal/lib/uui-modal.mdx +++ b/packages/uui-modal/lib/uui-modal.mdx @@ -91,6 +91,10 @@ Dispatched on first render. This will set open to true and show the modal. Can b Dispatched when the modal is closed. Can be cancelled if you want to prevent the modal from closing. But then you'll have to manually call `_closeModal()` when you want to close the modal. This is used in the `uui-modal-sidebar` to wait for the animation to finish before removing the modal from the DOM. +#### `close-end` + +This event is triggered before removing the component from the DOM, either after animations or delays or when `_closeModal()` is manually invoked. + ### CSS Variables --- From 3ff54ce3cc0ac70d1e040f4848cd73f4306e8ff0 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 4 Oct 2023 00:23:17 +0000 Subject: [PATCH 2/6] build(deps-dev): bump postcss from 8.4.26 to 8.4.31 Bumps [postcss](https://github.com/postcss/postcss) from 8.4.26 to 8.4.31. - [Release notes](https://github.com/postcss/postcss/releases) - [Changelog](https://github.com/postcss/postcss/blob/main/CHANGELOG.md) - [Commits](https://github.com/postcss/postcss/compare/8.4.26...8.4.31) --- updated-dependencies: - dependency-name: postcss dependency-type: direct:development ... Signed-off-by: dependabot[bot] --- package-lock.json | 34 ++++------------------------------ package.json | 2 +- 2 files changed, 5 insertions(+), 31 deletions(-) diff --git a/package-lock.json b/package-lock.json index 93f7aa76e..a9959f22a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -57,7 +57,7 @@ "lint-staged": "13.2.3", "npm-check-updates": "16.10.16", "plop": "3.1.2", - "postcss": "8.4.26", + "postcss": "8.4.31", "postcss-advanced-variables": "3.0.1", "postcss-cli": "10.1.0", "postcss-color-function": "4.1.0", @@ -25624,7 +25624,9 @@ } }, "node_modules/postcss": { - "version": "8.4.26", + "version": "8.4.31", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.31.tgz", + "integrity": "sha512-PS08Iboia9mts/2ygV3eLpY5ghnUcfLV/EXTOW1E2qYxJKGGBUtNjN76FYHnMs36RmARn41bC0AZmn+rR0OVpQ==", "dev": true, "funding": [ { @@ -25640,7 +25642,6 @@ "url": "https://github.com/sponsors/ai" } ], - "license": "MIT", "dependencies": { "nanoid": "^3.3.6", "picocolors": "^1.0.0", @@ -31348,33 +31349,6 @@ "@esbuild/win32-x64": "0.18.20" } }, - "node_modules/vite/node_modules/postcss": { - "version": "8.4.29", - "dev": true, - "funding": [ - { - "type": "opencollective", - "url": "https://opencollective.com/postcss/" - }, - { - "type": "tidelift", - "url": "https://tidelift.com/funding/github/npm/postcss" - }, - { - "type": "github", - "url": "https://github.com/sponsors/ai" - } - ], - "license": "MIT", - "dependencies": { - "nanoid": "^3.3.6", - "picocolors": "^1.0.0", - "source-map-js": "^1.0.2" - }, - "engines": { - "node": "^10 || ^12 || >=14" - } - }, "node_modules/walk-up-path": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/walk-up-path/-/walk-up-path-3.0.1.tgz", diff --git a/package.json b/package.json index 9edafb3da..8858debdc 100644 --- a/package.json +++ b/package.json @@ -100,7 +100,7 @@ "lint-staged": "13.2.3", "npm-check-updates": "16.10.16", "plop": "3.1.2", - "postcss": "8.4.26", + "postcss": "8.4.31", "postcss-advanced-variables": "3.0.1", "postcss-cli": "10.1.0", "postcss-color-function": "4.1.0", From 8464fca080c7beb2b7817c0316c2f695610817ab Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 2 Oct 2023 09:38:33 +0000 Subject: [PATCH 3/6] build(deps-dev): bump eslint-config-prettier from 8.9.0 to 9.0.0 Bumps [eslint-config-prettier](https://github.com/prettier/eslint-config-prettier) from 8.9.0 to 9.0.0. - [Changelog](https://github.com/prettier/eslint-config-prettier/blob/main/CHANGELOG.md) - [Commits](https://github.com/prettier/eslint-config-prettier/compare/v8.9.0...v9.0.0) --- updated-dependencies: - dependency-name: eslint-config-prettier dependency-type: direct:development update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- package-lock.json | 7 ++++--- package.json | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/package-lock.json b/package-lock.json index a9959f22a..0926db0ad 100644 --- a/package-lock.json +++ b/package-lock.json @@ -43,7 +43,7 @@ "element-internals-polyfill": "1.3.5", "esbuild": "0.17.18", "eslint": "8.45.0", - "eslint-config-prettier": "8.9.0", + "eslint-config-prettier": "9.0.0", "eslint-import-resolver-typescript": "3.5.5", "eslint-plugin-html": "7.1.0", "eslint-plugin-import": "2.27.5", @@ -16372,9 +16372,10 @@ } }, "node_modules/eslint-config-prettier": { - "version": "8.9.0", + "version": "9.0.0", + "resolved": "https://registry.npmjs.org/eslint-config-prettier/-/eslint-config-prettier-9.0.0.tgz", + "integrity": "sha512-IcJsTkJae2S35pRsRAwoCE+925rJJStOdkKnLVgtE+tEpqU0EVVM7OqrwxqgptKdX29NUwC82I5pXsGFIgSevw==", "dev": true, - "license": "MIT", "bin": { "eslint-config-prettier": "bin/cli.js" }, diff --git a/package.json b/package.json index 8858debdc..b983c2dda 100644 --- a/package.json +++ b/package.json @@ -86,7 +86,7 @@ "element-internals-polyfill": "1.3.5", "esbuild": "0.17.18", "eslint": "8.45.0", - "eslint-config-prettier": "8.9.0", + "eslint-config-prettier": "9.0.0", "eslint-import-resolver-typescript": "3.5.5", "eslint-plugin-html": "7.1.0", "eslint-plugin-import": "2.27.5", From 165e1dcfc704129b1e491ac0dda7b5b695a0b0b4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jesper=20M=C3=B8ller=20Jensen?= <26099018+JesmoDev@users.noreply.github.com> Date: Tue, 10 Oct 2023 18:53:23 +1300 Subject: [PATCH 4/6] uui tab group --- packages/uui-tabs/lib/uui-tab-group.element.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/uui-tabs/lib/uui-tab-group.element.ts b/packages/uui-tabs/lib/uui-tab-group.element.ts index cde096957..e4d535a7d 100644 --- a/packages/uui-tabs/lib/uui-tab-group.element.ts +++ b/packages/uui-tabs/lib/uui-tab-group.element.ts @@ -4,9 +4,9 @@ import { property, query, queryAssignedElements } from 'lit/decorators.js'; import { repeat } from 'lit/directives/repeat.js'; import type { UUIButtonElement } from '@umbraco-ui/uui-button/lib'; -import '@umbraco-ui/uui-button/lib/uui-button.element'; -import '@umbraco-ui/uui-popover-container/lib/uui-popover-container.element'; -import '@umbraco-ui/uui-symbol-more/lib/uui-symbol-more.element'; +import '@umbraco-ui/uui-button/lib/uui-button.element.js'; +import '@umbraco-ui/uui-popover-container/lib/uui-popover-container.element.js'; +import '@umbraco-ui/uui-symbol-more/lib/uui-symbol-more.element.js'; import { UUITabElement } from './uui-tab.element'; From e2263869b21c097fa50091fd49dcf93a8b787862 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jesper=20M=C3=B8ller=20Jensen?= <26099018+JesmoDev@users.noreply.github.com> Date: Tue, 10 Oct 2023 20:14:42 +1300 Subject: [PATCH 5/6] fix imports --- packages/uui-tabs/lib/uui-tab-group.element.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/uui-tabs/lib/uui-tab-group.element.ts b/packages/uui-tabs/lib/uui-tab-group.element.ts index e4d535a7d..66e7df8b0 100644 --- a/packages/uui-tabs/lib/uui-tab-group.element.ts +++ b/packages/uui-tabs/lib/uui-tab-group.element.ts @@ -4,9 +4,9 @@ import { property, query, queryAssignedElements } from 'lit/decorators.js'; import { repeat } from 'lit/directives/repeat.js'; import type { UUIButtonElement } from '@umbraco-ui/uui-button/lib'; -import '@umbraco-ui/uui-button/lib/uui-button.element.js'; -import '@umbraco-ui/uui-popover-container/lib/uui-popover-container.element.js'; -import '@umbraco-ui/uui-symbol-more/lib/uui-symbol-more.element.js'; +import '@umbraco-ui/uui-button/lib'; +import '@umbraco-ui/uui-popover-container/lib'; +import '@umbraco-ui/uui-symbol-more/lib'; import { UUITabElement } from './uui-tab.element'; From 6447b59c7b34bc6f493d1c71273b9f03456dab6d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jesper=20M=C3=B8ller=20Jensen?= <26099018+JesmoDev@users.noreply.github.com> Date: Tue, 10 Oct 2023 20:17:31 +1300 Subject: [PATCH 6/6] add dependencies --- packages/uui-tabs/package.json | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/uui-tabs/package.json b/packages/uui-tabs/package.json index 483a8782e..dbe84a8c1 100644 --- a/packages/uui-tabs/package.json +++ b/packages/uui-tabs/package.json @@ -30,7 +30,10 @@ "custom-elements.json" ], "dependencies": { - "@umbraco-ui/uui-base": "1.5.0-rc.0" + "@umbraco-ui/uui-base": "1.5.0-rc.0", + "@umbraco-ui/uui-button": "1.5.0-rc.0", + "@umbraco-ui/uui-popover-container": "1.5.0-rc.0", + "@umbraco-ui/uui-symbol-more": "1.5.0-rc.0" }, "scripts": { "build": "npm run analyze && tsc --build --force && rollup -c rollup.config.js",