diff --git a/CHANGELOG.md b/CHANGELOG.md index 7cb71660..e92a14e6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,22 @@ +# 2.66.0 (2024-06-07) + +### Feature + +- **Accordion**: new accordion component + +### Improvements + +- **Select**: + - Display option’s help on the selected value when provided in `options` list. + - Improve control model to allow better management of option’s icon when passed programmatically +- **Toggle**: Add an option `spaceBetweenLabelAndToggle` allowing to display label and toggle properly aligned on the left and on the right of the container. + +### Bug fix + +- **Toggle**: + - Trigger the click event when clicking anywhere on the toggle container + - Fix label color when toggle is disabled + # 2.65.20 (2024-05-30) ### Improvements diff --git a/package-lock.json b/package-lock.json index f82f4413..f7dce065 100644 --- a/package-lock.json +++ b/package-lock.json @@ -112,12 +112,6 @@ "url": "https://github.com/sponsors/epoberezkin" } }, - "node_modules/@angular-builders/common/node_modules/jsonc-parser": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/jsonc-parser/-/jsonc-parser-3.2.1.tgz", - "integrity": "sha512-AilxAyFOAcK5wA1+LeaySVBrHsGQvUFCDWXKpZjzaL0PqW+xfBOttn8GNtWKFWqneyMZj41MWF9Kl6iPWLwgOA==", - "dev": true - }, "node_modules/@angular-builders/common/node_modules/picomatch": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.1.tgz", @@ -230,38 +224,69 @@ } }, "node_modules/@angular-devkit/architect": { - "version": "0.1401.0", - "resolved": "https://registry.npmjs.org/@angular-devkit/architect/-/architect-0.1401.0.tgz", - "integrity": "sha512-dHgP2/5EXkJpdf6Y1QHQX2RP8xTli/CFZH3uNnTh+EuAib/kwu+Z6K3UttZWB5VGhAF1u/xf97Vly/UkXvjKAg==", + "version": "0.1601.8", + "resolved": "https://registry.npmjs.org/@angular-devkit/architect/-/architect-0.1601.8.tgz", + "integrity": "sha512-kOXVGwsQnZvtz2UZNefcEy64Jiwq0eSoQUeozvDXOaYRJABLjPKI2YaarvKC9/Z1SGLuje0o/eRJO4T8aRk9rQ==", "dev": true, "peer": true, "dependencies": { - "@angular-devkit/core": "14.1.0", - "rxjs": "6.6.7" + "@angular-devkit/core": "16.1.8", + "rxjs": "7.8.1" }, "engines": { - "node": "^14.15.0 || >=16.10.0", + "node": "^16.14.0 || >=18.10.0", "npm": "^6.11.0 || ^7.5.6 || >=8.0.0", "yarn": ">= 1.13.0" } }, - "node_modules/@angular-devkit/architect/node_modules/rxjs": { - "version": "6.6.7", - "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-6.6.7.tgz", - "integrity": "sha512-hTdwr+7yYNIT5n4AMYp85KA6yw2Va0FLa3Rguvbpa4W3I5xynaBZo41cM3XM+4Q6fRMj3sBYIR1VAmZMXYJvRQ==", + "node_modules/@angular-devkit/architect/node_modules/@angular-devkit/core": { + "version": "16.1.8", + "resolved": "https://registry.npmjs.org/@angular-devkit/core/-/core-16.1.8.tgz", + "integrity": "sha512-dSRD/+bGanArIXkj+kaU1kDFleZeQMzmBiOXX+pK0Ah9/0Yn1VmY3RZh1zcX9vgIQXV+t7UPrTpOjaERMUtVGw==", "dev": true, "peer": true, "dependencies": { - "tslib": "^1.9.0" + "ajv": "8.12.0", + "ajv-formats": "2.1.1", + "jsonc-parser": "3.2.0", + "rxjs": "7.8.1", + "source-map": "0.7.4" }, "engines": { - "npm": ">=2.0.0" + "node": "^16.14.0 || >=18.10.0", + "npm": "^6.11.0 || ^7.5.6 || >=8.0.0", + "yarn": ">= 1.13.0" + }, + "peerDependencies": { + "chokidar": "^3.5.2" + }, + "peerDependenciesMeta": { + "chokidar": { + "optional": true + } } }, - "node_modules/@angular-devkit/architect/node_modules/tslib": { - "version": "1.14.1", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", - "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==", + "node_modules/@angular-devkit/architect/node_modules/ajv": { + "version": "8.12.0", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.12.0.tgz", + "integrity": "sha512-sRu1kpcO9yLtYxBKvqfTeh9KzZEwO3STyX1HT+4CaDzC6HpTGYhIhPIzj9XuKU7KYDwnaeh5hcOwjy1QuJzBPA==", + "dev": true, + "peer": true, + "dependencies": { + "fast-deep-equal": "^3.1.1", + "json-schema-traverse": "^1.0.0", + "require-from-string": "^2.0.2", + "uri-js": "^4.2.2" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/epoberezkin" + } + }, + "node_modules/@angular-devkit/architect/node_modules/jsonc-parser": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/jsonc-parser/-/jsonc-parser-3.2.0.tgz", + "integrity": "sha512-gfFQZrcTc8CnKXp6Y4/CBT3fTc0OVuDofpre4aEeEpSBPV5X5v4+Vmx+8snU7RLPrNHPKSgLxGo9YuQzz20o+w==", "dev": true, "peer": true }, @@ -900,12 +925,6 @@ "node": ">=12" } }, - "node_modules/@angular-devkit/build-angular/node_modules/jsonc-parser": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/jsonc-parser/-/jsonc-parser-3.2.1.tgz", - "integrity": "sha512-AilxAyFOAcK5wA1+LeaySVBrHsGQvUFCDWXKpZjzaL0PqW+xfBOttn8GNtWKFWqneyMZj41MWF9Kl6iPWLwgOA==", - "dev": true - }, "node_modules/@angular-devkit/build-angular/node_modules/lru-cache": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", @@ -1034,12 +1053,6 @@ "url": "https://github.com/sponsors/epoberezkin" } }, - "node_modules/@angular-devkit/build-webpack/node_modules/jsonc-parser": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/jsonc-parser/-/jsonc-parser-3.2.1.tgz", - "integrity": "sha512-AilxAyFOAcK5wA1+LeaySVBrHsGQvUFCDWXKpZjzaL0PqW+xfBOttn8GNtWKFWqneyMZj41MWF9Kl6iPWLwgOA==", - "dev": true - }, "node_modules/@angular-devkit/build-webpack/node_modules/picomatch": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.1.tgz", @@ -1053,20 +1066,21 @@ } }, "node_modules/@angular-devkit/core": { - "version": "14.1.0", - "resolved": "https://registry.npmjs.org/@angular-devkit/core/-/core-14.1.0.tgz", - "integrity": "sha512-Y2d/+nFmjjY4eatc3cwdDDAnpnhG3KTX2OVW7dXSUxW3eY5e3vdMlVUbFiKwvwAshlrJy85Y6RMvZSBN4VrpnA==", + "version": "16.2.14", + "resolved": "https://registry.npmjs.org/@angular-devkit/core/-/core-16.2.14.tgz", + "integrity": "sha512-Ui14/d2+p7lnmXlK/AX2ieQEGInBV75lonNtPQgwrYgskF8ufCuN0DyVZQUy9fJDkC+xQxbJyYrby/BS0R0e7w==", "dev": true, "peer": true, "dependencies": { - "ajv": "8.11.0", + "ajv": "8.12.0", "ajv-formats": "2.1.1", - "jsonc-parser": "3.1.0", - "rxjs": "6.6.7", + "jsonc-parser": "3.2.0", + "picomatch": "2.3.1", + "rxjs": "7.8.1", "source-map": "0.7.4" }, "engines": { - "node": "^14.15.0 || >=16.10.0", + "node": "^16.14.0 || >=18.10.0", "npm": "^6.11.0 || ^7.5.6 || >=8.0.0", "yarn": ">= 1.13.0" }, @@ -1079,62 +1093,53 @@ } } }, - "node_modules/@angular-devkit/core/node_modules/rxjs": { - "version": "6.6.7", - "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-6.6.7.tgz", - "integrity": "sha512-hTdwr+7yYNIT5n4AMYp85KA6yw2Va0FLa3Rguvbpa4W3I5xynaBZo41cM3XM+4Q6fRMj3sBYIR1VAmZMXYJvRQ==", + "node_modules/@angular-devkit/core/node_modules/ajv": { + "version": "8.12.0", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.12.0.tgz", + "integrity": "sha512-sRu1kpcO9yLtYxBKvqfTeh9KzZEwO3STyX1HT+4CaDzC6HpTGYhIhPIzj9XuKU7KYDwnaeh5hcOwjy1QuJzBPA==", "dev": true, "peer": true, "dependencies": { - "tslib": "^1.9.0" + "fast-deep-equal": "^3.1.1", + "json-schema-traverse": "^1.0.0", + "require-from-string": "^2.0.2", + "uri-js": "^4.2.2" }, - "engines": { - "npm": ">=2.0.0" + "funding": { + "type": "github", + "url": "https://github.com/sponsors/epoberezkin" } }, - "node_modules/@angular-devkit/core/node_modules/tslib": { - "version": "1.14.1", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", - "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==", + "node_modules/@angular-devkit/core/node_modules/jsonc-parser": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/jsonc-parser/-/jsonc-parser-3.2.0.tgz", + "integrity": "sha512-gfFQZrcTc8CnKXp6Y4/CBT3fTc0OVuDofpre4aEeEpSBPV5X5v4+Vmx+8snU7RLPrNHPKSgLxGo9YuQzz20o+w==", "dev": true, "peer": true }, "node_modules/@angular-devkit/schematics": { - "version": "14.1.0", - "resolved": "https://registry.npmjs.org/@angular-devkit/schematics/-/schematics-14.1.0.tgz", - "integrity": "sha512-5QC01k9eznuQSiqxijKhVkAEmA8sioYuLhBzyffaPszSySH8kPMNxhAc8zJhBTNLumbS6iDaGkSqTQl5Kv9fOw==", + "version": "16.2.14", + "resolved": "https://registry.npmjs.org/@angular-devkit/schematics/-/schematics-16.2.14.tgz", + "integrity": "sha512-B6LQKInCT8w5zx5Pbroext5eFFRTCJdTwHN8GhcVS8IeKCnkeqVTQLjB4lBUg7LEm8Y7UHXwzrVxmk+f+MBXhw==", "dev": true, "peer": true, "dependencies": { - "@angular-devkit/core": "14.1.0", - "jsonc-parser": "3.1.0", - "magic-string": "0.26.2", + "@angular-devkit/core": "16.2.14", + "jsonc-parser": "3.2.0", + "magic-string": "0.30.1", "ora": "5.4.1", - "rxjs": "6.6.7" + "rxjs": "7.8.1" }, "engines": { - "node": "^14.15.0 || >=16.10.0", + "node": "^16.14.0 || >=18.10.0", "npm": "^6.11.0 || ^7.5.6 || >=8.0.0", "yarn": ">= 1.13.0" } }, - "node_modules/@angular-devkit/schematics/node_modules/rxjs": { - "version": "6.6.7", - "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-6.6.7.tgz", - "integrity": "sha512-hTdwr+7yYNIT5n4AMYp85KA6yw2Va0FLa3Rguvbpa4W3I5xynaBZo41cM3XM+4Q6fRMj3sBYIR1VAmZMXYJvRQ==", - "dev": true, - "peer": true, - "dependencies": { - "tslib": "^1.9.0" - }, - "engines": { - "npm": ">=2.0.0" - } - }, - "node_modules/@angular-devkit/schematics/node_modules/tslib": { - "version": "1.14.1", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", - "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==", + "node_modules/@angular-devkit/schematics/node_modules/jsonc-parser": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/jsonc-parser/-/jsonc-parser-3.2.0.tgz", + "integrity": "sha512-gfFQZrcTc8CnKXp6Y4/CBT3fTc0OVuDofpre4aEeEpSBPV5X5v4+Vmx+8snU7RLPrNHPKSgLxGo9YuQzz20o+w==", "dev": true, "peer": true }, @@ -1278,12 +1283,6 @@ "url": "https://github.com/sponsors/epoberezkin" } }, - "node_modules/@angular/cli/node_modules/jsonc-parser": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/jsonc-parser/-/jsonc-parser-3.2.1.tgz", - "integrity": "sha512-AilxAyFOAcK5wA1+LeaySVBrHsGQvUFCDWXKpZjzaL0PqW+xfBOttn8GNtWKFWqneyMZj41MWF9Kl6iPWLwgOA==", - "dev": true - }, "node_modules/@angular/cli/node_modules/lru-cache": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", @@ -5281,12 +5280,6 @@ "url": "https://github.com/sponsors/epoberezkin" } }, - "node_modules/@schematics/angular/node_modules/jsonc-parser": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/jsonc-parser/-/jsonc-parser-3.2.1.tgz", - "integrity": "sha512-AilxAyFOAcK5wA1+LeaySVBrHsGQvUFCDWXKpZjzaL0PqW+xfBOttn8GNtWKFWqneyMZj41MWF9Kl6iPWLwgOA==", - "dev": true - }, "node_modules/@schematics/angular/node_modules/magic-string": { "version": "0.30.8", "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.8.tgz", @@ -6228,15 +6221,15 @@ } }, "node_modules/ajv": { - "version": "8.11.0", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.11.0.tgz", - "integrity": "sha512-wGgprdCvMalC0BztXvitD2hC04YffAvtsUn93JbGXYLAtCUO4xd17mCCZQxUOItiBwZvJScWo8NIvQMQ71rdpg==", + "version": "8.13.0", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.13.0.tgz", + "integrity": "sha512-PRA911Blj99jR5RMeTunVbNXMF6Lp4vZXnk5GQjcnUWUTsrXtekg/pnmFFI2u/I36Y/2bITGS30GZCXei6uNkA==", "dev": true, "dependencies": { - "fast-deep-equal": "^3.1.1", + "fast-deep-equal": "^3.1.3", "json-schema-traverse": "^1.0.0", "require-from-string": "^2.0.2", - "uri-js": "^4.2.2" + "uri-js": "^4.4.1" }, "funding": { "type": "github", @@ -12467,11 +12460,10 @@ } }, "node_modules/jsonc-parser": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/jsonc-parser/-/jsonc-parser-3.1.0.tgz", - "integrity": "sha512-DRf0QjnNeCUds3xTjKlQQ3DpJD51GvDjJfnxUVWg6PZTo2otSm+slzNAxU/35hF8/oJIKoG9slq30JYOsF2azg==", - "dev": true, - "peer": true + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/jsonc-parser/-/jsonc-parser-3.2.1.tgz", + "integrity": "sha512-AilxAyFOAcK5wA1+LeaySVBrHsGQvUFCDWXKpZjzaL0PqW+xfBOttn8GNtWKFWqneyMZj41MWF9Kl6iPWLwgOA==", + "dev": true }, "node_modules/jsonfile": { "version": "6.1.0", @@ -12821,13 +12813,13 @@ } }, "node_modules/magic-string": { - "version": "0.26.2", - "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.26.2.tgz", - "integrity": "sha512-NzzlXpclt5zAbmo6h6jNc8zl2gNRGHvmsZW4IvZhTC4W7k4OlLP+S5YLussa/r3ixNT66KOQfNORlXHSOy/X4A==", + "version": "0.30.1", + "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.1.tgz", + "integrity": "sha512-mbVKXPmS0z0G4XqFDCTllmDQ6coZzn94aMlb0o/A4HEHJCKcanlDZwYJgwnkmgD3jyWhUgj9VsPrfd972yPffA==", "dev": true, "peer": true, "dependencies": { - "sourcemap-codec": "^1.4.8" + "@jridgewell/sourcemap-codec": "^1.4.15" }, "engines": { "node": ">=12" @@ -13798,22 +13790,6 @@ "node": ">=12" } }, - "node_modules/ng-packagr/node_modules/ajv": { - "version": "8.12.0", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.12.0.tgz", - "integrity": "sha512-sRu1kpcO9yLtYxBKvqfTeh9KzZEwO3STyX1HT+4CaDzC6HpTGYhIhPIzj9XuKU7KYDwnaeh5hcOwjy1QuJzBPA==", - "dev": true, - "dependencies": { - "fast-deep-equal": "^3.1.1", - "json-schema-traverse": "^1.0.0", - "require-from-string": "^2.0.2", - "uri-js": "^4.2.2" - }, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/epoberezkin" - } - }, "node_modules/ng-packagr/node_modules/commander": { "version": "12.0.0", "resolved": "https://registry.npmjs.org/commander/-/commander-12.0.0.tgz", @@ -13868,12 +13844,6 @@ "@esbuild/win32-x64": "0.20.2" } }, - "node_modules/ng-packagr/node_modules/jsonc-parser": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/jsonc-parser/-/jsonc-parser-3.2.0.tgz", - "integrity": "sha512-gfFQZrcTc8CnKXp6Y4/CBT3fTc0OVuDofpre4aEeEpSBPV5X5v4+Vmx+8snU7RLPrNHPKSgLxGo9YuQzz20o+w==", - "dev": true - }, "node_modules/nice-napi": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/nice-napi/-/nice-napi-1.0.2.tgz", @@ -16271,13 +16241,6 @@ "node": ">=0.10.0" } }, - "node_modules/sourcemap-codec": { - "version": "1.4.8", - "resolved": "https://registry.npmjs.org/sourcemap-codec/-/sourcemap-codec-1.4.8.tgz", - "integrity": "sha512-9NykojV5Uih4lgo5So5dtw+f0JgJX30KCNI8gwhz2J9A15wD0Ml6tjHKwf6fTSa6fAdVBdZeNOs9eJ71qCk8vA==", - "dev": true, - "peer": true - }, "node_modules/spdx-correct": { "version": "3.2.0", "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.2.0.tgz", @@ -16575,9 +16538,9 @@ } }, "node_modules/tar": { - "version": "6.2.0", - "resolved": "https://registry.npmjs.org/tar/-/tar-6.2.0.tgz", - "integrity": "sha512-/Wo7DcT0u5HUV486xg675HtjNd3BXZ6xDbzsCUZPt5iw8bTQ63bP0Raut3mvro9u+CUyq7YQd8Cx55fsZXxqLQ==", + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/tar/-/tar-6.2.1.tgz", + "integrity": "sha512-DZ4yORTwrbTj/7MZYq2w+/ZFdI6OZ/f9SFHR+71gIVUZhOQPHzVCLpvRnPgyaMpfWxxk/4ONva3GQSyNIKRv6A==", "dev": true, "dependencies": { "chownr": "^2.0.0", @@ -17155,9 +17118,9 @@ } }, "node_modules/universalify": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.0.tgz", - "integrity": "sha512-hAZsKq7Yy11Zu1DE0OzWjw7nnLZmJZYTDZZyEFHZdUhV8FkH5MCfoU1XMaxXovpyW5nq5scPqq0ZDP9Zyl04oQ==", + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.1.tgz", + "integrity": "sha512-gptHNQghINnc/vTGIk0SOFGFNXw7JVrlRUtConJRlvaw6DuX0wO5Jeko9sWrMBhh+PsYAZ7oXAiOnf/UKogyiw==", "dev": true, "engines": { "node": ">= 10.0.0" @@ -18048,12 +18011,6 @@ "uri-js": "^4.2.2" } }, - "jsonc-parser": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/jsonc-parser/-/jsonc-parser-3.2.1.tgz", - "integrity": "sha512-AilxAyFOAcK5wA1+LeaySVBrHsGQvUFCDWXKpZjzaL0PqW+xfBOttn8GNtWKFWqneyMZj41MWF9Kl6iPWLwgOA==", - "dev": true - }, "picomatch": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.1.tgz", @@ -18126,30 +18083,47 @@ } }, "@angular-devkit/architect": { - "version": "0.1401.0", - "resolved": "https://registry.npmjs.org/@angular-devkit/architect/-/architect-0.1401.0.tgz", - "integrity": "sha512-dHgP2/5EXkJpdf6Y1QHQX2RP8xTli/CFZH3uNnTh+EuAib/kwu+Z6K3UttZWB5VGhAF1u/xf97Vly/UkXvjKAg==", + "version": "0.1601.8", + "resolved": "https://registry.npmjs.org/@angular-devkit/architect/-/architect-0.1601.8.tgz", + "integrity": "sha512-kOXVGwsQnZvtz2UZNefcEy64Jiwq0eSoQUeozvDXOaYRJABLjPKI2YaarvKC9/Z1SGLuje0o/eRJO4T8aRk9rQ==", "dev": true, "peer": true, "requires": { - "@angular-devkit/core": "14.1.0", - "rxjs": "6.6.7" + "@angular-devkit/core": "16.1.8", + "rxjs": "7.8.1" }, "dependencies": { - "rxjs": { - "version": "6.6.7", - "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-6.6.7.tgz", - "integrity": "sha512-hTdwr+7yYNIT5n4AMYp85KA6yw2Va0FLa3Rguvbpa4W3I5xynaBZo41cM3XM+4Q6fRMj3sBYIR1VAmZMXYJvRQ==", + "@angular-devkit/core": { + "version": "16.1.8", + "resolved": "https://registry.npmjs.org/@angular-devkit/core/-/core-16.1.8.tgz", + "integrity": "sha512-dSRD/+bGanArIXkj+kaU1kDFleZeQMzmBiOXX+pK0Ah9/0Yn1VmY3RZh1zcX9vgIQXV+t7UPrTpOjaERMUtVGw==", "dev": true, "peer": true, "requires": { - "tslib": "^1.9.0" + "ajv": "8.12.0", + "ajv-formats": "2.1.1", + "jsonc-parser": "3.2.0", + "rxjs": "7.8.1", + "source-map": "0.7.4" } }, - "tslib": { - "version": "1.14.1", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", - "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==", + "ajv": { + "version": "8.12.0", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.12.0.tgz", + "integrity": "sha512-sRu1kpcO9yLtYxBKvqfTeh9KzZEwO3STyX1HT+4CaDzC6HpTGYhIhPIzj9XuKU7KYDwnaeh5hcOwjy1QuJzBPA==", + "dev": true, + "peer": true, + "requires": { + "fast-deep-equal": "^3.1.1", + "json-schema-traverse": "^1.0.0", + "require-from-string": "^2.0.2", + "uri-js": "^4.2.2" + } + }, + "jsonc-parser": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/jsonc-parser/-/jsonc-parser-3.2.0.tgz", + "integrity": "sha512-gfFQZrcTc8CnKXp6Y4/CBT3fTc0OVuDofpre4aEeEpSBPV5X5v4+Vmx+8snU7RLPrNHPKSgLxGo9YuQzz20o+w==", "dev": true, "peer": true } @@ -18492,12 +18466,6 @@ "integrity": "sha512-6v/WJubRsjxBbQdz6izgvx7LsVFvVaGmSdwrFHmEzoVgfXL89hkKPoQHsnVI2ngOkcBUQT9kmAM1hVL1k/Av4A==", "dev": true }, - "jsonc-parser": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/jsonc-parser/-/jsonc-parser-3.2.1.tgz", - "integrity": "sha512-AilxAyFOAcK5wA1+LeaySVBrHsGQvUFCDWXKpZjzaL0PqW+xfBOttn8GNtWKFWqneyMZj41MWF9Kl6iPWLwgOA==", - "dev": true - }, "lru-cache": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", @@ -18579,12 +18547,6 @@ "uri-js": "^4.2.2" } }, - "jsonc-parser": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/jsonc-parser/-/jsonc-parser-3.2.1.tgz", - "integrity": "sha512-AilxAyFOAcK5wA1+LeaySVBrHsGQvUFCDWXKpZjzaL0PqW+xfBOttn8GNtWKFWqneyMZj41MWF9Kl6iPWLwgOA==", - "dev": true - }, "picomatch": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.1.tgz", @@ -18594,66 +18556,60 @@ } }, "@angular-devkit/core": { - "version": "14.1.0", - "resolved": "https://registry.npmjs.org/@angular-devkit/core/-/core-14.1.0.tgz", - "integrity": "sha512-Y2d/+nFmjjY4eatc3cwdDDAnpnhG3KTX2OVW7dXSUxW3eY5e3vdMlVUbFiKwvwAshlrJy85Y6RMvZSBN4VrpnA==", + "version": "16.2.14", + "resolved": "https://registry.npmjs.org/@angular-devkit/core/-/core-16.2.14.tgz", + "integrity": "sha512-Ui14/d2+p7lnmXlK/AX2ieQEGInBV75lonNtPQgwrYgskF8ufCuN0DyVZQUy9fJDkC+xQxbJyYrby/BS0R0e7w==", "dev": true, "peer": true, "requires": { - "ajv": "8.11.0", + "ajv": "8.12.0", "ajv-formats": "2.1.1", - "jsonc-parser": "3.1.0", - "rxjs": "6.6.7", + "jsonc-parser": "3.2.0", + "picomatch": "2.3.1", + "rxjs": "7.8.1", "source-map": "0.7.4" }, "dependencies": { - "rxjs": { - "version": "6.6.7", - "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-6.6.7.tgz", - "integrity": "sha512-hTdwr+7yYNIT5n4AMYp85KA6yw2Va0FLa3Rguvbpa4W3I5xynaBZo41cM3XM+4Q6fRMj3sBYIR1VAmZMXYJvRQ==", + "ajv": { + "version": "8.12.0", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.12.0.tgz", + "integrity": "sha512-sRu1kpcO9yLtYxBKvqfTeh9KzZEwO3STyX1HT+4CaDzC6HpTGYhIhPIzj9XuKU7KYDwnaeh5hcOwjy1QuJzBPA==", "dev": true, "peer": true, "requires": { - "tslib": "^1.9.0" + "fast-deep-equal": "^3.1.1", + "json-schema-traverse": "^1.0.0", + "require-from-string": "^2.0.2", + "uri-js": "^4.2.2" } }, - "tslib": { - "version": "1.14.1", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", - "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==", + "jsonc-parser": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/jsonc-parser/-/jsonc-parser-3.2.0.tgz", + "integrity": "sha512-gfFQZrcTc8CnKXp6Y4/CBT3fTc0OVuDofpre4aEeEpSBPV5X5v4+Vmx+8snU7RLPrNHPKSgLxGo9YuQzz20o+w==", "dev": true, "peer": true } } }, "@angular-devkit/schematics": { - "version": "14.1.0", - "resolved": "https://registry.npmjs.org/@angular-devkit/schematics/-/schematics-14.1.0.tgz", - "integrity": "sha512-5QC01k9eznuQSiqxijKhVkAEmA8sioYuLhBzyffaPszSySH8kPMNxhAc8zJhBTNLumbS6iDaGkSqTQl5Kv9fOw==", + "version": "16.2.14", + "resolved": "https://registry.npmjs.org/@angular-devkit/schematics/-/schematics-16.2.14.tgz", + "integrity": "sha512-B6LQKInCT8w5zx5Pbroext5eFFRTCJdTwHN8GhcVS8IeKCnkeqVTQLjB4lBUg7LEm8Y7UHXwzrVxmk+f+MBXhw==", "dev": true, "peer": true, "requires": { - "@angular-devkit/core": "14.1.0", - "jsonc-parser": "3.1.0", - "magic-string": "0.26.2", + "@angular-devkit/core": "16.2.14", + "jsonc-parser": "3.2.0", + "magic-string": "0.30.1", "ora": "5.4.1", - "rxjs": "6.6.7" + "rxjs": "7.8.1" }, "dependencies": { - "rxjs": { - "version": "6.6.7", - "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-6.6.7.tgz", - "integrity": "sha512-hTdwr+7yYNIT5n4AMYp85KA6yw2Va0FLa3Rguvbpa4W3I5xynaBZo41cM3XM+4Q6fRMj3sBYIR1VAmZMXYJvRQ==", - "dev": true, - "peer": true, - "requires": { - "tslib": "^1.9.0" - } - }, - "tslib": { - "version": "1.14.1", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", - "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==", + "jsonc-parser": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/jsonc-parser/-/jsonc-parser-3.2.0.tgz", + "integrity": "sha512-gfFQZrcTc8CnKXp6Y4/CBT3fTc0OVuDofpre4aEeEpSBPV5X5v4+Vmx+8snU7RLPrNHPKSgLxGo9YuQzz20o+w==", "dev": true, "peer": true } @@ -18751,12 +18707,6 @@ "uri-js": "^4.2.2" } }, - "jsonc-parser": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/jsonc-parser/-/jsonc-parser-3.2.1.tgz", - "integrity": "sha512-AilxAyFOAcK5wA1+LeaySVBrHsGQvUFCDWXKpZjzaL0PqW+xfBOttn8GNtWKFWqneyMZj41MWF9Kl6iPWLwgOA==", - "dev": true - }, "lru-cache": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", @@ -21438,12 +21388,6 @@ "uri-js": "^4.2.2" } }, - "jsonc-parser": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/jsonc-parser/-/jsonc-parser-3.2.1.tgz", - "integrity": "sha512-AilxAyFOAcK5wA1+LeaySVBrHsGQvUFCDWXKpZjzaL0PqW+xfBOttn8GNtWKFWqneyMZj41MWF9Kl6iPWLwgOA==", - "dev": true - }, "magic-string": { "version": "0.30.8", "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.8.tgz", @@ -22286,15 +22230,15 @@ } }, "ajv": { - "version": "8.11.0", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.11.0.tgz", - "integrity": "sha512-wGgprdCvMalC0BztXvitD2hC04YffAvtsUn93JbGXYLAtCUO4xd17mCCZQxUOItiBwZvJScWo8NIvQMQ71rdpg==", + "version": "8.13.0", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.13.0.tgz", + "integrity": "sha512-PRA911Blj99jR5RMeTunVbNXMF6Lp4vZXnk5GQjcnUWUTsrXtekg/pnmFFI2u/I36Y/2bITGS30GZCXei6uNkA==", "dev": true, "requires": { - "fast-deep-equal": "^3.1.1", + "fast-deep-equal": "^3.1.3", "json-schema-traverse": "^1.0.0", "require-from-string": "^2.0.2", - "uri-js": "^4.2.2" + "uri-js": "^4.4.1" } }, "ajv-formats": { @@ -26854,11 +26798,10 @@ "dev": true }, "jsonc-parser": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/jsonc-parser/-/jsonc-parser-3.1.0.tgz", - "integrity": "sha512-DRf0QjnNeCUds3xTjKlQQ3DpJD51GvDjJfnxUVWg6PZTo2otSm+slzNAxU/35hF8/oJIKoG9slq30JYOsF2azg==", - "dev": true, - "peer": true + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/jsonc-parser/-/jsonc-parser-3.2.1.tgz", + "integrity": "sha512-AilxAyFOAcK5wA1+LeaySVBrHsGQvUFCDWXKpZjzaL0PqW+xfBOttn8GNtWKFWqneyMZj41MWF9Kl6iPWLwgOA==", + "dev": true }, "jsonfile": { "version": "6.1.0", @@ -27119,13 +27062,13 @@ "dev": true }, "magic-string": { - "version": "0.26.2", - "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.26.2.tgz", - "integrity": "sha512-NzzlXpclt5zAbmo6h6jNc8zl2gNRGHvmsZW4IvZhTC4W7k4OlLP+S5YLussa/r3ixNT66KOQfNORlXHSOy/X4A==", + "version": "0.30.1", + "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.1.tgz", + "integrity": "sha512-mbVKXPmS0z0G4XqFDCTllmDQ6coZzn94aMlb0o/A4HEHJCKcanlDZwYJgwnkmgD3jyWhUgj9VsPrfd972yPffA==", "dev": true, "peer": true, "requires": { - "sourcemap-codec": "^1.4.8" + "@jridgewell/sourcemap-codec": "^1.4.15" } }, "make-dir": { @@ -27736,18 +27679,6 @@ "dev": true, "optional": true }, - "ajv": { - "version": "8.12.0", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.12.0.tgz", - "integrity": "sha512-sRu1kpcO9yLtYxBKvqfTeh9KzZEwO3STyX1HT+4CaDzC6HpTGYhIhPIzj9XuKU7KYDwnaeh5hcOwjy1QuJzBPA==", - "dev": true, - "requires": { - "fast-deep-equal": "^3.1.1", - "json-schema-traverse": "^1.0.0", - "require-from-string": "^2.0.2", - "uri-js": "^4.2.2" - } - }, "commander": { "version": "12.0.0", "resolved": "https://registry.npmjs.org/commander/-/commander-12.0.0.tgz", @@ -27791,12 +27722,6 @@ "@esbuild/win32-ia32": "0.20.2", "@esbuild/win32-x64": "0.20.2" } - }, - "jsonc-parser": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/jsonc-parser/-/jsonc-parser-3.2.0.tgz", - "integrity": "sha512-gfFQZrcTc8CnKXp6Y4/CBT3fTc0OVuDofpre4aEeEpSBPV5X5v4+Vmx+8snU7RLPrNHPKSgLxGo9YuQzz20o+w==", - "dev": true } } }, @@ -29540,13 +29465,6 @@ } } }, - "sourcemap-codec": { - "version": "1.4.8", - "resolved": "https://registry.npmjs.org/sourcemap-codec/-/sourcemap-codec-1.4.8.tgz", - "integrity": "sha512-9NykojV5Uih4lgo5So5dtw+f0JgJX30KCNI8gwhz2J9A15wD0Ml6tjHKwf6fTSa6fAdVBdZeNOs9eJ71qCk8vA==", - "dev": true, - "peer": true - }, "spdx-correct": { "version": "3.2.0", "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.2.0.tgz", @@ -29772,9 +29690,9 @@ "dev": true }, "tar": { - "version": "6.2.0", - "resolved": "https://registry.npmjs.org/tar/-/tar-6.2.0.tgz", - "integrity": "sha512-/Wo7DcT0u5HUV486xg675HtjNd3BXZ6xDbzsCUZPt5iw8bTQ63bP0Raut3mvro9u+CUyq7YQd8Cx55fsZXxqLQ==", + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/tar/-/tar-6.2.1.tgz", + "integrity": "sha512-DZ4yORTwrbTj/7MZYq2w+/ZFdI6OZ/f9SFHR+71gIVUZhOQPHzVCLpvRnPgyaMpfWxxk/4ONva3GQSyNIKRv6A==", "dev": true, "requires": { "chownr": "^2.0.0", @@ -30172,9 +30090,9 @@ } }, "universalify": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.0.tgz", - "integrity": "sha512-hAZsKq7Yy11Zu1DE0OzWjw7nnLZmJZYTDZZyEFHZdUhV8FkH5MCfoU1XMaxXovpyW5nq5scPqq0ZDP9Zyl04oQ==", + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.1.tgz", + "integrity": "sha512-gptHNQghINnc/vTGIk0SOFGFNXw7JVrlRUtConJRlvaw6DuX0wO5Jeko9sWrMBhh+PsYAZ7oXAiOnf/UKogyiw==", "dev": true }, "unpipe": { diff --git a/package.json b/package.json index 5d87873c..078f7f8a 100644 --- a/package.json +++ b/package.json @@ -58,4 +58,4 @@ "pre-commit": "pretty-quick --staged" } } -} \ No newline at end of file +} diff --git a/projects/demo/src/app/app.component.ts b/projects/demo/src/app/app.component.ts index 4ef7ff94..3100438a 100644 --- a/projects/demo/src/app/app.component.ts +++ b/projects/demo/src/app/app.component.ts @@ -1,6 +1,8 @@ import { Component } from '@angular/core'; import { AccessibilityPageComponent, + AccordionItemPageComponent, + AccordionPageComponent, AvatarPageComponent, AvatarPilePageComponent, BreakpointPageComponent, @@ -80,6 +82,8 @@ export const menu: IDemoMenuSection[] = [ { view: 'datepicker', title: 'Date Picker', type: DatePickerPageComponent }, { view: 'datetime', title: 'Date/time', type: DateTimePageComponent }, { view: 'dropdown', title: 'Dropdown', type: DropdownPageComponent }, + { view: 'accordion', title: 'Accordion', type: AccordionPageComponent }, + { view: 'accordion-item', title: 'Accordion item', type: AccordionItemPageComponent }, { view: 'expander', title: 'Expander', type: ExpanderPageComponent }, { view: 'infinite-scroll', title: 'Infinite scroll', type: InfiniteScrollPageComponent }, { view: 'popup', title: 'Popup', type: PopupPageComponent }, diff --git a/projects/demo/src/app/demo/index.ts b/projects/demo/src/app/demo/index.ts index 9f2fa3c7..82f8781b 100644 --- a/projects/demo/src/app/demo/index.ts +++ b/projects/demo/src/app/demo/index.ts @@ -4,6 +4,7 @@ export * from './demo.module'; export * from './demo-menu/demo-menu.component'; export * from './demo-page/demo-page.component'; +export * from './pages/accordion-page'; export * from './pages/accessibility/accessibility-page.component'; export * from './pages/avatar-page/avatar-page.component'; export * from './pages/avatar-pile-page/avatar-pile-page.component'; @@ -39,6 +40,7 @@ export * from './pages/native-text-field-page/native-text-field-page.component'; export * from './pages/palette-page/palette-page.component'; export * from './pages/popover-page/popover-page.component'; export * from './pages/popup-page/popup-page.component'; +export * from './pages/radio-page/radio-page.component'; export * from './pages/scroll-pages'; export * from './pages/scrollbar-page/scrollbar-page.component'; export * from './pages/select-page'; diff --git a/projects/demo/src/app/demo/pages/accordion-page/accordion-item-page.component.html b/projects/demo/src/app/demo/pages/accordion-page/accordion-item-page.component.html new file mode 100644 index 00000000..3163e084 --- /dev/null +++ b/projects/demo/src/app/demo/pages/accordion-page/accordion-item-page.component.html @@ -0,0 +1,68 @@ + + Accordion item + +

