Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
gargantext-ihaskell
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
gargantext
gargantext-ihaskell
Commits
ad2b61a7
Commit
ad2b61a7
authored
Jul 23, 2021
by
David Davó
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added more String widgets
parent
9741786d
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
166 additions
and
31 deletions
+166
-31
ihaskell-widgets.cabal
ihaskell-display/ihaskell-widgets/ihaskell-widgets.cabal
+2
-0
Widgets.hs
...-display/ihaskell-widgets/src/IHaskell/Display/Widgets.hs
+2
-0
Common.hs
...y/ihaskell-widgets/src/IHaskell/Display/Widgets/Common.hs
+3
-5
Singletons.hs
...askell-widgets/src/IHaskell/Display/Widgets/Singletons.hs
+3
-1
Combobox.hs
...l-widgets/src/IHaskell/Display/Widgets/String/Combobox.hs
+63
-0
Password.hs
...l-widgets/src/IHaskell/Display/Widgets/String/Password.hs
+58
-0
Text.hs
...skell-widgets/src/IHaskell/Display/Widgets/String/Text.hs
+1
-7
Types.hs
...ay/ihaskell-widgets/src/IHaskell/Display/Widgets/Types.hs
+34
-18
No files found.
ihaskell-display/ihaskell-widgets/ihaskell-widgets.cabal
View file @
ad2b61a7
...
@@ -89,9 +89,11 @@ library
...
@@ -89,9 +89,11 @@ library
IHaskell.Display.Widgets.Selection.SelectionRangeSlider
IHaskell.Display.Widgets.Selection.SelectionRangeSlider
IHaskell.Display.Widgets.Selection.ToggleButtons
IHaskell.Display.Widgets.Selection.ToggleButtons
IHaskell.Display.Widgets.Selection.SelectMultiple
IHaskell.Display.Widgets.Selection.SelectMultiple
IHaskell.Display.Widgets.String.Combobox
IHaskell.Display.Widgets.String.HTML
IHaskell.Display.Widgets.String.HTML
IHaskell.Display.Widgets.String.HTMLMath
IHaskell.Display.Widgets.String.HTMLMath
IHaskell.Display.Widgets.String.Label
IHaskell.Display.Widgets.String.Label
IHaskell.Display.Widgets.String.Password
IHaskell.Display.Widgets.String.Text
IHaskell.Display.Widgets.String.Text
IHaskell.Display.Widgets.String.TextArea
IHaskell.Display.Widgets.String.TextArea
...
...
ihaskell-display/ihaskell-widgets/src/IHaskell/Display/Widgets.hs
View file @
ad2b61a7
...
@@ -37,9 +37,11 @@ import IHaskell.Display.Widgets.Selection.SelectionRangeSlider as X
...
@@ -37,9 +37,11 @@ import IHaskell.Display.Widgets.Selection.SelectionRangeSlider as X
import
IHaskell.Display.Widgets.Selection.ToggleButtons
as
X
import
IHaskell.Display.Widgets.Selection.ToggleButtons
as
X
import
IHaskell.Display.Widgets.Selection.SelectMultiple
as
X
import
IHaskell.Display.Widgets.Selection.SelectMultiple
as
X
import
IHaskell.Display.Widgets.String.Combobox
as
X
import
IHaskell.Display.Widgets.String.HTML
as
X
import
IHaskell.Display.Widgets.String.HTML
as
X
import
IHaskell.Display.Widgets.String.HTMLMath
as
X
import
IHaskell.Display.Widgets.String.HTMLMath
as
X
import
IHaskell.Display.Widgets.String.Label
as
X
import
IHaskell.Display.Widgets.String.Label
as
X
import
IHaskell.Display.Widgets.String.Password
as
X
import
IHaskell.Display.Widgets.String.Text
as
X
import
IHaskell.Display.Widgets.String.Text
as
X
import
IHaskell.Display.Widgets.String.TextArea
as
X
import
IHaskell.Display.Widgets.String.TextArea
as
X
...
...
ihaskell-display/ihaskell-widgets/src/IHaskell/Display/Widgets/Common.hs
View file @
ad2b61a7
...
@@ -47,7 +47,7 @@ pattern ButtonStyle = S.SButtonStyle
...
@@ -47,7 +47,7 @@ pattern ButtonStyle = S.SButtonStyle
pattern
BSValue
=
S
.
SBSValue
pattern
BSValue
=
S
.
SBSValue
pattern
ImageFormat
=
S
.
SImageFormat
pattern
ImageFormat
=
S
.
SImageFormat
pattern
BoolValue
=
S
.
SBoolValue
pattern
BoolValue
=
S
.
SBoolValue
pattern
Options
=
S
.
SOption
s
pattern
Options
Labels
=
S
.
SOptionsLabel
s
pattern
OptionalIndex
=
S
.
SOptionalIndex
pattern
OptionalIndex
=
S
.
SOptionalIndex
pattern
Index
=
S
.
SIndex
pattern
Index
=
S
.
SIndex
pattern
SelectionHandler
=
S
.
SSelectionHandler
pattern
SelectionHandler
=
S
.
SSelectionHandler
...
@@ -95,6 +95,8 @@ pattern VideoFormat = S.SVideoFormat
...
@@ -95,6 +95,8 @@ pattern VideoFormat = S.SVideoFormat
pattern
AutoPlay
=
S
.
SAutoPlay
pattern
AutoPlay
=
S
.
SAutoPlay
pattern
Loop
=
S
.
SLoop
pattern
Loop
=
S
.
SLoop
pattern
Controls
=
S
.
SControls
pattern
Controls
=
S
.
SControls
pattern
Options
=
S
.
SOptions
pattern
EnsureOption
=
S
.
SEnsureOption
-- | Close a widget's comm
-- | Close a widget's comm
closeWidget
::
IHaskellWidget
w
=>
w
->
IO
()
closeWidget
::
IHaskellWidget
w
=>
w
->
IO
()
...
@@ -246,10 +248,6 @@ instance Show VideoFormatValue where
...
@@ -246,10 +248,6 @@ instance Show VideoFormatValue where
instance
ToJSON
VideoFormatValue
where
instance
ToJSON
VideoFormatValue
where
toJSON
=
toJSON
.
pack
.
show
toJSON
=
toJSON
.
pack
.
show
-- | Options for selection widgets.
data
SelectionOptions
=
OptionLabels
[
Text
]
|
OptionDict
[(
Text
,
Text
)]
-- | Orientation values.
-- | Orientation values.
data
OrientationValue
=
HorizontalOrientation
data
OrientationValue
=
HorizontalOrientation
|
VerticalOrientation
|
VerticalOrientation
...
...
ihaskell-display/ihaskell-widgets/src/IHaskell/Display/Widgets/Singletons.hs
View file @
ad2b61a7
...
@@ -53,7 +53,7 @@ singletons
...
@@ -53,7 +53,7 @@ singletons
| BSValue
| BSValue
| ImageFormat
| ImageFormat
| BoolValue
| BoolValue
| Options
| Options
Labels
| Index
| Index
| OptionalIndex
| OptionalIndex
| SelectionHandler
| SelectionHandler
...
@@ -101,5 +101,7 @@ singletons
...
@@ -101,5 +101,7 @@ singletons
| AutoPlay
| AutoPlay
| Loop
| Loop
| Controls
| Controls
| Options
| EnsureOption
deriving (Eq, Ord, Show)
deriving (Eq, Ord, Show)
|]
|]
ihaskell-display/ihaskell-widgets/src/IHaskell/Display/Widgets/String/Combobox.hs
0 → 100644
View file @
ad2b61a7
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE TypeSynonymInstances #-}
{-# OPTIONS_GHC -fno-warn-orphans #-}
module
IHaskell.Display.Widgets.String.Combobox
(
-- * The Combobox Widget
ComboboxWidget
-- * Constructor
,
mkComboboxWidget
)
where
-- To keep `cabal repl` happy when running from the ihaskell repo
import
Prelude
import
Control.Monad
(
when
)
import
Data.Aeson
import
Data.IORef
(
newIORef
)
import
Data.Vinyl
(
Rec
(
..
),
(
<+>
))
import
IHaskell.Display
import
IHaskell.Eval.Widgets
import
IHaskell.IPython.Message.UUID
as
U
import
IHaskell.Display.Widgets.Types
import
IHaskell.Display.Widgets.Common
-- | A 'ComboboxWidget' represents a Combobox widget from IPython.html.widgets.
type
ComboboxWidget
=
IPythonWidget
'C
o
mboboxType
-- | Create a new Combobox widget
mkComboboxWidget
::
IO
ComboboxWidget
mkComboboxWidget
=
do
-- Default properties, with a random uuid
wid
<-
U
.
random
let
txtWidget
=
defaultTextWidget
"ComboboxView"
"ComboboxModel"
boxWidget
=
(
Options
=::
[]
)
:&
(
EnsureOption
=::
False
)
:&
RNil
widgetState
=
WidgetState
$
txtWidget
<+>
boxWidget
stateIO
<-
newIORef
widgetState
let
widget
=
IPythonWidget
wid
stateIO
-- Open a comm for this widget, and store it in the kernel state
widgetSendOpen
widget
$
toJSON
widgetState
-- Return the widget
return
widget
instance
IHaskellWidget
ComboboxWidget
where
getCommUUID
=
uuid
-- Two possibilities: 1. content -> event -> "submit" 2. sync_data -> value -> <new_value>
comm
tw
val
_
=
do
case
nestedObjectLookup
val
[
"state"
,
"value"
]
of
Just
(
String
value
)
->
setField'
tw
StringValue
value
>>
triggerChange
tw
_
->
pure
()
case
nestedObjectLookup
val
[
"content"
,
"event"
]
of
Just
(
String
event
)
->
when
(
event
==
"submit"
)
$
triggerSubmit
tw
_
->
pure
()
ihaskell-display/ihaskell-widgets/src/IHaskell/Display/Widgets/String/Password.hs
0 → 100644
View file @
ad2b61a7
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE TypeSynonymInstances #-}
{-# OPTIONS_GHC -fno-warn-orphans #-}
module
IHaskell.Display.Widgets.String.Password
(
-- * The Password Widget
PasswordWidget
-- * Constructor
,
mkPasswordWidget
)
where
-- To keep `cabal repl` happy when running from the ihaskell repo
import
Prelude
import
Control.Monad
(
when
)
import
Data.Aeson
import
Data.IORef
(
newIORef
)
import
Data.Vinyl
(
Rec
(
..
),
(
<+>
))
import
IHaskell.Display
import
IHaskell.Eval.Widgets
import
IHaskell.IPython.Message.UUID
as
U
import
IHaskell.Display.Widgets.Types
import
IHaskell.Display.Widgets.Common
-- | A 'PasswordWidget' represents a Password widget from IPython.html.widgets.
type
PasswordWidget
=
IPythonWidget
'P
a
sswordType
-- | Create a new Password widget
mkPasswordWidget
::
IO
PasswordWidget
mkPasswordWidget
=
do
-- Default properties, with a random uuid
wid
<-
U
.
random
let
widgetState
=
WidgetState
$
defaultTextWidget
"PasswordView"
"PasswordModel"
stateIO
<-
newIORef
widgetState
let
widget
=
IPythonWidget
wid
stateIO
-- Open a comm for this widget, and store it in the kernel state
widgetSendOpen
widget
$
toJSON
widgetState
-- Return the widget
return
widget
instance
IHaskellWidget
PasswordWidget
where
getCommUUID
=
uuid
comm
tw
val
_
=
do
case
nestedObjectLookup
val
[
"state"
,
"value"
]
of
Just
(
String
value
)
->
setField'
tw
StringValue
value
>>
triggerChange
tw
_
->
pure
()
case
nestedObjectLookup
val
[
"content"
,
"event"
]
of
Just
(
String
event
)
->
when
(
event
==
"submit"
)
$
triggerSubmit
tw
_
->
pure
()
\ No newline at end of file
ihaskell-display/ihaskell-widgets/src/IHaskell/Display/Widgets/String/Text.hs
View file @
ad2b61a7
...
@@ -35,13 +35,7 @@ mkTextWidget :: IO TextWidget
...
@@ -35,13 +35,7 @@ mkTextWidget :: IO TextWidget
mkTextWidget
=
do
mkTextWidget
=
do
-- Default properties, with a random uuid
-- Default properties, with a random uuid
wid
<-
U
.
random
wid
<-
U
.
random
let
strWidget
=
defaultStringWidget
"TextView"
"TextModel"
let
widgetState
=
WidgetState
$
defaultTextWidget
"TextView"
"TextModel"
txtWidget
=
(
Disabled
=::
False
)
:&
(
ContinuousUpdate
=::
True
)
:&
(
SubmitHandler
=::
return
()
)
:&
(
ChangeHandler
=::
return
()
)
:&
RNil
widgetState
=
WidgetState
$
strWidget
<+>
txtWidget
stateIO
<-
newIORef
widgetState
stateIO
<-
newIORef
widgetState
...
...
ihaskell-display/ihaskell-widgets/src/IHaskell/Display/Widgets/Types.hs
View file @
ad2b61a7
...
@@ -133,13 +133,15 @@ type DescriptionWidgetClass = CoreWidgetClass :++ DOMWidgetClass :++ '[ 'S.Descr
...
@@ -133,13 +133,15 @@ type DescriptionWidgetClass = CoreWidgetClass :++ DOMWidgetClass :++ '[ 'S.Descr
type
StringClass
=
DescriptionWidgetClass
:++
[
'S
.
StringValue
,
'S
.
Placeholder
]
type
StringClass
=
DescriptionWidgetClass
:++
[
'S
.
StringValue
,
'S
.
Placeholder
]
type
TextClass
=
StringClass
:++
[
'S
.
Disabled
,
'S
.
ContinuousUpdate
,
'S
.
SubmitHandler
,
'S
.
ChangeHandler
]
type
BoolClass
=
DescriptionWidgetClass
:++
[
'S
.
BoolValue
,
'S
.
Disabled
,
'S
.
ChangeHandler
]
type
BoolClass
=
DescriptionWidgetClass
:++
[
'S
.
BoolValue
,
'S
.
Disabled
,
'S
.
ChangeHandler
]
type
SelectionClass
=
DescriptionWidgetClass
:++
[
'S
.
Options
,
'S
.
OptionalIndex
,
'S
.
Disabled
,
'S
.
SelectionHandler
]
type
SelectionClass
=
DescriptionWidgetClass
:++
[
'S
.
Options
Labels
,
'S
.
OptionalIndex
,
'S
.
Disabled
,
'S
.
SelectionHandler
]
type
SelectionNonemptyClass
=
DescriptionWidgetClass
:++
[
'S
.
Options
,
'S
.
Index
,
'S
.
Disabled
,
'S
.
SelectionHandler
]
type
SelectionNonemptyClass
=
DescriptionWidgetClass
:++
[
'S
.
Options
Labels
,
'S
.
Index
,
'S
.
Disabled
,
'S
.
SelectionHandler
]
type
MultipleSelectionClass
=
DescriptionWidgetClass
:++
[
'S
.
Options
,
'S
.
Indices
,
'S
.
Disabled
,
'S
.
SelectionHandler
]
type
MultipleSelectionClass
=
DescriptionWidgetClass
:++
[
'S
.
Options
Labels
,
'S
.
Indices
,
'S
.
Disabled
,
'S
.
SelectionHandler
]
type
IntClass
=
DescriptionWidgetClass
:++
[
'S
.
IntValue
,
'S
.
ChangeHandler
]
type
IntClass
=
DescriptionWidgetClass
:++
[
'S
.
IntValue
,
'S
.
ChangeHandler
]
...
@@ -190,7 +192,7 @@ type family FieldType (f :: Field) :: * where
...
@@ -190,7 +192,7 @@ type family FieldType (f :: Field) :: * where
FieldType
'S
.
BSValue
=
ByteString
FieldType
'S
.
BSValue
=
ByteString
FieldType
'S
.
ImageFormat
=
ImageFormatValue
FieldType
'S
.
ImageFormat
=
ImageFormatValue
FieldType
'S
.
BoolValue
=
Bool
FieldType
'S
.
BoolValue
=
Bool
FieldType
'S
.
Options
=
SelectionOptions
FieldType
'S
.
Options
Labels
=
[
Text
]
FieldType
'S
.
Index
=
Integer
FieldType
'S
.
Index
=
Integer
FieldType
'S
.
OptionalIndex
=
Maybe
Integer
FieldType
'S
.
OptionalIndex
=
Maybe
Integer
FieldType
'S
.
SelectionHandler
=
IO
()
FieldType
'S
.
SelectionHandler
=
IO
()
...
@@ -238,6 +240,8 @@ type family FieldType (f :: Field) :: * where
...
@@ -238,6 +240,8 @@ type family FieldType (f :: Field) :: * where
FieldType
'S
.
AutoPlay
=
Bool
FieldType
'S
.
AutoPlay
=
Bool
FieldType
'S
.
Loop
=
Bool
FieldType
'S
.
Loop
=
Bool
FieldType
'S
.
Controls
=
Bool
FieldType
'S
.
Controls
=
Bool
FieldType
'S
.
Options
=
[
Text
]
FieldType
'S
.
EnsureOption
=
Bool
-- | Can be used to put different widgets in a list. Useful for dealing with children widgets.
-- | Can be used to put different widgets in a list. Useful for dealing with children widgets.
data
ChildWidget
=
forall
w
.
RecAll
Attr
(
WidgetFields
w
)
ToPairs
=>
ChildWidget
(
IPythonWidget
w
)
data
ChildWidget
=
forall
w
.
RecAll
Attr
(
WidgetFields
w
)
ToPairs
=>
ChildWidget
(
IPythonWidget
w
)
...
@@ -270,9 +274,11 @@ data WidgetType = ButtonType
...
@@ -270,9 +274,11 @@ data WidgetType = ButtonType
|
ImageType
|
ImageType
|
VideoType
|
VideoType
|
OutputType
|
OutputType
|
ComboboxType
|
HTMLType
|
HTMLType
|
HTMLMathType
|
HTMLMathType
|
LabelType
|
LabelType
|
PasswordType
|
TextType
|
TextType
|
TextAreaType
|
TextAreaType
|
CheckBoxType
|
CheckBoxType
...
@@ -317,10 +323,10 @@ type family WidgetFields (w :: WidgetType) :: [Field] where
...
@@ -317,10 +323,10 @@ type family WidgetFields (w :: WidgetType) :: [Field] where
WidgetFields
'O
u
tputType
=
DOMWidgetClass
WidgetFields
'O
u
tputType
=
DOMWidgetClass
WidgetFields
'H
T
MLType
=
StringClass
WidgetFields
'H
T
MLType
=
StringClass
WidgetFields
'H
T
MLMathType
=
StringClass
WidgetFields
'H
T
MLMathType
=
StringClass
WidgetFields
'C
o
mboboxType
=
TextClass
:++
[
'S
.
Options
,
'S
.
EnsureOption
]
WidgetFields
'L
a
belType
=
StringClass
WidgetFields
'L
a
belType
=
StringClass
WidgetFields
'T
e
xtType
=
WidgetFields
'P
a
sswordType
=
TextClass
StringClass
:++
WidgetFields
'T
e
xtType
=
TextClass
[
'S
.
Disabled
,
'S
.
ContinuousUpdate
,
'S
.
SubmitHandler
,
'S
.
ChangeHandler
]
-- Type level lists with a single element need both the list and the
-- Type level lists with a single element need both the list and the
-- constructor ticked, and a space between the open square bracket and
-- constructor ticked, and a space between the open square bracket and
...
@@ -478,14 +484,8 @@ instance ToPairs (Attr 'S.Index) where
...
@@ -478,14 +484,8 @@ instance ToPairs (Attr 'S.Index) where
instance
ToPairs
(
Attr
'S
.
OptionalIndex
)
where
instance
ToPairs
(
Attr
'S
.
OptionalIndex
)
where
toPairs
x
=
[
"index"
.=
toJSON
x
]
toPairs
x
=
[
"index"
.=
toJSON
x
]
instance
ToPairs
(
Attr
'S
.
Options
)
where
instance
ToPairs
(
Attr
'S
.
OptionsLabels
)
where
toPairs
x
=
toPairs
x
=
[
"_options_labels"
.=
toJSON
x
]
case
_value
x
of
Dummy
_
->
labels
(
""
::
Text
)
Real
(
OptionLabels
xs
)
->
labels
xs
Real
(
OptionDict
xps
)
->
labels
$
map
fst
xps
where
labels
xs
=
[
"_options_labels"
.=
xs
]
instance
ToPairs
(
Attr
'S
.
SelectionHandler
)
where
instance
ToPairs
(
Attr
'S
.
SelectionHandler
)
where
toPairs
_
=
[]
-- Not sent to the frontend
toPairs
_
=
[]
-- Not sent to the frontend
...
@@ -616,6 +616,12 @@ instance ToPairs (Attr 'S.Loop) where
...
@@ -616,6 +616,12 @@ instance ToPairs (Attr 'S.Loop) where
instance
ToPairs
(
Attr
'S
.
Controls
)
where
instance
ToPairs
(
Attr
'S
.
Controls
)
where
toPairs
x
=
[
"controls"
.=
toJSON
x
]
toPairs
x
=
[
"controls"
.=
toJSON
x
]
instance
ToPairs
(
Attr
'S
.
Options
)
where
toPairs
x
=
[
"options"
.=
toJSON
x
]
instance
ToPairs
(
Attr
'S
.
EnsureOption
)
where
toPairs
x
=
[
"ensure_option"
.=
toJSON
x
]
-- | Store the value for a field, as an object parametrized by the Field. No verification is done
-- | Store the value for a field, as an object parametrized by the Field. No verification is done
-- for these values.
-- for these values.
(
=::
)
::
(
SingI
f
,
Typeable
(
FieldType
f
))
=>
Sing
f
->
FieldType
f
->
Attr
f
(
=::
)
::
(
SingI
f
,
Typeable
(
FieldType
f
))
=>
Sing
f
->
FieldType
f
->
Attr
f
...
@@ -694,6 +700,16 @@ defaultStringWidget viewName modelName = defaultDescriptionWidget viewName model
...
@@ -694,6 +700,16 @@ defaultStringWidget viewName modelName = defaultDescriptionWidget viewName model
:&
(
Placeholder
=::
""
)
:&
(
Placeholder
=::
""
)
:&
RNil
:&
RNil
-- | A record representing a widget of the Text class from IPython
defaultTextWidget
::
FieldType
'S
.
ViewName
->
FieldType
'S
.
ModelName
->
Rec
Attr
TextClass
defaultTextWidget
viewName
modelName
=
defaultStringWidget
viewName
modelName
<+>
txtAttrs
where
txtAttrs
=
(
Disabled
=::
False
)
:&
(
ContinuousUpdate
=::
True
)
:&
(
SubmitHandler
=::
return
()
)
:&
(
ChangeHandler
=::
return
()
)
:&
RNil
-- | A record representing a widget of the _Bool class from IPython
-- | A record representing a widget of the _Bool class from IPython
defaultBoolWidget
::
FieldType
'S
.
ViewName
->
FieldType
'S
.
ModelName
->
Rec
Attr
BoolClass
defaultBoolWidget
::
FieldType
'S
.
ViewName
->
FieldType
'S
.
ModelName
->
Rec
Attr
BoolClass
defaultBoolWidget
viewName
modelName
=
defaultDescriptionWidget
viewName
modelName
<+>
boolAttrs
defaultBoolWidget
viewName
modelName
=
defaultDescriptionWidget
viewName
modelName
<+>
boolAttrs
...
@@ -707,7 +723,7 @@ defaultBoolWidget viewName modelName = defaultDescriptionWidget viewName modelNa
...
@@ -707,7 +723,7 @@ defaultBoolWidget viewName modelName = defaultDescriptionWidget viewName modelNa
defaultSelectionWidget
::
FieldType
'S
.
ViewName
->
FieldType
'S
.
ModelName
->
Rec
Attr
SelectionClass
defaultSelectionWidget
::
FieldType
'S
.
ViewName
->
FieldType
'S
.
ModelName
->
Rec
Attr
SelectionClass
defaultSelectionWidget
viewName
modelName
=
defaultDescriptionWidget
viewName
modelName
<+>
selectionAttrs
defaultSelectionWidget
viewName
modelName
=
defaultDescriptionWidget
viewName
modelName
<+>
selectionAttrs
where
where
selectionAttrs
=
(
Options
=::
OptionLabels
[]
)
selectionAttrs
=
(
Options
Labels
=::
[]
)
:&
(
OptionalIndex
=::
Nothing
)
:&
(
OptionalIndex
=::
Nothing
)
:&
(
Disabled
=::
False
)
:&
(
Disabled
=::
False
)
:&
(
SelectionHandler
=::
return
()
)
:&
(
SelectionHandler
=::
return
()
)
...
@@ -717,7 +733,7 @@ defaultSelectionWidget viewName modelName = defaultDescriptionWidget viewName mo
...
@@ -717,7 +733,7 @@ defaultSelectionWidget viewName modelName = defaultDescriptionWidget viewName mo
defaultSelectionNonemptyWidget
::
FieldType
'S
.
ViewName
->
FieldType
'S
.
ModelName
->
Rec
Attr
SelectionNonemptyClass
defaultSelectionNonemptyWidget
::
FieldType
'S
.
ViewName
->
FieldType
'S
.
ModelName
->
Rec
Attr
SelectionNonemptyClass
defaultSelectionNonemptyWidget
viewName
modelName
=
defaultDescriptionWidget
viewName
modelName
<+>
selectionAttrs
defaultSelectionNonemptyWidget
viewName
modelName
=
defaultDescriptionWidget
viewName
modelName
<+>
selectionAttrs
where
where
selectionAttrs
=
(
Options
=::
OptionLabels
[]
)
selectionAttrs
=
(
Options
Labels
=::
[]
)
:&
(
Index
=::
0
)
:&
(
Index
=::
0
)
:&
(
Disabled
=::
False
)
:&
(
Disabled
=::
False
)
:&
(
SelectionHandler
=::
return
()
)
:&
(
SelectionHandler
=::
return
()
)
...
@@ -727,7 +743,7 @@ defaultSelectionNonemptyWidget viewName modelName = defaultDescriptionWidget vie
...
@@ -727,7 +743,7 @@ defaultSelectionNonemptyWidget viewName modelName = defaultDescriptionWidget vie
defaultMultipleSelectionWidget
::
FieldType
'S
.
ViewName
->
FieldType
'S
.
ModelName
->
Rec
Attr
MultipleSelectionClass
defaultMultipleSelectionWidget
::
FieldType
'S
.
ViewName
->
FieldType
'S
.
ModelName
->
Rec
Attr
MultipleSelectionClass
defaultMultipleSelectionWidget
viewName
modelName
=
defaultDescriptionWidget
viewName
modelName
<+>
mulSelAttrs
defaultMultipleSelectionWidget
viewName
modelName
=
defaultDescriptionWidget
viewName
modelName
<+>
mulSelAttrs
where
where
mulSelAttrs
=
(
Options
=::
OptionLabels
[]
)
mulSelAttrs
=
(
Options
Labels
=::
[]
)
:&
(
Indices
=::
[]
)
:&
(
Indices
=::
[]
)
:&
(
Disabled
=::
False
)
:&
(
Disabled
=::
False
)
:&
(
SelectionHandler
=::
return
()
)
:&
(
SelectionHandler
=::
return
()
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment