Module: Ruflet::UI::MaterialControlMethods

Included in:
ControlMethods
Defined in:
lib/ruflet_ui/ruflet/ui/material_control_methods.rb

Instance Method Summary collapse

Instance Method Details

#alert_dialog(**props) ⇒ Object



62
# File 'lib/ruflet_ui/ruflet/ui/material_control_methods.rb', line 62

def alert_dialog(**props) = build_widget(:alertdialog, **props)

#alertdialog(**props) ⇒ Object



63
# File 'lib/ruflet_ui/ruflet/ui/material_control_methods.rb', line 63

def alertdialog(**props) = alert_dialog(**props)

#app_bar(**props) ⇒ Object



85
# File 'lib/ruflet_ui/ruflet/ui/material_control_methods.rb', line 85

def app_bar(**props) = build_widget(:appbar, **props)

#appbar(**props) ⇒ Object



86
# File 'lib/ruflet_ui/ruflet/ui/material_control_methods.rb', line 86

def appbar(**props) = app_bar(**props)

#bar_chart(**props) ⇒ Object



101
# File 'lib/ruflet_ui/ruflet/ui/material_control_methods.rb', line 101

def bar_chart(**props) = build_widget(:barchart, **props)

#bar_chart_group(**props) ⇒ Object



103
# File 'lib/ruflet_ui/ruflet/ui/material_control_methods.rb', line 103

def bar_chart_group(**props) = build_widget(:barchartgroup, **props)

#bar_chart_rod(**props) ⇒ Object



105
# File 'lib/ruflet_ui/ruflet/ui/material_control_methods.rb', line 105

def bar_chart_rod(**props) = build_widget(:barchartrod, **props)

#bar_chart_rod_stack_item(**props) ⇒ Object



107
# File 'lib/ruflet_ui/ruflet/ui/material_control_methods.rb', line 107

def bar_chart_rod_stack_item(**props) = build_widget(:barchartrodstackitem, **props)

#barchart(**props) ⇒ Object



102
# File 'lib/ruflet_ui/ruflet/ui/material_control_methods.rb', line 102

def barchart(**props) = bar_chart(**props)

#barchartgroup(**props) ⇒ Object



104
# File 'lib/ruflet_ui/ruflet/ui/material_control_methods.rb', line 104

def barchartgroup(**props) = bar_chart_group(**props)

#barchartrod(**props) ⇒ Object



106
# File 'lib/ruflet_ui/ruflet/ui/material_control_methods.rb', line 106

def barchartrod(**props) = bar_chart_rod(**props)

#barchartrodstackitem(**props) ⇒ Object



108
# File 'lib/ruflet_ui/ruflet/ui/material_control_methods.rb', line 108

def barchartrodstackitem(**props) = bar_chart_rod_stack_item(**props)

#bottom_sheet(**props) ⇒ Object



66
# File 'lib/ruflet_ui/ruflet/ui/material_control_methods.rb', line 66

def bottom_sheet(**props) = build_widget(:bottomsheet, **props)

#bottomsheet(**props) ⇒ Object



67
# File 'lib/ruflet_ui/ruflet/ui/material_control_methods.rb', line 67

def bottomsheet(**props) = bottom_sheet(**props)

#button(**props) ⇒ Object



45
46
47
# File 'lib/ruflet_ui/ruflet/ui/material_control_methods.rb', line 45

def button(**props) = build_widget(:button, **props)
# Ruflet currently uses a single Material button control schema.
# Keep elevated_button DSL available by routing to :button.

#candlestick_chart(**props) ⇒ Object



119
# File 'lib/ruflet_ui/ruflet/ui/material_control_methods.rb', line 119

def candlestick_chart(**props) = build_widget(:candlestickchart, **props)

#candlestick_chart_spot(**props) ⇒ Object



121
# File 'lib/ruflet_ui/ruflet/ui/material_control_methods.rb', line 121

def candlestick_chart_spot(**props) = build_widget(:candlestickchartspot, **props)

#candlestickchart(**props) ⇒ Object



120
# File 'lib/ruflet_ui/ruflet/ui/material_control_methods.rb', line 120

def candlestickchart(**props) = candlestick_chart(**props)

#candlestickchartspot(**props) ⇒ Object



122
# File 'lib/ruflet_ui/ruflet/ui/material_control_methods.rb', line 122

def candlestickchartspot(**props) = candlestick_chart_spot(**props)

#center(**props, &block) ⇒ Object



9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# File 'lib/ruflet_ui/ruflet/ui/material_control_methods.rb', line 9

def center(**props, &block)
  mapped = props.dup
  defaults = { expand: true, alignment: { x: 0, y: 0 } }

  if block
    nested = WidgetBuilder.new
    block_result = nested.instance_eval(&block)
    child =
      if nested.children.any?
        nested.children.first
      elsif block_result.is_a?(Ruflet::Control)
        block_result
      end
    mapped[:content] = child if child
  end

  build_widget(:container, **normalize_container_props(defaults.merge(mapped)))
end

#chart_axis(**props) ⇒ Object



135
# File 'lib/ruflet_ui/ruflet/ui/material_control_methods.rb', line 135

def chart_axis(**props) = build_widget(:chartaxis, **props)

#chart_axis_label(**props) ⇒ Object



137
# File 'lib/ruflet_ui/ruflet/ui/material_control_methods.rb', line 137

def chart_axis_label(**props) = build_widget(:chartaxislabel, **props)

#chartaxis(**props) ⇒ Object



136
# File 'lib/ruflet_ui/ruflet/ui/material_control_methods.rb', line 136

def chartaxis(**props) = chart_axis(**props)

#chartaxislabel(**props) ⇒ Object



138
# File 'lib/ruflet_ui/ruflet/ui/material_control_methods.rb', line 138

def chartaxislabel(**props) = chart_axis_label(**props)

#checkbox(**props) ⇒ Object



58
# File 'lib/ruflet_ui/ruflet/ui/material_control_methods.rb', line 58

def checkbox(**props) = build_widget(:checkbox, **props)

#clipboard(**props) ⇒ Object



88
# File 'lib/ruflet_ui/ruflet/ui/material_control_methods.rb', line 88

def clipboard(**props) = build_widget(:clipboard, **props)

#column(**props, &block) ⇒ Object



7
# File 'lib/ruflet_ui/ruflet/ui/material_control_methods.rb', line 7

def column(**props, &block) = build_widget(:column, **props, &block)

#container(**props, &block) ⇒ Object



32
# File 'lib/ruflet_ui/ruflet/ui/material_control_methods.rb', line 32

def container(**props, &block) = build_widget(:container, **normalize_container_props(props), &block)

#drag_target(**props, &block) ⇒ Object



36
# File 'lib/ruflet_ui/ruflet/ui/material_control_methods.rb', line 36

def drag_target(**props, &block) = build_widget(:dragtarget, **props, &block)

#draggable(**props, &block) ⇒ Object



35
# File 'lib/ruflet_ui/ruflet/ui/material_control_methods.rb', line 35

def draggable(**props, &block) = build_widget(:draggable, **props, &block)

#dragtarget(**props, &block) ⇒ Object



37
# File 'lib/ruflet_ui/ruflet/ui/material_control_methods.rb', line 37

def dragtarget(**props, &block) = drag_target(**props, &block)

#elevated_button(**props) ⇒ Object

Ruflet currently uses a single Material button control schema. Keep elevated_button DSL available by routing to :button.



48
# File 'lib/ruflet_ui/ruflet/ui/material_control_methods.rb', line 48

def elevated_button(**props) = build_widget(:button, **props)

#fab(content = nil, **props) ⇒ Object



142
143
144
145
# File 'lib/ruflet_ui/ruflet/ui/material_control_methods.rb', line 142

def fab(content = nil, **props)
  mapped = normalize_fab_props(props.dup, content)
  build_widget(:floatingactionbutton, **mapped)
end

#filled_button(**props) ⇒ Object



51
# File 'lib/ruflet_ui/ruflet/ui/material_control_methods.rb', line 51

def filled_button(**props) = build_widget(:filledbutton, **props)

#filledbutton(**props) ⇒ Object



52
# File 'lib/ruflet_ui/ruflet/ui/material_control_methods.rb', line 52

def filledbutton(**props) = filled_button(**props)

#floating_action_button(**props) ⇒ Object



89
# File 'lib/ruflet_ui/ruflet/ui/material_control_methods.rb', line 89

def floating_action_button(**props) = build_widget(:floatingactionbutton, **props)

#floatingactionbutton(**props) ⇒ Object



90
# File 'lib/ruflet_ui/ruflet/ui/material_control_methods.rb', line 90

def floatingactionbutton(**props) = floating_action_button(**props)

#gesture_detector(**props, &block) ⇒ Object



33
# File 'lib/ruflet_ui/ruflet/ui/material_control_methods.rb', line 33

def gesture_detector(**props, &block) = build_widget(:gesturedetector, **props, &block)

#gesturedetector(**props, &block) ⇒ Object



34
# File 'lib/ruflet_ui/ruflet/ui/material_control_methods.rb', line 34

def gesturedetector(**props, &block) = gesture_detector(**props, &block)

#grid_view(**props, &block) ⇒ Object



30
# File 'lib/ruflet_ui/ruflet/ui/material_control_methods.rb', line 30

def grid_view(**props, &block) = build_widget(:gridview, **props, &block)

#gridview(**props, &block) ⇒ Object



31
# File 'lib/ruflet_ui/ruflet/ui/material_control_methods.rb', line 31

def gridview(**props, &block) = grid_view(**props, &block)

#icon(**props) ⇒ Object



75
# File 'lib/ruflet_ui/ruflet/ui/material_control_methods.rb', line 75

def icon(**props) = build_widget(:icon, **props)

#icon_button(**props) ⇒ Object



54
# File 'lib/ruflet_ui/ruflet/ui/material_control_methods.rb', line 54

def icon_button(**props) = build_widget(:iconbutton, **props)

#iconbutton(**props) ⇒ Object



55
# File 'lib/ruflet_ui/ruflet/ui/material_control_methods.rb', line 55

def iconbutton(**props) = icon_button(**props)

#image(src = nil, src_base64: nil, placeholder_src: nil, **props) ⇒ Object



77
78
79
80
81
82
83
# File 'lib/ruflet_ui/ruflet/ui/material_control_methods.rb', line 77

def image(src = nil, src_base64: nil, placeholder_src: nil, **props)
  mapped = props.dup
  mapped[:src] = normalize_image_source(src) unless src.nil?
  mapped[:src] = normalize_image_source(src_base64) if mapped[:src].nil? && !src_base64.nil?
  mapped[:placeholder_src] = normalize_image_source(placeholder_src) unless placeholder_src.nil?
  build_widget(:image, **mapped)
end

#line_chart(**props) ⇒ Object



109
# File 'lib/ruflet_ui/ruflet/ui/material_control_methods.rb', line 109

def line_chart(**props) = build_widget(:linechart, **props)

#line_chart_data(**props) ⇒ Object



111
# File 'lib/ruflet_ui/ruflet/ui/material_control_methods.rb', line 111

def line_chart_data(**props) = build_widget(:linechartdata, **props)

#line_chart_data_point(**props) ⇒ Object



113
# File 'lib/ruflet_ui/ruflet/ui/material_control_methods.rb', line 113

def line_chart_data_point(**props) = build_widget(:linechartdatapoint, **props)

#linechart(**props) ⇒ Object



110
# File 'lib/ruflet_ui/ruflet/ui/material_control_methods.rb', line 110

def linechart(**props) = line_chart(**props)

#linechartdata(**props) ⇒ Object



112
# File 'lib/ruflet_ui/ruflet/ui/material_control_methods.rb', line 112

def linechartdata(**props) = line_chart_data(**props)

#linechartdatapoint(**props) ⇒ Object



114
# File 'lib/ruflet_ui/ruflet/ui/material_control_methods.rb', line 114

def linechartdatapoint(**props) = line_chart_data_point(**props)

#markdown(value = nil, **props) ⇒ Object



69
70
71
72
73
# File 'lib/ruflet_ui/ruflet/ui/material_control_methods.rb', line 69

def markdown(value = nil, **props)
  mapped = props.dup
  mapped[:value] = value unless value.nil?
  build_widget(:markdown, **mapped)
end


97
# File 'lib/ruflet_ui/ruflet/ui/material_control_methods.rb', line 97

def navigation_bar(**props, &block) = build_widget(:navigationbar, **props, &block)