Accordion item allows to expand/collapse a section.

+

+ It can be used by itself using its + expanded + input, or grouped in an + accordion + component +

+
+ + + +

Some content

+

Some content that can be long or short.

+

+ Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore + magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo + consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla + pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id + est laborum. +

+
+
+
+ + +

Inputs

+
+
description
+
Optional description to be displayed below the title in the item’s header.
+
expanded
+
+ Boolean controlling the state of the item: expanded when true. + (false, and so collapsed by default) +
+
id
+
+ Item identifier. + required +
+
itemTitle
+
Item title to be displayed on the item’s header
+
+ +

Outputs

+
+
expandedChange
+
+ Event emitted when toggling the accordion item. It contains a boolean corresponding to the new item state. +
+
+ +

Directive

+ +

The item content must be wrapped in pa-accordion-item-body tag.

+
+ + +
{{code}}
+
+
diff --git a/projects/demo/src/app/demo/pages/accordion-page/accordion-item-page.component.ts b/projects/demo/src/app/demo/pages/accordion-page/accordion-item-page.component.ts new file mode 100644 index 00000000..f13cbb3e --- /dev/null +++ b/projects/demo/src/app/demo/pages/accordion-page/accordion-item-page.component.ts @@ -0,0 +1,24 @@ +import { ChangeDetectionStrategy, Component } from '@angular/core'; +import { PaDemoModule } from '../../demo.module'; +import { AccordionBodyDirective, AccordionItemComponent } from '@guillotinaweb/pastanaga-angular'; +import { RouterLink } from '@angular/router'; + +@Component({ + standalone: true, + imports: [PaDemoModule, AccordionItemComponent, AccordionBodyDirective, RouterLink], + templateUrl: './accordion-item-page.component.html', + changeDetection: ChangeDetectionStrategy.OnPush, +}) +export class AccordionItemPageComponent { + expanded = false; + + code = ` + + Some content + +`; +} diff --git a/projects/demo/src/app/demo/pages/accordion-page/accordion-page.component.html b/projects/demo/src/app/demo/pages/accordion-page/accordion-page.component.html new file mode 100644 index 00000000..0ef2c723 --- /dev/null +++ b/projects/demo/src/app/demo/pages/accordion-page/accordion-page.component.html @@ -0,0 +1,70 @@ + + Accordion + + +

