-
-
Notifications
You must be signed in to change notification settings - Fork 529
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
27 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -348,6 +348,16 @@ def bundle_icons(verbose=False, external=True, download_list=None): | |
for icon in glob.glob(str(icon_dir / '*')): | ||
shutil.copyfile(icon, dest_dir / os.path.basename(icon)) | ||
|
||
def patch_tabulator(): | ||
# https://github.com/olifolkerd/tabulator/issues/4421 | ||
path = BUNDLE_DIR / 'datatabulator' / '[email protected]' / 'dist' / 'js' / 'tabulator.min.js' | ||
text = path.read_text() | ||
old = '"focus"!==this.options("editTriggerEvent")&&"click"!==this.options("editTriggerEvent")' | ||
new = '"click"!==this.options("editTriggerEvent")' | ||
assert text.count(old) == 1 | ||
text = text.replace(old, new) | ||
path.write_text(text) | ||
|
||
def bundle_resources(verbose=False, external=True): | ||
download_list = [] | ||
bundle_resource_urls(verbose=verbose, external=external, download_list=download_list) | ||
|
@@ -363,3 +373,5 @@ def bundle_resources(verbose=False, external=True): | |
for future in futures: | ||
if future: | ||
future.result() | ||
|
||
patch_tabulator() |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,6 +12,7 @@ | |
resolve_stylesheet, set_resource_mode, | ||
) | ||
from panel.io.state import set_curdoc | ||
from panel.models.tabulator import TABULATOR_VERSION | ||
from panel.theme.native import Native | ||
from panel.widgets import Button | ||
|
||
|
@@ -84,11 +85,11 @@ def test_resources_model_server(document): | |
with set_curdoc(document): | ||
extension('tabulator') | ||
assert resources.js_files[:2] == [ | ||
'static/extensions/panel/bundled/datatabulator/tabulator-tables@5.5.0/dist/js/tabulator.min.js', | ||
f'static/extensions/panel/bundled/datatabulator/tabulator-tables@{TABULATOR_VERSION}/dist/js/tabulator.min.js', | ||
'static/extensions/panel/bundled/datatabulator/luxon/build/global/luxon.min.js', | ||
] | ||
assert resources.css_files == [ | ||
f'static/extensions/panel/bundled/datatabulator/tabulator-tables@5.5.0/dist/css/tabulator_simple.min.css?v={JS_VERSION}' | ||
f'static/extensions/panel/bundled/datatabulator/tabulator-tables@{TABULATOR_VERSION}/dist/css/tabulator_simple.min.css?v={JS_VERSION}' | ||
] | ||
|
||
def test_resources_model_cdn(document): | ||
|
@@ -97,25 +98,26 @@ def test_resources_model_cdn(document): | |
with set_curdoc(document): | ||
extension('tabulator') | ||
assert resources.js_files[:2] == [ | ||
f'{CDN_DIST}bundled/datatabulator/tabulator-tables@5.5.0/dist/js/tabulator.min.js', | ||
f'{CDN_DIST}bundled/datatabulator/tabulator-tables@{TABULATOR_VERSION}/dist/js/tabulator.min.js', | ||
f'{CDN_DIST}bundled/datatabulator/luxon/build/global/luxon.min.js', | ||
] | ||
assert resources.css_files == [ | ||
f'{CDN_DIST}bundled/datatabulator/tabulator-tables@5.5.0/dist/css/tabulator_simple.min.css?v={JS_VERSION}' | ||
f'{CDN_DIST}bundled/datatabulator/tabulator-tables@{TABULATOR_VERSION}/dist/css/tabulator_simple.min.css?v={JS_VERSION}' | ||
] | ||
|
||
def test_resources_model_inline(document): | ||
resources = Resources(mode='inline') | ||
with set_resource_mode('inline'): | ||
with set_curdoc(document): | ||
extension('tabulator') | ||
tabulator_jsfile = f'bundled/datatabulator/tabulator-tables@{TABULATOR_VERSION}/dist/js/tabulator.min.js' | ||
luxon_jsfile = 'bundled/datatabulator/luxon/build/global/luxon.min.js' | ||
tabulator_cssfile = f'bundled/datatabulator/tabulator-tables@{TABULATOR_VERSION}/dist/css/tabulator_simple.min.css' | ||
assert resources.js_raw[-2:] == [ | ||
(DIST_DIR / 'bundled/datatabulator/[email protected]/dist/js/tabulator.min.js').read_text(encoding='utf-8'), | ||
(DIST_DIR / 'bundled/datatabulator/luxon/build/global/luxon.min.js').read_text(encoding='utf-8') | ||
] | ||
assert resources.css_raw == [ | ||
(DIST_DIR / 'bundled/datatabulator/[email protected]/dist/css/tabulator_simple.min.css').read_text(encoding='utf-8') | ||
(DIST_DIR / tabulator_jsfile).read_text(encoding='utf-8'), | ||
(DIST_DIR / luxon_jsfile).read_text(encoding='utf-8'), | ||
] | ||
assert resources.css_raw == [(DIST_DIR / tabulator_cssfile).read_text(encoding='utf-8')] | ||
|
||
def test_resources_reactive_html_server(document): | ||
resources = Resources(mode='server') | ||
|