99
# File 'lib/ruflet_ui/ruflet/ui/material_control_methods.rb', line 99

def navigation_bar_destination(**props, &block) = build_widget(:navigationbardestination, **props, &block)


98
# File 'lib/ruflet_ui/ruflet/ui/material_control_methods.rb', line 98

def navigationbar(**props, &block) = navigation_bar(**props, &block)


100
# File 'lib/ruflet_ui/ruflet/ui/material_control_methods.rb', line 100

def navigationbardestination(**props, &block) = navigation_bar_destination(**props, &block)

#pie_chart(**props) ⇒ Object



115
# File 'lib/ruflet_ui/ruflet/ui/material_control_methods.rb', line 115

def pie_chart(**props) = build_widget(:piechart, **props)

#pie_chart_section(**props) ⇒ Object



117
# File 'lib/ruflet_ui/ruflet/ui/material_control_methods.rb', line 117

def pie_chart_section(**props) = build_widget(:piechartsection, **props)

#piechart(**props) ⇒ Object



116
# File 'lib/ruflet_ui/ruflet/ui/material_control_methods.rb', line 116

def piechart(**props) = pie_chart(**props)

#piechartsection(**props) ⇒ Object



118
# File 'lib/ruflet_ui/ruflet/ui/material_control_methods.rb', line 118

def piechartsection(**props) = pie_chart_section(**props)

#radar_chart(**props) ⇒ Object



123
# File 'lib/ruflet_ui/ruflet/ui/material_control_methods.rb', line 123

def radar_chart(**props) = build_widget(:radarchart, **props)

#radar_chart_title(**props) ⇒ Object



125
# File 'lib/ruflet_ui/ruflet/ui/material_control_methods.rb', line 125

def radar_chart_title(**props) = build_widget(:radarcharttitle, **props)

#radar_data_set(**props) ⇒ Object



127
# File 'lib/ruflet_ui/ruflet/ui/material_control_methods.rb', line 127

def radar_data_set(**props) = build_widget(:radardataset, **props)

#radar_data_set_entry(**props) ⇒ Object



129
# File 'lib/ruflet_ui/ruflet/ui/material_control_methods.rb', line 129

def radar_data_set_entry(**props) = build_widget(:radardatasetentry, **props)

#radarchart(**props) ⇒ Object



124
# File 'lib/ruflet_ui/ruflet/ui/material_control_methods.rb', line 124

def radarchart(**props) = radar_chart(**props)

#radarcharttitle(**props) ⇒ Object



126
# File 'lib/ruflet_ui/ruflet/ui/material_control_methods.rb', line 126

def radarcharttitle(**props) = radar_chart_title(**props)

#radardataset(**props) ⇒ Object



128
# File 'lib/ruflet_ui/ruflet/ui/material_control_methods.rb', line 128

def radardataset(**props) = radar_data_set(**props)

#radardatasetentry(**props) ⇒ Object



130
# File 'lib/ruflet_ui/ruflet/ui/material_control_methods.rb', line 130

def radardatasetentry(**props) = radar_data_set_entry(**props)

#radio(**props) ⇒ Object



59
# File 'lib/ruflet_ui/ruflet/ui/material_control_methods.rb', line 59

def radio(**props) = build_widget(:radio, **props)

#radio_group(**props) ⇒ Object



60
# File 'lib/ruflet_ui/ruflet/ui/material_control_methods.rb', line 60

def radio_group(**props) = build_widget(:radiogroup, **props)

#radiogroup(**props) ⇒ Object



61
# File 'lib/ruflet_ui/ruflet/ui/material_control_methods.rb', line 61

def radiogroup(**props) = radio_group(**props)

#row(**props, &block) ⇒ Object



28
# File 'lib/ruflet_ui/ruflet/ui/material_control_methods.rb', line 28

def row(**props, &block) = build_widget(:row, **props, &block)

#scatter_chart(**props) ⇒ Object



131
# File 'lib/ruflet_ui/ruflet/ui/material_control_methods.rb', line 131

def scatter_chart(**props) = build_widget(:scatterchart, **props)

#scatter_chart_spot(**props) ⇒ Object



133
# File 'lib/ruflet_ui/ruflet/ui/material_control_methods.rb', line 133

def scatter_chart_spot(**props) = build_widget(:scatterchartspot, **props)

