Header menu logo issie

PopupHelpers Module

Types and nested modules

Type/Module Description

Constants

CERSCProps

CERSCState

CodeEditorReactStatefulComponent

DynamicAction

DynamicElement

Functions and values

Function or value Description

buildPopup title body foot close extraStyle dispatch model

Full Usage: buildPopup title body foot close extraStyle dispatch model

Parameters:
Returns: ReactElement

Base popup builder function, used by other popup generators

title : string
body : (Msg -> Unit) -> Model -> 'a
foot : (Msg -> Unit) -> Model -> 'b
close : (Msg -> Unit) -> MouseEvent -> unit
extraStyle : CSSProp list
dispatch : Msg -> Unit
model : Model
Returns: ReactElement

choicePopup title body buttonTrueText buttonFalseText buttonAction dispatch

Full Usage: choicePopup title body buttonTrueText buttonFalseText buttonAction dispatch

Parameters:
    title : string
    body : ReactElement
    buttonTrueText : string
    buttonFalseText : string
    buttonAction : bool -> MouseEvent -> Unit
    dispatch : Msg -> 'a

Returns: 'a

A static choice dialog popup.

title : string
body : ReactElement
buttonTrueText : string
buttonFalseText : string
buttonAction : bool -> MouseEvent -> Unit
dispatch : Msg -> 'a
Returns: 'a

choicePopupFunc title body buttonTrueText buttonFalseText buttonAction

Full Usage: choicePopupFunc title body buttonTrueText buttonFalseText buttonAction

Parameters:
Returns: (Msg -> Unit) -> Model -> ReactElement

A static choice dialog popup returning the popup function

title : string
body : (Msg -> Unit) -> ReactElement
buttonTrueText : string
buttonFalseText : string
buttonAction : bool -> (Msg -> Unit) -> MouseEvent -> Unit
Returns: (Msg -> Unit) -> Model -> ReactElement

closablePopup title body foot extraStyle dispatch

Full Usage: closablePopup title body foot extraStyle dispatch

Parameters:
Returns: Unit

Create a popup and add it to the page. Body and foot are static content. Can be closed by the ClosePopup message.

title : string
body : ReactElement
foot : ReactElement
extraStyle : CSSProp list
dispatch : Msg -> Unit
Returns: Unit

closablePopupFunc title body foot extraStyle

Full Usage: closablePopupFunc title body foot extraStyle

Parameters:
Returns: (Msg -> Unit) -> Model -> ReactElement

As closablePopup but accept functions and return the popup function Can be closed by the ClosePopup message.

title : string
body : (Msg -> Unit) -> ReactElement
foot : (Msg -> Unit) -> ReactElement
extraStyle : CSSProp list
Returns: (Msg -> Unit) -> Model -> ReactElement

codeEditor props elems

Full Usage: codeEditor props elems

Parameters:
Returns: ReactElement
Modifiers: inline
props : CodeEditorProps list
elems : ReactElement list
Returns: ReactElement

confirmationPopup title buttonText body buttonAction dispatch

Full Usage: confirmationPopup title buttonText body buttonAction dispatch

Parameters:
    title : string
    buttonText : string
    body : ReactElement
    buttonAction : unit -> unit
    dispatch : Msg -> unit

Returns: Unit

A static confirmation popup.

title : string
buttonText : string
body : ReactElement
buttonAction : unit -> unit
dispatch : Msg -> unit
Returns: Unit

dialogPopup title body buttonText buttonAction isDisabled extraStyle dispatch

Full Usage: dialogPopup title body buttonText buttonAction isDisabled extraStyle dispatch

Parameters:
    title : string
    body : Model -> 'a
    buttonText : string
    buttonAction : Model -> unit
    isDisabled : Model -> bool
    extraStyle : CSSProp list
    dispatch : Msg -> unit

Returns: Unit

