tao_ui 0.2.10 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 07e08999a1fabcf4e08b534781281b66fa93db73
4
- data.tar.gz: 5c6ef34f6cbb67b0aa4c5783345c49ad4d6b0106
3
+ metadata.gz: '08a5164450b5d1bdb27871b60c350da8c49cd68d'
4
+ data.tar.gz: d32f21b84361dbdfab0f849d65f53e7e04f25606
5
5
  SHA512:
6
- metadata.gz: 3d76266a43a9ddf7bc147e3cf42713d538885bc7b976b9ec67ef406ac0a01b08ac4142fc6989be7db27e5e5199b3e116bdc3febe9f7236e1f11c4d32d86ded4c
7
- data.tar.gz: 208fa2fb87faef5aaa7be228763344b4534396692c778cb8715918b21481094a06bb0e7fafadaccdeb5b4e61f2a4795efdc0c192eafc202dc643bcb8e09c0f0c
6
+ metadata.gz: c348496315b9cc86d9d961083faf0ae5fc4b02184c3f5d868ddd8221eebd0898c87d09f94d4ce9c96dc97cf8b3a221abc1d35a13ee373e376b442cd932cb4ea6
7
+ data.tar.gz: b79aea6494d55fb6fa74ac29137360906f1d251e768810d4cc387432a94492c441b7bcce85cbb8e2f20ee9a2912bf6e06dcff5506058a8168b75d6e2fe489e65
File without changes
@@ -71,10 +71,10 @@ class Tao.Dialog.Element extends TaoComponent
71
71
 
72
72
  _activeChanged: ->
73
73
  if @active
74
- $('body').addClass('dialog-active')
74
+ $('body, html').addClass('tao-dialog-active')
75
75
  @namespacedTrigger 'show'
76
76
  else
77
- $('body').removeClass('dialog-active')
77
+ $('body, html').removeClass('tao-dialog-active')
78
78
  @namespacedTrigger 'hide'
79
79
 
80
80
  setContent: (content) ->
@@ -7,7 +7,7 @@ class Tao.Popover.Element extends TaoComponent
7
7
 
8
8
  @tag 'tao-popover'
9
9
 
10
- @attribute 'active', type: 'boolean', observe: true
10
+ @attribute 'active', 'disabled', type: 'boolean', observe: true
11
11
 
12
12
  @attribute 'targetSelector', 'targetTraversal'
13
13
 
@@ -19,13 +19,18 @@ class Tao.Popover.Element extends TaoComponent
19
19
 
20
20
  @attribute 'offset', type: 'number', default: 0
21
21
 
22
- @attribute 'autoHide', 'autoDestroy', 'withArrow', 'disabled', type: 'boolean'
22
+ @attribute 'autoHide', 'autoDestroy', 'withArrow', 'autoActivate', type: 'boolean'
23
23
 
24
24
  _connected: ->
25
25
  @_initTarget()
26
26
  @_initTrigger()
27
27
  @_initSize()
28
- @_activeChanged() if @active
28
+
29
+ if @autoActivate
30
+ @reflow()
31
+ @active = true
32
+ else if @active
33
+ @_activeChanged()
29
34
 
30
35
  _initTarget: ->
31
36
  @target = if @targetTraversal && @targetSelector
@@ -83,14 +88,18 @@ class Tao.Popover.Element extends TaoComponent
83
88
 
84
89
  _activeChanged: ->
85
90
  if @active
86
- @target.addClass 'tao-popover-active'
91
+ @target.addClass "#{@constructor._tag}-active"
87
92
  @_enableAutoHide() if @autoHide
88
93
  @namespacedTrigger 'show'
89
94
  else
90
- @target.removeClass 'tao-popover-active'
95
+ @target.removeClass "#{@constructor._tag}-active"
91
96
  @_disableAutoHide() if @autoHide
92
97
  @namespacedTrigger 'hide'
93
98
 
99
+ _beforeDisabledChanged: (disabled) ->
100
+ @active = false if disabled && @active
101
+ null
102
+
94
103
  _enableAutoHide: ->
95
104
  $(document).on "mousedown.tao-popover-#{@taoId}", (e) =>
96
105
  return unless @active
@@ -74,10 +74,10 @@ class Tao.SlideBox.ElementBase extends TaoComponent
74
74
  @_unbindAutoHideEvent() if @autoHide
75
75
  if @active
76
76
  @_bindAutoHideEvent() if @autoHide
77
- $('body').addClass('slide-box-active')
77
+ $('body, html').addClass('slide-box-active')
78
78
  @namespacedTrigger 'show'
79
79
  else
80
- $('body').removeClass('slide-box-active')
80
+ $('body, html').removeClass('slide-box-active')
81
81
  @namespacedTrigger 'hide'
82
82
 
83
83
  _autoHideEvent: ''
@@ -7,11 +7,14 @@ a {
7
7
  fill: $link-hover-color;
8
8
  }
9
9
 
10
- &.warn {
11
- &:hover {
12
- color: lighten($red-color, 10%);
13
- fill: lighten($red-color, 10%);
14
- }
10
+ &.warn:hover {
11
+ color: lighten($red-color, 10%);
12
+ fill: lighten($red-color, 10%);
13
+ }
14
+
15
+ &.disabled:hover {
16
+ color: $lightest-grey-color;
17
+ fill: $lightest-grey-color;
15
18
  }
16
19
  }
17
20
 
@@ -1,6 +1,6 @@
1
1
  @import 'tao/ui/globals';
2
2
 
