diff --git a/CHANGELOG.md b/CHANGELOG.md index 4b2a5d80..b1f86662 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,17 @@ --- +#### `5.2.22` + +- chore(dependencies): update +- refactor(collapse): input signals, host bindings +- refactor(navbar): input signals, host bindings +- refactor(icon.directive): host binding innerHtml +- refactor(offcanvas): minor fixes +- refactor(sidebar-nav): minor fixes + +--- + #### `5.2.21` - chore(dependencies): update diff --git a/package-lock.json b/package-lock.json index 132c5fc9..a0c337b4 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,42 +1,42 @@ { "name": "coreui-angular-dev", - "version": "5.2.21", + "version": "5.2.22", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "coreui-angular-dev", - "version": "5.2.21", - "license": "MIT", - "dependencies": { - "@angular/animations": "^18.2.8", - "@angular/cdk": "^18.2.9", - "@angular/common": "^18.2.8", - "@angular/compiler": "^18.2.8", - "@angular/core": "^18.2.8", - "@angular/forms": "^18.2.8", - "@angular/localize": "^18.2.8", - "@angular/platform-browser": "^18.2.8", - "@angular/platform-browser-dynamic": "^18.2.8", - "@angular/router": "^18.2.8", + "version": "5.2.22", + "license": "MIT", + "dependencies": { + "@angular/animations": "^18.2.9", + "@angular/cdk": "^18.2.10", + "@angular/common": "^18.2.9", + "@angular/compiler": "^18.2.9", + "@angular/core": "^18.2.9", + "@angular/forms": "^18.2.9", + "@angular/localize": "^18.2.9", + "@angular/platform-browser": "^18.2.9", + "@angular/platform-browser-dynamic": "^18.2.9", + "@angular/router": "^18.2.9", "@coreui/chartjs": "^4.0.0", "@coreui/icons": "^3.0.1", "@popperjs/core": "~2.11.8", - "chart.js": "^4.4.5", + "chart.js": "^4.4.6", "lodash-es": "^4.17.21", "rxjs": "~7.8.1", "tslib": "^2.8.0", "zone.js": "~0.14.10" }, "devDependencies": { - "@angular-devkit/build-angular": "^18.2.9", - "@angular-devkit/schematics": "^18.2.9", - "@angular/cli": "^18.2.9", - "@angular/compiler-cli": "^18.2.8", - "@angular/language-service": "^18.2.8", + "@angular-devkit/build-angular": "^18.2.10", + "@angular-devkit/schematics": "^18.2.10", + "@angular/cli": "^18.2.10", + "@angular/compiler-cli": "^18.2.9", + "@angular/language-service": "^18.2.9", "@types/jasmine": "^5.1.4", "@types/lodash-es": "^4.17.12", - "@types/node": "^20.16.13", + "@types/node": "^20.17.1", "angular-eslint": "~18.4.0", "copyfiles": "^2.4.1", "eslint": "^9.13.0", @@ -49,7 +49,7 @@ "ng-packagr": "^18.2.1", "prettier": "^3.3.3", "typescript": "~5.5.4", - "typescript-eslint": "~8.10.0" + "typescript-eslint": "~8.12.0" }, "engines": { "node": "^20.11.1 || >=22.0.0", @@ -70,13 +70,13 @@ } }, "node_modules/@angular-devkit/architect": { - "version": "0.1802.9", - "resolved": "https://registry.npmjs.org/@angular-devkit/architect/-/architect-0.1802.9.tgz", - "integrity": "sha512-fubJf4WC/t3ITy+tyjI4/CKKwUP4XJTmV+Y0nyPcrkcthVyUcIpZB74NlUOvg6WECiPQuIc+CtoAaA9X5+RQ5Q==", + "version": "0.1802.10", + "resolved": "https://registry.npmjs.org/@angular-devkit/architect/-/architect-0.1802.10.tgz", + "integrity": "sha512-/xudcHK2s4J/GcL6qyobmGaWMHQcYLSMqCaWMT+nK6I6tu9VEAj/p3R83Tzx8B/eKi31Pz499uHw9pmqdtbafg==", "dev": true, "license": "MIT", "dependencies": { - "@angular-devkit/core": "18.2.9", + "@angular-devkit/core": "18.2.10", "rxjs": "7.8.1" }, "engines": { @@ -86,17 +86,17 @@ } }, "node_modules/@angular-devkit/build-angular": { - "version": "18.2.9", - "resolved": "https://registry.npmjs.org/@angular-devkit/build-angular/-/build-angular-18.2.9.tgz", - "integrity": "sha512-d4W6t9vBozFUmOP2VvihMcSg/zgr3AvJY6/b7OPuATlK+W3P6tmsqxGIQ6eKc1TxXeu3lWhi14mV2pPykfrwfA==", + "version": "18.2.10", + "resolved": "https://registry.npmjs.org/@angular-devkit/build-angular/-/build-angular-18.2.10.tgz", + "integrity": "sha512-47XgJ5fdIqlZUFWAo/XtNsh3y597DtLZWvfsnwShw6/TgyiV0rbL1Z24Rn2TCV1D/b3VhLutAIIZ/i5O5BirxQ==", "dev": true, "license": "MIT", "dependencies": { "@ampproject/remapping": "2.3.0", - "@angular-devkit/architect": "0.1802.9", - "@angular-devkit/build-webpack": "0.1802.9", - "@angular-devkit/core": "18.2.9", - "@angular/build": "18.2.9", + "@angular-devkit/architect": "0.1802.10", + "@angular-devkit/build-webpack": "0.1802.10", + "@angular-devkit/core": "18.2.10", + "@angular/build": "18.2.10", "@babel/core": "7.25.2", "@babel/generator": "7.25.0", "@babel/helper-annotate-as-pure": "7.24.7", @@ -107,7 +107,7 @@ "@babel/preset-env": "7.25.3", "@babel/runtime": "7.25.0", "@discoveryjs/json-ext": "0.6.1", - "@ngtools/webpack": "18.2.9", + "@ngtools/webpack": "18.2.10", "@vitejs/plugin-basic-ssl": "1.1.0", "ansi-colors": "4.1.3", "autoprefixer": "10.4.20", @@ -118,7 +118,7 @@ "css-loader": "7.1.2", "esbuild-wasm": "0.23.0", "fast-glob": "3.3.2", - "http-proxy-middleware": "3.0.0", + "http-proxy-middleware": "3.0.3", "https-proxy-agent": "7.0.5", "istanbul-lib-instrument": "6.0.3", "jsonc-parser": "3.3.1", @@ -222,13 +222,13 @@ "license": "0BSD" }, "node_modules/@angular-devkit/build-webpack": { - "version": "0.1802.9", - "resolved": "https://registry.npmjs.org/@angular-devkit/build-webpack/-/build-webpack-0.1802.9.tgz", - "integrity": "sha512-p7xNGo5ZTV/Z0Rk+q2/E68QQLw9VT33kauDh6s010jIeBLrOwMo74JpzXMSFttQo5O4bLKP8IORzIM+0q7Uzjg==", + "version": "0.1802.10", + "resolved": "https://registry.npmjs.org/@angular-devkit/build-webpack/-/build-webpack-0.1802.10.tgz", + "integrity": "sha512-WRftK/RJ9rBDDmkx5IAtIpyNo0DJiMfgGUTuZNpNUaJfSfGeaSZYgC7o1++axMchID8pncmI3Hr8L8gaP94WQg==", "dev": true, "license": "MIT", "dependencies": { - "@angular-devkit/architect": "0.1802.9", + "@angular-devkit/architect": "0.1802.10", "rxjs": "7.8.1" }, "engines": { @@ -242,9 +242,9 @@ } }, "node_modules/@angular-devkit/core": { - "version": "18.2.9", - "resolved": "https://registry.npmjs.org/@angular-devkit/core/-/core-18.2.9.tgz", - "integrity": "sha512-bsVt//5E0ua7FZfO0dCF/qGGY6KQD34/bNGyRu5B6HedimpdU2/0PGDptksU5v3yKEc9gNw0xC6mT0UsY/R9pA==", + "version": "18.2.10", + "resolved": "https://registry.npmjs.org/@angular-devkit/core/-/core-18.2.10.tgz", + "integrity": "sha512-LFqiNdraBujg8e1lhuB0bkFVAoIbVbeXXwfoeROKH60OPbP8tHdgV6sFTqU7UGBKA+b+bYye70KFTG2Ys8QzKQ==", "dev": true, "license": "MIT", "dependencies": { @@ -270,13 +270,13 @@ } }, "node_modules/@angular-devkit/schematics": { - "version": "18.2.9", - "resolved": "https://registry.npmjs.org/@angular-devkit/schematics/-/schematics-18.2.9.tgz", - "integrity": "sha512-aIY5/IomDOINGCtFYi77uo0acDpdQNNCighfBBUGEBNMQ1eE3oGNGpLAH/qWeuxJndgmxrdKsvws9DdT46kLig==", + "version": "18.2.10", + "resolved": "https://registry.npmjs.org/@angular-devkit/schematics/-/schematics-18.2.10.tgz", + "integrity": "sha512-EIm/yCYg3ZYPsPYJxXRX5F6PofJCbNQ5rZEuQEY09vy+ZRTqGezH0qoUP5WxlYeJrjiRLYqADI9WtVNzDyaD4w==", "dev": true, "license": "MIT", "dependencies": { - "@angular-devkit/core": "18.2.9", + "@angular-devkit/core": "18.2.10", "jsonc-parser": "3.3.1", "magic-string": "0.30.11", "ora": "5.4.1", @@ -390,9 +390,9 @@ } }, "node_modules/@angular/animations": { - "version": "18.2.8", - "resolved": "https://registry.npmjs.org/@angular/animations/-/animations-18.2.8.tgz", - "integrity": "sha512-dMSn2hg70siv3lhP+vqhMbgc923xw6XBUvnpCPEzhZqFHvPXfh/LubmsD5RtqHmjWebXtgVcgS+zg3Gq3jB2lg==", + "version": "18.2.9", + "resolved": "https://registry.npmjs.org/@angular/animations/-/animations-18.2.9.tgz", + "integrity": "sha512-GAsTKENoTRVKgXX4ACBMMTp8SW4rW8u637uLag+ttJV2XBzC3YJlw5m6b/W4cdrmqZjztoEwUjR6CUTjBqMujQ==", "license": "MIT", "dependencies": { "tslib": "^2.3.0" @@ -401,18 +401,18 @@ "node": "^18.19.1 || ^20.11.1 || >=22.0.0" }, "peerDependencies": { - "@angular/core": "18.2.8" + "@angular/core": "18.2.9" } }, "node_modules/@angular/build": { - "version": "18.2.9", - "resolved": "https://registry.npmjs.org/@angular/build/-/build-18.2.9.tgz", - "integrity": "sha512-o1hOEM2e6ARy+ck2Pohl0d/RFgbbXTw6/hTLAj3CBKjtqAGStRaVF2UlJjhi+xOxlfsOPuJJc9IpzLBteku+Ag==", + "version": "18.2.10", + "resolved": "https://registry.npmjs.org/@angular/build/-/build-18.2.10.tgz", + "integrity": "sha512-YFBKvAyC5sH17yRYcx7VHCtJ4KUg7xCjCQ4Pe16kiTvW6vuYsgU6Btyti0Qgewd7XaWpTM8hk8N6hE4Z0hpflw==", "dev": true, "license": "MIT", "dependencies": { "@ampproject/remapping": "2.3.0", - "@angular-devkit/architect": "0.1802.9", + "@angular-devkit/architect": "0.1802.10", "@babel/core": "7.25.2", "@babel/helper-annotate-as-pure": "7.24.7", "@babel/helper-split-export-declaration": "7.24.7", @@ -474,9 +474,9 @@ } }, "node_modules/@angular/cdk": { - "version": "18.2.9", - "resolved": "https://registry.npmjs.org/@angular/cdk/-/cdk-18.2.9.tgz", - "integrity": "sha512-hV2dXpvy2TLwCsRtI/ZXkb2EoaJiellRr+kbcnKwO15LFoz3mTAOhKtsvu7yOyURkaPiI605qiIZrPP4zLL1qw==", + "version": "18.2.10", + "resolved": "https://registry.npmjs.org/@angular/cdk/-/cdk-18.2.10.tgz", + "integrity": "sha512-Weh0slrfWNp5N6UO4m3tXzs2QBFexNsnJf1dq0oaLDBgfkuqUmxdCkurSv5+lWZRkTPLYmd/hQeJpvrhxMCleg==", "license": "MIT", "dependencies": { "tslib": "^2.3.0" @@ -491,18 +491,18 @@ } }, "node_modules/@angular/cli": { - "version": "18.2.9", - "resolved": "https://registry.npmjs.org/@angular/cli/-/cli-18.2.9.tgz", - "integrity": "sha512-ejTIqwvPABwK7MtVmI2qWbEaMhhbHNsq0NPzl1hwLtkrLbjdDrEVv0Wy+gN0xqrT9NyCPl4AmNLz/xuYTzgU5g==", + "version": "18.2.10", + "resolved": "https://registry.npmjs.org/@angular/cli/-/cli-18.2.10.tgz", + "integrity": "sha512-qW/F3XVZMzzenFzbn+7FGpw8GOt9qW8UxBtYya7gUNdWlcsgGUk+ZaGC2OLbfI5gX6pchW4TOPMsDSMeaCEI2Q==", "dev": true, "license": "MIT", "dependencies": { - "@angular-devkit/architect": "0.1802.9", - "@angular-devkit/core": "18.2.9", - "@angular-devkit/schematics": "18.2.9", + "@angular-devkit/architect": "0.1802.10", + "@angular-devkit/core": "18.2.10", + "@angular-devkit/schematics": "18.2.10", "@inquirer/prompts": "5.3.8", "@listr2/prompt-adapter-inquirer": "2.0.15", - "@schematics/angular": "18.2.9", + "@schematics/angular": "18.2.10", "@yarnpkg/lockfile": "1.1.0", "ini": "4.1.3", "jsonc-parser": "3.3.1", @@ -525,9 +525,9 @@ } }, "node_modules/@angular/common": { - "version": "18.2.8", - "resolved": "https://registry.npmjs.org/@angular/common/-/common-18.2.8.tgz", - "integrity": "sha512-TYsKtE5nVaIScWSLGSO34Skc+s3hB/BujSddnfQHoNFvPT/WR0dfmdlpVCTeLj+f50htFoMhW11tW99PbK+whQ==", + "version": "18.2.9", + "resolved": "https://registry.npmjs.org/@angular/common/-/common-18.2.9.tgz", + "integrity": "sha512-Opi6DVaU0aGyJqLk5jPmeYx559fp3afj4wuxM5aDzV4KEVGDVbNCpO0hMuwHZ6rtCjHhv1fQthgS48qoiQ6LKw==", "license": "MIT", "dependencies": { "tslib": "^2.3.0" @@ -536,14 +536,14 @@ "node": "^18.19.1 || ^20.11.1 || >=22.0.0" }, "peerDependencies": { - "@angular/core": "18.2.8", + "@angular/core": "18.2.9", "rxjs": "^6.5.3 || ^7.4.0" } }, "node_modules/@angular/compiler": { - "version": "18.2.8", - "resolved": "https://registry.npmjs.org/@angular/compiler/-/compiler-18.2.8.tgz", - "integrity": "sha512-JRedHNfK1CCPVyeGQB5w3WBYqMA6X8Q240CkvjlGfn0pVXihf9DWk3nkSQJVgYxpvpHfxdgjaYZ5IpMzlkmkhw==", + "version": "18.2.9", + "resolved": "https://registry.npmjs.org/@angular/compiler/-/compiler-18.2.9.tgz", + "integrity": "sha512-fchbcbsyTOd/qHGy+yPEmE1p10OTNEjGrWHQzUbf3xdlm23EvxHTitHh8i6EBdwYnM5zz0IIBhltP8tt89oeYw==", "license": "MIT", "dependencies": { "tslib": "^2.3.0" @@ -552,7 +552,7 @@ "node": "^18.19.1 || ^20.11.1 || >=22.0.0" }, "peerDependencies": { - "@angular/core": "18.2.8" + "@angular/core": "18.2.9" }, "peerDependenciesMeta": { "@angular/core": { @@ -561,9 +561,9 @@ } }, "node_modules/@angular/compiler-cli": { - "version": "18.2.8", - "resolved": "https://registry.npmjs.org/@angular/compiler-cli/-/compiler-cli-18.2.8.tgz", - "integrity": "sha512-OksDE4LWQUCcIvMjtZF7eiDCdIMrcMMpC1+Q0PIYi7KmnqXFGs4/Y0NdJvtn/LrQznzz5WaKM3ZDVNZTRX4wmw==", + "version": "18.2.9", + "resolved": "https://registry.npmjs.org/@angular/compiler-cli/-/compiler-cli-18.2.9.tgz", + "integrity": "sha512-4iMoRvyMmq/fdI/4Gob9HKjL/jvTlCjbS4kouAYHuGO9w9dmUhi1pY1z+mALtCEl9/Q8CzU2W8e5cU2xtV4nVg==", "license": "MIT", "dependencies": { "@babel/core": "7.25.2", @@ -584,7 +584,7 @@ "node": "^18.19.1 || ^20.11.1 || >=22.0.0" }, "peerDependencies": { - "@angular/compiler": "18.2.8", + "@angular/compiler": "18.2.9", "typescript": ">=5.4 <5.6" } }, @@ -617,9 +617,9 @@ } }, "node_modules/@angular/core": { - "version": "18.2.8", - "resolved": "https://registry.npmjs.org/@angular/core/-/core-18.2.8.tgz", - "integrity": "sha512-NwIuX/Iby1jT6Iv1/s6S3wOFf8xfuQR3MPGvKhGgNtjXLbHG+TXceK9+QPZC0s9/Z8JR/hz+li34B79GrIKgUg==", + "version": "18.2.9", + "resolved": "https://registry.npmjs.org/@angular/core/-/core-18.2.9.tgz", + "integrity": "sha512-h9/Bzo/7LTPzzh9I/1Gk8TWOXPGeHt3jLlnYrCh2KbrWbTErNtW0V3ad5I3Zv+K2Z7RSl9Z3D3Y6ILH796N4ZA==", "license": "MIT", "dependencies": { "tslib": "^2.3.0" @@ -633,9 +633,9 @@ } }, "node_modules/@angular/forms": { - "version": "18.2.8", - "resolved": "https://registry.npmjs.org/@angular/forms/-/forms-18.2.8.tgz", - "integrity": "sha512-JCLki7KC6D5vF6dE6yGlBmW33khIgpHs8N9SzuiJtkQqNDTIQA8cPsGV6qpLpxflxASynQOX5lDkWYdQyfm77Q==", + "version": "18.2.9", + "resolved": "https://registry.npmjs.org/@angular/forms/-/forms-18.2.9.tgz", + "integrity": "sha512-yyN5dG60CXH6MRte8rv4aGUTeNOMz/pUV7rVxittpjN7tPHfGEL9Xz89Or90Aa1QiHuBmHFk+9A39s03aO1rDQ==", "license": "MIT", "dependencies": { "tslib": "^2.3.0" @@ -644,16 +644,16 @@ "node": "^18.19.1 || ^20.11.1 || >=22.0.0" }, "peerDependencies": { - "@angular/common": "18.2.8", - "@angular/core": "18.2.8", - "@angular/platform-browser": "18.2.8", + "@angular/common": "18.2.9", + "@angular/core": "18.2.9", + "@angular/platform-browser": "18.2.9", "rxjs": "^6.5.3 || ^7.4.0" } }, "node_modules/@angular/language-service": { - "version": "18.2.8", - "resolved": "https://registry.npmjs.org/@angular/language-service/-/language-service-18.2.8.tgz", - "integrity": "sha512-IueQ57CPP0Dt0z2n8B1A6JTwTq6m/AJVObZzrkSfXlzY1rY2qRuTJmAbZpTJ3iAxVzNYoaGh+NFHmJL8fRiXKQ==", + "version": "18.2.9", + "resolved": "https://registry.npmjs.org/@angular/language-service/-/language-service-18.2.9.tgz", + "integrity": "sha512-vC9la5VpvfX27ept36rlc42nGxDak7YfbWtSoZUageyZJUWyIEAvW8rNNPEvoO86RLi011/HmyyIr2GSQLKvxA==", "dev": true, "license": "MIT", "engines": { @@ -661,9 +661,9 @@ } }, "node_modules/@angular/localize": { - "version": "18.2.8", - "resolved": "https://registry.npmjs.org/@angular/localize/-/localize-18.2.8.tgz", - "integrity": "sha512-1T7aXEdgVyeYnHOfQUuIDO8Lsamg1ZLrJrA5zUv61asPJp6HCcMjXy9vDQ1XvHm5+CdDjKk/rczlN4lSMZ0QRw==", + "version": "18.2.9", + "resolved": "https://registry.npmjs.org/@angular/localize/-/localize-18.2.9.tgz", + "integrity": "sha512-CcqyVqV/GyyBe6Cndm2WRM5dyJwjDQ0F7QRGwO3jYWFSYF0h/f0ZjZVH4ra1IX+AwEEicOXW1ig3FBbeOqHPug==", "license": "MIT", "dependencies": { "@babel/core": "7.25.2", @@ -680,14 +680,14 @@ "node": "^18.19.1 || ^20.11.1 || >=22.0.0" }, "peerDependencies": { - "@angular/compiler": "18.2.8", - "@angular/compiler-cli": "18.2.8" + "@angular/compiler": "18.2.9", + "@angular/compiler-cli": "18.2.9" } }, "node_modules/@angular/platform-browser": { - "version": "18.2.8", - "resolved": "https://registry.npmjs.org/@angular/platform-browser/-/platform-browser-18.2.8.tgz", - "integrity": "sha512-EPai4ZPqSq3ilLJUC85kPi9wo5j5suQovwtgRyjM/75D9Qy4TV19g8hkVM5Co/zrltO8a2G6vDscCNI5BeGw2A==", + "version": "18.2.9", + "resolved": "https://registry.npmjs.org/@angular/platform-browser/-/platform-browser-18.2.9.tgz", + "integrity": "sha512-UNu6XjK0SV35FFe55yd1yefZI8tzflVKzev/RzC31XngrczhlH0+WCbae4rG1XJULzJwJ1R1p7gqq4+ktEczRQ==", "license": "MIT", "dependencies": { "tslib": "^2.3.0" @@ -696,9 +696,9 @@ "node": "^18.19.1 || ^20.11.1 || >=22.0.0" }, "peerDependencies": { - "@angular/animations": "18.2.8", - "@angular/common": "18.2.8", - "@angular/core": "18.2.8" + "@angular/animations": "18.2.9", + "@angular/common": "18.2.9", + "@angular/core": "18.2.9" }, "peerDependenciesMeta": { "@angular/animations": { @@ -707,9 +707,9 @@ } }, "node_modules/@angular/platform-browser-dynamic": { - "version": "18.2.8", - "resolved": "https://registry.npmjs.org/@angular/platform-browser-dynamic/-/platform-browser-dynamic-18.2.8.tgz", - "integrity": "sha512-poZoapDqyN/rxGKQ3C6esdPiPLMkSpP2v12hoEa12KHgfPk7T1e+a+NMyJjV8HeOY3WyvL7tGRhW0NPTajTkhw==", + "version": "18.2.9", + "resolved": "https://registry.npmjs.org/@angular/platform-browser-dynamic/-/platform-browser-dynamic-18.2.9.tgz", + "integrity": "sha512-cUTB8Jc3I/fu2UKv/PJmNGQGvKyyTo8ln4GUX3EJ4wUHzgkrU0s4x7DNok0Ql8FZKs5dLR8C0xVbG7Dv/ViPdw==", "license": "MIT", "dependencies": { "tslib": "^2.3.0" @@ -718,16 +718,16 @@ "node": "^18.19.1 || ^20.11.1 || >=22.0.0" }, "peerDependencies": { - "@angular/common": "18.2.8", - "@angular/compiler": "18.2.8", - "@angular/core": "18.2.8", - "@angular/platform-browser": "18.2.8" + "@angular/common": "18.2.9", + "@angular/compiler": "18.2.9", + "@angular/core": "18.2.9", + "@angular/platform-browser": "18.2.9" } }, "node_modules/@angular/router": { - "version": "18.2.8", - "resolved": "https://registry.npmjs.org/@angular/router/-/router-18.2.8.tgz", - "integrity": "sha512-L+olYgxIiBq+tbfayVI0cv1yOuymsw33msnGC2l/vpc9sSVfqGzESFnB4yMVU3vHtE9v6v2Y6O+iV44/b79W/g==", + "version": "18.2.9", + "resolved": "https://registry.npmjs.org/@angular/router/-/router-18.2.9.tgz", + "integrity": "sha512-D0rSrMf/sbhr5yQgz+LNBxdv1BR3S4pYDj1Exq6yVRKX8HSbjc5hxe/44VaOEKBh8StJ6GRiNOMoIcDt73Jang==", "license": "MIT", "dependencies": { "tslib": "^2.3.0" @@ -736,9 +736,9 @@ "node": "^18.19.1 || ^20.11.1 || >=22.0.0" }, "peerDependencies": { - "@angular/common": "18.2.8", - "@angular/core": "18.2.8", - "@angular/platform-browser": "18.2.8", + "@angular/common": "18.2.9", + "@angular/core": "18.2.9", + "@angular/platform-browser": "18.2.9", "rxjs": "^6.5.3 || ^7.4.0" } }, @@ -4035,9 +4035,9 @@ ] }, "node_modules/@ngtools/webpack": { - "version": "18.2.9", - "resolved": "https://registry.npmjs.org/@ngtools/webpack/-/webpack-18.2.9.tgz", - "integrity": "sha512-/apDvs4qevjSWoYw3h3/c/mILFrf2EgCJfBy9f3E7PEgi2tjifOIszBRrLQkVpeHAaFgEH8zKS2ol0hAmOl8sw==", + "version": "18.2.10", + "resolved": "https://registry.npmjs.org/@ngtools/webpack/-/webpack-18.2.10.tgz", + "integrity": "sha512-CGYr8rdM5ntdb4kLUAhrLBPrhJQ4KBPo3KMT6qJE/S+jJJn5zHzedpuGFOCVhC1Siw+n1pOBSI8leTRJIW/eCQ==", "dev": true, "license": "MIT", "engines": { @@ -4685,14 +4685,14 @@ } }, "node_modules/@schematics/angular": { - "version": "18.2.9", - "resolved": "https://registry.npmjs.org/@schematics/angular/-/angular-18.2.9.tgz", - "integrity": "sha512-LlMHZQ6f8zrqSK24OBXi4u2MTNHNu9ZN6JXpbElq0bz/9QkUR2zy+Kk2wLpPxCwXYTZby7/xgHiTzXvG+zTdhw==", + "version": "18.2.10", + "resolved": "https://registry.npmjs.org/@schematics/angular/-/angular-18.2.10.tgz", + "integrity": "sha512-2pDHT4aSzfs8Up4RQmHHuFd5FeuUebS1ZJwyt46MfXzRMFtzUZV/JKsIvDqyMwnkvFfLvgJyTCkl8JGw5jQObg==", "dev": true, "license": "MIT", "dependencies": { - "@angular-devkit/core": "18.2.9", - "@angular-devkit/schematics": "18.2.9", + "@angular-devkit/core": "18.2.10", + "@angular-devkit/schematics": "18.2.10", "jsonc-parser": "3.3.1" }, "engines": { @@ -4946,9 +4946,9 @@ } }, "node_modules/@types/express-serve-static-core": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/@types/express-serve-static-core/-/express-serve-static-core-5.0.0.tgz", - "integrity": "sha512-AbXMTZGt40T+KON9/Fdxx0B2WK5hsgxcfXJLr5bFpZ7b4JCex2WyQPTEKdXqfHiY5nKKBScZ7yCoO6Pvgxfvnw==", + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/@types/express-serve-static-core/-/express-serve-static-core-5.0.1.tgz", + "integrity": "sha512-CRICJIl0N5cXDONAdlTv5ShATZ4HEwk6kDDIW2/w9qOWKg+NU/5F8wYRWCrONad0/UKkloNSmmyN/wX4rtpbVA==", "dev": true, "license": "MIT", "dependencies": { @@ -5037,9 +5037,9 @@ } }, "node_modules/@types/node": { - "version": "20.16.13", - "resolved": "https://registry.npmjs.org/@types/node/-/node-20.16.13.tgz", - "integrity": "sha512-GjQ7im10B0labo8ZGXDGROUl9k0BNyDgzfGpb4g/cl+4yYDWVKcozANF4FGr4/p0O/rAkQClM6Wiwkije++1Tg==", + "version": "20.17.1", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.17.1.tgz", + "integrity": "sha512-j2VlPv1NnwPJbaCNv69FO/1z4lId0QmGvpT41YxitRtWlg96g/j8qcv2RKsLKe2F6OJgyXhupN1Xo17b2m139Q==", "dev": true, "license": "MIT", "dependencies": { @@ -5145,17 +5145,17 @@ } }, "node_modules/@typescript-eslint/eslint-plugin": { - "version": "8.10.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.10.0.tgz", - "integrity": "sha512-phuB3hoP7FFKbRXxjl+DRlQDuJqhpOnm5MmtROXyWi3uS/Xg2ZXqiQfcG2BJHiN4QKyzdOJi3NEn/qTnjUlkmQ==", + "version": "8.12.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.12.0.tgz", + "integrity": "sha512-uRqchEKT0/OwDePTwCjSFO2aH4zccdeQ7DgAzM/8fuXc+PAXvpdMRbuo+oCmK1lSfXssk2UUBNiWihobKxQp/g==", "dev": true, "license": "MIT", "dependencies": { "@eslint-community/regexpp": "^4.10.0", - "@typescript-eslint/scope-manager": "8.10.0", - "@typescript-eslint/type-utils": "8.10.0", - "@typescript-eslint/utils": "8.10.0", - "@typescript-eslint/visitor-keys": "8.10.0", + "@typescript-eslint/scope-manager": "8.12.0", + "@typescript-eslint/type-utils": "8.12.0", + "@typescript-eslint/utils": "8.12.0", + "@typescript-eslint/visitor-keys": "8.12.0", "graphemer": "^1.4.0", "ignore": "^5.3.1", "natural-compare": "^1.4.0", @@ -5179,16 +5179,16 @@ } }, "node_modules/@typescript-eslint/parser": { - "version": "8.10.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-8.10.0.tgz", - "integrity": "sha512-E24l90SxuJhytWJ0pTQydFT46Nk0Z+bsLKo/L8rtQSL93rQ6byd1V/QbDpHUTdLPOMsBCcYXZweADNCfOCmOAg==", + "version": "8.12.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-8.12.0.tgz", + "integrity": "sha512-7U20duDQWAOhCk2VtyY41Vor/CJjiEW063Zel9aoRXq89FQ/jr+0e0m3kxh9Sk5SFW9B1AblVIBtXd+1xQ1NWQ==", "dev": true, "license": "BSD-2-Clause", "dependencies": { - "@typescript-eslint/scope-manager": "8.10.0", - "@typescript-eslint/types": "8.10.0", - "@typescript-eslint/typescript-estree": "8.10.0", - "@typescript-eslint/visitor-keys": "8.10.0", + "@typescript-eslint/scope-manager": "8.12.0", + "@typescript-eslint/types": "8.12.0", + "@typescript-eslint/typescript-estree": "8.12.0", + "@typescript-eslint/visitor-keys": "8.12.0", "debug": "^4.3.4" }, "engines": { @@ -5208,14 +5208,14 @@ } }, "node_modules/@typescript-eslint/scope-manager": { - "version": "8.10.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.10.0.tgz", - "integrity": "sha512-AgCaEjhfql9MDKjMUxWvH7HjLeBqMCBfIaBbzzIcBbQPZE7CPh1m6FF+L75NUMJFMLYhCywJXIDEMa3//1A0dw==", + "version": "8.12.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.12.0.tgz", + "integrity": "sha512-jbuCXK18iEshRFUtlCIMAmOKA6OAsKjo41UcXPqx7ZWh2b4cmg6pV/pNcZSB7oW9mtgF95yizr7Jnwt3IUD2pA==", "dev": true, "license": "MIT", "dependencies": { - "@typescript-eslint/types": "8.10.0", - "@typescript-eslint/visitor-keys": "8.10.0" + "@typescript-eslint/types": "8.12.0", + "@typescript-eslint/visitor-keys": "8.12.0" }, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -5226,14 +5226,14 @@ } }, "node_modules/@typescript-eslint/type-utils": { - "version": "8.10.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-8.10.0.tgz", - "integrity": "sha512-PCpUOpyQSpxBn230yIcK+LeCQaXuxrgCm2Zk1S+PTIRJsEfU6nJ0TtwyH8pIwPK/vJoA+7TZtzyAJSGBz+s/dg==", + "version": "8.12.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-8.12.0.tgz", + "integrity": "sha512-cHioAZO/nLgyzTmwv7gWIjEKMHSbioKEZqLCaItTn7RvJP1QipuGVwEjPJa6Kv9u9UiUMVAESY9JH186TjKITw==", "dev": true, "license": "MIT", "dependencies": { - "@typescript-eslint/typescript-estree": "8.10.0", - "@typescript-eslint/utils": "8.10.0", + "@typescript-eslint/typescript-estree": "8.12.0", + "@typescript-eslint/utils": "8.12.0", "debug": "^4.3.4", "ts-api-utils": "^1.3.0" }, @@ -5251,9 +5251,9 @@ } }, "node_modules/@typescript-eslint/types": { - "version": "8.10.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.10.0.tgz", - "integrity": "sha512-k/E48uzsfJCRRbGLapdZgrX52csmWJ2rcowwPvOZ8lwPUv3xW6CcFeJAXgx4uJm+Ge4+a4tFOkdYvSpxhRhg1w==", + "version": "8.12.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.12.0.tgz", + "integrity": "sha512-Cc+iNtqBJ492f8KLEmKXe1l6683P0MlFO8Bk1NMphnzVIGH4/Wn9kvandFH+gYR1DDUjH/hgeWRGdO5Tj8gjYg==", "dev": true, "license": "MIT", "engines": { @@ -5265,14 +5265,14 @@ } }, "node_modules/@typescript-eslint/typescript-estree": { - "version": "8.10.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.10.0.tgz", - "integrity": "sha512-3OE0nlcOHaMvQ8Xu5gAfME3/tWVDpb/HxtpUZ1WeOAksZ/h/gwrBzCklaGzwZT97/lBbbxJ16dMA98JMEngW4w==", + "version": "8.12.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.12.0.tgz", + "integrity": "sha512-a4koVV7HHVOQWcGb6ZcAlunJnAdwo/CITRbleQBSjq5+2WLoAJQCAAiecvrAdSM+n/man6Ghig5YgdGVIC6xqw==", "dev": true, "license": "BSD-2-Clause", "dependencies": { - "@typescript-eslint/types": "8.10.0", - "@typescript-eslint/visitor-keys": "8.10.0", + "@typescript-eslint/types": "8.12.0", + "@typescript-eslint/visitor-keys": "8.12.0", "debug": "^4.3.4", "fast-glob": "^3.3.2", "is-glob": "^4.0.3", @@ -5294,16 +5294,16 @@ } }, "node_modules/@typescript-eslint/utils": { - "version": "8.10.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.10.0.tgz", - "integrity": "sha512-Oq4uZ7JFr9d1ZunE/QKy5egcDRXT/FrS2z/nlxzPua2VHFtmMvFNDvpq1m/hq0ra+T52aUezfcjGRIB7vNJF9w==", + "version": "8.12.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.12.0.tgz", + "integrity": "sha512-5i1tqLwlf0fpX1j05paNKyIzla/a4Y3Xhh6AFzi0do/LDJLvohtZYaisaTB9kq0D4uBocAxWDTGzNMOCCwIgXA==", "dev": true, "license": "MIT", "dependencies": { "@eslint-community/eslint-utils": "^4.4.0", - "@typescript-eslint/scope-manager": "8.10.0", - "@typescript-eslint/types": "8.10.0", - "@typescript-eslint/typescript-estree": "8.10.0" + "@typescript-eslint/scope-manager": "8.12.0", + "@typescript-eslint/types": "8.12.0", + "@typescript-eslint/typescript-estree": "8.12.0" }, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -5317,13 +5317,13 @@ } }, "node_modules/@typescript-eslint/visitor-keys": { - "version": "8.10.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.10.0.tgz", - "integrity": "sha512-k8nekgqwr7FadWk548Lfph6V3r9OVqjzAIVskE7orMZR23cGJjAOVazsZSJW+ElyjfTM4wx/1g88Mi70DDtG9A==", + "version": "8.12.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.12.0.tgz", + "integrity": "sha512-2rXkr+AtZZLuNY18aUjv5wtB9oUiwY1WnNi7VTsdCdy1m958ULeUKoAegldQTjqpbpNJ5cQ4egR8/bh5tbrKKQ==", "dev": true, "license": "MIT", "dependencies": { - "@typescript-eslint/types": "8.10.0", + "@typescript-eslint/types": "8.12.0", "eslint-visitor-keys": "^3.4.3" }, "engines": { @@ -6349,9 +6349,9 @@ "license": "MIT" }, "node_modules/chart.js": { - "version": "4.4.5", - "resolved": "https://registry.npmjs.org/chart.js/-/chart.js-4.4.5.tgz", - "integrity": "sha512-CVVjg1RYTJV9OCC8WeJPMx8gsV8K6WIyIEQUE3ui4AR9Hfgls9URri6Ja3hyMVBbTF8Q2KFa19PE815gWcWhng==", + "version": "4.4.6", + "resolved": "https://registry.npmjs.org/chart.js/-/chart.js-4.4.6.tgz", + "integrity": "sha512-8Y406zevUPbbIBA/HRk33khEmQPk5+cxeflWE/2rx1NJsjVWMPw/9mSP9rxHP5eqi6LNoPBVMfZHxbwLSgldYA==", "license": "MIT", "dependencies": { "@kurkle/color": "^0.3.0" @@ -7085,6 +7085,7 @@ "version": "0.0.24", "resolved": "https://registry.npmjs.org/critters/-/critters-0.0.24.tgz", "integrity": "sha512-Oyqew0FGM0wYUSNqR0L6AteO5MpMoUU0rhKRieXeiKs+PmRTxiJMyaunYB2KF6fQ3dzChXKCpbFOEJx3OQ1v/Q==", + "deprecated": "Ownership of Critters has moved to the Nuxt team, who will be maintaining the project going forward. If you'd like to keep using Critters, please switch to the actively-maintained fork at https://github.com/danielroe/beasties", "dev": true, "license": "Apache-2.0", "dependencies": { @@ -9187,23 +9188,33 @@ } }, "node_modules/http-proxy-middleware": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/http-proxy-middleware/-/http-proxy-middleware-3.0.0.tgz", - "integrity": "sha512-36AV1fIaI2cWRzHo+rbcxhe3M3jUDCNzc4D5zRl57sEWRAxdXYtw7FSQKYY6PDKssiAKjLYypbssHk+xs/kMXw==", + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/http-proxy-middleware/-/http-proxy-middleware-3.0.3.tgz", + "integrity": "sha512-usY0HG5nyDUwtqpiZdETNbmKtw3QQ1jwYFZ9wi5iHzX2BcILwQKtYDJPo7XHTsu5Z0B2Hj3W9NNnbd+AjFWjqg==", "dev": true, "license": "MIT", "dependencies": { - "@types/http-proxy": "^1.17.10", - "debug": "^4.3.4", + "@types/http-proxy": "^1.17.15", + "debug": "^4.3.6", "http-proxy": "^1.18.1", - "is-glob": "^4.0.1", - "is-plain-obj": "^3.0.0", - "micromatch": "^4.0.5" + "is-glob": "^4.0.3", + "is-plain-object": "^5.0.0", + "micromatch": "^4.0.8" }, "engines": { "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, + "node_modules/http-proxy-middleware/node_modules/is-plain-object": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-5.0.0.tgz", + "integrity": "sha512-VRSzKkbMm5jMDoKLbltAkFQ5Qr7VDiTFGXxYFXXowVj387GeGNOCsOH6Msy00SGZ3Fp84b1Naa1psqgcCIEP5Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/https-proxy-agent": { "version": "7.0.5", "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-7.0.5.tgz", @@ -14903,15 +14914,15 @@ } }, "node_modules/typescript-eslint": { - "version": "8.10.0", - "resolved": "https://registry.npmjs.org/typescript-eslint/-/typescript-eslint-8.10.0.tgz", - "integrity": "sha512-YIu230PeN7z9zpu/EtqCIuRVHPs4iSlqW6TEvjbyDAE3MZsSl2RXBo+5ag+lbABCG8sFM1WVKEXhlQ8Ml8A3Fw==", + "version": "8.12.0", + "resolved": "https://registry.npmjs.org/typescript-eslint/-/typescript-eslint-8.12.0.tgz", + "integrity": "sha512-m8aQM4pqc17dcD3BsQzUqVXkcclCspuCCv7GhYlwMWNYAXFV8xJkn8vUM8YxoR78BY6S+NX/J7rfNVaGNLgXgQ==", "dev": true, "license": "MIT", "dependencies": { - "@typescript-eslint/eslint-plugin": "8.10.0", - "@typescript-eslint/parser": "8.10.0", - "@typescript-eslint/utils": "8.10.0" + "@typescript-eslint/eslint-plugin": "8.12.0", + "@typescript-eslint/parser": "8.12.0", + "@typescript-eslint/utils": "8.12.0" }, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" diff --git a/package.json b/package.json index 1b4aaf9a..99584a32 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "coreui-angular-dev", - "version": "5.2.21", + "version": "5.2.22", "description": "CoreUI Components Library for Angular", "copyright": "Copyright 2024 creativeLabs Łukasz Holeczek", "license": "MIT", @@ -39,34 +39,34 @@ }, "private": true, "dependencies": { - "@angular/animations": "^18.2.8", - "@angular/cdk": "^18.2.9", - "@angular/common": "^18.2.8", - "@angular/compiler": "^18.2.8", - "@angular/core": "^18.2.8", - "@angular/forms": "^18.2.8", - "@angular/localize": "^18.2.8", - "@angular/platform-browser": "^18.2.8", - "@angular/platform-browser-dynamic": "^18.2.8", - "@angular/router": "^18.2.8", + "@angular/animations": "^18.2.9", + "@angular/cdk": "^18.2.10", + "@angular/common": "^18.2.9", + "@angular/compiler": "^18.2.9", + "@angular/core": "^18.2.9", + "@angular/forms": "^18.2.9", + "@angular/localize": "^18.2.9", + "@angular/platform-browser": "^18.2.9", + "@angular/platform-browser-dynamic": "^18.2.9", + "@angular/router": "^18.2.9", "@coreui/chartjs": "^4.0.0", "@coreui/icons": "^3.0.1", "@popperjs/core": "~2.11.8", - "chart.js": "^4.4.5", + "chart.js": "^4.4.6", "lodash-es": "^4.17.21", "rxjs": "~7.8.1", "tslib": "^2.8.0", "zone.js": "~0.14.10" }, "devDependencies": { - "@angular-devkit/build-angular": "^18.2.9", - "@angular-devkit/schematics": "^18.2.9", - "@angular/cli": "^18.2.9", - "@angular/compiler-cli": "^18.2.8", - "@angular/language-service": "^18.2.8", + "@angular-devkit/build-angular": "^18.2.10", + "@angular-devkit/schematics": "^18.2.10", + "@angular/cli": "^18.2.10", + "@angular/compiler-cli": "^18.2.9", + "@angular/language-service": "^18.2.9", "@types/jasmine": "^5.1.4", "@types/lodash-es": "^4.17.12", - "@types/node": "^20.16.13", + "@types/node": "^20.17.1", "angular-eslint": "~18.4.0", "copyfiles": "^2.4.1", "eslint": "^9.13.0", @@ -79,7 +79,7 @@ "ng-packagr": "^18.2.1", "prettier": "^3.3.3", "typescript": "~5.5.4", - "typescript-eslint": "~8.10.0" + "typescript-eslint": "~8.12.0" }, "keywords": [ "angular", diff --git a/projects/coreui-angular-chartjs/package.json b/projects/coreui-angular-chartjs/package.json index 159d16c1..14fc5143 100644 --- a/projects/coreui-angular-chartjs/package.json +++ b/projects/coreui-angular-chartjs/package.json @@ -1,6 +1,6 @@ { "name": "@coreui/angular-chartjs", - "version": "5.2.21", + "version": "5.2.22", "description": "Angular wrapper component for Chart.js", "copyright": "Copyright 2024 creativeLabs Łukasz Holeczek", "license": "MIT", @@ -27,7 +27,7 @@ "peerDependencies": { "@angular/core": "^18.2.0", "@coreui/chartjs": "^4.0.0", - "chart.js": "^4.4.5" + "chart.js": "^4.4.6" }, "dependencies": { "lodash-es": "^4.17.21", diff --git a/projects/coreui-angular/package.json b/projects/coreui-angular/package.json index 6f7e287f..c69c43de 100644 --- a/projects/coreui-angular/package.json +++ b/projects/coreui-angular/package.json @@ -1,6 +1,6 @@ { "name": "@coreui/angular", - "version": "5.2.21", + "version": "5.2.22", "description": "CoreUI Components Library for Angular", "copyright": "Copyright 2024 creativeLabs Łukasz Holeczek", "license": "MIT", @@ -28,8 +28,8 @@ "@angular/common": "^18.2.0", "@angular/core": "^18.2.0", "@angular/router": "^18.2.0", - "@coreui/coreui": "^5.1.2", - "@coreui/icons-angular": "~5.2.21", + "@coreui/coreui": "^5.2.0", + "@coreui/icons-angular": "~5.2.22", "rxjs": "^7.8.1" }, "repository": { diff --git a/projects/coreui-angular/src/lib/collapse/collapse.animations.ts b/projects/coreui-angular/src/lib/collapse/collapse.animations.ts index 68d7df42..4ba17a63 100644 --- a/projects/coreui-angular/src/lib/collapse/collapse.animations.ts +++ b/projects/coreui-angular/src/lib/collapse/collapse.animations.ts @@ -1,24 +1,12 @@ import { animate, animation, style } from '@angular/animations'; -export const expandAnimation = animation([ - animate('{{ time }} {{ easing }}') -]); +export const expandAnimation = animation([animate('{{ time }} {{ easing }}')]); export const collapseAnimation = animation([ style({ height: '*', minHeight: '*' }), - animate('{{ time }} {{ easing }}', - style({ height: 0, minHeight: 0 }) - ) + animate('{{ time }} {{ easing }}', style({ height: 0, minHeight: 0 })) ]); -export const expandHorizontalAnimation = animation([ - animate('{{ time }} {{ easing }}') -]); +export const expandHorizontalAnimation = animation([animate('{{ time }} {{ easing }}')]); -export const collapseHorizontalAnimation = animation([ - // style({ opacity: '*' }), - animate( - '{{ time }} {{ easing }}' - // style({ opacity: 0 }) - ) -]); +export const collapseHorizontalAnimation = animation([animate('{{ time }} {{ easing }}')]); diff --git a/projects/coreui-angular/src/lib/collapse/collapse.directive.spec.ts b/projects/coreui-angular/src/lib/collapse/collapse.directive.spec.ts index 070aefa2..0d278708 100644 --- a/projects/coreui-angular/src/lib/collapse/collapse.directive.spec.ts +++ b/projects/coreui-angular/src/lib/collapse/collapse.directive.spec.ts @@ -1,14 +1,13 @@ import { CollapseDirective } from './collapse.directive'; -import { Component, DebugElement, ElementRef, Renderer2, Type } from '@angular/core'; -import { AnimationBuilder } from '@angular/animations'; +import { Component, DebugElement, ElementRef, Renderer2 } from '@angular/core'; import { ComponentFixture, TestBed } from '@angular/core/testing'; -import { By } from '@angular/platform-browser'; import { NoopAnimationsModule } from '@angular/platform-browser/animations'; +import { By } from '@angular/platform-browser'; class MockElementRef extends ElementRef {} @Component({ - template: '
', + template: '
Test
', standalone: true, imports: [CollapseDirective] }) @@ -19,25 +18,23 @@ describe('CollapseDirective', () => { let fixture: ComponentFixture; let elementRef: DebugElement; let renderer: Renderer2; - let animationBuilder: AnimationBuilder; beforeEach(() => { TestBed.configureTestingModule({ imports: [TestComponent, CollapseDirective, NoopAnimationsModule], - providers: [{ provide: ElementRef, useClass: MockElementRef }, { provide: AnimationBuilder }, Renderer2] + providers: [{ provide: ElementRef, useClass: MockElementRef }, Renderer2] }); fixture = TestBed.createComponent(TestComponent); component = fixture.componentInstance; elementRef = fixture.debugElement.query(By.directive(CollapseDirective)); - renderer = fixture.componentRef.injector.get(Renderer2 as Type); fixture.detectChanges(); // initial binding }); it('should create an instance', () => { TestBed.runInInjectionContext(() => { - const directive = new CollapseDirective(elementRef, renderer, animationBuilder); + const directive = new CollapseDirective(); expect(directive).toBeTruthy(); }); }); diff --git a/projects/coreui-angular/src/lib/collapse/collapse.directive.ts b/projects/coreui-angular/src/lib/collapse/collapse.directive.ts index 34acc3d3..89624fde 100644 --- a/projects/coreui-angular/src/lib/collapse/collapse.directive.ts +++ b/projects/coreui-angular/src/lib/collapse/collapse.directive.ts @@ -1,17 +1,15 @@ import { - AfterViewInit, booleanAttribute, computed, Directive, - DoCheck, + effect, ElementRef, - Input, + inject, input, - OnChanges, OnDestroy, output, Renderer2, - SimpleChanges + signal } from '@angular/core'; import { AnimationBuilder, AnimationPlayer, useAnimation } from '@angular/animations'; @@ -22,19 +20,31 @@ import { expandHorizontalAnimation } from './collapse.animations'; -// todo @Directive({ selector: '[cCollapse]', exportAs: 'cCollapse', standalone: true, - host: { '[class]': 'hostClasses()' } + host: { '[class]': 'hostClasses()', '[style]': '{display: "none"}' } }) -export class CollapseDirective implements OnDestroy, AfterViewInit, DoCheck, OnChanges { +export class CollapseDirective implements OnDestroy { + readonly #hostElement = inject(ElementRef); + readonly #renderer = inject(Renderer2); + readonly #animationBuilder = inject(AnimationBuilder); + #player: AnimationPlayer | undefined = undefined; + /** * @ignore - * todo: 'animate' input signal for navbar */ - @Input({ transform: booleanAttribute }) animate: boolean = true; + readonly animateInput = input(true, { transform: booleanAttribute, alias: 'animate' }); + + readonly animate = signal(true); + + readonly animateInputEffect = effect( + () => { + this.animate.set(this.animateInput()); + }, + { allowSignalWrites: true } + ); /** * Set horizontal collapsing to transition the width instead of height. @@ -47,18 +57,31 @@ export class CollapseDirective implements OnDestroy, AfterViewInit, DoCheck, OnC * Toggle the visibility of collapsible element. * @type boolean * @default false - * todo: 'visible' input signal */ - @Input({ transform: booleanAttribute }) - set visible(value) { - this._visible = value; - } + readonly visibleInput = input(false, { transform: booleanAttribute, alias: 'visible' }); - get visible(): boolean { - return this._visible; - } + readonly visibleChange = output(); + + readonly visibleInputEffect = effect( + () => { + this.visible.set(this.visibleInput()); + }, + { allowSignalWrites: true } + ); + + readonly visible = signal(false); - private _visible: boolean = false; + #init = false; + + readonly visibleEffect = effect( + () => { + const visible = this.visible(); + + (this.#init || visible) && this.createPlayer(visible); + this.#init = true; + }, + { allowSignalWrites: true } + ); /** * Add `navbar` prop for grouping and hiding navbar contents by a parent breakpoint. @@ -83,21 +106,6 @@ export class CollapseDirective implements OnDestroy, AfterViewInit, DoCheck, OnC */ readonly collapseChange = output(); - private player!: AnimationPlayer; - private readonly host: HTMLElement; - // private scrollHeight!: number; - private scrollWidth!: number; - private collapsing: boolean = false; - - constructor( - private readonly hostElement: ElementRef, - private readonly renderer: Renderer2, - private readonly animationBuilder: AnimationBuilder - ) { - this.host = this.hostElement.nativeElement; - this.renderer.setStyle(this.host, 'display', 'none'); - } - readonly hostClasses = computed(() => { return { 'navbar-collapse': this.navbar(), @@ -105,49 +113,31 @@ export class CollapseDirective implements OnDestroy, AfterViewInit, DoCheck, OnC } as Record; }); - ngAfterViewInit(): void { - if (this.visible) { - this.toggle(); - } - } - ngOnDestroy(): void { this.destroyPlayer(); } - ngOnChanges(changes: SimpleChanges): void { - if (changes['visible']) { - if (!changes['visible'].firstChange || !changes['visible'].currentValue) { - this.toggle(changes['visible'].currentValue); - } - } - } - - ngDoCheck(): void { - if (this._visible !== this.visible) { - this.toggle(); - } - } - - toggle(visible = this.visible): void { - this.createPlayer(visible); - this.player?.play(); + toggle(visible = !this.visible()): void { + this.visible.set(visible); } destroyPlayer(): void { - this.player?.destroy(); + this.#player?.destroy(); + this.#player = undefined; } - createPlayer(visible: boolean = this.visible): void { - if (this.player?.hasStarted()) { + createPlayer(visible: boolean = this.visible()): void { + if (this.#player?.hasStarted()) { this.destroyPlayer(); } + const host: HTMLElement = this.#hostElement.nativeElement; + if (visible) { - this.renderer.removeStyle(this.host, 'display'); + this.#renderer.removeStyle(host, 'display'); } - const duration = this.animate ? this.duration() : '0ms'; + const duration = this.animate() ? this.duration() : '0ms'; const expand = this.horizontal() ? expandHorizontalAnimation : expandAnimation; const collapse = this.horizontal() ? collapseHorizontalAnimation : collapseAnimation; @@ -156,53 +146,48 @@ export class CollapseDirective implements OnDestroy, AfterViewInit, DoCheck, OnC const capitalizedDimension = dimension[0].toUpperCase() + dimension.slice(1); const scrollSize = `scroll${capitalizedDimension}`; - const animationFactory = this.animationBuilder?.build( + const animationFactory = this.#animationBuilder?.build( useAnimation(visible ? expand : collapse, { params: { time: duration, easing: this.transition() } }) ); - this.player = animationFactory.create(this.host); + this.#player = animationFactory.create(host); - this.renderer.setStyle(this.host, dimension, visible ? 0 : `${this.host.getBoundingClientRect()[dimension]}px`); + !visible && host.offsetHeight && host.style[dimension] && host.scrollHeight; - !visible && this.host.offsetHeight; + this.#renderer.setStyle(host, dimension, visible ? 0 : `${host.getBoundingClientRect()[dimension]}px`); - this.player.onStart(() => { + this.#player.onStart(() => { this.setMaxSize(); - this.renderer.removeClass(this.host, 'collapse'); - this.renderer.addClass(this.host, 'collapsing'); - this.renderer.removeClass(this.host, 'show'); - this.collapsing = true; - if (visible) { - this.renderer.setStyle(this.host, dimension, `${this.hostElement.nativeElement[scrollSize]}px`); - } else { - this.renderer.setStyle(this.host, dimension, ''); - } - this.collapseChange.emit(visible ? 'opening' : 'collapsing'); + this.#renderer.removeClass(host, 'collapse'); + this.#renderer.addClass(host, 'collapsing'); + this.#renderer.removeClass(host, 'show'); + this.#renderer.setStyle(host, dimension, visible ? `${(host as any)[scrollSize]}px` : ''); + this.collapseChange?.emit(visible ? 'opening' : 'collapsing'); }); - this.player.onDone(() => { - this.visible = visible; - this.collapsing = false; - this.renderer.removeClass(this.host, 'collapsing'); - this.renderer.addClass(this.host, 'collapse'); + + this.#player.onDone(() => { + this.#renderer.removeClass(host, 'collapsing'); + this.#renderer.addClass(host, 'collapse'); if (visible) { - this.renderer.addClass(this.host, 'show'); - this.renderer.setStyle(this.host, dimension, ''); + this.#renderer.addClass(host, 'show'); + this.#renderer.setStyle(host, dimension, ''); } else { - this.renderer.removeClass(this.host, 'show'); + this.#renderer.removeClass(host, 'show'); } - this.collapseChange.emit(visible ? 'open' : 'collapsed'); + this.collapseChange?.emit(visible ? 'open' : 'collapsed'); + this.destroyPlayer(); + this.visibleChange.emit(visible); }); + + this.#player?.play(); } setMaxSize() { - // setTimeout(() => { + const host = this.#hostElement.nativeElement; if (this.horizontal()) { - this.scrollWidth = this.host.scrollWidth; - this.scrollWidth > 0 && this.renderer.setStyle(this.host, 'maxWidth', `${this.scrollWidth}px`); + host.scrollWidth > 0 && this.#renderer.setStyle(host, 'maxWidth', `${host.scrollWidth}px`); // } else { - // this.scrollHeight = this.host.scrollHeight; - // this.scrollHeight > 0 && this.renderer.setStyle(this.host, 'maxHeight', `${this.scrollHeight}px`); + // host.scrollHeight > 0 && this.#renderer.setStyle(host, 'maxHeight', `${host.scrollHeight}px`); } - // }); } } diff --git a/projects/coreui-angular/src/lib/navbar/navbar-brand/navbar-brand.directive.spec.ts b/projects/coreui-angular/src/lib/navbar/navbar-brand/navbar-brand.directive.spec.ts index c75fcf02..91b3141d 100644 --- a/projects/coreui-angular/src/lib/navbar/navbar-brand/navbar-brand.directive.spec.ts +++ b/projects/coreui-angular/src/lib/navbar/navbar-brand/navbar-brand.directive.spec.ts @@ -1,8 +1,11 @@ import { NavbarBrandDirective } from './navbar-brand.directive'; +import { TestBed } from '@angular/core/testing'; describe('NavbarBrandDirective', () => { it('should create an instance', () => { - const directive = new NavbarBrandDirective(); - expect(directive).toBeTruthy(); + TestBed.runInInjectionContext(() => { + const directive = new NavbarBrandDirective(); + expect(directive).toBeTruthy(); + }); }); }); diff --git a/projects/coreui-angular/src/lib/navbar/navbar-brand/navbar-brand.directive.ts b/projects/coreui-angular/src/lib/navbar/navbar-brand/navbar-brand.directive.ts index f35426c3..05379373 100644 --- a/projects/coreui-angular/src/lib/navbar/navbar-brand/navbar-brand.directive.ts +++ b/projects/coreui-angular/src/lib/navbar/navbar-brand/navbar-brand.directive.ts @@ -1,12 +1,10 @@ -import { Directive, HostBinding } from '@angular/core'; +import { Directive, input } from '@angular/core'; @Directive({ selector: '[cNavbarBrand]', - standalone: true + standalone: true, + host: { class: 'navbar-brand', '[attr.role]': 'role()' } }) export class NavbarBrandDirective { - - @HostBinding('class.navbar-brand') navbarBrand = true; - @HostBinding('attr.role') role = 'button'; - + readonly role = input('button'); } diff --git a/projects/coreui-angular/src/lib/navbar/navbar-nav/navbar-nav.component.ts b/projects/coreui-angular/src/lib/navbar/navbar-nav/navbar-nav.component.ts index db6afff7..e86a7cc8 100644 --- a/projects/coreui-angular/src/lib/navbar/navbar-nav/navbar-nav.component.ts +++ b/projects/coreui-angular/src/lib/navbar/navbar-nav/navbar-nav.component.ts @@ -1,23 +1,22 @@ -import { booleanAttribute, Component, HostBinding, Input } from '@angular/core'; +import { booleanAttribute, Component, computed, input } from '@angular/core'; @Component({ selector: 'c-navbar-nav', template: '', standalone: true, - host: { class: 'navbar-nav' } + host: { '[class]': 'hostClasses()' } }) export class NavbarNavComponent { /** * Enable vertical scrolling of a collapsed navbar toggleable contents. * @type boolean */ - @Input({ transform: booleanAttribute }) scroll: string | boolean = false; + readonly scroll = input(false, { transform: booleanAttribute }); - @HostBinding('class') - get hostClasses(): any { + readonly hostClasses = computed(() => { return { 'navbar-nav': true, - 'navbar-nav-scroll': this.scroll - }; - } + 'navbar-nav-scroll': this.scroll() + } as Record; + }); } diff --git a/projects/coreui-angular/src/lib/navbar/navbar-text/navbar-text.component.ts b/projects/coreui-angular/src/lib/navbar/navbar-text/navbar-text.component.ts index 4fd5baa1..f5f31119 100644 --- a/projects/coreui-angular/src/lib/navbar/navbar-text/navbar-text.component.ts +++ b/projects/coreui-angular/src/lib/navbar/navbar-text/navbar-text.component.ts @@ -1,12 +1,9 @@ -import { Component, HostBinding } from '@angular/core'; +import { Component } from '@angular/core'; @Component({ selector: 'c-navbar-text', template: '', - standalone: true + standalone: true, + host: { class: 'navbar-text' } }) -export class NavbarTextComponent { - - @HostBinding('class.navbar-text') navbarTextClass = true; - -} +export class NavbarTextComponent {} diff --git a/projects/coreui-angular/src/lib/navbar/navbar-toggler/navbar-toggler.directive.spec.ts b/projects/coreui-angular/src/lib/navbar/navbar-toggler/navbar-toggler.directive.spec.ts index 4a820bfa..357c5ab7 100644 --- a/projects/coreui-angular/src/lib/navbar/navbar-toggler/navbar-toggler.directive.spec.ts +++ b/projects/coreui-angular/src/lib/navbar/navbar-toggler/navbar-toggler.directive.spec.ts @@ -1,12 +1,18 @@ -import { NavbarTogglerDirective } from './navbar-toggler.directive'; import { ElementRef, Renderer2 } from '@angular/core'; +import { TestBed } from '@angular/core/testing'; +import { NavbarTogglerDirective } from './navbar-toggler.directive'; describe('NavbarTogglerDirective', () => { - let renderer: Renderer2; - let hostElement: ElementRef; + beforeEach(() => { + TestBed.configureTestingModule({ + providers: [Renderer2, { provide: ElementRef, useValue: { nativeElement: document.createElement('button') } }] + }); + }); it('should create an instance', () => { - const directive = new NavbarTogglerDirective(renderer, hostElement); - expect(directive).toBeTruthy(); + TestBed.runInInjectionContext(() => { + const directive = new NavbarTogglerDirective(); + expect(directive).toBeTruthy(); + }); }); }); diff --git a/projects/coreui-angular/src/lib/navbar/navbar-toggler/navbar-toggler.directive.ts b/projects/coreui-angular/src/lib/navbar/navbar-toggler/navbar-toggler.directive.ts index 346ae578..b046c8a7 100644 --- a/projects/coreui-angular/src/lib/navbar/navbar-toggler/navbar-toggler.directive.ts +++ b/projects/coreui-angular/src/lib/navbar/navbar-toggler/navbar-toggler.directive.ts @@ -1,55 +1,60 @@ -import { AfterContentInit, Directive, ElementRef, HostBinding, HostListener, Input, Renderer2 } from '@angular/core'; +import { afterNextRender, Directive, ElementRef, HostListener, inject, input, Renderer2 } from '@angular/core'; import { CollapseDirective } from '../../collapse'; @Directive({ selector: '[cNavbarToggler]', - standalone: true + standalone: true, + host: { + '[attr.aria-label]': 'ariaLabel()', + '[attr.type]': 'type()', + class: 'navbar-toggler' + } }) -export class NavbarTogglerDirective implements AfterContentInit { +export class NavbarTogglerDirective { + readonly #renderer = inject(Renderer2); + readonly #hostElement = inject(ElementRef); + + constructor() { + afterNextRender({ + read: () => { + const hasContent = this.#hostElement.nativeElement.childNodes.length as boolean; + if (!hasContent) { + this.addDefaultIcon(); + } + } + }); + } + /** * Reference to navbar collapse element (via # template variable) . [docs] * @type string * @default 'button' */ - @Input('cNavbarToggler') collapseRef?: CollapseDirective; - @HostBinding('class.navbar-toggler') navbarToggler = true; + readonly collapseRef = input(undefined, { alias: 'cNavbarToggler' }); + /** * Default type for navbar-toggler. [docs] * @type string * @default 'button' */ - @HostBinding('attr.type') - @Input() type = 'button'; + readonly type = input('button'); + /** * Default aria-label attr for navbar-toggler. [docs] * @type string * @default 'Toggle navigation' */ - @HostBinding('attr.aria-label') - @Input() ariaLabel = 'Toggle navigation'; - - private hasContent!: boolean; - - constructor( - private renderer: Renderer2, - private hostElement: ElementRef - ) { } + readonly ariaLabel = input('Toggle navigation'); @HostListener('click', ['$event']) handleClick() { - this.collapseRef?.toggle(!this.collapseRef?.visible); + const collapseRef = this.collapseRef(); + collapseRef?.toggle(!collapseRef?.visible()); } addDefaultIcon(): void { - const span = this.renderer.createElement('span'); - this.renderer.addClass(span, 'navbar-toggler-icon'); - this.renderer.appendChild(this.hostElement.nativeElement, span); - } - - ngAfterContentInit(): void { - this.hasContent = this.hostElement.nativeElement.childNodes.length as boolean; - if (!this.hasContent) { - this.addDefaultIcon(); - } + const span = this.#renderer.createElement('span'); + this.#renderer.addClass(span, 'navbar-toggler-icon'); + this.#renderer.appendChild(this.#hostElement.nativeElement, span); } } diff --git a/projects/coreui-angular/src/lib/navbar/navbar.component.html b/projects/coreui-angular/src/lib/navbar/navbar.component.html index 002456d8..86c946dd 100644 --- a/projects/coreui-angular/src/lib/navbar/navbar.component.html +++ b/projects/coreui-angular/src/lib/navbar/navbar.component.html @@ -1,7 +1,7 @@ - + -
+
diff --git a/projects/coreui-angular/src/lib/navbar/navbar.component.ts b/projects/coreui-angular/src/lib/navbar/navbar.component.ts index 67d67820..9bde6560 100644 --- a/projects/coreui-angular/src/lib/navbar/navbar.component.ts +++ b/projects/coreui-angular/src/lib/navbar/navbar.component.ts @@ -1,10 +1,22 @@ -import { AfterContentInit, Component, ContentChild, ElementRef, HostBinding, Input } from '@angular/core'; -import { NgClass, NgTemplateOutlet } from '@angular/common'; +import { + AfterContentInit, + afterRender, + Component, + computed, + contentChild, + ElementRef, + inject, + input, + OnDestroy, + signal +} from '@angular/core'; +import { DOCUMENT, NgClass, NgTemplateOutlet } from '@angular/common'; import { BreakpointObserver } from '@angular/cdk/layout'; import { CollapseDirective } from '../collapse'; import { Colors } from '../coreui.types'; import { ThemeDirective } from '../shared'; +import { Subscription } from 'rxjs'; // todo: fix container prop issue not rendering children // todo: workaround - use component directly in template @@ -15,79 +27,106 @@ import { ThemeDirective } from '../shared'; standalone: true, imports: [NgClass, NgTemplateOutlet], hostDirectives: [{ directive: ThemeDirective, inputs: ['colorScheme'] }], - host: { class: 'navbar' } + host: { '[class]': 'hostClasses()', '[attr.role]': 'role()' } }) -export class NavbarComponent implements AfterContentInit { +export class NavbarComponent implements AfterContentInit, OnDestroy { + readonly #breakpointObserver = inject(BreakpointObserver); + readonly #document = inject(DOCUMENT); + readonly #hostElement = inject(ElementRef); + /** * Sets the color context of the component to one of CoreUI’s themed colors. * @type Colors */ - @Input() color?: Colors; + readonly color = input(); + /** * Defines optional container wrapping children elements. */ - @Input() container?: boolean | 'sm' | 'md' | 'lg' | 'xl' | 'xxl' | 'fluid'; + readonly container = input(); + /** * Defines the responsive breakpoint to determine when content collapses. */ - @Input() expand?: boolean | 'sm' | 'md' | 'lg' | 'xl' | 'xxl'; + readonly expand = input(); + /** * Place component in non-static positions. */ - @Input() placement?: 'fixed-top' | 'fixed-bottom' | 'sticky-top'; + readonly placement = input<'fixed-top' | 'fixed-bottom' | 'sticky-top'>(); - @ContentChild(CollapseDirective) collapse!: CollapseDirective; + readonly role = input('navigation'); - @HostBinding('attr.role') - @Input() - role = 'navigation'; + readonly collapse = contentChild(CollapseDirective); - constructor( - private hostElement: ElementRef, - private breakpointObserver: BreakpointObserver - ) {} - - @HostBinding('class') - get hostClasses(): any { - const expandClassSuffix: string = this.expand === true ? '' : `-${this.expand}`; + readonly hostClasses = computed(() => { + const color = this.color(); + const expand = this.expand(); + const expandClassSuffix: string = expand === true ? '' : `-${expand}`; + const placement = this.placement(); return { navbar: true, - [`navbar-expand${expandClassSuffix}`]: !!this.expand, - [`bg-${this.color}`]: !!this.color, - [`${this.placement}`]: !!this.placement - }; - } + [`navbar-expand${expandClassSuffix}`]: !!expand, + [`bg-${color}`]: !!color, + [`${placement}`]: !!placement + } as Record; + }); - get containerClass(): string { - return `container${this.container !== true ? '-' + this.container : ''}`; - } + readonly containerClass = computed(() => { + const container = this.container(); + return `container${container !== true ? '-' + container : ''}`; + }); - get breakpoint(): string | boolean { - if (typeof this.expand === 'string') { - return ( - getComputedStyle(this.hostElement.nativeElement)?.getPropertyValue(`--cui-breakpoint-${this.expand}`) ?? false - ); + readonly computedStyle = signal(''); + + readonly afterNextRenderFn = afterRender({ + read: () => { + const expand = this.expand(); + if (typeof expand === 'string') { + const computedStyle = + this.#document.defaultView + ?.getComputedStyle(this.#hostElement.nativeElement) + ?.getPropertyValue(`--cui-breakpoint-${expand}`) ?? false; + computedStyle && this.computedStyle.set(computedStyle); + } + } + }); + + readonly breakpoint = computed(() => { + const expand = this.expand(); + if (typeof expand === 'string') { + return this.computedStyle(); } return false; - } + }); + + #observer!: Subscription; ngAfterContentInit(): void { - if (this.breakpoint) { - const onBreakpoint = `(min-width: ${this.breakpoint})`; - this.breakpointObserver.observe([onBreakpoint]).subscribe((result) => { - if (this.collapse) { - const animate = this.collapse.animate; - // todo: collapse animate input signal setter - this.collapse.animate = false; - this.collapse.toggle(false); - setTimeout(() => { - this.collapse.toggle(result.matches); + const breakpoint = this.breakpoint(); + if (breakpoint) { + const onBreakpoint = `(min-width: ${breakpoint})`; + this.#observer = this.#breakpointObserver + .observe([onBreakpoint]) + .pipe() + .subscribe((result) => { + const collapse = this.collapse(); + if (collapse) { + const animate = collapse.animate(); + collapse.animate.set(false); + collapse.toggle(false); setTimeout(() => { - this.collapse.animate = animate; + collapse.toggle(result.matches); + setTimeout(() => { + collapse.animate.set(animate); + }); }); - }); - } - }); + } + }); } } + + ngOnDestroy(): void { + this.#observer?.unsubscribe(); + } } diff --git a/projects/coreui-angular/src/lib/offcanvas/offcanvas/offcanvas.component.ts b/projects/coreui-angular/src/lib/offcanvas/offcanvas/offcanvas.component.ts index 6fe67d1d..a83ce571 100644 --- a/projects/coreui-angular/src/lib/offcanvas/offcanvas/offcanvas.component.ts +++ b/projects/coreui-angular/src/lib/offcanvas/offcanvas/offcanvas.component.ts @@ -193,7 +193,9 @@ export class OffcanvasComponent implements OnInit, OnDestroy { const element: Element = this.document.documentElement; const responsiveBreakpoint = this.responsive; const breakpointValue = - getComputedStyle(element)?.getPropertyValue(`--cui-breakpoint-${responsiveBreakpoint.trim()}`) ?? false; + this.document.defaultView + ?.getComputedStyle(element) + ?.getPropertyValue(`--cui-breakpoint-${responsiveBreakpoint.trim()}`) ?? false; return breakpointValue ? `${parseFloat(breakpointValue.trim()) - 0.02}px` : false; } diff --git a/projects/coreui-angular/src/lib/sidebar/sidebar-nav/sidebar-nav-link.component.ts b/projects/coreui-angular/src/lib/sidebar/sidebar-nav/sidebar-nav-link.component.ts index b55d1ecb..527cb7ff 100644 --- a/projects/coreui-angular/src/lib/sidebar/sidebar-nav/sidebar-nav-link.component.ts +++ b/projects/coreui-angular/src/lib/sidebar/sidebar-nav/sidebar-nav-link.component.ts @@ -85,7 +85,7 @@ export class SidebarNavLinkComponent implements OnInit, OnDestroy { this.url = typeof this.item.url === 'string' ? this.item.url - : this.router.serializeUrl(this.router.createUrlTree(this.item.url as any[])); + : this.router.serializeUrl(this.router.createUrlTree((this.item.url as any[]) ?? [''])); this.linkType = this.getLinkType(); this.href = this.isDisabled() ? '' : this.item.href || this.url; this.linkActive = this.router.url.split(/[?#(;]/)[0] === this.href.split(/[?#(;]/)[0]; @@ -110,7 +110,7 @@ export class SidebarNavLinkComponent implements OnInit, OnDestroy { public isExternalLink(): boolean { const linkPath = Array.isArray(this.item.url) ? this.item.url[0] : this.item.url; - return !!this.item.href || linkPath.substring(0, 4) === 'http'; + return !!this.item.href || linkPath?.substring(0, 4) === 'http'; } linkClicked(): void { diff --git a/projects/coreui-angular/src/lib/sidebar/sidebar-nav/sidebar-nav.component.ts b/projects/coreui-angular/src/lib/sidebar/sidebar-nav/sidebar-nav.component.ts index bb45b62b..521650c6 100644 --- a/projects/coreui-angular/src/lib/sidebar/sidebar-nav/sidebar-nav.component.ts +++ b/projects/coreui-angular/src/lib/sidebar/sidebar-nav/sidebar-nav.component.ts @@ -160,22 +160,26 @@ export class SidebarNavGroupComponent implements OnInit, OnDestroy { onAnimationStart($event: AnimationEvent) { this.display = { display: 'block' }; - if ($event.toState === 'open') { - const host = this.sidebarNav.nativeElement; - this.renderer.setStyle(host, 'height', `${host['scrollHeight']}px`); - } + setTimeout(() => { + const host = this.sidebarNav?.nativeElement; + if ($event.toState === 'open' && host) { + this.renderer.setStyle(host, 'height', `${host['scrollHeight']}px`); + } + }); } onAnimationDone($event: AnimationEvent) { - if ($event.toState === 'open') { - const host = this.sidebarNav.nativeElement; - this.renderer.setStyle(host, 'height', 'auto'); - } - if ($event.toState === 'closed') { - setTimeout(() => { - this.display = null; - }); - } + setTimeout(() => { + const host = this.sidebarNav?.nativeElement; + if ($event.toState === 'open' && host) { + this.renderer.setStyle(host, 'height', 'auto'); + } + if ($event.toState === 'closed') { + setTimeout(() => { + this.display = null; + }); + } + }); } } diff --git a/projects/coreui-icons-angular/package.json b/projects/coreui-icons-angular/package.json index 3088b19e..e96bc18f 100644 --- a/projects/coreui-icons-angular/package.json +++ b/projects/coreui-icons-angular/package.json @@ -1,6 +1,6 @@ { "name": "@coreui/icons-angular", - "version": "5.2.21", + "version": "5.2.22", "description": "CoreUI Icons Angular component and service", "copyright": "Copyright 2024 creativeLabs Łukasz Holeczek", "license": "MIT", diff --git a/projects/coreui-icons-angular/src/lib/icon/icon.directive.ts b/projects/coreui-icons-angular/src/lib/icon/icon.directive.ts index ff4c7e5c..42f710e7 100644 --- a/projects/coreui-icons-angular/src/lib/icon/icon.directive.ts +++ b/projects/coreui-icons-angular/src/lib/icon/icon.directive.ts @@ -8,7 +8,8 @@ import { transformName } from './icon.utils'; @Directive({ exportAs: 'cIcon', selector: 'svg[cIcon]', - standalone: true + standalone: true, + host: { ngSkipHydration: 'true', '[innerHtml]': 'innerHtml()' } }) export class IconDirective implements IIcon { readonly #elementRef = inject(ElementRef); @@ -78,13 +79,8 @@ export class IconDirective implements IIcon { return this.computedClasses; } - @HostBinding('innerHtml') - get bindInnerHtml() { - return this.innerHtml(); - } - readonly innerHtml = computed(() => { - const code = Array.isArray(this.code()) ? this.code()[1] ?? this.code()[0] ?? '' : this.code() || ''; + const code = Array.isArray(this.code()) ? (this.code()[1] ?? this.code()[0] ?? '') : this.code() || ''; // todo proper sanitize // const sanitized = this.sanitizer.sanitize(SecurityContext.HTML, code); return this.#sanitizer.bypassSecurityTrustHtml(this.titleCode + code || ''); @@ -103,8 +99,7 @@ export class IconDirective implements IIcon { } if (this.#name() && !this.#iconSet?.icons[this.#name()]) { console.warn( - `c-icon component: icon name '${this.#name()}' does not exist for IconSet service. ` + - `To use icon by 'name' prop you need to add it to IconSet service. \n`, + `cIcon directive: The '${this.#name()}' icon not found. Add it to the IconSet service for use with the 'name' property. \n`, this.#name() ); } @@ -112,7 +107,7 @@ export class IconDirective implements IIcon { }); readonly scale = computed(() => { - return Array.isArray(this.code()) && this.code().length > 1 ? `0 0 ${this.code()[0]}` : '0 0 64 64'; + return Array.isArray(this.code()) && (this.code()?.length ?? 0) > 1 ? `0 0 ${this.code()?.[0]}` : '0 0 64 64'; }); get computedSize(): Exclude | undefined {