-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #64 from sepal-contrib/refactor
Refactor
- Loading branch information
Showing
13 changed files
with
441 additions
and
139 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 |
---|---|---|
@@ -0,0 +1,3 @@ | ||
from sepal_ui.scripts.utils import init_ee | ||
|
||
init_ee() |
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
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 |
---|---|---|
@@ -0,0 +1,51 @@ | ||
import ipyvuetify as v | ||
import sepal_ui.sepalwidgets as sw | ||
|
||
btn_color = "primary" | ||
|
||
|
||
class IconBtn(sw.Btn): | ||
def __init__(self, gliph: str, *args, **kwargs): | ||
|
||
kwargs["icon"] = True | ||
kwargs["small"] = True | ||
kwargs["class_"] = "mr-2" | ||
|
||
super().__init__(gliph=gliph, *args, **kwargs) | ||
|
||
# to overwrite the default color | ||
self.color = kwargs.get("color") or btn_color | ||
self.v_icon.left = False | ||
|
||
|
||
class TextBtn(sw.Btn): | ||
def __init__(self, text: str, *args, **kwargs): | ||
|
||
kwargs["small"] = True | ||
kwargs["class_"] = "mr-2" | ||
|
||
super().__init__(msg=text, *args, **kwargs) | ||
|
||
# to overwrite the default color | ||
self.color = btn_color | ||
|
||
|
||
class DrawMenuBtn(v.Btn): | ||
|
||
def __init__(self, *args, **kwargs): | ||
|
||
self.v_on = "menuData.on" | ||
self.small = True | ||
self.children = [ | ||
v.Icon(children=["mdi-draw"], small=True, color="white"), | ||
v.Icon( | ||
children=["fa fa-caret-down"], | ||
small=True, | ||
right=True, | ||
color="white", | ||
), | ||
] | ||
|
||
super().__init__(*args, **kwargs) | ||
self.class_ = "mr-2" | ||
self.color = btn_color |
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
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
Oops, something went wrong.