Popup with an input textbox and two buttons. The text is reflected in Model.PopupDialogText. Return confirms the dialog, as it does in any other dialog with one obvious action. It used to reach KeyTypes.ScLeaveTextBox, whose job is to hand the keyboard back to the schematic: inside a popup that blurred the box the user had just typed into and did nothing else, which read as the entry having been thrown away. Swallowed here whether or not the action is available, so that Return means one thing inside a dialog rather than confirming it or emptying it depending on whether what has been typed so far is valid.

title : string
body : Model -> 'a
buttonText : string
buttonAction : Model -> unit
isDisabled : Model -> bool
extraStyle : CSSProp list
dispatch : Msg -> unit
Returns: Unit

dialogPopupBodyDescriptionAndInt beforeDescription currentDescription beforeInt intDefault valueProblem dispatch

Full Usage: dialogPopupBodyDescriptionAndInt beforeDescription currentDescription beforeInt intDefault valueProblem dispatch

Parameters:
Returns: Model -> ReactElement

Create the body of a dialog Popup with a compulsory description and a value, for editing an existing sheet parameter whose name is fixed. The caller seeds Text2 with the current description so that editing only the value leaves it intact. `valueProblem` is asked what is wrong with the value now in the box, and its answer is shown. The OK button is disabled when a slot of the sheet would break at the new value, and used to be disabled in silence - leaving the user to guess which component objected and why, when the constraint that failed carries a sentence written to explain exactly that.

beforeDescription : PopupDialogData -> 'a
currentDescription : string
beforeInt : PopupDialogData -> 'b
intDefault : bigint
valueProblem : Model -> string option
dispatch : Msg -> unit
Returns: Model -> ReactElement

dialogPopupBodyIntAndText beforeText placeholder beforeInt intDefault dispatch

Full Usage: dialogPopupBodyIntAndText beforeText placeholder beforeInt intDefault dispatch

Parameters:
    beforeText : Model -> 'a
    placeholder : string
    beforeInt : PopupDialogData -> 'b
    intDefault : int
    dispatch : Msg -> unit

Returns: Model -> ReactElement

Create the body of a dialog Popup with both text and int.

beforeText : Model -> 'a
placeholder : string
beforeInt : PopupDialogData -> 'b
intDefault : int
dispatch : Msg -> unit
Returns: Model -> ReactElement

dialogPopupBodyMemorySetup intDefault dispatch model

Full Usage: dialogPopupBodyMemorySetup intDefault dispatch model

Parameters:
    intDefault : int
    dispatch : Msg -> unit
    model : Model

Returns: ReactElement

Create the body of a memory dialog popup: asks for AddressWidth and WordWidth, two integers.

intDefault : int
dispatch : Msg -> unit
model : Model
Returns: ReactElement

dialogPopupBodyNInts beforeInt numOutputsDefault intDefault maxNumOutputs dispatch

Full Usage: dialogPopupBodyNInts beforeInt numOutputsDefault intDefault maxNumOutputs dispatch

Parameters:
    beforeInt : PopupDialogData -> 'a
    numOutputsDefault : int
    intDefault : int
    maxNumOutputs : int
    dispatch : Msg -> unit

Returns: Model -> ReactElement
beforeInt : PopupDialogData -> 'a
numOutputsDefault : int
intDefault : int
maxNumOutputs : int
dispatch : Msg -> unit
Returns: Model -> ReactElement

dialogPopupBodyOnlyBoundedInt beforeInt intDefault minBound maxBound dispatch

Full Usage: dialogPopupBodyOnlyBoundedInt beforeInt intDefault minBound maxBound dispatch

Parameters:
    beforeInt : PopupDialogData -> 'a
    intDefault : int
    minBound : int
    maxBound : int
    dispatch : Msg -> unit

Returns: Model -> ReactElement

Create the body of a dialog Popup with only an int whose value is bounded

beforeInt : PopupDialogData -> 'a
intDefault : int
minBound : int
maxBound : int
dispatch : Msg -> unit
Returns: Model -> ReactElement

dialogPopupBodyOnlyInt beforeInt intDefault dispatch

