glimmer-dsl-opal 0.24.0 → 0.25.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +20 -0
- data/README.md +53 -3
- data/VERSION +1 -1
- data/lib/glimmer-dsl-opal/samples/elaborate/login.rb +3 -5
- data/lib/glimmer-dsl-opal/samples/hello/hello_progress_bar.rb +126 -0
- data/lib/glimmer/dsl/opal/combo_selection_data_binding_expression.rb +3 -3
- data/lib/glimmer/swt/button_proxy.rb +5 -0
- data/lib/glimmer/swt/c_combo_proxy.rb +30 -1
- data/lib/glimmer/swt/combo_proxy.rb +10 -2
- data/lib/glimmer/swt/fill_layout_proxy.rb +2 -2
- data/lib/glimmer/swt/progress_bar_proxy.rb +105 -0
- data/lib/glimmer/swt/widget_proxy.rb +1 -0
- metadata +6 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7730a7073849e1cb3cf05073368a974a7cc493fa44621b3fd58d180e76c25c89
|
4
|
+
data.tar.gz: 7588d6730c8f81b27e8aff908bfe3c7f4daff093c004661abbb0c4fb0a2b4756
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f50d2e39e990b86392e4fc719737b19337083380c874e426186dbbfe9ad7b60445a76fa93a8f5cf6d5055576f60209423b940e5efce3fee28f5081a99a61c2a3
|
7
|
+
data.tar.gz: 70634d53b24b7a82fcc8ca50b6b502d8b8b4260d204e89682a953e9bdbae81c7688867c8552082f323b1526170cd40a7a85222f637f8d8fb765c2658ce306e29
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,25 @@
|
|
1
1
|
# Change Log
|
2
2
|
|
3
|
+
## 0.25.3
|
4
|
+
|
5
|
+
- Fix `c_combo`'s data-binding of selection receiving model changes
|
6
|
+
- Fix Hello, C Combo!'s reset button
|
7
|
+
- Fix Login sample by removing unnecessary require statement at the top
|
8
|
+
|
9
|
+
## 0.25.2
|
10
|
+
|
11
|
+
- Fix sizing of buttons with font height specified to fit text
|
12
|
+
|
13
|
+
## 0.25.1
|
14
|
+
|
15
|
+
- Support `progress_bar` `:vertical` SWT style
|
16
|
+
- Add `progress_bar` `:vertical` SWT style to Hello, Progress Bar!
|
17
|
+
|
18
|
+
## 0.25.0
|
19
|
+
|
20
|
+
- Support `progress_bar` widget without `:vertical` SWT style support
|
21
|
+
- Hello, Progress Bar! sample without `:vertical` SWT style
|
22
|
+
|
3
23
|
## 0.24.0
|
4
24
|
|
5
25
|
- `widget#print` method
|
data/README.md
CHANGED
@@ -143,7 +143,7 @@ Hello, Table! Game Booked
|
|
143
143
|
|
144
144
|
NOTE: Glimmer DSL for Opal is an alpha project. Please help make better by contributing, adopting for small or low risk projects, and providing feedback. It is still an early alpha, so the more feedback and issues you report the better.
|
145
145
|
|
146
|
-
**Alpha Version** 0.
|
146
|
+
**Alpha Version** 0.25.3 only supports bare-minimum capabilities for the included [samples](https://github.com/AndyObtiva/glimmer-dsl-opal#samples) (originally written for [glimmer-dsl-swt](https://github.com/AndyObtiva/glimmer-dsl-swt))
|
147
147
|
|
148
148
|
Other [Glimmer](https://github.com/AndyObtiva/glimmer) DSL gems:
|
149
149
|
- [glimmer-dsl-swt](https://github.com/AndyObtiva/glimmer-dsl-swt): Glimmer DSL for SWT (JRuby Desktop Development GUI Framework)
|
@@ -187,6 +187,8 @@ Other [Glimmer](https://github.com/AndyObtiva/glimmer) DSL gems:
|
|
187
187
|
- [Hello, Arrow!](#hello-arrow)
|
188
188
|
- [Hello, Message Box!](#hello-message-box)
|
189
189
|
- [Hello, Pop Up Context Menu!](#hello-pop-up-context-menu)
|
190
|
+
- [Hello, Print!](#hello-print)
|
191
|
+
- [Hello, Progress Bar!](#hello-progress-bar)
|
190
192
|
- [Hello, Menu Bar!](#hello-menu-bar)
|
191
193
|
- [Hello, Dialog!](#hello-dialog)
|
192
194
|
- [Elaborate Samples](#elaborate-samples)
|
@@ -262,9 +264,9 @@ Add the following to `Gemfile`:
|
|
262
264
|
```
|
263
265
|
gem 'opal', '1.0.4'
|
264
266
|
gem 'opal-rails', '1.1.2'
|
265
|
-
gem 'opal-async', '~> 1.
|
267
|
+
gem 'opal-async', '~> 1.3.0'
|
266
268
|
gem 'opal-jquery', '~> 0.4.4'
|
267
|
-
gem 'glimmer-dsl-opal', '~> 0.
|
269
|
+
gem 'glimmer-dsl-opal', '~> 0.25.3'
|
268
270
|
gem 'glimmer-dsl-xml', '~> 1.2.0', require: false
|
269
271
|
gem 'glimmer-dsl-css', '~> 1.2.0', require: false
|
270
272
|
|
@@ -1833,6 +1835,54 @@ You should see "Hello, Message Box!"
|
|
1833
1835
|
![Glimmer DSL for Opal Hello Message Box](images/glimmer-dsl-opal-hello-message-box.png)
|
1834
1836
|
![Glimmer DSL for Opal Hello Message Box Dialog](images/glimmer-dsl-opal-hello-message-box-dialog.png)
|
1835
1837
|
|
1838
|
+
#### Hello, Print!
|
1839
|
+
|
1840
|
+
Add the following require statement to `app/assets/javascripts/application.rb`
|
1841
|
+
|
1842
|
+
```ruby
|
1843
|
+
require 'glimmer-dsl-opal/samples/hello/hello_print'
|
1844
|
+
```
|
1845
|
+
|
1846
|
+
Glimmer app on the desktop (using [`glimmer-dsl-swt`](https://github.com/AndyObtiva/glimmer-dsl-swt) gem):
|
1847
|
+
|
1848
|
+
![Glimmer DSL for SWT Hello Print](https://github.com/AndyObtiva/glimmer-dsl-swt/raw/master/images/glimmer-hello-print.png)
|
1849
|
+
|
1850
|
+
Glimmer app on the web (using `glimmer-dsl-opal` gem):
|
1851
|
+
|
1852
|
+
Start the Rails server:
|
1853
|
+
```
|
1854
|
+
rails s
|
1855
|
+
```
|
1856
|
+
|
1857
|
+
Visit `http://localhost:3000`
|
1858
|
+
|
1859
|
+
You should see "Hello, Print!"
|
1860
|
+
|
1861
|
+
#### Hello, Progress Bar!
|
1862
|
+
|
1863
|
+
Add the following require statement to `app/assets/javascripts/application.rb`
|
1864
|
+
|
1865
|
+
```ruby
|
1866
|
+
require 'glimmer-dsl-opal/samples/hello/hello_progress_bar'
|
1867
|
+
```
|
1868
|
+
|
1869
|
+
Glimmer app on the desktop (using [`glimmer-dsl-swt`](https://github.com/AndyObtiva/glimmer-dsl-swt) gem):
|
1870
|
+
|
1871
|
+
![Glimmer DSL for SWT Hello Progress Bar](https://github.com/AndyObtiva/glimmer-dsl-swt/raw/master/images/glimmer-hello-progress-bar.gif)
|
1872
|
+
|
1873
|
+
Glimmer app on the web (using `glimmer-dsl-opal` gem):
|
1874
|
+
|
1875
|
+
Start the Rails server:
|
1876
|
+
```
|
1877
|
+
rails s
|
1878
|
+
```
|
1879
|
+
|
1880
|
+
Visit `http://localhost:3000`
|
1881
|
+
|
1882
|
+
You should see "Hello, Progress Bar!"
|
1883
|
+
|
1884
|
+
![Glimmer DSL for Opal Hello Progress Bar](https://github.com/AndyObtiva/glimmer-dsl-opal/raw/master/images/glimmer-dsl-opal-hello-progress-bar.gif)
|
1885
|
+
|
1836
1886
|
#### Hello, Pop Up Context Menu!
|
1837
1887
|
|
1838
1888
|
Add the following require statement to `app/assets/javascripts/application.rb`
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.
|
1
|
+
0.25.3
|
@@ -19,8 +19,6 @@
|
|
19
19
|
# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
20
20
|
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
21
21
|
|
22
|
-
require 'glimmer-dsl-swt'
|
23
|
-
|
24
22
|
class LoginPresenter
|
25
23
|
|
26
24
|
attr_accessor :user_name
|
@@ -64,10 +62,10 @@ end
|
|
64
62
|
|
65
63
|
class Login
|
66
64
|
include Glimmer::UI::CustomShell
|
67
|
-
|
68
|
-
before_body
|
65
|
+
|
66
|
+
before_body do
|
69
67
|
@presenter = LoginPresenter.new
|
70
|
-
|
68
|
+
end
|
71
69
|
|
72
70
|
body {
|
73
71
|
shell {
|
@@ -0,0 +1,126 @@
|
|
1
|
+
# Copyright (c) 2020-2021 Andy Maleh
|
2
|
+
#
|
3
|
+
# Permission is hereby granted, free of charge, to any person obtaining
|
4
|
+
# a copy of this software and associated documentation files (the
|
5
|
+
# "Software"), to deal in the Software without restriction, including
|
6
|
+
# without limitation the rights to use, copy, modify, merge, publish,
|
7
|
+
# distribute, sublicense, and/or sell copies of the Software, and to
|
8
|
+
# permit persons to whom the Software is furnished to do so, subject to
|
9
|
+
# the following conditions:
|
10
|
+
#
|
11
|
+
# The above copyright notice and this permission notice shall be
|
12
|
+
# included in all copies or substantial portions of the Software.
|
13
|
+
#
|
14
|
+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
15
|
+
# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
16
|
+
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
17
|
+
# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
18
|
+
# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
19
|
+
# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
20
|
+
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
21
|
+
|
22
|
+
class HelloProgressBar
|
23
|
+
include Glimmer::UI::CustomShell
|
24
|
+
|
25
|
+
class ProgressModel
|
26
|
+
attr_accessor :minimum, :maximum, :selection, :delay
|
27
|
+
end
|
28
|
+
|
29
|
+
before_body do
|
30
|
+
@progress_model = ProgressModel.new
|
31
|
+
@progress_model.minimum = 0
|
32
|
+
@progress_model.maximum = 100
|
33
|
+
@progress_model.selection = 0
|
34
|
+
@progress_model.delay = 0.01
|
35
|
+
end
|
36
|
+
|
37
|
+
body {
|
38
|
+
shell {
|
39
|
+
grid_layout(4, true)
|
40
|
+
|
41
|
+
text 'Hello, Progress Bar!'
|
42
|
+
|
43
|
+
progress_bar(:indeterminate) {
|
44
|
+
layout_data(:fill, :center, true, false) {
|
45
|
+
horizontal_span 4
|
46
|
+
}
|
47
|
+
}
|
48
|
+
|
49
|
+
label {
|
50
|
+
text 'Minimum'
|
51
|
+
}
|
52
|
+
|
53
|
+
label {
|
54
|
+
text 'Maximum'
|
55
|
+
}
|
56
|
+
|
57
|
+
label {
|
58
|
+
text 'Selection'
|
59
|
+
}
|
60
|
+
|
61
|
+
label {
|
62
|
+
text 'Delay in Seconds'
|
63
|
+
}
|
64
|
+
|
65
|
+
spinner {
|
66
|
+
selection <=> [@progress_model, :minimum]
|
67
|
+
}
|
68
|
+
|
69
|
+
spinner {
|
70
|
+
selection <=> [@progress_model, :maximum]
|
71
|
+
}
|
72
|
+
|
73
|
+
spinner {
|
74
|
+
selection <=> [@progress_model, :selection]
|
75
|
+
}
|
76
|
+
|
77
|
+
spinner {
|
78
|
+
digits 2
|
79
|
+
minimum 1
|
80
|
+
maximum 200
|
81
|
+
selection <=> [@progress_model, :delay, on_read: ->(v) {v.to_f*100.0}, on_write: ->(v) {v.to_f/100.0}]
|
82
|
+
}
|
83
|
+
|
84
|
+
progress_bar {
|
85
|
+
layout_data(:fill, :center, true, false) {
|
86
|
+
horizontal_span 4
|
87
|
+
}
|
88
|
+
minimum <= [@progress_model, :minimum]
|
89
|
+
maximum <= [@progress_model, :maximum]
|
90
|
+
selection <= [@progress_model, :selection]
|
91
|
+
}
|
92
|
+
|
93
|
+
# :vertical SWT style is unsupported for now
|
94
|
+
progress_bar(:vertical) {
|
95
|
+
layout_data(:fill, :center, true, false) {
|
96
|
+
horizontal_span 4
|
97
|
+
}
|
98
|
+
minimum <= [@progress_model, :minimum]
|
99
|
+
maximum <= [@progress_model, :maximum]
|
100
|
+
selection <= [@progress_model, :selection]
|
101
|
+
}
|
102
|
+
|
103
|
+
button {
|
104
|
+
layout_data(:fill, :center, true, false) {
|
105
|
+
horizontal_span 4
|
106
|
+
}
|
107
|
+
text "Start"
|
108
|
+
|
109
|
+
on_widget_selected do
|
110
|
+
# if a previous thread is running, then kill first
|
111
|
+
# (killing is not dangerous since it is only a thread about updating progress)
|
112
|
+
@current_thread&.kill
|
113
|
+
@current_thread = Thread.new do
|
114
|
+
@progress_model.selection = @progress_model.minimum
|
115
|
+
(@progress_model.minimum..@progress_model.maximum).to_a.each do |n|
|
116
|
+
@progress_model.selection = n
|
117
|
+
sleep(@progress_model.delay)
|
118
|
+
end
|
119
|
+
end
|
120
|
+
end
|
121
|
+
}
|
122
|
+
}
|
123
|
+
}
|
124
|
+
end
|
125
|
+
|
126
|
+
HelloProgressBar.launch
|
@@ -6,17 +6,17 @@ require 'glimmer/swt/combo_proxy'
|
|
6
6
|
module Glimmer
|
7
7
|
module DSL
|
8
8
|
module Opal
|
9
|
-
class ComboSelectionDataBindingExpression < Expression
|
9
|
+
class ComboSelectionDataBindingExpression < Expression
|
10
10
|
def can_interpret?(parent, keyword, *args, &block)
|
11
11
|
keyword == 'selection' and
|
12
12
|
block.nil? and
|
13
|
-
parent.is_a?(Glimmer::SWT::ComboProxy) and
|
13
|
+
(parent.is_a?(Glimmer::SWT::ComboProxy) || parent.is_a?(Glimmer::SWT::CComboProxy)) and
|
14
14
|
args.size == 1 and
|
15
15
|
args[0].is_a?(DataBinding::ModelBinding) and
|
16
16
|
args[0].evaluate_options_property.is_a?(Array)
|
17
17
|
end
|
18
18
|
|
19
|
-
def interpret(parent, keyword, *args, &block)
|
19
|
+
def interpret(parent, keyword, *args, &block)
|
20
20
|
model_binding = args[0]
|
21
21
|
|
22
22
|
#TODO make this options observer dependent and all similar observers in element specific data binding handlers
|
@@ -26,7 +26,7 @@ module Glimmer
|
|
26
26
|
module SWT
|
27
27
|
class CComboProxy < ComboProxy
|
28
28
|
def post_add_content
|
29
|
-
|
29
|
+
dom_element.selectmenu
|
30
30
|
c_combo_dom_element.css('width', 'initial')
|
31
31
|
end
|
32
32
|
|
@@ -38,6 +38,11 @@ module Glimmer
|
|
38
38
|
c_combo_dom_element.css('font-size', "#{@font.height}px") unless @font.nil?
|
39
39
|
end
|
40
40
|
|
41
|
+
def text=(value)
|
42
|
+
super(value)
|
43
|
+
c_combo_text_element.text(value)
|
44
|
+
end
|
45
|
+
|
41
46
|
def c_combo_path
|
42
47
|
"##{id}-button"
|
43
48
|
end
|
@@ -45,6 +50,30 @@ module Glimmer
|
|
45
50
|
def c_combo_dom_element
|
46
51
|
Document.find(c_combo_path)
|
47
52
|
end
|
53
|
+
|
54
|
+
def c_combo_text_path
|
55
|
+
c_combo_path + ' .ui-selectmenu-text'
|
56
|
+
end
|
57
|
+
|
58
|
+
def c_combo_text_element
|
59
|
+
Document.find(c_combo_text_path)
|
60
|
+
end
|
61
|
+
|
62
|
+
def observation_request_to_event_mapping
|
63
|
+
super.merge(
|
64
|
+
'on_widget_selected' => [
|
65
|
+
{
|
66
|
+
event: 'selectmenuchange',
|
67
|
+
event_handler: -> (event_listener) {
|
68
|
+
-> (event) {
|
69
|
+
self.text = event.target.value
|
70
|
+
event_listener.call(event)
|
71
|
+
}
|
72
|
+
}
|
73
|
+
},
|
74
|
+
],
|
75
|
+
)
|
76
|
+
end
|
48
77
|
end
|
49
78
|
end
|
50
79
|
|
@@ -1,3 +1,4 @@
|
|
1
|
+
|
1
2
|
require 'glimmer/data_binding/observable_element'
|
2
3
|
require 'glimmer/swt/widget_proxy'
|
3
4
|
|
@@ -6,7 +7,6 @@ module Glimmer
|
|
6
7
|
class ComboProxy < WidgetProxy
|
7
8
|
include Glimmer::DataBinding::ObservableElement
|
8
9
|
attr_reader :text, :items
|
9
|
-
attr_accessor :selection # virtual attribute just to pass the shine data-binding test (TODO THINK OF A BETTER WAY OF HANDLING THIS)
|
10
10
|
|
11
11
|
def initialize(parent, args, block)
|
12
12
|
super(parent, args, block)
|
@@ -19,7 +19,15 @@ module Glimmer
|
|
19
19
|
|
20
20
|
def text=(value)
|
21
21
|
@text = value
|
22
|
-
|
22
|
+
dom_element.val(value)
|
23
|
+
end
|
24
|
+
|
25
|
+
def selection
|
26
|
+
text
|
27
|
+
end
|
28
|
+
|
29
|
+
def selection=(value)
|
30
|
+
self.text = value
|
23
31
|
end
|
24
32
|
|
25
33
|
def items=(the_items)
|
@@ -0,0 +1,105 @@
|
|
1
|
+
# Copyright (c) 2020-2021 Andy Maleh
|
2
|
+
#
|
3
|
+
# Permission is hereby granted, free of charge, to any person obtaining
|
4
|
+
# a copy of this software and associated documentation files (the
|
5
|
+
# "Software"), to deal in the Software without restriction, including
|
6
|
+
# without limitation the rights to use, copy, modify, merge, publish,
|
7
|
+
# distribute, sublicense, and/or sell copies of the Software, and to
|
8
|
+
# permit persons to whom the Software is furnished to do so, subject to
|
9
|
+
# the following conditions:
|
10
|
+
#
|
11
|
+
# The above copyright notice and this permission notice shall be
|
12
|
+
# included in all copies or substantial portions of the Software.
|
13
|
+
#
|
14
|
+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
15
|
+
# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
16
|
+
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
17
|
+
# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
18
|
+
# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
19
|
+
# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
20
|
+
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
21
|
+
|
22
|
+
require 'glimmer/swt/widget_proxy'
|
23
|
+
|
24
|
+
module Glimmer
|
25
|
+
module SWT
|
26
|
+
class ProgressBarProxy < WidgetProxy
|
27
|
+
STYLE = <<~CSS
|
28
|
+
.ui-progressbar.vertical {
|
29
|
+
transform: rotate(-180deg);
|
30
|
+
height: 140px;
|
31
|
+
width: 28px;
|
32
|
+
margin-left: auto;
|
33
|
+
margin-right: auto;
|
34
|
+
}
|
35
|
+
CSS
|
36
|
+
|
37
|
+
attr_reader :vertical, :indeterminate, :maximum, :selection
|
38
|
+
attr_accessor :state, :minimum #ignored, only there for API compatibility
|
39
|
+
alias vertical? vertical
|
40
|
+
alias indeterminate? indeterminate
|
41
|
+
|
42
|
+
def initialize(parent, args, block)
|
43
|
+
@vertical = args.detect { |arg| SWTProxy[arg] == SWTProxy[:vertical] }
|
44
|
+
@indeterminate = args.detect { |arg| SWTProxy[arg] == SWTProxy[:indeterminate] }
|
45
|
+
super(parent, args, block)
|
46
|
+
# initialize manually if vertical
|
47
|
+
dom_element.progressbar if horizontal?
|
48
|
+
self.minimum = 0
|
49
|
+
self.selection = false if indeterminate?
|
50
|
+
end
|
51
|
+
|
52
|
+
def horizontal
|
53
|
+
!vertical
|
54
|
+
end
|
55
|
+
alias horizontal? horizontal
|
56
|
+
|
57
|
+
def minimum=(value)
|
58
|
+
@minimum = value
|
59
|
+
# re-update maximum and selection since they depend on minimum
|
60
|
+
self.maximum = @maximum if @maximum
|
61
|
+
self.selection = @selection if @selection
|
62
|
+
end
|
63
|
+
|
64
|
+
def maximum=(value)
|
65
|
+
@maximum = value
|
66
|
+
if horizontal?
|
67
|
+
dom_element.progressbar('option', 'max', @maximum - @minimum)
|
68
|
+
end
|
69
|
+
end
|
70
|
+
|
71
|
+
def selection=(selection_value)
|
72
|
+
@selection = selection_value
|
73
|
+
if horizontal?
|
74
|
+
value = @selection ? (@selection - @minimum) : @selection
|
75
|
+
dom_element.progressbar('option', 'value', value)
|
76
|
+
else
|
77
|
+
value = ((@selection - @minimum) / (@maximum - @minimum)) * 100
|
78
|
+
selection_dom_element.css('height', "#{value}%")
|
79
|
+
end
|
80
|
+
end
|
81
|
+
|
82
|
+
def element
|
83
|
+
'div'
|
84
|
+
end
|
85
|
+
|
86
|
+
def selection_dom_element
|
87
|
+
dom_element.find('.ui-progressbar-value')
|
88
|
+
end
|
89
|
+
|
90
|
+
def dom
|
91
|
+
progress_bar_id = id
|
92
|
+
progress_bar_class = name
|
93
|
+
progress_bar_class += ' vertical ui-progressbar ui-corner-all ui-widget ui-widget-content' if vertical?
|
94
|
+
progress_bar_class += ' indeterminate' if indeterminate?
|
95
|
+
@dom ||= html {
|
96
|
+
div(id: progress_bar_id, class: progress_bar_class) {
|
97
|
+
if vertical?
|
98
|
+
div(class: 'ui-progressbar-value ui-corner-left ui-widget-header', style: 'height: 0%;')
|
99
|
+
end
|
100
|
+
}
|
101
|
+
}.to_s
|
102
|
+
end
|
103
|
+
end
|
104
|
+
end
|
105
|
+
end
|
@@ -1037,6 +1037,7 @@ require 'glimmer/swt/table_column_proxy'
|
|
1037
1037
|
require 'glimmer/swt/table_item_proxy'
|
1038
1038
|
require 'glimmer/swt/table_proxy'
|
1039
1039
|
require 'glimmer/swt/text_proxy'
|
1040
|
+
require 'glimmer/swt/progress_bar_proxy'
|
1040
1041
|
require 'glimmer/swt/radio_proxy'
|
1041
1042
|
require 'glimmer/swt/scale_proxy'
|
1042
1043
|
require 'glimmer/swt/scrolled_composite_proxy'
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: glimmer-dsl-opal
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.25.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- AndyMaleh
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-08-
|
11
|
+
date: 2021-08-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: glimmer
|
@@ -58,14 +58,14 @@ dependencies:
|
|
58
58
|
requirements:
|
59
59
|
- - "~>"
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version: 1.
|
61
|
+
version: 1.3.0
|
62
62
|
type: :runtime
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
66
|
- - "~>"
|
67
67
|
- !ruby/object:Gem::Version
|
68
|
-
version: 1.
|
68
|
+
version: 1.3.0
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: to_collection
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
@@ -309,6 +309,7 @@ files:
|
|
309
309
|
- lib/glimmer-dsl-opal/samples/hello/hello_message_box.rb
|
310
310
|
- lib/glimmer-dsl-opal/samples/hello/hello_pop_up_context_menu.rb
|
311
311
|
- lib/glimmer-dsl-opal/samples/hello/hello_print.rb
|
312
|
+
- lib/glimmer-dsl-opal/samples/hello/hello_progress_bar.rb
|
312
313
|
- lib/glimmer-dsl-opal/samples/hello/hello_radio.rb
|
313
314
|
- lib/glimmer-dsl-opal/samples/hello/hello_radio_group.rb
|
314
315
|
- lib/glimmer-dsl-opal/samples/hello/hello_scale.rb
|
@@ -422,6 +423,7 @@ files:
|
|
422
423
|
- lib/glimmer/swt/menu_proxy.rb
|
423
424
|
- lib/glimmer/swt/message_box_proxy.rb
|
424
425
|
- lib/glimmer/swt/point.rb
|
426
|
+
- lib/glimmer/swt/progress_bar_proxy.rb
|
425
427
|
- lib/glimmer/swt/property_owner.rb
|
426
428
|
- lib/glimmer/swt/radio_proxy.rb
|
427
429
|
- lib/glimmer/swt/row_layout_proxy.rb
|