3
- body.tao-dialog-active {
3
+ .tao-dialog-active {
4
4
  overflow: hidden;
5
5
  }
6
6
 
@@ -69,6 +69,7 @@ $arrowSize: 1rem;
69
69
  &[direction='right-middle'] {
70
70
  .tao-popover-arrow {
71
71
  left: -$arrowSize;
72
+ width: $arrowSize / 2;
72
73
  }
73
74
 
74
75
  .arrow-basic {
@@ -92,6 +93,7 @@ $arrowSize: 1rem;
92
93
  &[direction='left-middle'] {
93
94
  .tao-popover-arrow {
94
95
  right: -$arrowSize;
96
+ width: $arrowSize / 2;
95
97
  }
96
98
 
97
99
  .arrow-basic {
@@ -137,6 +139,7 @@ $arrowSize: 1rem;
137
139
  &[direction='top-center'] {
138
140
  .tao-popover-arrow {
139
141
  bottom: -$arrowSize;
142
+ height: $arrowSize / 2;
140
143
  }
141
144
 
142
145
  .arrow-basic {
@@ -160,6 +163,7 @@ $arrowSize: 1rem;
160
163
  &[direction='bottom-center'] {
161
164
  .tao-popover-arrow {
162
165
  top: -$arrowSize;
166
+ height: $arrowSize / 2;
163
167
  }
164
168
 
165
169
  .arrow-basic {
@@ -99,7 +99,6 @@ hr {
99
99
  }
100
100
 
101
101
  p {
102
- line-height: 2.0;
103
102
  margin: 0 0 1em 0;
104
103
  }
105
104
 
@@ -1,5 +1,5 @@
1
1
 
2
- body.slide-box-active {
2
+ .slide-box-active {
3
3
  overflow: hidden;
4
4
  }
5
5
 
data/lib/tao_ui.rb CHANGED
@@ -1,4 +1,3 @@
1
- require "tao_ui/version"
2
1
  require "tao_ui/engine"
3
2
 
4
3
  module TaoUi
@@ -1,9 +1,3 @@
1
- require 'tao_ui/components/table/base_builder'
2
- require 'tao_ui/components/table/table_builder'
3
- require 'tao_ui/components/table/head_builder'
4
- require 'tao_ui/components/table/body_builder'
5
- require 'tao_ui/components/table/row_builder'
6
-
7
1
  module TaoUi
8
2
  module Components
9
3
  class TableComponent < TaoOnRails::Components::Base
@@ -1,6 +1,3 @@
1
- require 'tao_ui/components/tree/item_component'
2
- require 'tao_ui/components/tree/list_component'
3
-
4
1
  module TaoUi
5
2
  module Components
6
3
  class TreeComponent < TaoOnRails::Components::Base
data/lib/tao_ui/engine.rb CHANGED
@@ -1,15 +1,20 @@
1
1
  require 'autoprefixer-rails'
2
2
  require 'tao_on_rails'
3
- require 'tao_ui/components'
4
- require 'tao_ui/action_view/helpers'
5
3
 
6
4
  module TaoUi
7
5
  class Engine < ::Rails::Engine
8
6
 
7
+ config.eager_load_paths += Dir["#{config.root}/lib"]
8
+
9
9
  config.i18n.load_path += Dir[config.root.join('config', 'locales', '**', '*.{rb,yml}')]
10
+
10
11
  paths['app/views'] << 'lib/views'
11
12
 
12
- initializer "tao_ui.view_helpers" do |app|
13
+ ::ActiveSupport.on_load :tao_components do
14
+ load_tao_components TaoUi::Engine.root
15
+ end
16
+
17
+ initializer "tao_ui" do
13
18
  ::ActiveSupport.on_load :action_view do
14
19
  include TaoUi::ActionView::Helpers
15
20
  end
@@ -1,3 +1,3 @@
1
1
  module TaoUi
2
- VERSION = '0.2.10'
2
+ VERSION = '0.3.0'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tao_ui
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.10
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - farthinker
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-07-28 00:00:00.000000000 Z
11
+ date: 2017-09-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: tao_on_rails
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: 0.9.3
19
+ version: 0.10.0
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: 0.9.3
26
+ version: 0.10.0
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: autoprefixer-rails
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -125,8 +125,8 @@ files:
125
125
  - config/locales/tao_ui/components/slide_box/zh-CN.yml
126
126
  - config/locales/tao_ui/components/tree/en.yml
127
127
  - config/locales/tao_ui/components/tree/zh-CN.yml
128
- - lib/assets/icons/Loading.svg
129
128
  - lib/assets/icons/close.svg
129
+ - lib/assets/icons/loading.svg
130
130
  - lib/assets/javascripts/tao/ui/dialog/confirm.coffee
131
131
  - lib/assets/javascripts/tao/ui/dialog/element.coffee
132
132
  - lib/assets/javascripts/tao/ui/dialog/index.coffee
@@ -205,7 +205,6 @@ files:
205
205
  - lib/generators/tao/icons/templates/icons.coffee.erb
206
206
  - lib/tao_ui.rb
207
207
  - lib/tao_ui/action_view/helpers.rb
208
- - lib/tao_ui/components.rb
209
208
  - lib/tao_ui/components/confirm_dialog_component.rb
210
209
  - lib/tao_ui/components/confirm_popover_component.rb
211
210
  - lib/tao_ui/components/dialog_component.rb
@@ -1,11 +0,0 @@
1
- require 'tao_ui/components/icon_component'
2
- require 'tao_ui/components/table_component'
3
- require 'tao_ui/components/slide_box_component'
4
- require 'tao_ui/components/popover_component'
5
- require 'tao_ui/components/tooltip_component'
6
- require 'tao_ui/components/confirm_popover_component'
7
- require 'tao_ui/components/dialog_component'
8
- require 'tao_ui/components/message_dialog_component'
9
- require 'tao_ui/components/confirm_dialog_component'
10
- require 'tao_ui/components/sortable_component'
11
- require 'tao_ui/components/tree_component'