Full Usage: dialogPopupBodyOnlyInt beforeInt intDefault dispatch

Parameters:
Returns: Model -> ReactElement

Create the body of a dialog Popup with only an int.

beforeInt : PopupDialogData -> 'a
intDefault : int
dispatch : Msg -> unit
Returns: Model -> ReactElement

dialogPopupBodyOnlyText before placeholder dispatch model

Full Usage: dialogPopupBodyOnlyText before placeholder dispatch model

Parameters:
Returns: ReactElement

Create the body of a dialog Popup with only text.

before : PopupDialogData -> 'a
placeholder : string
dispatch : Msg -> unit
model : Model
Returns: ReactElement

dialogPopupBodyOnlyTextWithDefaultValue before placeholder currDescr dispatch model

Full Usage: dialogPopupBodyOnlyTextWithDefaultValue before placeholder currDescr dispatch model

Parameters:
    before : PopupDialogData -> 'a
    placeholder : string
    currDescr : string option
    dispatch : Msg -> unit
    model : Model

Returns: ReactElement

Create the body of a dialog Popup with only text for sheet description (can have an initial value + allow empty).

before : PopupDialogData -> 'a
placeholder : string
currDescr : string option
dispatch : Msg -> unit
model : Model
Returns: ReactElement

dialogPopupBodyTextAndInt beforeText placeholder beforeInt intDefault dispatch

Full Usage: dialogPopupBodyTextAndInt beforeText placeholder beforeInt intDefault dispatch

Parameters:
Returns: Model -> ReactElement

Create the body of a dialog Popup with both text and int.

beforeText : PopupDialogData -> 'a
placeholder : string
beforeInt : PopupDialogData -> 'b
intDefault : int
dispatch : Msg -> unit
Returns: Model -> ReactElement

dialogPopupBodyTextAndTwoInts focus (beforeText, textPlaceholder) (beforeInt1, beforeInt2) (intDefault1, intDefault2) dispatch

Full Usage: dialogPopupBodyTextAndTwoInts focus (beforeText, textPlaceholder) (beforeInt1, beforeInt2) (intDefault1, intDefault2) dispatch

Parameters:
Returns: Model -> ReactElement

Create the body of a dialog Popup with text and two ints. focus: which of the boxes has initial focus (= 1,2,3)

focus : int
beforeText : PopupDialogData -> 'a
textPlaceholder : string
beforeInt1 : PopupDialogData -> 'b
beforeInt2 : PopupDialogData -> 'c
intDefault1 : bigint
intDefault2 : bigint
dispatch : Msg -> unit
Returns: Model -> ReactElement

dialogPopupBodyTextDescriptionAndInt beforeText placeholder beforeDescription descriptionPlaceholder beforeInt intDefault nameIsTaken dispatch

Full Usage: dialogPopupBodyTextDescriptionAndInt beforeText placeholder beforeDescription descriptionPlaceholder beforeInt intDefault nameIsTaken dispatch

Parameters:
Returns: Model -> ReactElement

Create the body of a dialog Popup with a name, a compulsory description, and a value. Used to declare a sheet parameter: the description is what a custom component instance of the sheet shows the user when it asks them for a value, so a parameter cannot be declared without one. Name goes to Text, description to Text2, value to Int2. `nameIsTaken` is asked whether the sheet already declares a parameter of that name. Passed in rather than worked out here, so that this file needs to know nothing about where a sheet keeps its parameters.

beforeText : PopupDialogData -> 'a
placeholder : string
beforeDescription : PopupDialogData -> 'b
descriptionPlaceholder : string
beforeInt : PopupDialogData -> 'c
intDefault : bigint
nameIsTaken : string -> bool
dispatch : Msg -> unit
Returns: Model -> ReactElement

dialogPopupBodyTwoInts (beforeInt1, beforeInt2) (intDefault1, intDefault2) width2 dispatch

Full Usage: dialogPopupBodyTwoInts (beforeInt1, beforeInt2) (intDefault1, intDefault2) width2 dispatch

