-
Notifications
You must be signed in to change notification settings - Fork 6
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 #584 from nfdi4plants/Feature_Excel_EnableSelectio…
…nOfImportedTermsForTemplates Enable selection of terms to import into excel
- Loading branch information
Showing
23 changed files
with
503 additions
and
255 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
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,108 @@ | ||
namespace Modals | ||
|
||
open Feliz | ||
open Feliz.DaisyUI | ||
open Model | ||
open Messages | ||
open Shared | ||
open Types.TableImport | ||
|
||
open ARCtrl | ||
open JsonImport | ||
open Components | ||
open Fable.React.Helpers | ||
|
||
type ModalElements = | ||
|
||
static member Button(text: string, onClickAction, buttonInput, ?isDisabled: bool) = | ||
let isDisabled = defaultArg isDisabled false | ||
Daisy.button.a [ | ||
button.success | ||
button.wide | ||
if isDisabled then | ||
button.error | ||
prop.disabled isDisabled | ||
prop.onClick (fun _ -> onClickAction buttonInput) | ||
|
||
prop.text text | ||
] | ||
|
||
static member RadioPlugin(radioGroup: string, txt: string, isChecked, onChange: bool -> unit, ?isDisabled: bool) = | ||
let isDisabled = defaultArg isDisabled false | ||
Daisy.formControl [ | ||
Daisy.label [ | ||
prop.className [ | ||
"cursor-pointer transition-colors" | ||
if isDisabled then | ||
"!cursor-not-allowed" | ||
else | ||
"hover:bg-base-300" | ||
] | ||
prop.children [ | ||
Daisy.radio [ | ||
prop.disabled isDisabled | ||
radio.xs | ||
prop.name radioGroup | ||
prop.isChecked isChecked | ||
prop.onChange onChange | ||
] | ||
Html.span [ | ||
prop.className "text-sm" | ||
prop.text txt | ||
] | ||
] | ||
] | ||
] | ||
|
||
static member Box(title: string, icon: string, content: ReactElement, ?className: string list) = | ||
Html.div [ | ||
prop.className [ | ||
"rounded shadow p-2 flex flex-col gap-2 border" | ||
if className.IsSome then | ||
className.Value |> String.concat " " | ||
] | ||
prop.children [ | ||
Html.h3 [ | ||
prop.className "font-semibold gap-2 flex flex-row items-center" | ||
prop.children [ | ||
Html.i [prop.className icon] | ||
Html.span title | ||
] | ||
] | ||
content | ||
] | ||
] | ||
|
||
static member BoxWithChildren(children: ReactElement list, ?title: string, ?icon: string, ?className: string list) = | ||
Html.div [ | ||
prop.className [ | ||
"rounded shadow p-2 flex flex-col gap-2 border" | ||
if className.IsSome then | ||
className.Value |> String.concat " " | ||
] | ||
prop.children [ | ||
Html.h3 [ | ||
prop.className "font-semibold gap-2 flex flex-row items-center" | ||
if icon.IsSome || title.IsSome then | ||
prop.children [ | ||
if icon.IsSome then | ||
Html.i [prop.className icon.Value] | ||
if title.IsSome then | ||
Html.span title.Value | ||
] | ||
prop.children children | ||
] | ||
] | ||
] | ||
|
||
static member SelectorButton<'a when 'a : equality> (targetselector: 'a, selector: 'a, setSelector: 'a -> unit, ?isDisabled) = | ||
Daisy.button.button [ | ||
join.item | ||
if isDisabled.IsSome then | ||
prop.disabled isDisabled.Value | ||
prop.style [style.flexGrow 1] | ||
if (targetselector = selector) then | ||
button.primary | ||
prop.onClick (fun _ -> setSelector targetselector) | ||
prop.text (string targetselector) | ||
] |
Oops, something went wrong.