-
Notifications
You must be signed in to change notification settings - Fork 6
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
Enable selection of terms to import into excel #584
Merged
Freymaurer
merged 18 commits into
main
from
Feature_Excel_EnableSelectionOfImportedTermsForTemplates
Dec 16, 2024
Merged
Changes from 14 commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
bffed7f
Enable selection of terms to import into excel
Etschbeijer 2aa0ddf
Fix error in swate alpha
Etschbeijer b179a4a
Move basic modal element creation methods into separat file
Etschbeijer b46fc28
Replace existing TemplateFromDB with Modal
Etschbeijer 04a2cb7
Add usage of selected columns to swate alpha
Etschbeijer 12d4d78
Adapt box layout
Etschbeijer 450cda8
Enable column selection and import type selection for templates and j…
Etschbeijer c2064a5
update layout
Etschbeijer 4d11c9a
Improve layout by adding gaps
Etschbeijer 2cf7798
Adapted Cehckbox height
Etschbeijer ace120f
Apply review changes
Etschbeijer 849b155
Implemente review changes
Etschbeijer 869ade6
Implemented review suggestions
Etschbeijer ca0a1d4
Implement review changes
Etschbeijer 6ddefa4
Implement review changes
Etschbeijer 5feb2b1
Implement review changes
Etschbeijer 9cf7d21
Enable usage of selectedColumns in swate alpha
Etschbeijer 95dcf24
Enable naming of radioGroup to enable usage in swate alpha
Etschbeijer File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,122 @@ | ||
module Modals | ||
|
||
open Feliz | ||
open Feliz.DaisyUI | ||
open Model | ||
open Messages | ||
open Shared | ||
open SelectedColumns | ||
|
||
open ARCtrl | ||
open JsonImport | ||
open Components | ||
open Fable.React.Helpers | ||
|
||
type ModalElements = | ||
|
||
static member LogicContainer (children: ReactElement list) = | ||
Html.div [ | ||
// prop.className "border-l-4 border-transparent px-4 py-2 shadow-md" | ||
// prop.style [ | ||
// let rndVal = rnd.Next(30,70) | ||
// let colorArr = [|NFDIColors.LightBlue.Lighter10; NFDIColors.Mint.Lighter10;|] | ||
// style.custom("borderImageSlice", "1") | ||
// style.custom("borderImageSource", $"linear-gradient({colorArr.[if order then 0 else 1]} {100-rndVal}%%, {colorArr.[if order then 1 else 0]})") | ||
// order <- not order | ||
// ] | ||
prop.className "relative flex p-4 animated-border shadow-md gap-4 flex-col" //experimental | ||
prop.children children | ||
] | ||
|
||
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) | ||
] |
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.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Move to
GenericComponents.fs
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.
Now that i think about it. Why do you need this in a modal? this should only be used for sidebar logic groups?
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 grouped all elements that were used by SeletiveTemplateFromDB.fs and SelectiveImporModal.fs into the ModalElements.fs.
Origininally I rebuild the whole template selection as a modal but have undone it.