Parameters:
Returns: Model -> ReactElement

Create the body of a dialog Popup with two ints.

beforeInt1 : PopupDialogData -> 'a
beforeInt2 : PopupDialogData -> 'b
intDefault1 : bigint
intDefault2 : bigint
width2 : string
dispatch : Msg -> unit
Returns: Model -> ReactElement

dialogPopupBodyTwoTexts (beforeText1, placeholder1) (beforeText2, placeholder2) dispatch model

Full Usage: dialogPopupBodyTwoTexts (beforeText1, placeholder1) (beforeText2, placeholder2) dispatch model

Parameters:
Returns: ReactElement

Create the body of a dialog Popup with two text fields, both required. First goes to Text, second to Text2.

beforeText1 : PopupDialogData -> 'a
placeholder1 : string
beforeText2 : PopupDialogData -> 'b
placeholder2 : string
dispatch : Msg -> unit
model : Model
Returns: ReactElement

dialogPopupRefresh title body extraStyle dispatch

Full Usage: dialogPopupRefresh title body extraStyle dispatch

Parameters:
Returns: Unit
title : string
body : Model -> ReactElement
extraStyle : CSSProp list
dispatch : Msg -> unit
Returns: Unit

dialogVerilogCompBody before moduleName errorDiv errorList showExtraErrors codeToAdd compileButton addButton dispatch model

Full Usage: dialogVerilogCompBody before moduleName errorDiv errorList showExtraErrors codeToAdd compileButton addButton dispatch model

Parameters:
Returns: ReactElement

Create the body of a Verilog Editor Popup.

before : PopupDialogData -> 'a
moduleName : string option
errorDiv : ReactElement
errorList : ErrorInfo list
showExtraErrors : bool
codeToAdd : string option
compileButton : PopupDialogData -> Unit
addButton : PopupDialogData -> string * ReplaceType * int * int -> unit
dispatch : Msg -> unit
model : Model
Returns: ReactElement

dialogVerilogPopup title body saveUpdateText noErrors showingExtraInfo saveButtonAction moreInfoButton cancelAction isDisabled extraStyle dispatch

Full Usage: dialogVerilogPopup title body saveUpdateText noErrors showingExtraInfo saveButtonAction moreInfoButton cancelAction isDisabled extraStyle dispatch

Parameters:
Returns: 'b

Popup with an input textbox and two buttons. The text is reflected in Model.PopupDialogText. The Verilog editor. Unlike every other popup here it holds work that exists nowhere else until it is saved, so leaving it is the one irrecoverable thing it can do. `cancelAction` is therefore given all three ways out that are not Save - the Cancel button, the X, and a click on the background - rather than each dispatching ClosePopup for itself. They discard exactly the same edits, so a confirmation on one of them and not the others would be a confirmation the user can miss by clicking somewhere else.

title : string
body : Model -> 'a
saveUpdateText : string
noErrors : bool
showingExtraInfo : bool
saveButtonAction : PopupDialogData -> unit
moreInfoButton : PopupDialogData -> unit
cancelAction : PopupDialogData -> Unit
isDisabled : PopupDialogData -> bool
extraStyle : CSSProp list
dispatch : Msg -> 'b
Returns: 'b

dynamicClosablePopup title body foot extraStyle dispatch

Full Usage: dynamicClosablePopup title body foot extraStyle dispatch

Parameters:
Returns: Unit

Body and foot are functions that take a string of text and produce a reactElement. The meaning of the input string to those functions is the content of PopupDialogText (i.e. in a dialog popup, the string is the current value of the input box.).

title : string
body : Model -> ReactElement
foot : Model -> ReactElement
extraStyle : CSSProp list
dispatch : Msg -> Unit
Returns: Unit

dynamicClosablePopupFunc title body foot extraStyle

Full Usage: dynamicClosablePopupFunc title body foot extraStyle

Parameters:
Returns: (Msg -> Unit) -> Model -> ReactElement

As dynamicClosablePopup but accept functions of dispatch and return the popup function