+ Accordion component allows to control a group of accordion items. + By default, opening an item will automatically close other opened item if any. +

+
+ + + + +

Content 1

+

Some content that can be long or short.

+

+ Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et + dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex + ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat + nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit + anim id est laborum. +

+
+
+ + +

Content 2

+

Some content that can be long or short.

+
+
+ + +

Content 3

+

Some content that can be long or short.

+
+
+ + +

Content 4

+

Some content that can be long or short.

+
+
+
+
+ + +

Inputs

+
+
allowMultipleExpanded
+
+ Set to true to prevent items to be automatically closed when opening another one. + (false by default) +
+
+
+ + +
{{code}}
+
+
diff --git a/projects/demo/src/app/demo/pages/accordion-page/accordion-page.component.ts b/projects/demo/src/app/demo/pages/accordion-page/accordion-page.component.ts new file mode 100644 index 00000000..dea43b03 --- /dev/null +++ b/projects/demo/src/app/demo/pages/accordion-page/accordion-page.component.ts @@ -0,0 +1,45 @@ +import { ChangeDetectionStrategy, Component } from '@angular/core'; +import { PaDemoModule } from '../../demo.module'; +import { AccordionBodyDirective, AccordionComponent, AccordionItemComponent } from '@guillotinaweb/pastanaga-angular'; +import { RouterLink } from '@angular/router'; + +@Component({ + standalone: true, + imports: [PaDemoModule, AccordionComponent, AccordionItemComponent, AccordionBodyDirective, RouterLink], + templateUrl: './accordion-page.component.html', + changeDetection: ChangeDetectionStrategy.OnPush, +}) +export class AccordionPageComponent { + code = ` + + + Some content + + + + +

Content 2

+
+
+ + +

Content 3

+
+
+ + +

Content 4

+
+
+
`; +} diff --git a/projects/demo/src/app/demo/pages/accordion-page/index.ts b/projects/demo/src/app/demo/pages/accordion-page/index.ts new file mode 100644 index 00000000..b994caab --- /dev/null +++ b/projects/demo/src/app/demo/pages/accordion-page/index.ts @@ -0,0 +1,2 @@ +export * from './accordion-page.component'; +export * from './accordion-item-page.component'; diff --git a/projects/demo/src/app/demo/pages/select-page/select-page.component.html b/projects/demo/src/app/demo/pages/select-page/select-page.component.html index 08151516..7808d35e 100644 --- a/projects/demo/src/app/demo/pages/select-page/select-page.component.html +++ b/projects/demo/src/app/demo/pages/select-page/select-page.component.html @@ -72,7 +72,20 @@

