-
Notifications
You must be signed in to change notification settings - Fork 6
Feat: Support Vuetify V4 #45
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
6bcd0f3
54bec66
bc33975
f290e6b
5c571c4
1270342
3f4a53c
692ebf4
14fc394
3d14e06
729c03a
8dd1461
ee9e2ce
6507faa
1601726
9b6843b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,2 +1,2 @@ | ||
| [codespell] | ||
| skip = **/package-lock.json,trame_vuetify/widgets/vuetify3.py | ||
| skip = **/package-lock.json,trame_vuetify/widgets/vuetify3.py,trame_vuetify/widgets/vuetify4.py |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| # Building | ||
|
|
||
| ## Generating the Bundles | ||
|
|
||
| ### Vuetify 3 | ||
|
|
||
| 1. Navigate to `v3-lab/` | ||
| 2. Run `npm i` to install Vuetify v3 | ||
| 3. Run `npm run build` to generate the bundled JS, this should be present in `trame_vuetify/module/v3-lab-serve/trame-vuetify-lab.js` | ||
|
|
||
| ### Vuetify 4 | ||
|
|
||
| 1. Navigate to `v4-lab/` | ||
| 2. Run `npm i` to install Vuetify v4 | ||
| 3. Run `npm run build` to generate the bundled JS, this should be present in `trame_vuetify/module/v4-lab-serve/trame-vuetify-lab.js` | ||
|
|
||
| ## Compiling the Python Bindings + Retrieving Fonts | ||
|
|
||
| Run `./build-bundles.sh`. |
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is the build script I mentioned in the PR description, I was using it a lot for testing and figured I'd push it if this is something you find useful, I can have it removed otherwise |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,49 @@ | ||
| #!/bin/bash | ||
|
|
||
| export SRC_URL=https://cdn.jsdelivr.net/npm | ||
|
|
||
| # Vuetify 3 | ||
| export V3_VERSION=vuetify@3.12.10 | ||
| export V3_DST_PATH=../trame_vuetify/module/v3-serve | ||
| export V3_LAB_DST_PATH=../trame_vuetify/module/v3-lab-serve | ||
| mkdir -p $V3_DST_PATH/{fonts,css} | ||
| mkdir -p $V3_LAB_DST_PATH/{fonts,css} | ||
|
|
||
| # Make and download Vuetify 3 | ||
| curl "$SRC_URL/$V3_VERSION/dist/vuetify.min.css" -Lo "$V3_DST_PATH/vuetify3.css" | ||
| curl "$SRC_URL/$V3_VERSION/dist/vuetify.min.js" -Lo "$V3_DST_PATH/vuetify3.js" | ||
|
|
||
| # Prepare icons + fonts for regular Vuetify 3 | ||
| curl "$SRC_URL/@mdi/font@7.x/css/materialdesignicons.min.css" -Lo "$V3_DST_PATH/css/mdi.css" | ||
| curl "$SRC_URL/@mdi/font@7.x/fonts/materialdesignicons-webfont.woff2" -Lo "$V3_DST_PATH/fonts/materialdesignicons-webfont.woff2" | ||
|
|
||
| # Prepare icons + fonts for Vuetify 3 Lab | ||
| curl "$SRC_URL/@mdi/font@7.x/css/materialdesignicons.min.css" -Lo "$V3_LAB_DST_PATH/css/mdi.css" | ||
| curl "$SRC_URL/@mdi/font@7.x/fonts/materialdesignicons-webfont.woff2" -Lo "$V3_LAB_DST_PATH/fonts/materialdesignicons-webfont.woff2" | ||
|
|
||
| # Re-generate the Python bindings | ||
| curl "$SRC_URL/$V3_VERSION/dist/json/web-types.json" -Lo ./v3/web-types.json | ||
| ./v3/generate_python.py | ||
|
|
||
| # Vuetify 4 | ||
| export V4_VERSION=vuetify@4.2.1 | ||
| export V4_DST_PATH=../trame_vuetify/module/v4-serve | ||
| export V4_LAB_DST_PATH=../trame_vuetify/module/v4-lab-serve | ||
| mkdir -p $V4_DST_PATH/{fonts,css} | ||
| mkdir -p $V4_LAB_DST_PATH/{fonts,css} | ||
|
|
||
| # Make and download Vuetify 4 | ||
| curl "$SRC_URL/$V4_VERSION/dist/vuetify.min.css" -Lo "$V4_DST_PATH/vuetify4.css" | ||
| curl "$SRC_URL/$V4_VERSION/dist/vuetify.min.js" -Lo "$V4_DST_PATH/vuetify4.js" | ||
|
|
||
| # Prepare icons + fonts for regular Vuetify 4 | ||
| curl "$SRC_URL/@mdi/font@7.x/css/materialdesignicons.min.css" -Lo "$V4_DST_PATH/css/mdi.css" | ||
| curl "$SRC_URL/@mdi/font@7.x/fonts/materialdesignicons-webfont.woff2" -Lo "$V4_DST_PATH/fonts/materialdesignicons-webfont.woff2" | ||
|
|
||
| # Prepare icons + fonts for Vuetify 4 Lab | ||
| curl "$SRC_URL/@mdi/font@7.x/css/materialdesignicons.min.css" -Lo "$V4_LAB_DST_PATH/css/mdi.css" | ||
| curl "$SRC_URL/@mdi/font@7.x/fonts/materialdesignicons-webfont.woff2" -Lo "$V4_LAB_DST_PATH/fonts/materialdesignicons-webfont.woff2" | ||
|
|
||
| # Re-generate the Python bindings | ||
| curl "$SRC_URL/$V4_VERSION/dist/json/web-types.json" -Lo ./v4/web-types.json | ||
| ./v4/generate_python.py |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -13,18 +13,19 @@ def __init__(self, _elem_name, children=None, **kwargs): | |
| super().__init__(_elem_name, children, **kwargs) | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. good catch |
||
| if self.server: | ||
| if USE_LAB: | ||
| from trame_vuetify.module import vue3_lab | ||
| from trame_vuetify.module import v3_lab | ||
|
|
||
| self.server.enable_module(vue3_lab) | ||
| self.server.enable_module(v3_lab) | ||
| else: | ||
| from trame_vuetify.module import vue3 | ||
| from trame_vuetify.module import v3 | ||
|
|
||
| self.server.enable_module(vue3) | ||
| self.server.enable_module(v3) | ||
|
|
||
|
|
||
| try: | ||
| import numpy as np | ||
| from numbers import Number | ||
|
|
||
| import numpy as np | ||
| except Exception: | ||
| # dataframe_to_grid won't work | ||
| pass | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure if that file is still needed. But normally this is taking care by
https://github.com/Kitware/trame-vuetify/blob/master/pyproject.toml#L41-L48
Try building the wheel when you remove that file all together to validate that it is true.