title : string
body : (Msg -> Unit) -> Model -> 'a
foot : (Msg -> Unit) -> Model -> 'b
extraStyle : CSSProp list
Returns: (Msg -> Unit) -> Model -> ReactElement

dynamicConfirmationPopup title buttonText body buttonActionOpt dispatch

Full Usage: dynamicConfirmationPopup title buttonText body buttonActionOpt dispatch

Parameters:
    title : string
    buttonText : string
    body : Model -> ReactElement
    buttonActionOpt : (unit -> unit) option
    dispatch : Msg -> unit

Returns: Unit
title : string
buttonText : string
body : Model -> ReactElement
buttonActionOpt : (unit -> unit) option
dispatch : Msg -> unit
Returns: Unit

dynamicProgressPopupFunc title cancel

Full Usage: dynamicProgressPopupFunc title cancel

Parameters:
Returns: (Msg -> Unit) -> Model -> ReactElement

Popup to track progress of some long operation. Progress is captured via two dialog integers, current and max number. Typically the number is number of steps. The popup display is controlled by model.PopupDialog integers. Progress model updates must change these.

title : string
cancel : (Msg -> Unit) -> Unit
Returns: (Msg -> Unit) -> Model -> ReactElement

getCode dialogData

Full Usage: getCode dialogData

Parameters:
Returns: string
dialogData : PopupDialogData
Returns: string

getErrorList dialogData

Full Usage: getErrorList dialogData

Parameters:
Returns: ErrorInfo list
dialogData : PopupDialogData
Returns: ErrorInfo list

getImportDecisions dialogData

Full Usage: getImportDecisions dialogData

Parameters:
Returns: Map<string, ImportDecision option>
dialogData : PopupDialogData
Returns: Map<string, ImportDecision option>

getInt dialogData

Full Usage: getInt dialogData

Parameters:
Returns: int
dialogData : PopupDialogData
Returns: int

getInt2 dialogData

Full Usage: getInt2 dialogData

Parameters:
Returns: bigint
dialogData : PopupDialogData
Returns: bigint

getIntList dialogData numInputsDefault widthDefault

Full Usage: getIntList dialogData numInputsDefault widthDefault

Parameters:
Returns: int list
dialogData : PopupDialogData
numInputsDefault : int
widthDefault : int
Returns: int list

getIntList2 dialogData numInputsDefault lsbDefault

Full Usage: getIntList2 dialogData numInputsDefault lsbDefault

Parameters:
Returns: int list
dialogData : PopupDialogData
numInputsDefault : int
lsbDefault : int
Returns: int list

getMemoryEditor model

Full Usage: getMemoryEditor model

Parameters:
Returns: MemoryEditorData
model : Model
Returns: MemoryEditorData

getMemorySetup dialogData wordWidthDefault

Full Usage: getMemorySetup dialogData wordWidthDefault

Parameters:
Returns: int * int * InitMemData * string option
dialogData : PopupDialogData
wordWidthDefault : int
Returns: int * int * InitMemData * string option

getText dialogData

Full Usage: getText dialogData

Parameters:
Returns: string
dialogData : PopupDialogData
Returns: string

getText2 dialogData

Full Usage: getText2 dialogData

Parameters:
Returns: string
dialogData : PopupDialogData
Returns: string

mapNoDispatch optReact

Full Usage: mapNoDispatch optReact

Parameters:
Returns: ((Msg -> Unit) -> ReactElement) option
optReact : ReactElement option
Returns: ((Msg -> Unit) -> ReactElement) option

newBuildPopup title body foot close extraStyle dispatch model

Full Usage: newBuildPopup title body foot close extraStyle dispatch model

Parameters:
Returns: ReactElement

Base popup builder function, used by other popup generators: close function depends on (dynamic) model. OK button is enabled based on return from body function

title : string
body : (Msg -> unit) -> Model -> ReactElement
foot : DynamicElement
close : DynamicAction
extraStyle : CSSProp list
dispatch : Msg -> Unit
model : Model
Returns: ReactElement

