Skip to content
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

Update JavaScript dependencies #3654

Merged
merged 30 commits into from
Aug 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
d80fea8
update google fonts
falkoschindler Aug 30, 2024
477d137
update Tailwind API
falkoschindler Aug 30, 2024
3eaf397
update JavaScript dependencies
falkoschindler Aug 30, 2024
4a93e82
fix relative paths in mermaid library
falkoschindler Aug 30, 2024
4890164
adjustments for AG Grid version 32
falkoschindler Aug 30, 2024
ced98f4
add new coremirror themes
falkoschindler Aug 30, 2024
9dd8059
fix some type annotations
falkoschindler Aug 30, 2024
7707893
fix echart test
falkoschindler Aug 30, 2024
e04fa7c
adjustments for vanilla-jsoneditor version 23
falkoschindler Aug 30, 2024
a37d6fe
clean up lib folder
falkoschindler Aug 30, 2024
ea6c37c
adjustments for mermaid version 11
falkoschindler Aug 30, 2024
3da74b0
add missing dependencies for `ui.scene`
falkoschindler Aug 30, 2024
e536d3f
fix tween update
falkoschindler Aug 30, 2024
2742a47
fix test about serving image files
falkoschindler Aug 30, 2024
a2a8e7a
restore accidentally removed codemirror dependencies
falkoschindler Aug 30, 2024
6b1766c
add missing page function for scene.initialized demo
falkoschindler Aug 30, 2024
4835f81
try to make upload test more robust
falkoschindler Aug 30, 2024
2287406
fix overflow when adding borders to the plotly plot
falkoschindler Aug 30, 2024
10e67cc
prevent some elements from overflowing their containers
falkoschindler Aug 30, 2024
0cdb4ea
found a better workaround
falkoschindler Aug 30, 2024
2da15db
fix EChart layout issue (see #2932)
falkoschindler Aug 30, 2024
77651e6
make sure to pass kwargs to `ui.table`
falkoschindler Aug 30, 2024
bc2541a
improve layout of interactive styling demo
falkoschindler Aug 30, 2024
7afb782
fix name of option "suppressFieldDotNotation"
falkoschindler Aug 30, 2024
d5d5c34
fix another table initializer
falkoschindler Aug 30, 2024
2f1cd0b
fix overflowing window corners
falkoschindler Aug 30, 2024
6ad95d5
simplify buggy AG Grid theme demo
falkoschindler Aug 30, 2024
c67ac32
wait for chart to be initialized
falkoschindler Aug 30, 2024
b87eafd
improve initial scene resize
falkoschindler Aug 30, 2024
fda8616
tiny layout fix
falkoschindler Aug 30, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
26 changes: 13 additions & 13 deletions DEPENDENCIES.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
# Included Web Dependencies

- vue: 3.3.6 ([MIT](https://opensource.org/licenses/MIT))
- quasar: 2.13.0 ([MIT](https://opensource.org/licenses/MIT))
- tailwindcss: 3.2.0 ([MIT](https://opensource.org/licenses/MIT))
- socket.io: 4.7.2 ([MIT](https://opensource.org/licenses/MIT))
- es-module-shims: 1.8.0 ([MIT](https://opensource.org/licenses/MIT))
- aggrid: 30.2.0 ([MIT](https://opensource.org/licenses/MIT))
- vue: 3.4.38 ([MIT](https://opensource.org/licenses/MIT))
- quasar: 2.16.9 ([MIT](https://opensource.org/licenses/MIT))
- tailwindcss: 3.4.10 ([MIT](https://opensource.org/licenses/MIT))
- socket.io: 4.7.5 ([MIT](https://opensource.org/licenses/MIT))
- es-module-shims: 1.10.0 ([MIT](https://opensource.org/licenses/MIT))
- aggrid: 32.1.0 ([MIT](https://opensource.org/licenses/MIT))
- codemirror: 6.0.1 ([MIT](https://opensource.org/licenses/MIT))
- echarts: 5.4.3 ([Apache-2.0](https://opensource.org/licenses/Apache-2.0))
- echarts: 5.5.1 ([Apache-2.0](https://opensource.org/licenses/Apache-2.0))
- echarts-gl: 2.0.9 ([BSD-3-Clause](https://opensource.org/licenses/BSD-3-Clause))
- leaflet: 1.9.4 ([BSD-2-Clause](https://opensource.org/licenses/BSD-2-Clause))
- leaflet-draw: 1.0.4 ([MIT](https://opensource.org/licenses/MIT))
- mermaid: 10.5.1 ([MIT](https://opensource.org/licenses/MIT))
- nipplejs: 0.10.1 ([MIT](https://opensource.org/licenses/MIT))
- plotly: 2.27.0 ([MIT](https://opensource.org/licenses/MIT))
- three: 0.157.0 ([MIT](https://opensource.org/licenses/MIT))
- tween: 21.0.0 ([MIT](https://opensource.org/licenses/MIT))
- vanilla-jsoneditor: 0.18.10 ([ISC](https://opensource.org/licenses/ISC))
- mermaid: 11.0.2 ([MIT](https://opensource.org/licenses/MIT))
- nipplejs: 0.10.2 ([MIT](https://opensource.org/licenses/MIT))
- plotly: 2.35.0 ([MIT](https://opensource.org/licenses/MIT))
- three: 0.168.0 ([MIT](https://opensource.org/licenses/MIT))
- tween: 25.0.0 ([MIT](https://opensource.org/licenses/MIT))
- vanilla-jsoneditor: 0.23.8 ([ISC](https://opensource.org/licenses/ISC))
13 changes: 5 additions & 8 deletions nicegui/elements/aggrid.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,21 +42,18 @@ export default {
checkboxRenderer: CheckboxRenderer,
};

this.grid = new agGrid.Grid(this.$el, this.gridOptions);
this.gridOptions.api.addGlobalListener(this.handle_event);
this.api = agGrid.createGrid(this.$el, this.gridOptions);
this.api.addGlobalListener(this.handle_event);
},
run_grid_method(name, ...args) {
return runMethod(this.gridOptions.api, name, args);
},
run_column_method(name, ...args) {
return runMethod(this.gridOptions.columnApi, name, args);
return runMethod(this.api, name, args);
},
run_row_method(row_id, name, ...args) {
return runMethod(this.gridOptions.api.getRowNode(row_id), name, args);
return runMethod(this.api.getRowNode(row_id), name, args);
},
handle_event(type, args) {
if ((type === "gridReady" || type === "gridSizeChanged") && this.auto_size_columns) {
this.gridOptions.api.sizeColumnsToFit();
this.api.sizeColumnsToFit();
}
this.$emit(type, {
value: args.value,
Expand Down
28 changes: 11 additions & 17 deletions nicegui/elements/aggrid.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

from typing_extensions import Self

from .. import optional_features
from .. import helpers, optional_features
from ..awaitable_response import AwaitableResponse
from ..element import Element

Expand All @@ -25,7 +25,7 @@ def __init__(self,

An element to create a grid using `AG Grid <https://www.ag-grid.com/>`_.

The methods `run_grid_method` and `run_column_method` can be used to interact with the AG Grid instance on the client.
The methods `run_grid_method` and `run_row_method` can be used to interact with the AG Grid instance on the client.

:param options: dictionary of AG Grid options
:param html_columns: list of columns that should be rendered as HTML (default: `[]`)
Expand Down Expand Up @@ -79,7 +79,7 @@ def is_special_dtype(dtype):
return cls({
'columnDefs': [{'field': str(col)} for col in df.columns],
'rowData': df.to_dict('records'),
'suppressDotNotation': True,
'suppressFieldDotNotation': True,
**options,
}, theme=theme, auto_size_columns=auto_size_columns)

Expand Down Expand Up @@ -108,21 +108,15 @@ def run_grid_method(self, name: str, *args, timeout: float = 1) -> AwaitableResp
"""
return self.run_method('run_grid_method', name, *args, timeout=timeout)

def run_column_method(self, name: str, *args, timeout: float = 1) -> AwaitableResponse:
"""Run an AG Grid Column API method.
def run_column_method(self, name: str, *args, timeout: float = 1) -> AwaitableResponse: # DEPRECATED
"""This method is deprecated. Use `run_grid_method` instead.

See `AG Grid Column API <https://www.ag-grid.com/javascript-data-grid/column-api/>`_ for a list of methods.

If the function is awaited, the result of the method call is returned.
Otherwise, the method is executed without waiting for a response.

:param name: name of the method
:param args: arguments to pass to the method
:param timeout: timeout in seconds (default: 1 second)

:return: AwaitableResponse that can be awaited to get the result of the method call
See https://www.ag-grid.com/javascript-data-grid/column-api/ for more information
"""
return self.run_method('run_column_method', name, *args, timeout=timeout)
helpers.warn_once('The method `run_column_method` is deprecated. '
'It will be removed in NiceGUI 3.0. '
'Use `run_grid_method` instead.')
return self.run_method('run_grid_method', name, *args, timeout=timeout)

def run_row_method(self, row_id: str, name: str, *args, timeout: float = 1) -> AwaitableResponse:
"""Run an AG Grid API method on a specific row.
Expand Down Expand Up @@ -191,7 +185,7 @@ async def get_client_data(
}
result = await self.client.run_javascript(f'''
const rowData = [];
getElement({self.id}).gridOptions.api.{API_METHODS[method]}(node => rowData.push(node.data));
getElement({self.id}).api.{API_METHODS[method]}(node => rowData.push(node.data));
return rowData;
''', timeout=timeout)
return cast(List[Dict], result)
Expand Down
43 changes: 43 additions & 0 deletions nicegui/elements/codemirror.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,51 +154,94 @@

SUPPORTED_THEMES = Literal[
'abcdef',
'abcdefDarkStyle',
'abyss',
'abyssDarkStyle',
'androidstudio',
'androidstudioDarkStyle',
'andromeda',
'andromedaDarkStyle',
'atomone',
'atomoneDarkStyle',
'aura',
'auraDarkStyle',
'basicDark',
'basicDarkStyle',
'basicLight',
'basicLightStyle',
'bbedit',
'bbeditLightStyle',
'bespin',
'bespinDarkStyle',
'consoleDark',
'consoleLight',
'copilot',
'copilotDarkStyle',
'darcula',
'darculaDarkStyle',
'douToneLightStyle',
'dracula',
'draculaDarkStyle',
'duotoneDark',
'duotoneDarkStyle',
'duotoneLight',
'eclipse',
'eclipseLightStyle',
'githubDark',
'githubDarkStyle',
'githubLight',
'githubLightStyle',
'gruvboxDark',
'gruvboxDarkStyle',
'gruvboxLight',
'kimbie',
'kimbieDarkStyle',
'material',
'materialDark',
'materialDarkStyle',
'materialLight',
'materialLightStyle',
'monokai',
'monokaiDarkStyle',
'monokaiDimmed',
'monokaiDimmedDarkStyle',
'noctisLilac',
'noctisLilacLightStyle',
'nord',
'nordDarkStyle',
'okaidia',
'okaidiaDarkStyle',
'oneDark',
'quietlight',
'quietlightStyle',
'red',
'redDarkStyle',
'solarizedDark',
'solarizedDarkStyle',
'solarizedLight',
'solarizedLightStyle',
'sublime',
'sublimeDarkStyle',
'tokyoNight',
'tokyoNightDay',
'tokyoNightDayStyle',
'tokyoNightStorm',
'tokyoNightStormStyle',
'tokyoNightStyle',
'tomorrowNightBlue',
'tomorrowNightBlueStyle',
'vscodeDark',
'vscodeDarkStyle',
'vscodeLight',
'vscodeLightStyle',
'whiteDark',
'whiteDarkStyle',
'whiteLight',
'whiteLightStyle',
'xcodeDark',
'xcodeDarkStyle',
'xcodeLight',
'xcodeLightStyle',
]


Expand Down
6 changes: 5 additions & 1 deletion nicegui/elements/echart.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { convertDynamicProperties } from "../../static/utils/dynamic_properties.
export default {
template: "<div></div>",
async mounted() {
await this.$nextTick(); // wait for Tailwind classes to be applied
await new Promise((resolve) => setTimeout(resolve, 0)); // wait for Tailwind classes to be applied
if (this.enable_3d) {
await import("echarts-gl");
}
Expand Down Expand Up @@ -72,6 +72,10 @@ export default {
},
methods: {
update_chart() {
if (!this.chart) {
setTimeout(this.update_chart, 10);
return;
}
convertDynamicProperties(this.options, true);
this.chart.setOption(this.options, { notMerge: this.chart.options?.series.length != this.options.series.length });
},
Expand Down
2 changes: 1 addition & 1 deletion nicegui/elements/json_editor.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { JSONEditor } from "index";
import { JSONEditor } from "standalone";

export default {
template: "<div></div>",
Expand Down
2 changes: 1 addition & 1 deletion nicegui/elements/json_editor.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from ..events import GenericEventArguments, JsonEditorChangeEventArguments, JsonEditorSelectEventArguments, handle_event


class JsonEditor(Element, component='json_editor.js', dependencies=['lib/vanilla-jsoneditor/index.js']):
class JsonEditor(Element, component='json_editor.js', dependencies=['lib/vanilla-jsoneditor/standalone.js']):

def __init__(self,
properties: Dict, *,
Expand Down
Loading
Loading