Dynamic options

This is a quite long option which should show an ellipsis This option is even longer and should also show an ellipsis + This option has a label and a description and should also show an ellipsis +
+

+ Show select containing options with description: + + working only with options provided through + options + Input + +

+
diff --git a/projects/demo/src/app/demo/pages/select-page/select-page.component.ts b/projects/demo/src/app/demo/pages/select-page/select-page.component.ts index 6bf623c6..adaaa159 100644 --- a/projects/demo/src/app/demo/pages/select-page/select-page.component.ts +++ b/projects/demo/src/app/demo/pages/select-page/select-page.component.ts @@ -8,6 +8,23 @@ import { OptionHeaderModel, OptionModel, OptionSeparator } from '@guillotinaweb/ export class SelectPageComponent { model = ''; selectedTab = 'standalone'; + + optionsWithDescription: (OptionModel | OptionSeparator | OptionHeaderModel)[] = [ + new OptionModel({ id: 'desc1', label: 'Option 1', help: 'Description 1', value: 'desc1' }), + new OptionModel({ + id: 'desc2', + label: 'Another option with description', + help: 'Some description to be displayed', + value: 'desc2', + }), + new OptionModel({ + id: 'desc3', + label: 'Super long option with description showing an ellipsis', + help: 'Another description to be displayed which is also really really long and should has an ellipsis as well', + value: 'desc3', + }), + ]; + dropdownContent: (OptionModel | OptionSeparator | OptionHeaderModel)[] = [ new OptionHeaderModel({ id: 'audio', label: 'Audio' }), new OptionModel({ id: 'file1', label: 'User 1', value: 'user1' }), diff --git a/projects/demo/src/app/demo/pages/toggle-page/toggle-page.component.html b/projects/demo/src/app/demo/pages/toggle-page/toggle-page.component.html index 0f333f27..8d0ce5dc 100644 --- a/projects/demo/src/app/demo/pages/toggle-page/toggle-page.component.html +++ b/projects/demo/src/app/demo/pages/toggle-page/toggle-page.component.html @@ -165,6 +165,12 @@