newButtonFoot buttonAction buttonText closeAction enable dispatch model

Full Usage: newButtonFoot buttonAction buttonText closeAction enable dispatch model

Parameters:
    buttonAction : (Msg -> unit) -> Model -> unit
    buttonText : string
    closeAction : (Msg -> unit) -> Model -> unit
    enable : Model -> bool
    dispatch : Msg -> unit
    model : Model

Returns: ReactElement
buttonAction : (Msg -> unit) -> Model -> unit
buttonText : string
closeAction : (Msg -> unit) -> Model -> unit
enable : Model -> bool
dispatch : Msg -> unit
model : Model
Returns: ReactElement

newConfirmationPopup title body buttonActionOpt buttonEnable close dispatch model

Full Usage: newConfirmationPopup title body buttonActionOpt buttonEnable close dispatch model

Parameters:
Returns: ReactElement
title : string
body : (Msg -> unit) -> Model -> ReactElement
buttonActionOpt : DynamicAction option
buttonEnable : Model -> bool
close : DynamicAction
dispatch : Msg -> unit
model : Model
Returns: ReactElement

noDispatch react _dispatch

Full Usage: noDispatch react _dispatch

Parameters:
Returns: ReactElement
react : ReactElement
_dispatch : Msg -> Unit
Returns: ReactElement

openInBrowser url _arg3

Full Usage: openInBrowser url _arg3

Parameters:
    url : string
    _arg3 : 'a

url : string
_arg3 : 'a

paramValueBox valueDefault dispatch

Full Usage: paramValueBox valueDefault dispatch

Parameters:
Returns: ReactElement

A parameter's value, typed into a box. A text box parsed as a bigint rather than an Input.number, because a parameter value is a ParamInt and so may be larger than any int: a parameter that gives a wide Constant its value is the case that needs it. The box is uncontrolled, so an unparseable entry stays on screen to be corrected while Int2 goes to None, which is what the red text and the disabled button read.

valueDefault : ParamInt
dispatch : Msg -> unit
Returns: ReactElement

paramValueError dialogData

Full Usage: paramValueError dialogData

Parameters:
Returns: ReactElement

The red text under a parameter's value box: shown only once the box has been made unparseable, since it opens holding a value that parses.

dialogData : PopupDialogData
Returns: ReactElement

preventDefault e

Full Usage: preventDefault e

Parameters:
e : ClipboardEvent

showMemoryEditorPopup maybeTitle body maybeFoot extraStyle dispatch

Full Usage: showMemoryEditorPopup maybeTitle body maybeFoot extraStyle dispatch

Parameters:
Returns: 'b
maybeTitle : string option
body : MemoryEditorData -> 'a
maybeFoot : ReactElement option
extraStyle : CSSProp list
dispatch : Msg -> 'b
Returns: 'b

staticButtonFoot buttonAction buttonText dispatch

Full Usage: staticButtonFoot buttonAction buttonText dispatch

Parameters:
    buttonAction : MouseEvent -> unit
    buttonText : string
    dispatch : Msg -> unit

Returns: ReactElement
buttonAction : MouseEvent -> unit
buttonText : string
dispatch : Msg -> unit
Returns: ReactElement

unclosablePopup maybeTitle body maybeFoot extraStyle dispatch

Full Usage: unclosablePopup maybeTitle body maybeFoot extraStyle dispatch

Parameters:
Returns: ReactElement

Unclosable popup.

maybeTitle : string option
body : ReactElement
maybeFoot : ReactElement option
extraStyle : CSSProp list
dispatch : 'a
Returns: ReactElement

verilogEditorTemplate

Full Usage: verilogEditorTemplate

Returns: string

What the editor holds for a Verilog component that has not been written yet. Named rather than written inline in setInitState below because the cancel path compares against it: a new component whose code is still this has had nothing typed into it, so closing the editor throws nothing away and need not ask. See CatalogueView.createVerilogPopup.

Returns: string

Type something to start searching.