formagic 0.3.2 → 0.3.3
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 +4 -4
- data/Gemfile.lock +1 -1
- data/app/assets/javascripts/formagic/inputs/array.coffee +5 -3
- data/app/assets/javascripts/formagic/inputs/documents_reorder.coffee +5 -1
- data/app/assets/javascripts/formagic/inputs/list.coffee +4 -5
- data/app/assets/javascripts/formagic.coffee +4 -1
- data/app/assets/stylesheets/formagic/array.scss +14 -27
- data/app/assets/stylesheets/formagic/list.scss +1 -0
- data/app/assets/stylesheets/formagic/nested-form.scss +21 -19
- data/app/assets/stylesheets/formagic.scss +5 -18
- data/lib/formagic/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 1232cfe4348b90ec411f702c7047b5ef9293b73e
|
|
4
|
+
data.tar.gz: f4e4defe3db6b66b51c71bfd65c70627b9bf1139
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 62ec94089f8b9f6d48c0e91b8314a8aacd1c147b5e1a4d0335dd2e6fc59f7739059e791106d021454c33313c4891a8685c450ed3071a237e30efaa358be6c879
|
|
7
|
+
data.tar.gz: 170fc20d96fa30268a7c82599ccdefbf65b58012c2e38fa12821be074d2b15a690abc99eb243a879cc54e6ef3a0076b86b0faaae13d3894eb06ccd3af0e79023
|
data/Gemfile.lock
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
# -----------------------------------------------------------------------------
|
|
8
8
|
|
|
9
9
|
# -----------------------------------------------------------------------------
|
|
10
|
-
# INPUT
|
|
10
|
+
# INPUT ARRAY
|
|
11
11
|
# -----------------------------------------------------------------------------
|
|
12
12
|
# Allows to create/delete/reorder list items connected to dynamic or static
|
|
13
13
|
# collection. Value should be an array of objects.
|
|
@@ -67,9 +67,11 @@ class @InputArray extends InputString
|
|
|
67
67
|
|
|
68
68
|
_render_item: (o) ->
|
|
69
69
|
value = _escapeHtml(o)
|
|
70
|
-
|
|
71
70
|
listItem =$ """<li data-value='#{ value }'>
|
|
72
|
-
<span class='icon-reorder'
|
|
71
|
+
<span class='icon-reorder'
|
|
72
|
+
data-container-class='#{ @reorderContainerClass }'>
|
|
73
|
+
#{ Icons.reorderDocuments }
|
|
74
|
+
</span>
|
|
73
75
|
#{ value }
|
|
74
76
|
<a href='#' class='action_remove'>Remove</a>
|
|
75
77
|
</li>"""
|
|
@@ -54,7 +54,11 @@
|
|
|
54
54
|
|
|
55
55
|
|
|
56
56
|
_add_form_reorder_button: (form) ->
|
|
57
|
-
|
|
57
|
+
reorderIcon = """<div class='icon-reorder'
|
|
58
|
+
data-container-class='#{@reorderContainerClass}'>
|
|
59
|
+
#{ Icons.reorderDocuments }
|
|
60
|
+
</div>"""
|
|
61
|
+
form.$el.prepend(reorderIcon).addClass('reorderable')
|
|
58
62
|
|
|
59
63
|
|
|
60
64
|
_find_form_by_target: (el) ->
|
|
@@ -89,7 +89,10 @@ class @InputList extends InputString
|
|
|
89
89
|
item = o[@config.titleFieldName]
|
|
90
90
|
|
|
91
91
|
listItem =$ """<li data-id='#{ o._id }'>
|
|
92
|
-
<span class='icon-reorder'
|
|
92
|
+
<span class='icon-reorder'
|
|
93
|
+
data-container-class='#{ @reorderContainerClass }'>
|
|
94
|
+
#{ Icons.reorderDocuments }
|
|
95
|
+
</span>
|
|
93
96
|
#{ item }
|
|
94
97
|
<a href='#' class='action_remove'>Remove</a>
|
|
95
98
|
</li>"""
|
|
@@ -145,7 +148,3 @@ include(InputList, inputListTypeahead)
|
|
|
145
148
|
|
|
146
149
|
|
|
147
150
|
chr.formInputs['list'] = InputList
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
@@ -2,50 +2,37 @@
|
|
|
2
2
|
|
|
3
3
|
.input-array {
|
|
4
4
|
input {
|
|
5
|
-
padding-left
|
|
6
|
-
margin-top
|
|
5
|
+
padding-left: 2.5em;
|
|
6
|
+
margin-top: .25em;
|
|
7
7
|
}
|
|
8
8
|
|
|
9
9
|
ul {
|
|
10
|
-
margin
|
|
11
|
-
padding
|
|
12
|
-
list-style
|
|
13
|
-
line-height
|
|
10
|
+
margin: 0 0 0 1em;
|
|
11
|
+
padding: 0;
|
|
12
|
+
list-style: none;
|
|
13
|
+
line-height: 1.5;
|
|
14
14
|
|
|
15
15
|
li {
|
|
16
16
|
@include user-select(none); position: relative;
|
|
17
17
|
|
|
18
18
|
a {
|
|
19
|
-
color
|
|
20
|
-
font-size
|
|
19
|
+
color: $formagic-assertive-color;
|
|
20
|
+
font-size: 0.75em;
|
|
21
21
|
&:hover {
|
|
22
|
-
opacity
|
|
22
|
+
opacity: 0.5;
|
|
23
23
|
}
|
|
24
24
|
}
|
|
25
25
|
}
|
|
26
26
|
}
|
|
27
27
|
|
|
28
28
|
.slip-reordering {
|
|
29
|
-
color
|
|
29
|
+
color: $formagic-positive-color;
|
|
30
30
|
}
|
|
31
31
|
|
|
32
32
|
.icon-reorder {
|
|
33
|
-
@include
|
|
34
|
-
left
|
|
35
|
-
|
|
36
|
-
&:
|
|
37
|
-
background-position : 10px 3px;
|
|
38
|
-
height : 1.5em;
|
|
39
|
-
}
|
|
33
|
+
@include reorder-icon-base();
|
|
34
|
+
margin-left: -20px;
|
|
35
|
+
width: 20px;
|
|
36
|
+
&:hover { color: $formagic-positive-color; }
|
|
40
37
|
}
|
|
41
|
-
|
|
42
|
-
// input:after {
|
|
43
|
-
// content: '+';
|
|
44
|
-
// display: block;
|
|
45
|
-
// width: 40px;
|
|
46
|
-
// height: 24px;
|
|
47
|
-
// position: absolute; left: 12px; top: -3px;
|
|
48
|
-
// font-size: 22px;
|
|
49
|
-
// color: $formagic-border-color;
|
|
50
|
-
// }
|
|
51
38
|
}
|
|
@@ -22,18 +22,21 @@
|
|
|
22
22
|
}
|
|
23
23
|
|
|
24
24
|
& > ul > li > .icon-reorder {
|
|
25
|
-
@include
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
25
|
+
@include reorder-icon-base();
|
|
26
|
+
right: 0;
|
|
27
|
+
top: 20px;
|
|
28
|
+
margin-right: -30px;
|
|
29
|
+
line-height: 40px;
|
|
30
|
+
width: 30px;
|
|
31
|
+
|
|
32
|
+
&:hover {
|
|
33
|
+
color: $formagic-positive-color;
|
|
34
|
+
}
|
|
29
35
|
}
|
|
30
36
|
|
|
31
37
|
& > ul li.reorderable {
|
|
38
|
+
margin-right: 0.75em;
|
|
32
39
|
background-color : white;
|
|
33
|
-
|
|
34
|
-
& > .form-input:first-of-type {
|
|
35
|
-
padding-left : 2.5em;
|
|
36
|
-
}
|
|
37
40
|
}
|
|
38
41
|
}
|
|
39
42
|
|
|
@@ -53,24 +56,23 @@
|
|
|
53
56
|
}
|
|
54
57
|
|
|
55
58
|
.nested-form-delete {
|
|
56
|
-
@include position(absolute,
|
|
59
|
+
@include position(absolute, 0 -1.5em null null);
|
|
57
60
|
@include hide-text;
|
|
58
61
|
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
62
|
+
border-radius: 1em;
|
|
63
|
+
height: 1.25em;
|
|
64
|
+
width: 1.25em;
|
|
65
|
+
z-index: 1;
|
|
66
|
+
line-height: 1;
|
|
64
67
|
|
|
65
68
|
&:before {
|
|
66
|
-
@include position(absolute, null .
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
color : $formagic-label-color;
|
|
69
|
+
@include position(absolute, null .325em null null);
|
|
70
|
+
content: '\00d7';
|
|
71
|
+
color: $formagic-label-color;
|
|
70
72
|
}
|
|
71
73
|
|
|
72
74
|
&:hover {
|
|
73
|
-
background-color : $formagic-
|
|
75
|
+
background-color : $formagic-assertive-color;
|
|
74
76
|
|
|
75
77
|
&:before {
|
|
76
78
|
color : white;
|
|
@@ -45,21 +45,11 @@ $formagic-border-color : #eee !default;
|
|
|
45
45
|
border : none;
|
|
46
46
|
}
|
|
47
47
|
|
|
48
|
-
@mixin icon-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
&:before {
|
|
54
|
-
content : '';
|
|
55
|
-
display : block;
|
|
56
|
-
height : 40px;
|
|
57
|
-
width : 40px;
|
|
58
|
-
background-position : 10px 10px;
|
|
59
|
-
background-repeat : no-repeat;
|
|
60
|
-
background-image : url("data:image/svg+xml;charset=utf-8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'><line x1='0' y1='8' x2='20' y2='8' stroke-width='2' stroke='#{ $color }' /><line x1='0' y1='12' x2='20' y2='12' stroke-width='2' stroke='#{ $color }' /></svg>");
|
|
61
|
-
background-size : 20px 20px;
|
|
62
|
-
}
|
|
48
|
+
@mixin reorder-icon-base {
|
|
49
|
+
@include position(absolute);
|
|
50
|
+
text-align: center;
|
|
51
|
+
z-index: 10;
|
|
52
|
+
cursor: pointer;
|
|
63
53
|
}
|
|
64
54
|
|
|
65
55
|
@import "formagic/form";
|
|
@@ -77,6 +67,3 @@ $formagic-border-color : #eee !default;
|
|
|
77
67
|
@import "formagic/switch";
|
|
78
68
|
@import "formagic/text";
|
|
79
69
|
@import "formagic/array";
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
data/lib/formagic/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: formagic
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.3.
|
|
4
|
+
version: 0.3.3
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Alexander Kravets
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2015-11-
|
|
11
|
+
date: 2015-11-26 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: bourbon
|