glimmer-dsl-web 0.0.9 → 0.0.11

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,36 @@
1
+ require 'glimmer-dsl-web'
2
+
3
+ class Counter
4
+ attr_accessor :count
5
+
6
+ def initialize
7
+ self.count = 0
8
+ end
9
+ end
10
+
11
+ class ButtonCounter
12
+ include Glimmer::Web::Component
13
+
14
+ before_render do
15
+ @counter = Counter.new
16
+ end
17
+
18
+ markup {
19
+ div {
20
+ button {
21
+ # Unidirectional Data-Binding indicating that on every change to @counter.count, the value
22
+ # is read and converted to "Click To Increment: #{value} ", and then automatically
23
+ # copied to button innerText (content) to display to the user
24
+ inner_text <= [@counter, :count,
25
+ on_read: ->(value) { "Click To Increment: #{value} " }
26
+ ]
27
+
28
+ onclick {
29
+ @counter.count += 1
30
+ }
31
+ }
32
+ }
33
+ }
34
+ end
35
+
36
+ ButtonCounter.render
@@ -30,6 +30,7 @@ if RUBY_ENGINE != 'opal'
30
30
  require 'opal-rails'
31
31
  require 'opal-async'
32
32
  require 'opal-jquery'
33
+ require 'glimmer/helpers/glimmer_helper'
33
34
  else
34
35
  # GLIMMER_DSL_OPAL_MISSING = File.join(GLIMMER_DSL_OPAL_ROOT, 'lib', 'glimmer-dsl-opal', 'missing')
35
36
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: glimmer-dsl-web
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.9
4
+ version: 0.0.11
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andy Maleh
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-01-05 00:00:00.000000000 Z
11
+ date: 2024-01-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: glimmer
@@ -58,28 +58,28 @@ dependencies:
58
58
  requirements:
59
59
  - - '='
60
60
  - !ruby/object:Gem::Version
61
- version: 1.4.1
61
+ version: 1.8.2
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.4.1
68
+ version: 1.8.2
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: opal-rails
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
73
  - - '='
74
74
  - !ruby/object:Gem::Version
75
- version: 2.0.2
75
+ version: 2.0.3
76
76
  type: :runtime
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
80
  - - '='
81
81
  - !ruby/object:Gem::Version
82
- version: 2.0.2
82
+ version: 2.0.3
83
83
  - !ruby/object:Gem::Dependency
84
84
  name: opal-async
85
85
  requirement: !ruby/object:Gem::Requirement
@@ -100,14 +100,14 @@ dependencies:
100
100
  requirements:
101
101
  - - "~>"
102
102
  - !ruby/object:Gem::Version
103
- version: 0.4.6
103
+ version: 0.5.0
104
104
  type: :runtime
105
105
  prerelease: false
106
106
  version_requirements: !ruby/object:Gem::Requirement
107
107
  requirements:
108
108
  - - "~>"
109
109
  - !ruby/object:Gem::Version
110
- version: 0.4.6
110
+ version: 0.5.0
111
111
  - !ruby/object:Gem::Dependency
112
112
  name: to_collection
113
113
  requirement: !ruby/object:Gem::Requirement
@@ -257,8 +257,11 @@ files:
257
257
  - lib/glimmer-dsl-web/samples/hello/hello_content_data_binding.rb
258
258
  - lib/glimmer-dsl-web/samples/hello/hello_data_binding.rb
259
259
  - lib/glimmer-dsl-web/samples/hello/hello_form.rb
260
+ - lib/glimmer-dsl-web/samples/hello/hello_glimmer_component_helper/address_form.rb
260
261
  - lib/glimmer-dsl-web/samples/hello/hello_input_date_time.rb
262
+ - lib/glimmer-dsl-web/samples/hello/hello_observer.rb
261
263
  - lib/glimmer-dsl-web/samples/hello/hello_world.rb
264
+ - lib/glimmer-dsl-web/samples/regular/button_counter.rb
262
265
  - lib/glimmer-dsl-web/vendor/jquery.js
263
266
  - lib/glimmer/config/opal_logger.rb
264
267
  - lib/glimmer/data_binding/element_binding.rb
@@ -270,10 +273,12 @@ files:
270
273
  - lib/glimmer/dsl/web/element_expression.rb
271
274
  - lib/glimmer/dsl/web/general_element_expression.rb
272
275
  - lib/glimmer/dsl/web/listener_expression.rb
276
+ - lib/glimmer/dsl/web/observe_expression.rb
273
277
  - lib/glimmer/dsl/web/p_expression.rb
274
278
  - lib/glimmer/dsl/web/property_expression.rb
275
279
  - lib/glimmer/dsl/web/select_expression.rb
276
280
  - lib/glimmer/dsl/web/shine_data_binding_expression.rb
281
+ - lib/glimmer/helpers/glimmer_helper.rb
277
282
  - lib/glimmer/util/proc_tracker.rb
278
283
  - lib/glimmer/web.rb
279
284
  - lib/glimmer/web/component.rb