tao_form 0.1.8 → 0.1.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d408f2561696e985935289d860c142ac75ea4c5a
4
- data.tar.gz: 9dbc3b7048c07dd2d21f3eaf434d3d578ebacd17
3
+ metadata.gz: ee2ff40f7bdfcc88531bc195a44cd9519fbdc149
4
+ data.tar.gz: d2c855cdb833109f1a80f76a8966114371bf271c
5
5
  SHA512:
6
- metadata.gz: b10e8496af90e90c276632b622d20e4d30ea06394d303f5546bbefcdddc7c0b9891dc32a96a063c58e29b76a4664eccfb59c6e4befa9cdd953ae1c59beba2562
7
- data.tar.gz: 8fb2b7b0a4d173ddeb84263f1c866aac7ace7a9bd78280cc0fababff397ca3e8de5efbfae8a52f6c6a1f7cefa5c0eaf3dd30f4211a32cae64b267c5123412aa2
6
+ metadata.gz: 725bafd0dbe6eca4dfa3bab172244f552b8309321e9a0bc413dfe91664d2688e657c9d75b96b20b55ba708f5347e6270ff8017fcd785649d8195b387a43968e8
7
+ data.tar.gz: 48711a34c50054ec54605d791a4f0a713a7fcf4b749617928d79ec9a56546634d148951353327c5b1d35ab9b2878e581eec4a2c43c9a31e3d5c4bfa7456d9e45
@@ -6,6 +6,12 @@ class Tao.Form.CheckboxBase extends TaoComponent
6
6
 
7
7
  @tag 'tao-check-box'
8
8
 
9
+ @get 'indeterminate', ->
10
+ @field?.prop 'indeterminate'
11
+
12
+ @set 'indeterminate', (value) ->
13
+ @field?.prop 'indeterminate', value
14
+
9
15
  _connected: ->
10
16
  @field = @jq.find('input:checkbox')
11
17
  @_bind()
@@ -8,13 +8,14 @@ class Tao.Form.Select.DataProvider extends TaoModule
8
8
  @option 'field'
9
9
 
10
10
  _init: ->
11
- @options = @field.find('option').map (i, optionEl) =>
11
+ @options = @field.find('option').map (i, optionEl) ->
12
12
  Option.fromElement optionEl
13
13
  .get()
14
14
 
15
15
  @field.on 'tao:addOption', (e, option) =>
16
16
  if option.data?.group
17
- index = _.findIndex @options, (opt) -> opt.data?.group == option.data?.group
17
+ index = _.findIndex @options, (opt) ->
18
+ opt.data?.group == option.data?.group
18
19
  @options.splice index, 0, option
19
20
  else
20
21
  @options.unshift option
@@ -47,9 +48,11 @@ class Tao.Form.Select.DataProvider extends TaoModule
47
48
  "#{@remote.searchKey}": value
48
49
  dataType: 'json'
49
50
  .done (result) ->
50
- options = if _.isArray(result.options) && result.options.length > 0 && _.isArray(result.options[0])
51
+ options = if _.isArray(result.options) && result.options.length > 0 &&\
52
+ _.isArray(result.options[0]) && _.isArray(result.options[0][1])
51
53
  result.options.reduce (opts, group) ->
52
- return unless _.isArray(group) && group.length > 1 && _.isArray(group[1])
54
+ unless _.isArray(group) && group.length > 1 && _.isArray(group[1])
55
+ return
53
56
  group[1].forEach (opt) ->
54
57
  opts.push Option.fromJson(opt, group[0])
55
58
  opts
@@ -63,7 +63,7 @@ class Tao.Form.Select.MultipleResultBase extends TaoComponent
63
63
  $option.prop 'selected', false
64
64
 
65
65
  _generateOption: (option) ->
66
- $option = $('<option>', test: option.text, value: option.value).appendTo(@field)
66
+ $option = $('<option>', text: option.text, value: option.value).appendTo(@field)
67
67
  @field.trigger 'tao:addOption', option, $option
68
68
  $option
69
69
 