Inputs

(default: false) +
spaceBetweenLabelAndToggle
+
+ Display label and toggle with space between them instead of close to each others. + (default: false) +
+
withBackground
Display a background on the toggle box diff --git a/projects/pastanaga-angular/package.json b/projects/pastanaga-angular/package.json index 23c36b1b..147d117d 100644 --- a/projects/pastanaga-angular/package.json +++ b/projects/pastanaga-angular/package.json @@ -1,7 +1,7 @@ { "name": "@guillotinaweb/pastanaga-angular", "description": "Provides Pastanaga UI elements as Angular components", - "version": "2.65.20", + "version": "2.66.0", "license": "MIT", "keywords": [ "angular", diff --git a/projects/pastanaga-angular/src/lib/accordion/accordion-item/accordion-item.component.html b/projects/pastanaga-angular/src/lib/accordion/accordion-item/accordion-item.component.html new file mode 100644 index 00000000..703bb752 --- /dev/null +++ b/projects/pastanaga-angular/src/lib/accordion/accordion-item/accordion-item.component.html @@ -0,0 +1,19 @@ +
+ + {{ (expanded ? 'pastanaga.collapse' : 'pastanaga.expand') | translate }} + +
+
{{ itemTitle }}
+
{{ description }}
+
+
+ +
+ +
diff --git a/projects/pastanaga-angular/src/lib/accordion/accordion-item/accordion-item.component.scss b/projects/pastanaga-angular/src/lib/accordion/accordion-item/accordion-item.component.scss new file mode 100644 index 00000000..7332d992 --- /dev/null +++ b/projects/pastanaga-angular/src/lib/accordion/accordion-item/accordion-item.component.scss @@ -0,0 +1,81 @@ +@import '../../../styles/variables'; + +$padding-accordion-body: rhythm(2); + +:host { + border: 1px solid $color-neutral-light; + border-bottom: none; + display: block; + + &:first-of-type { + border-top-left-radius: $border-radius-default; + border-top-right-radius: $border-radius-default; + } + &:last-of-type { + border-bottom: 1px solid $color-neutral-light; + border-bottom-left-radius: $border-radius-default; + border-bottom-right-radius: $border-radius-default; + } + + .pa-accordion-item-header { + align-items: center; + cursor: pointer; + display: flex; + gap: rhythm(1); + padding: rhythm(1.5) rhythm(2) rhythm(1.5) rhythm(1); + position: relative; + + &:after { + background: $color-neutral-lighter; + bottom: 0; + content: ''; + height: 0; + left: rhythm(2); + position: absolute; + width: calc(100% - #{rhythm(4)}); + } + + .pa-accordion-item-title { + flex: 1; + + .body-s { + color: $color-neutral-regular; + } + } + + .pa-accordion-button ::ng-deep .pa-button { + transition: transform $transition-hint; + } + } + + .pa-accordion-item-body { + height: calc(var(--contentHeight, 1px) + #{$padding-accordion-body} * 2); + opacity: 1; + padding: $padding-accordion-body; + transition: + height $transition-response, + opacity $transition-hint, + padding $transition-response; + } + + &.pa-accordion-collapsed { + .pa-accordion-item-body { + height: 0; + opacity: 0; + padding: 0 $padding-accordion-body; + position: relative; + z-index: -1; + } + } + + &:not(.pa-accordion-collapsed) { + .pa-accordion-item-header { + .pa-accordion-button ::ng-deep .pa-button { + transform: rotate(90deg); + } + &:after { + height: 1px; + } + } + } +} diff --git a/projects/pastanaga-angular/src/lib/accordion/accordion-item/accordion-item.component.ts b/projects/pastanaga-angular/src/lib/accordion/accordion-item/accordion-item.component.ts new file mode 100644 index 00000000..40bf8e15 --- /dev/null +++ b/projects/pastanaga-angular/src/lib/accordion/accordion-item/accordion-item.component.ts @@ -0,0 +1,66 @@ +import { + AfterViewInit, + booleanAttribute, + ChangeDetectionStrategy, + ChangeDetectorRef, + Component, + ContentChild, + Directive, + ElementRef, + EventEmitter, + HostBinding, + inject, + Input, + Output, +} from '@angular/core'; +import { PaButtonModule } from '../../button'; +import { PaTranslateModule } from '../../translate'; + +@Directive({ + selector: 'pa-accordion-item-body', + standalone: true, +}) +export class AccordionBodyDirective {} + +@Component({ + selector: 'pa-accordion-item', + standalone: true, + imports: [PaButtonModule, PaTranslateModule], + templateUrl: './accordion-item.component.html', + styleUrl: './accordion-item.component.scss', + changeDetection: ChangeDetectionStrategy.OnPush, +}) +export class AccordionItemComponent implements AfterViewInit { + private cdr = inject(ChangeDetectorRef); + private elementRef = inject(ElementRef); + + @Input({ required: true }) id = ''; + @Input({ required: true }) itemTitle = ''; + @Input() description = ''; + @Input({ transform: booleanAttribute }) expanded = false; + + @Output() expandedChange = new EventEmitter(); + + @ContentChild(AccordionBodyDirective, { read: ElementRef }) itemContent?: ElementRef; + @HostBinding('class.pa-accordion-collapsed') get collapsed() { + return !this.expanded; + } + + ngAfterViewInit() { + this.updateContentHeight(); + } + + toggleAccordion() { + this.expandedChange.emit(!this.expanded); + } + + updateContentHeight() { + setTimeout(() => { + this.elementRef.nativeElement.style.setProperty( + '--contentHeight', + `${this.itemContent?.nativeElement.getBoundingClientRect().height}px`, + ); + this.cdr.detectChanges(); + }); + } +} diff --git a/projects/pastanaga-angular/src/lib/accordion/accordion.component.scss b/projects/pastanaga-angular/src/lib/accordion/accordion.component.scss new file mode 100644 index 00000000..e69de29b diff --git a/projects/pastanaga-angular/src/lib/accordion/accordion.component.ts b/projects/pastanaga-angular/src/lib/accordion/accordion.component.ts new file mode 100644 index 00000000..bc1128f3 --- /dev/null +++ b/projects/pastanaga-angular/src/lib/accordion/accordion.component.ts @@ -0,0 +1,56 @@ +import { + AfterViewInit, + booleanAttribute, + ChangeDetectionStrategy, + Component, + ContentChildren, + EventEmitter, + Input, + OnDestroy, + Output, + QueryList, +} from '@angular/core'; +import { AccordionItemComponent } from './accordion-item/accordion-item.component'; +import { Subject } from 'rxjs'; +import { takeUntil } from 'rxjs/operators'; + +@Component({ + selector: 'pa-accordion', + standalone: true, + imports: [], + template: ` + + `, + styleUrl: './accordion.component.scss', + changeDetection: ChangeDetectionStrategy.OnPush, +}) +export class AccordionComponent implements AfterViewInit, OnDestroy { + private unsubscribeAll = new Subject(); + + @Input({ transform: booleanAttribute }) allowMultipleExpanded = false; + + @Output() toggleAccordion = new EventEmitter(); + + @ContentChildren(AccordionItemComponent) items?: QueryList; + + ngAfterViewInit() { + this.items?.forEach((item) => { + item.expandedChange.pipe(takeUntil(this.unsubscribeAll)).subscribe((expanded) => { + item.expanded = expanded; + this.toggleAccordion.emit(); + if (!this.allowMultipleExpanded && expanded) { + this.items?.forEach((otherItem) => { + if (otherItem.id !== item.id) { + otherItem.expanded = false; + } + }); + } + }); + }); + } + + ngOnDestroy() { + this.unsubscribeAll.next(); + this.unsubscribeAll.complete(); + } +} diff --git a/projects/pastanaga-angular/src/lib/accordion/index.ts b/projects/pastanaga-angular/src/lib/accordion/index.ts new file mode 100644 index 00000000..6ef050e3 --- /dev/null +++ b/projects/pastanaga-angular/src/lib/accordion/index.ts @@ -0,0 +1,2 @@ +export * from './accordion.component'; +export * from './accordion-item/accordion-item.component'; diff --git a/projects/pastanaga-angular/src/lib/controls/control.model.ts b/projects/pastanaga-angular/src/lib/controls/control.model.ts index 4e7b4728..eb6a5314 100644 --- a/projects/pastanaga-angular/src/lib/controls/control.model.ts +++ b/projects/pastanaga-angular/src/lib/controls/control.model.ts @@ -1,3 +1,5 @@ +import { IconModel } from '../icon'; + export enum ControlType { checkbox = 'checkbox', radio = 'radio', @@ -22,6 +24,8 @@ export interface IOptionModel extends IControlModel { destructive?: boolean; dontCloseOnSelect?: boolean; hasSeparator?: boolean; + iconModel?: IconModel; + iconOnRight?: boolean; } export class BaseControlModel { @@ -59,12 +63,16 @@ export class OptionModel extends ControlModel { destructive: boolean; dontCloseOnSelect: boolean; hasSeparator: boolean; + iconModel?: IconModel; + iconOnRight?: boolean; constructor(data: IOptionModel) { super({ ...data, type: ControlType.option }); this.destructive = data.destructive || false; this.dontCloseOnSelect = data.dontCloseOnSelect || false; this.hasSeparator = data.hasSeparator || false; + this.iconModel = data.iconModel; + this.iconOnRight = data.iconOnRight || false; } } diff --git a/projects/pastanaga-angular/src/lib/controls/textfield/select/select-options/select-options.component.html b/projects/pastanaga-angular/src/lib/controls/textfield/select/select-options/select-options.component.html index 6ea08c97..5a8260e5 100644 --- a/projects/pastanaga-angular/src/lib/controls/textfield/select/select-options/select-options.component.html +++ b/projects/pastanaga-angular/src/lib/controls/textfield/select/select-options/select-options.component.html @@ -14,8 +14,10 @@ [selected]="typedOption.option.selected" [destructive]="typedOption.option.destructive" [dontCloseOnSelect]="typedOption.option.dontCloseOnSelect" - [icon]="typedOption.option.icon" + [icon]="typedOption.option.iconModel || typedOption.option.icon" + [iconOnRight]="typedOption.option.iconOnRight" [value]="typedOption.option.value" + [description]="typedOption.option.help" (selectOption)="selectOption(typedOption.option)"> {{ typedOption.option.label }} diff --git a/projects/pastanaga-angular/src/lib/controls/textfield/select/select.component.html b/projects/pastanaga-angular/src/lib/controls/textfield/select/select.component.html index 212bc204..c64f6497 100644 --- a/projects/pastanaga-angular/src/lib/controls/textfield/select/select.component.html +++ b/projects/pastanaga-angular/src/lib/controls/textfield/select/select.component.html @@ -15,12 +15,11 @@ tabindex="0" cdkMonitorElementFocus sameWidth - paEllipsisTooltip - [paEllipsisContent]="displayedValue" [class.pa-field-control-filled]="hasValue || isOpened" [class.read-only]="readonly" [class.disabled]="control.disabled" [class.expanded]="isOpened" + [class.pa-select-with-help]="selectedOption && selectedOption.help" [id]="id" [attr.name]="name" [attr.aria-label]="label" @@ -31,12 +30,24 @@ (mousedown)="onMouseDown()" (mouseup)="onMouseUp()" (cdkFocusChange)="onControlFocused($event)"> - - {{ displayedValue }} - +
+ + {{ displayedValue }} + + @if (selectedOption && selectedOption.help) { + + {{ selectedOption.help }} + + } +