From 29d56edd3886d4c4c99ecbc0858d32d3fcdf1721 Mon Sep 17 00:00:00 2001 From: TechQuery Date: Fri, 21 Feb 2025 15:17:57 +0800 Subject: [PATCH] [add] Row & Col components [refactor] rewrite Alert & BreadCrumb components to WebCell v3 [optimize] Class updating of Nav component [fix] Pagination margin bugs [optimize] update Upstream packages --- package.json | 4 +- pnpm-lock.yaml | 144 ++++++++++++++++---------------- source/Layout/Grid.tsx | 80 +++++++++++++++++- source/Navigator/BreadCrumb.tsx | 31 +++++++ source/Navigator/Nav.tsx | 48 +++++++++-- source/Navigator/Pagination.tsx | 6 +- source/Prompt/Alert.tsx | 51 +++++++++++ v1/Navigator/BreadCrumb.tsx | 29 ------- v1/Prompt/Alert.tsx | 51 ----------- 9 files changed, 278 insertions(+), 166 deletions(-) create mode 100644 source/Navigator/BreadCrumb.tsx create mode 100644 source/Prompt/Alert.tsx delete mode 100644 v1/Navigator/BreadCrumb.tsx delete mode 100644 v1/Prompt/Alert.tsx diff --git a/package.json b/package.json index 2c645436..b748d531 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "boot-cell", - "version": "2.0.0-rc.1", + "version": "2.0.0-rc.2", "license": "LGPL-3.0", "author": "shiy2008@gmail.com", "description": "Web Components UI library based on WebCell v3, BootStrap v5, BootStrap Icon v1 & FontAwesome v6", @@ -31,7 +31,7 @@ "mobx": "^6.13.6", "regenerator-runtime": "^0.14.1", "web-cell": "^3.0.3", - "web-utility": "^4.4.2" + "web-utility": "^4.4.3" }, "peerDependencies": { "@fortawesome/fontawesome-free": "^6", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 4c227003..f9c13e0b 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -30,8 +30,8 @@ importers: specifier: ^3.0.3 version: 3.0.3(typescript@5.7.3) web-utility: - specifier: ^4.4.2 - version: 4.4.2(typescript@5.7.3) + specifier: ^4.4.3 + version: 4.4.3(typescript@5.7.3) devDependencies: '@jest/types': specifier: ^29.6.3 @@ -80,7 +80,7 @@ importers: version: 3.0.0 jest: specifier: ^29.7.0 - version: 29.7.0(@types/node@22.13.4)(ts-node@10.9.2(@swc/core@1.10.17(@swc/helpers@0.5.15))(@types/node@22.13.4)(typescript@5.7.3)) + version: 29.7.0(@types/node@22.13.4)(ts-node@10.9.2(@swc/core@1.10.18(@swc/helpers@0.5.15))(@types/node@22.13.4)(typescript@5.7.3)) less: specifier: ^4.2.2 version: 4.2.2 @@ -101,10 +101,10 @@ importers: version: 3.5.1 ts-jest: specifier: ^29.2.5 - version: 29.2.5(@babel/core@7.26.9)(@jest/transform@29.7.0)(@jest/types@29.6.3)(babel-jest@29.7.0(@babel/core@7.26.9))(jest@29.7.0(@types/node@22.13.4)(ts-node@10.9.2(@swc/core@1.10.17(@swc/helpers@0.5.15))(@types/node@22.13.4)(typescript@5.7.3)))(typescript@5.7.3) + version: 29.2.5(@babel/core@7.26.9)(@jest/transform@29.7.0)(@jest/types@29.6.3)(babel-jest@29.7.0(@babel/core@7.26.9))(jest@29.7.0(@types/node@22.13.4)(ts-node@10.9.2(@swc/core@1.10.18(@swc/helpers@0.5.15))(@types/node@22.13.4)(typescript@5.7.3)))(typescript@5.7.3) ts-node: specifier: ^10.9.2 - version: 10.9.2(@swc/core@1.10.17(@swc/helpers@0.5.15))(@types/node@22.13.4)(typescript@5.7.3) + version: 10.9.2(@swc/core@1.10.18(@swc/helpers@0.5.15))(@types/node@22.13.4)(typescript@5.7.3) typedoc: specifier: ^0.27.7 version: 0.27.7(typescript@5.7.3) @@ -823,68 +823,68 @@ packages: '@sinonjs/fake-timers@10.3.0': resolution: {integrity: sha512-V4BG07kuYSUkTCSBHG8G8TNhM+F19jXFWnQtzj+we8DrkpSBCee9Z3Ms8yiGer/dlmhe35/Xdgyo3/0rQKg7YA==} - '@swc/core-darwin-arm64@1.10.17': - resolution: {integrity: sha512-LSQhSjESleTc0c45BnVKRacp9Nl4zhJMlV/nmhpFCOv/CqHI5YBDX5c9bPk9jTRNHIf0QH92uTtswt8yN++TCQ==} + '@swc/core-darwin-arm64@1.10.18': + resolution: {integrity: sha512-FdGqzAIKVQJu8ROlnHElP59XAUsUzCFSNsou+tY/9ba+lhu8R9v0OI5wXiPErrKGZpQFMmx/BPqqhx3X4SuGNg==} engines: {node: '>=10'} cpu: [arm64] os: [darwin] - '@swc/core-darwin-x64@1.10.17': - resolution: {integrity: sha512-TTaZFS4jLuA3y6+D2HYv4yVGhmjkOGG6KyAwBiJEeoUaazX5MYOyQwaZBPhRGtzHZFrzi4t4jNix4kAkMajPkQ==} + '@swc/core-darwin-x64@1.10.18': + resolution: {integrity: sha512-RZ73gZRituL/ZVLgrW6BYnQ5g8tuStG4cLUiPGJsUZpUm0ullSH6lHFvZTCBNFTfpQChG6eEhi2IdG6DwFp1lw==} engines: {node: '>=10'} cpu: [x64] os: [darwin] - '@swc/core-linux-arm-gnueabihf@1.10.17': - resolution: {integrity: sha512-8P+ESJyGnVdJi0nUcQfxkbTiB/7hnu6N3U72KbvHFBcuroherwzW4DId1XD4RTU2Cjsh1dztZoCcOLY8W9RW1Q==} + '@swc/core-linux-arm-gnueabihf@1.10.18': + resolution: {integrity: sha512-8iJqI3EkxJuuq21UHoen1VS+QlS23RvynRuk95K+Q2HBjygetztCGGEc+Xelx9a0uPkDaaAtFvds4JMDqb9SAA==} engines: {node: '>=10'} cpu: [arm] os: [linux] - '@swc/core-linux-arm64-gnu@1.10.17': - resolution: {integrity: sha512-zT21jDQCe+IslzOtw+BD/9ElO/H4qU4fkkOeVQ68PcxuqYS2gwyDxWqa9IGwpzWexYM+Lzi1rAbl/1BM6nGW8Q==} + '@swc/core-linux-arm64-gnu@1.10.18': + resolution: {integrity: sha512-8f1kSktWzMB6PG+r8lOlCfXz5E8Qhsmfwonn77T/OfjvGwQaWrcoASh2cdjpk3dydbf8jsKGPQE1lSc7GyjXRQ==} engines: {node: '>=10'} cpu: [arm64] os: [linux] - '@swc/core-linux-arm64-musl@1.10.17': - resolution: {integrity: sha512-C2jaW1X+93HscVcesKYgSuZ9GaKqKcQvwvD+q+4JZkaKF4Zopt/aguc6Tmn/nuavRk0WV8yVCpHXoP7lz/2akA==} + '@swc/core-linux-arm64-musl@1.10.18': + resolution: {integrity: sha512-4rv+E4VLdgQw6zjbTAauCAEExxChvxMpBUMCiZweTNPKbJJ2dY6BX2WGJ1ea8+RcgqR/Xysj3AFbOz1LBz6dGA==} engines: {node: '>=10'} cpu: [arm64] os: [linux] - '@swc/core-linux-x64-gnu@1.10.17': - resolution: {integrity: sha512-vfyxqV5gddurG2NVJLemR/68s7GTe0QruozrZiDpNqr9V4VX9t3PadDKMDAvQz6jKrtiqMtshNXQTNRKAKlzFw==} + '@swc/core-linux-x64-gnu@1.10.18': + resolution: {integrity: sha512-vTNmyRBVP+sZca+vtwygYPGTNudTU6Gl6XhaZZ7cEUTBr8xvSTgEmYXoK/2uzyXpaTUI4Bmtp1x81cGN0mMoLQ==} engines: {node: '>=10'} cpu: [x64] os: [linux] - '@swc/core-linux-x64-musl@1.10.17': - resolution: {integrity: sha512-8M+nI5MHZGQUnXyfTLsGw85a3oQRXMsFjgMZuOEJO9ZGBIEnYVuWOxENfcP6MmlJmTOW+cJxHnMGhKY+fjcntw==} + '@swc/core-linux-x64-musl@1.10.18': + resolution: {integrity: sha512-1TZPReKhFCeX776XaT6wegknfg+g3zODve+r4oslFHI+g7cInfWlxoGNDS3niPKyuafgCdOjme2g3OF+zzxfsQ==} engines: {node: '>=10'} cpu: [x64] os: [linux] - '@swc/core-win32-arm64-msvc@1.10.17': - resolution: {integrity: sha512-iUeIBFM6c/NwsreLFSAH395Dahc+54mSi0Kq//IrZ2Y16VlqCV7VHdOIMrdAyDoBFUvh0jKuLJPWt+jlKGtSLg==} + '@swc/core-win32-arm64-msvc@1.10.18': + resolution: {integrity: sha512-o/2CsaWSN3bkzVQ6DA+BiFKSVEYvhWGA1h+wnL2zWmIDs2Knag54sOEXZkCaf8YQyZesGeXJtPEy9hh/vjJgkA==} engines: {node: '>=10'} cpu: [arm64] os: [win32] - '@swc/core-win32-ia32-msvc@1.10.17': - resolution: {integrity: sha512-lPXYFvkfYIN8HdNmG6dCnQqgA+rOSTgeAjIhGsYCEyLsYkkhF2FQw34OF6PnWawQ6hOdOE9v6Bw3T4enj3Lb6w==} + '@swc/core-win32-ia32-msvc@1.10.18': + resolution: {integrity: sha512-eTPASeJtk4mJDfWiYEiOC6OYUi/N7meHbNHcU8e+aKABonhXrIo/FmnTE8vsUtC6+jakT1TQBdiQ8fzJ1kJVwA==} engines: {node: '>=10'} cpu: [ia32] os: [win32] - '@swc/core-win32-x64-msvc@1.10.17': - resolution: {integrity: sha512-KrnkFEWpBmxSe8LixhAZXeeUwTNDVukrPeXJ1PiG+pmb5nI989I9J9IQVIgBv+JXXaK+rmiWjlcIkphaDJJEAA==} + '@swc/core-win32-x64-msvc@1.10.18': + resolution: {integrity: sha512-1Dud8CDBnc34wkBOboFBQud9YlV1bcIQtKSg7zC8LtwR3h+XAaCayZPkpGmmAlCv1DLQPvkF+s0JcaVC9mfffQ==} engines: {node: '>=10'} cpu: [x64] os: [win32] - '@swc/core@1.10.17': - resolution: {integrity: sha512-FXZx7jHpiwz4fTuuueWwsvN7VFLSoeS3mcxCTPUNOHs/K2ecaBO+slh5T5Xvt/KGuD2I/2T8G6Zts0maPkt2lQ==} + '@swc/core@1.10.18': + resolution: {integrity: sha512-IUWKD6uQYGRy8w2X9EZrtYg1O3SCijlHbCXzMaHQYc1X7yjijQh4H3IVL9ssZZyVp2ZDfQZu4bD5DWxxvpyjvg==} engines: {node: '>=10'} peerDependencies: '@swc/helpers': '*' @@ -2615,8 +2615,8 @@ packages: peerDependencies: typescript: ^4.1.0 - web-utility@4.4.2: - resolution: {integrity: sha512-mpUh9jQ4SGSRKehfQKsvMMItzeRb5SPvYbbyksvWy5HPVsKh8VOS6ijVD0PiwaFGuv729Dg+oXzWyiibSZVCBw==} + web-utility@4.4.3: + resolution: {integrity: sha512-QGnqRBbHOuvuhgMCJFoIHe9O47ZLEAkdjVdOPGq8jhzRlLNlU6UrLs7/Cco6XpLJOByMHP8UKc5rRt/vgmtVoA==} peerDependencies: typescript: '>=4.1' @@ -2894,7 +2894,7 @@ snapshots: jest-util: 29.7.0 slash: 3.0.0 - '@jest/core@29.7.0(ts-node@10.9.2(@swc/core@1.10.17(@swc/helpers@0.5.15))(@types/node@22.13.4)(typescript@5.7.3))': + '@jest/core@29.7.0(ts-node@10.9.2(@swc/core@1.10.18(@swc/helpers@0.5.15))(@types/node@22.13.4)(typescript@5.7.3))': dependencies: '@jest/console': 29.7.0 '@jest/reporters': 29.7.0 @@ -2908,7 +2908,7 @@ snapshots: exit: 0.1.2 graceful-fs: 4.2.11 jest-changed-files: 29.7.0 - jest-config: 29.7.0(@types/node@22.13.4)(ts-node@10.9.2(@swc/core@1.10.17(@swc/helpers@0.5.15))(@types/node@22.13.4)(typescript@5.7.3)) + jest-config: 29.7.0(@types/node@22.13.4)(ts-node@10.9.2(@swc/core@1.10.18(@swc/helpers@0.5.15))(@types/node@22.13.4)(typescript@5.7.3)) jest-haste-map: 29.7.0 jest-message-util: 29.7.0 jest-regex-util: 29.6.3 @@ -3332,7 +3332,7 @@ snapshots: '@parcel/plugin': 2.13.3(@parcel/core@2.13.3(@swc/helpers@0.5.15)) '@parcel/source-map': 2.1.1 '@parcel/utils': 2.13.3 - '@swc/core': 1.10.17(@swc/helpers@0.5.15) + '@swc/core': 1.10.18(@swc/helpers@0.5.15) nullthrows: 1.1.1 transitivePeerDependencies: - '@parcel/core' @@ -3348,7 +3348,7 @@ snapshots: '@parcel/types': 2.13.3(@parcel/core@2.13.3(@swc/helpers@0.5.15)) '@parcel/utils': 2.13.3 '@parcel/workers': 2.13.3(@parcel/core@2.13.3(@swc/helpers@0.5.15)) - '@swc/core': 1.10.17(@swc/helpers@0.5.15) + '@swc/core': 1.10.18(@swc/helpers@0.5.15) semver: 7.7.1 transitivePeerDependencies: - '@swc/helpers' @@ -3789,51 +3789,51 @@ snapshots: dependencies: '@sinonjs/commons': 3.0.1 - '@swc/core-darwin-arm64@1.10.17': + '@swc/core-darwin-arm64@1.10.18': optional: true - '@swc/core-darwin-x64@1.10.17': + '@swc/core-darwin-x64@1.10.18': optional: true - '@swc/core-linux-arm-gnueabihf@1.10.17': + '@swc/core-linux-arm-gnueabihf@1.10.18': optional: true - '@swc/core-linux-arm64-gnu@1.10.17': + '@swc/core-linux-arm64-gnu@1.10.18': optional: true - '@swc/core-linux-arm64-musl@1.10.17': + '@swc/core-linux-arm64-musl@1.10.18': optional: true - '@swc/core-linux-x64-gnu@1.10.17': + '@swc/core-linux-x64-gnu@1.10.18': optional: true - '@swc/core-linux-x64-musl@1.10.17': + '@swc/core-linux-x64-musl@1.10.18': optional: true - '@swc/core-win32-arm64-msvc@1.10.17': + '@swc/core-win32-arm64-msvc@1.10.18': optional: true - '@swc/core-win32-ia32-msvc@1.10.17': + '@swc/core-win32-ia32-msvc@1.10.18': optional: true - '@swc/core-win32-x64-msvc@1.10.17': + '@swc/core-win32-x64-msvc@1.10.18': optional: true - '@swc/core@1.10.17(@swc/helpers@0.5.15)': + '@swc/core@1.10.18(@swc/helpers@0.5.15)': dependencies: '@swc/counter': 0.1.3 '@swc/types': 0.1.17 optionalDependencies: - '@swc/core-darwin-arm64': 1.10.17 - '@swc/core-darwin-x64': 1.10.17 - '@swc/core-linux-arm-gnueabihf': 1.10.17 - '@swc/core-linux-arm64-gnu': 1.10.17 - '@swc/core-linux-arm64-musl': 1.10.17 - '@swc/core-linux-x64-gnu': 1.10.17 - '@swc/core-linux-x64-musl': 1.10.17 - '@swc/core-win32-arm64-msvc': 1.10.17 - '@swc/core-win32-ia32-msvc': 1.10.17 - '@swc/core-win32-x64-msvc': 1.10.17 + '@swc/core-darwin-arm64': 1.10.18 + '@swc/core-darwin-x64': 1.10.18 + '@swc/core-linux-arm-gnueabihf': 1.10.18 + '@swc/core-linux-arm64-gnu': 1.10.18 + '@swc/core-linux-arm64-musl': 1.10.18 + '@swc/core-linux-x64-gnu': 1.10.18 + '@swc/core-linux-x64-musl': 1.10.18 + '@swc/core-win32-arm64-msvc': 1.10.18 + '@swc/core-win32-ia32-msvc': 1.10.18 + '@swc/core-win32-x64-msvc': 1.10.18 '@swc/helpers': 0.5.15 '@swc/counter@0.1.3': {} @@ -4164,13 +4164,13 @@ snapshots: optionalDependencies: typescript: 5.7.3 - create-jest@29.7.0(@types/node@22.13.4)(ts-node@10.9.2(@swc/core@1.10.17(@swc/helpers@0.5.15))(@types/node@22.13.4)(typescript@5.7.3)): + create-jest@29.7.0(@types/node@22.13.4)(ts-node@10.9.2(@swc/core@1.10.18(@swc/helpers@0.5.15))(@types/node@22.13.4)(typescript@5.7.3)): dependencies: '@jest/types': 29.6.3 chalk: 4.1.2 exit: 0.1.2 graceful-fs: 4.2.11 - jest-config: 29.7.0(@types/node@22.13.4)(ts-node@10.9.2(@swc/core@1.10.17(@swc/helpers@0.5.15))(@types/node@22.13.4)(typescript@5.7.3)) + jest-config: 29.7.0(@types/node@22.13.4)(ts-node@10.9.2(@swc/core@1.10.18(@swc/helpers@0.5.15))(@types/node@22.13.4)(typescript@5.7.3)) jest-util: 29.7.0 prompts: 2.4.2 transitivePeerDependencies: @@ -4232,7 +4232,7 @@ snapshots: scheduler-polyfill: 1.3.0 tslib: 2.8.1 web-streams-polyfill: 4.1.0 - web-utility: 4.4.2(typescript@5.7.3) + web-utility: 4.4.3(typescript@5.7.3) transitivePeerDependencies: - typescript @@ -4630,16 +4630,16 @@ snapshots: - babel-plugin-macros - supports-color - jest-cli@29.7.0(@types/node@22.13.4)(ts-node@10.9.2(@swc/core@1.10.17(@swc/helpers@0.5.15))(@types/node@22.13.4)(typescript@5.7.3)): + jest-cli@29.7.0(@types/node@22.13.4)(ts-node@10.9.2(@swc/core@1.10.18(@swc/helpers@0.5.15))(@types/node@22.13.4)(typescript@5.7.3)): dependencies: - '@jest/core': 29.7.0(ts-node@10.9.2(@swc/core@1.10.17(@swc/helpers@0.5.15))(@types/node@22.13.4)(typescript@5.7.3)) + '@jest/core': 29.7.0(ts-node@10.9.2(@swc/core@1.10.18(@swc/helpers@0.5.15))(@types/node@22.13.4)(typescript@5.7.3)) '@jest/test-result': 29.7.0 '@jest/types': 29.6.3 chalk: 4.1.2 - create-jest: 29.7.0(@types/node@22.13.4)(ts-node@10.9.2(@swc/core@1.10.17(@swc/helpers@0.5.15))(@types/node@22.13.4)(typescript@5.7.3)) + create-jest: 29.7.0(@types/node@22.13.4)(ts-node@10.9.2(@swc/core@1.10.18(@swc/helpers@0.5.15))(@types/node@22.13.4)(typescript@5.7.3)) exit: 0.1.2 import-local: 3.2.0 - jest-config: 29.7.0(@types/node@22.13.4)(ts-node@10.9.2(@swc/core@1.10.17(@swc/helpers@0.5.15))(@types/node@22.13.4)(typescript@5.7.3)) + jest-config: 29.7.0(@types/node@22.13.4)(ts-node@10.9.2(@swc/core@1.10.18(@swc/helpers@0.5.15))(@types/node@22.13.4)(typescript@5.7.3)) jest-util: 29.7.0 jest-validate: 29.7.0 yargs: 17.7.2 @@ -4649,7 +4649,7 @@ snapshots: - supports-color - ts-node - jest-config@29.7.0(@types/node@22.13.4)(ts-node@10.9.2(@swc/core@1.10.17(@swc/helpers@0.5.15))(@types/node@22.13.4)(typescript@5.7.3)): + jest-config@29.7.0(@types/node@22.13.4)(ts-node@10.9.2(@swc/core@1.10.18(@swc/helpers@0.5.15))(@types/node@22.13.4)(typescript@5.7.3)): dependencies: '@babel/core': 7.26.9 '@jest/test-sequencer': 29.7.0 @@ -4675,7 +4675,7 @@ snapshots: strip-json-comments: 3.1.1 optionalDependencies: '@types/node': 22.13.4 - ts-node: 10.9.2(@swc/core@1.10.17(@swc/helpers@0.5.15))(@types/node@22.13.4)(typescript@5.7.3) + ts-node: 10.9.2(@swc/core@1.10.18(@swc/helpers@0.5.15))(@types/node@22.13.4)(typescript@5.7.3) transitivePeerDependencies: - babel-plugin-macros - supports-color @@ -4895,12 +4895,12 @@ snapshots: merge-stream: 2.0.0 supports-color: 8.1.1 - jest@29.7.0(@types/node@22.13.4)(ts-node@10.9.2(@swc/core@1.10.17(@swc/helpers@0.5.15))(@types/node@22.13.4)(typescript@5.7.3)): + jest@29.7.0(@types/node@22.13.4)(ts-node@10.9.2(@swc/core@1.10.18(@swc/helpers@0.5.15))(@types/node@22.13.4)(typescript@5.7.3)): dependencies: - '@jest/core': 29.7.0(ts-node@10.9.2(@swc/core@1.10.17(@swc/helpers@0.5.15))(@types/node@22.13.4)(typescript@5.7.3)) + '@jest/core': 29.7.0(ts-node@10.9.2(@swc/core@1.10.18(@swc/helpers@0.5.15))(@types/node@22.13.4)(typescript@5.7.3)) '@jest/types': 29.6.3 import-local: 3.2.0 - jest-cli: 29.7.0(@types/node@22.13.4)(ts-node@10.9.2(@swc/core@1.10.17(@swc/helpers@0.5.15))(@types/node@22.13.4)(typescript@5.7.3)) + jest-cli: 29.7.0(@types/node@22.13.4)(ts-node@10.9.2(@swc/core@1.10.18(@swc/helpers@0.5.15))(@types/node@22.13.4)(typescript@5.7.3)) transitivePeerDependencies: - '@types/node' - babel-plugin-macros @@ -5545,12 +5545,12 @@ snapshots: '@tokenizer/token': 0.3.0 ieee754: 1.2.1 - ts-jest@29.2.5(@babel/core@7.26.9)(@jest/transform@29.7.0)(@jest/types@29.6.3)(babel-jest@29.7.0(@babel/core@7.26.9))(jest@29.7.0(@types/node@22.13.4)(ts-node@10.9.2(@swc/core@1.10.17(@swc/helpers@0.5.15))(@types/node@22.13.4)(typescript@5.7.3)))(typescript@5.7.3): + ts-jest@29.2.5(@babel/core@7.26.9)(@jest/transform@29.7.0)(@jest/types@29.6.3)(babel-jest@29.7.0(@babel/core@7.26.9))(jest@29.7.0(@types/node@22.13.4)(ts-node@10.9.2(@swc/core@1.10.18(@swc/helpers@0.5.15))(@types/node@22.13.4)(typescript@5.7.3)))(typescript@5.7.3): dependencies: bs-logger: 0.2.6 ejs: 3.1.10 fast-json-stable-stringify: 2.1.0 - jest: 29.7.0(@types/node@22.13.4)(ts-node@10.9.2(@swc/core@1.10.17(@swc/helpers@0.5.15))(@types/node@22.13.4)(typescript@5.7.3)) + jest: 29.7.0(@types/node@22.13.4)(ts-node@10.9.2(@swc/core@1.10.18(@swc/helpers@0.5.15))(@types/node@22.13.4)(typescript@5.7.3)) jest-util: 29.7.0 json5: 2.2.3 lodash.memoize: 4.1.2 @@ -5564,7 +5564,7 @@ snapshots: '@jest/types': 29.6.3 babel-jest: 29.7.0(@babel/core@7.26.9) - ts-node@10.9.2(@swc/core@1.10.17(@swc/helpers@0.5.15))(@types/node@22.13.4)(typescript@5.7.3): + ts-node@10.9.2(@swc/core@1.10.18(@swc/helpers@0.5.15))(@types/node@22.13.4)(typescript@5.7.3): dependencies: '@cspotcode/source-map-support': 0.8.1 '@tsconfig/node10': 1.0.11 @@ -5582,7 +5582,7 @@ snapshots: v8-compile-cache-lib: 3.0.1 yn: 3.1.1 optionalDependencies: - '@swc/core': 1.10.17(@swc/helpers@0.5.15) + '@swc/core': 1.10.18(@swc/helpers@0.5.15) tslib@2.8.1: {} @@ -5661,7 +5661,7 @@ snapshots: dom-renderer: 2.6.1(typescript@5.7.3) mobx: 6.13.6 regenerator-runtime: 0.14.1 - web-utility: 4.4.2(typescript@5.7.3) + web-utility: 4.4.3(typescript@5.7.3) transitivePeerDependencies: - happy-dom - typescript @@ -5675,7 +5675,7 @@ snapshots: regenerator-runtime: 0.13.11 typescript: 5.7.3 - web-utility@4.4.2(typescript@5.7.3): + web-utility@4.4.3(typescript@5.7.3): dependencies: '@swc/helpers': 0.5.15 element-internals-polyfill: 1.3.13 diff --git a/source/Layout/Grid.tsx b/source/Layout/Grid.tsx index 6d6c51e2..dbfa1a5c 100644 --- a/source/Layout/Grid.tsx +++ b/source/Layout/Grid.tsx @@ -1,9 +1,9 @@ -import { JsxProps } from 'dom-renderer'; -import { FC } from 'web-cell'; +import classNames from 'classnames'; +import { FC, WebCellProps } from 'web-cell'; import { Size } from '../type'; -export interface ContainerProps extends JsxProps { +export interface ContainerProps extends WebCellProps { fluid?: boolean | Size; } @@ -22,3 +22,77 @@ export const Container: FC = ({ {children} ); + +export type RowProps = Record<'xs' | Size, number | 'auto'> & WebCellProps; + +export const Row: FC = ({ + className, + xs, + sm, + md, + lg, + xl, + xxl, + children, + ...props +}) => { + const size = xs || sm || md || lg || xl || xxl; + const columnClass = size + ? `row-cols${ + xs + ? '' + : sm + ? '-sm' + : md + ? '-md' + : lg + ? '-lg' + : xl + ? '-xl' + : xxl && '-xxl' + }-${size}` + : ''; + + return ( +
+ {children} +
+ ); +}; + +export type ColProps = RowProps; + +export const Col: FC = ({ + className, + xs, + sm, + md, + lg, + xl, + xxl, + children, + ...props +}) => { + const size = xs || sm || md || lg || xl || xxl; + const columnClass = size + ? `col${ + xs + ? '' + : sm + ? '-sm' + : md + ? '-md' + : lg + ? '-lg' + : xl + ? '-xl' + : xxl && '-xxl' + }-${size}` + : ''; + + return ( +
+ {children} +
+ ); +}; diff --git a/source/Navigator/BreadCrumb.tsx b/source/Navigator/BreadCrumb.tsx new file mode 100644 index 00000000..fe785db1 --- /dev/null +++ b/source/Navigator/BreadCrumb.tsx @@ -0,0 +1,31 @@ +import classNames from 'classnames'; +import { FC, WebCellProps } from 'web-cell'; + +export type BreadcrumbProps = WebCellProps; + +export const BreadCrumb: FC = ({ children, ...props }) => ( + +); + +export interface BreadcrumbItemProps extends WebCellProps { + active?: boolean; +} + +export const BreadcrumbItem: FC = ({ + className = '', + href, + target, + active, + children, + ...props +}) => ( +
  • + {active ? children : {children}} +
  • +); diff --git a/source/Navigator/Nav.tsx b/source/Navigator/Nav.tsx index adff3228..963ca13b 100644 --- a/source/Navigator/Nav.tsx +++ b/source/Navigator/Nav.tsx @@ -1,5 +1,15 @@ +import classNames from 'classnames'; import { JsxChildren } from 'dom-renderer'; -import { FC, WebCell, WebCellProps, component } from 'web-cell'; +import { observable } from 'mobx'; +import { + FC, + WebCell, + WebCellProps, + attribute, + component, + reaction +} from 'web-cell'; +import { CustomElement } from 'web-utility'; import { ButtonProps } from '../Form/Button'; import { DropdownButton } from './Dropdown'; @@ -41,21 +51,47 @@ export const NavDropdown: FC = ({ ); -export interface Nav extends WebCell {} +export interface NavProps extends WebCellProps { + variant?: 'pills' | 'underline' | 'tabs'; + fill?: boolean; + justify?: boolean; +} + +export interface Nav extends WebCell {} @component({ tagName: 'bs-nav', mode: 'open' }) -export class Nav extends HTMLElement { - declare props: WebCellProps; +export class Nav extends HTMLElement implements CustomElement { + @attribute + @observable + accessor variant: 'pills' | 'underline' | 'tabs' | undefined; + + @attribute + @observable + accessor fill = false; + + @attribute + @observable + accessor justify = false; + + @reaction(({ variant, fill, justify }) => ({ variant, fill, justify })) + protected updateClass({ variant, fill, justify }: this) { + this.className = classNames('nav', this.className, { + [`nav-${variant}`]: variant, + 'nav-fill': fill, + [`nav-justified`]: justify + }); + } connectedCallback() { + this.role = 'tablist'; + const navBar = this.closest( 'offcanvas-navbar, .navbar' ); - - if (!navBar) return this.classList.add('nav'); + if (!navBar) return; const expand = navBar.expand || diff --git a/source/Navigator/Pagination.tsx b/source/Navigator/Pagination.tsx index 1af33d19..d68d771e 100644 --- a/source/Navigator/Pagination.tsx +++ b/source/Navigator/Pagination.tsx @@ -14,7 +14,7 @@ export const Pagination: FC = ({ ...props }) => ( @@ -75,7 +75,7 @@ export const Pager: FC = ({ return (
    event.preventDefault())} > = ({ onChange?.({ pageSize, pageIndex: +input.value }); }} /> - + {pageIndex > 1 && ( 1 )} diff --git a/source/Prompt/Alert.tsx b/source/Prompt/Alert.tsx new file mode 100644 index 00000000..bfd21ba7 --- /dev/null +++ b/source/Prompt/Alert.tsx @@ -0,0 +1,51 @@ +import classNames from 'classnames'; +import { FC, WebCellProps } from 'web-cell'; + +import { CloseButton } from '../Form/Button'; +import { TextColor } from '../type'; + +export interface AlertProps extends WebCellProps { + variant?: TextColor; + title?: string; + dismissible?: boolean; + show?: boolean; + onClose?: (event: MouseEvent) => any; +} + +export const Alert: FC = ({ + className, + variant = 'primary', + title, + children, + show = true, + dismissible, + onClose +}) => ( + +); + +export type AlertLinkProps = WebCellProps; + +export const AlertLink: FC = ({ + className = '', + children, + ...props +}) => ( + + {children} + +); diff --git a/v1/Navigator/BreadCrumb.tsx b/v1/Navigator/BreadCrumb.tsx deleted file mode 100644 index 184fa162..00000000 --- a/v1/Navigator/BreadCrumb.tsx +++ /dev/null @@ -1,29 +0,0 @@ -import { createCell } from 'web-cell'; -import type { HTMLProps, HTMLHyperLinkProps } from 'web-utility'; - -export interface BreadcrumbProps extends HTMLProps { - path: HTMLHyperLinkProps[]; -} - -export function BreadCrumb({ className, path }: BreadcrumbProps) { - return ( - - ); -} diff --git a/v1/Prompt/Alert.tsx b/v1/Prompt/Alert.tsx deleted file mode 100644 index 4bf5b377..00000000 --- a/v1/Prompt/Alert.tsx +++ /dev/null @@ -1,51 +0,0 @@ -import { WebCellProps, createCell, VNodeChildElement } from 'web-cell'; -import { transitOut } from 'web-utility/source/animation'; -import classNames from 'classnames'; - -import { CommonColors } from '../utility/constant'; -import { CloseButton } from '../Form/Button'; - -export interface AlertProps extends WebCellProps { - color?: CommonColors; - title?: string; - closable?: boolean; - onClose?: (event: MouseEvent) => any; -} - -export function Alert({ - className, - color = 'primary', - title, - defaultSlot, - closable, - onClose -}: AlertProps) { - return ( - - ); -}