@@ -1,5 +1,5 @@
1
1
  //= require tao/ui
2
2
  //= require ./reset
3
- //= require ./layout
3
+ //= require ./layouts
4
4
  //= require ./inputs
5
5
  //= require ./fields
@@ -1,4 +1,4 @@
1
- @import './globals';
1
+ @import 'tao/form/globals';
2
2
 
3
3
  .tao-form {
4
4
  display: block;
@@ -50,7 +50,7 @@
50
50
  margin: 0 $form-field-margin-h 0 0;
51
51
  line-height: $form-label-line-height;
52
52
  font-size: $form-label-font-size;
53
- color: $light-grey-color;
53
+ color: $lighter-grey-color;
54
54
 
55
55
  &.required abbr {
56
56
  text-decoration: none;
@@ -116,7 +116,7 @@
116
116
  }
117
117
 
118
118
  .form-buttons {
119
- margin: 2em 0 0 $form-label-width + $form-field-margin-h;
119
+ margin: 2rem 0 0 $form-label-width + $form-field-margin-h;
120
120
 
121
121
  .success-message {
122
122
  display: inline-flex;
@@ -0,0 +1,2 @@
1
+ //= require ./default
2
+ //= require ./narrow
@@ -0,0 +1,31 @@
1
+ @import 'tao/form/globals';
2
+
3
+ .tao-form.narrow {
4
+ width: $form-field-width;
5
+ margin: 0 auto;
6
+
7
+ form {
8
+ .form-input {
9
+ display: block;
10
+ margin: 0 0 1.5rem 0;
11
+
12
+ .input-label {
13
+ text-align: left;
14
+ }
15
+
16
+ & > .hint {
17
+ opacity: 1;
18
+ margin: 0.375rem 0;
19
+ padding: 0;
20
+ line-height: inherit;
21
+ }
22
+ }
23
+
24
+ .form-buttons {
25
+ margin: 4rem 0 0 0;
26
+ display: flex;
27
+ align-items: center;
28
+ justify-content: center;
29
+ }
30
+ }
31
+ }
@@ -23,7 +23,7 @@ tao-check-box {
23
23
 
24
24
  &.icon-indeterminate {
25
25
  width: 10px;
26
- height: 2px;
26
+ height: 3px;
27
27
  margin: 7px 3px;
28
28
  border-radius: 2px;
29
29
  background: #ffffff;
@@ -67,6 +67,10 @@ module TaoForm
67
67
  end
68
68
  end
69
69
 
70
+ def default_options
71
+ {class: 'tao-datetime-picker'}
72
+ end
73
+
70
74
  end
71
75
  end
72
76
  end
@@ -82,6 +82,10 @@ module TaoForm
82
82
  end
83
83
  end
84
84
 
85
+ def default_options
86
+ {class: 'tao-select'}
87
+ end
88
+
85
89
  end
86
90
  end
87
91
  end
@@ -1,3 +1,3 @@
1
1
  module TaoForm
2
- VERSION = '0.1.8'
2
+ VERSION = '0.1.9'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tao_form
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.8
4
+ version: 0.1.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - your name
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-06-28 00:00:00.000000000 Z
11
+ date: 2017-07-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: tao_on_rails
@@ -210,7 +210,9 @@ files:
210
210
  - lib/assets/stylesheets/tao/form/inputs/group.scss
211
211
  - lib/assets/stylesheets/tao/form/inputs/index.scss
212
212
  - lib/assets/stylesheets/tao/form/inputs/text.scss
213
- - lib/assets/stylesheets/tao/form/layout.scss
213
+ - lib/assets/stylesheets/tao/form/layouts/default.scss
214
+ - lib/assets/stylesheets/tao/form/layouts/index.scss
215
+ - lib/assets/stylesheets/tao/form/layouts/narrow.scss
214
216
  - lib/assets/stylesheets/tao/form/mobile/_globals.scss
215
217
  - lib/assets/stylesheets/tao/form/mobile/_mixins.scss
216
218
  - lib/assets/stylesheets/tao/form/mobile/_variables.scss