tao_form 0.1.8 → 0.1.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/assets/javascripts/tao/form/shared/fields/checkbox.coffee +6 -0
- data/lib/assets/javascripts/tao/form/shared/fields/select/models/data_provider.coffee +7 -4
- data/lib/assets/javascripts/tao/form/shared/fields/select/multiple_result/base.coffee +1 -1
- data/lib/assets/stylesheets/tao/form/index.scss +1 -1
- data/lib/assets/stylesheets/tao/form/{layout.scss → layouts/default.scss} +3 -3
- data/lib/assets/stylesheets/tao/form/layouts/index.scss +2 -0
- data/lib/assets/stylesheets/tao/form/layouts/narrow.scss +31 -0
- data/lib/assets/stylesheets/tao/form/shared/fields/_checkbox.scss +1 -1
- data/lib/tao_form/components/datetime_picker_component.rb +4 -0
- data/lib/tao_form/components/select_component.rb +4 -0
- data/lib/tao_form/version.rb +1 -1
- metadata +5 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ee2ff40f7bdfcc88531bc195a44cd9519fbdc149
|
4
|
+
data.tar.gz: d2c855cdb833109f1a80f76a8966114371bf271c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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) ->
|
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
|
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
|
-
|
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>',
|
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,4 +1,4 @@
|
|
1
|
-
@import '
|
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: $
|
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:
|
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,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
|
+
}
|
data/lib/tao_form/version.rb
CHANGED
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.
|
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-
|
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/
|
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
|