#scatterchart(**props) ⇒ Object



132
# File 'lib/ruflet_ui/ruflet/ui/material_control_methods.rb', line 132

def scatterchart(**props) = scatter_chart(**props)

#scatterchartspot(**props) ⇒ Object



134
# File 'lib/ruflet_ui/ruflet/ui/material_control_methods.rb', line 134

def scatterchartspot(**props) = scatter_chart_spot(**props)

#snack_bar(**props) ⇒ Object



64
# File 'lib/ruflet_ui/ruflet/ui/material_control_methods.rb', line 64

def snack_bar(**props) = build_widget(:snackbar, **props)

#snackbar(**props) ⇒ Object



65
# File 'lib/ruflet_ui/ruflet/ui/material_control_methods.rb', line 65

def snackbar(**props) = snack_bar(**props)

#stack(**props, &block) ⇒ Object



29
# File 'lib/ruflet_ui/ruflet/ui/material_control_methods.rb', line 29

def stack(**props, &block) = build_widget(:stack, **props, &block)

#tab(**props, &block) ⇒ Object



92
# File 'lib/ruflet_ui/ruflet/ui/material_control_methods.rb', line 92

def tab(**props, &block) = build_widget(:tab, **props, &block)

#tab_bar(**props, &block) ⇒ Object



93
# File 'lib/ruflet_ui/ruflet/ui/material_control_methods.rb', line 93

def tab_bar(**props, &block) = build_widget(:tabbar, **props, &block)

#tab_bar_view(**props, &block) ⇒ Object



95
# File 'lib/ruflet_ui/ruflet/ui/material_control_methods.rb', line 95

def tab_bar_view(**props, &block) = build_widget(:tabbarview, **props, &block)

#tabbar(**props, &block) ⇒ Object



94
# File 'lib/ruflet_ui/ruflet/ui/material_control_methods.rb', line 94

def tabbar(**props, &block) = tab_bar(**props, &block)

#tabbarview(**props, &block) ⇒ Object



96
# File 'lib/ruflet_ui/ruflet/ui/material_control_methods.rb', line 96

def tabbarview(**props, &block) = tab_bar_view(**props, &block)

#tabs(**props, &block) ⇒ Object



91
# File 'lib/ruflet_ui/ruflet/ui/material_control_methods.rb', line 91

def tabs(**props, &block) = build_widget(:tabs, **props, &block)

#text(value = nil, **props) ⇒ Object



39
40
41
42
43
# File 'lib/ruflet_ui/ruflet/ui/material_control_methods.rb', line 39

def text(value = nil, **props)
  mapped = props.dup
  mapped[:value] = value unless value.nil?
  build_widget(:text, **mapped)
end

#text_button(**props) ⇒ Object



49
# File 'lib/ruflet_ui/ruflet/ui/material_control_methods.rb', line 49

def text_button(**props) = build_widget(:textbutton, **props)

#text_field(**props) ⇒ Object



56
# File 'lib/ruflet_ui/ruflet/ui/material_control_methods.rb', line 56

def text_field(**props) = build_widget(:textfield, **props)

#textbutton(**props) ⇒ Object



50
# File 'lib/ruflet_ui/ruflet/ui/material_control_methods.rb', line 50

def textbutton(**props) = text_button(**props)

#textfield(**props) ⇒ Object



57
# File 'lib/ruflet_ui/ruflet/ui/material_control_methods.rb', line 57

def textfield(**props) = text_field(**props)

#url_launcher(**props) ⇒ Object



87
# File 'lib/ruflet_ui/ruflet/ui/material_control_methods.rb', line 87

def url_launcher(**props) = build_widget(:url_launcher, **props)

#view(**props, &block) ⇒ Object



6
# File 'lib/ruflet_ui/ruflet/ui/material_control_methods.rb', line 6

def view(**props, &block) = build_widget(:view, **props, &block)

#web_view(**props) ⇒ Object



139
# File 'lib/ruflet_ui/ruflet/ui/material_control_methods.rb', line 139

def web_view(**props) = build_widget(:webview, **props)

#webview(**props) ⇒ Object



140
# File 'lib/ruflet_ui/ruflet/ui/material_control_methods.rb', line 140

def webview(**props) = web_view(**props)