romo 0.20.10 → 0.20.11
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/assets/css/romo/color_select.scss +62 -0
- data/assets/js/romo/color_select.js +580 -0
- data/assets/js/romo/dropdown.js +13 -5
- data/assets/js/romo/modal.js +16 -3
- data/assets/js/romo/option_list_dropdown.js +80 -26
- data/assets/js/romo/picker.js +225 -83
- data/assets/js/romo/select.js +192 -63
- data/assets/js/romo/select_dropdown.js +149 -60
- data/assets/js/romo/selected_options_list.js +32 -5
- data/assets/js/romo/tooltip.js +16 -2
- data/assets/js/romo/word_boundary_filter.js +11 -7
- data/lib/romo/dassets.rb +2 -0
- data/lib/romo/version.rb +1 -1
- data/test/unit/dassets_tests.rb +2 -0
- metadata +4 -2
@@ -65,7 +65,11 @@ RomoSelectedOptionsList.prototype.doRefreshUI = function() {
|
|
65
65
|
var itemBorderWidth = 1;
|
66
66
|
var itemLeftPad = parseInt(Romo.css(addElem, "padding-left"), 10);
|
67
67
|
var itemRightPad = parseInt(Romo.css(addElem, "padding-right"), 10);
|
68
|
-
Romo.setStyle(
|
68
|
+
Romo.setStyle(
|
69
|
+
Romo.find(addElem, 'DIV')[0],
|
70
|
+
'max-width',
|
71
|
+
String(listWidth-listLeftPad-listRightPad-(2*itemBorderWidth)-itemLeftPad-itemRightPad)+'px'
|
72
|
+
);
|
69
73
|
}, this));
|
70
74
|
|
71
75
|
var focusElemWidth = Romo.width(this.focusElem);
|
@@ -82,7 +86,14 @@ RomoSelectedOptionsList.prototype.doRefreshUI = function() {
|
|
82
86
|
var listBottomPad = parseInt(Romo.css(uiListElem, "padding-bottom"), 10);
|
83
87
|
|
84
88
|
var maxRows = Romo.data(this.focusElem, 'romo-selected-options-list-max-rows') || 0;
|
85
|
-
var maxHeight =
|
89
|
+
var maxHeight = (
|
90
|
+
listTopPad+
|
91
|
+
(itemHeight*maxRows)+
|
92
|
+
(itemMarginBottom*(maxRows-1))+
|
93
|
+
(2*itemBorderWidth*maxRows)+
|
94
|
+
listBottomPad+
|
95
|
+
(itemHeight/2)
|
96
|
+
);
|
86
97
|
}
|
87
98
|
if (maxRows !== 0 && (uiListElemHeight > maxHeight)) {
|
88
99
|
Romo.setStyle(this.elem, 'height', String(maxHeight)+'px');
|
@@ -100,7 +111,11 @@ RomoSelectedOptionsList.prototype.doRefreshUI = function() {
|
|
100
111
|
// private
|
101
112
|
|
102
113
|
RomoSelectedOptionsList.prototype._bindElem = function() {
|
103
|
-
this.elem = Romo.elems(
|
114
|
+
this.elem = Romo.elems(
|
115
|
+
'<div class="romo-selected-options-list">'+
|
116
|
+
'<div class="romo-selected-options-list-items"></div>'+
|
117
|
+
'</div>'
|
118
|
+
)[0];
|
104
119
|
|
105
120
|
Romo.on(this.elem, 'click', Romo.proxy(function(e) {
|
106
121
|
Romo.trigger(this.elem, 'romoSelectedOptionsList:listClick', [this]);
|
@@ -112,8 +127,20 @@ RomoSelectedOptionsList.prototype._bindElem = function() {
|
|
112
127
|
|
113
128
|
RomoSelectedOptionsList.prototype._buildItemElem = function(item) {
|
114
129
|
var itemClass = Romo.data(this.focusElem, 'romo-selected-options-list-item-class') || '';
|
115
|
-
var itemElem = Romo.elems(
|
116
|
-
|
130
|
+
var itemElem = Romo.elems(
|
131
|
+
'<div class="romo-selected-options-list-item romo-pointer '+
|
132
|
+
'romo-pad0-left romo-pad0-right romo-push0-right romo-push0-bottom '+
|
133
|
+
itemClass+'">'+
|
134
|
+
'</div>'
|
135
|
+
)[0];
|
136
|
+
Romo.append(
|
137
|
+
itemElem,
|
138
|
+
Romo.elems(
|
139
|
+
'<div class="romo-crop-ellipsis romo-text-strikethrough-hover">'+
|
140
|
+
(item.displayText || '')+
|
141
|
+
'</div>'
|
142
|
+
)[0]
|
143
|
+
);
|
117
144
|
Romo.setData(itemElem, 'romo-selected-options-list-value', (item.value || ''));
|
118
145
|
Romo.on(itemElem, 'click', Romo.proxy(this._onItemClick, this));
|
119
146
|
|
data/assets/js/romo/tooltip.js
CHANGED
@@ -158,8 +158,22 @@ RomoTooltip.prototype._bindElem = function() {
|
|
158
158
|
}
|
159
159
|
|
160
160
|
RomoTooltip.prototype._bindPopup = function() {
|
161
|
-
this.popupElem = Romo.elems(
|
162
|
-
|
161
|
+
this.popupElem = Romo.elems(
|
162
|
+
'<div class="romo-tooltip-popup">' +
|
163
|
+
'<div class="romo-tooltip-arrow"></div>' +
|
164
|
+
'<div class="romo-tooltip-body"></div>' +
|
165
|
+
'</div>'
|
166
|
+
)[0];
|
167
|
+
|
168
|
+
var popupParentElem;
|
169
|
+
var appendToClosestSel = Romo.data(this.elem, 'romo-tooltip-append-to-closest');
|
170
|
+
if (appendToClosestSel !== undefined) {
|
171
|
+
popupParentElem = Romo.closest(this.elem, appendToClosestSel);
|
172
|
+
} else {
|
173
|
+
popupParentElem = Romo.f(
|
174
|
+
Romo.data(this.elem, 'romo-tooltip-append-to') || 'BODY'
|
175
|
+
)[0];
|
176
|
+
}
|
163
177
|
Romo.append(popupParentElem, this.popupElem);
|
164
178
|
|
165
179
|
this.bodyElem = Romo.children(this.popupElem, '.romo-tooltip-body')[0];
|
@@ -1,14 +1,14 @@
|
|
1
|
-
var RomoWordBoundaryFilter = function(filterString,
|
1
|
+
var RomoWordBoundaryFilter = function(filterString, setItems, getItemTextContentCallback) {
|
2
2
|
this.boundaryCharsRegex = /[\s-_]+/;
|
3
|
-
this.
|
4
|
-
this.
|
3
|
+
this.matchingItems = [];
|
4
|
+
this.notMatchingItems = [];
|
5
5
|
this.filters = filterString
|
6
6
|
.trim()
|
7
7
|
.toLowerCase()
|
8
8
|
.split(this.boundaryCharsRegex);
|
9
9
|
|
10
|
-
Romo.array(
|
11
|
-
var contentStack =
|
10
|
+
Romo.array(setItems).forEach(Romo.proxy(function(item) {
|
11
|
+
var contentStack = getItemTextContentCallback(item)
|
12
12
|
.trim()
|
13
13
|
.toLowerCase()
|
14
14
|
.split(this.boundaryCharsRegex).reverse();
|
@@ -33,9 +33,13 @@ var RomoWordBoundaryFilter = function(filterString, setElems, getElemTextContent
|
|
33
33
|
}, this), true);
|
34
34
|
|
35
35
|
if (match === true) {
|
36
|
-
this.
|
36
|
+
this.matchingItems.push(item);
|
37
37
|
} else {
|
38
|
-
this.
|
38
|
+
this.notMatchingItems.push(item);
|
39
39
|
}
|
40
40
|
}, this));
|
41
|
+
|
42
|
+
// TODO: backwards compatible, remove later on
|
43
|
+
this.matchingElems = this.matchingItems;
|
44
|
+
this.notMatchingElems = this.notMatchingItems;
|
41
45
|
}
|
data/lib/romo/dassets.rb
CHANGED
@@ -38,6 +38,7 @@ module Romo::Dassets
|
|
38
38
|
'css/romo/indicator_text_input.css',
|
39
39
|
'css/romo/select.css',
|
40
40
|
'css/romo/picker.css',
|
41
|
+
'css/romo/color_select.css',
|
41
42
|
'css/romo/datepicker.css',
|
42
43
|
'css/romo/tooltip.css',
|
43
44
|
'css/romo/sortable.css',
|
@@ -61,6 +62,7 @@ module Romo::Dassets
|
|
61
62
|
'js/romo/select_dropdown.js',
|
62
63
|
'js/romo/select.js',
|
63
64
|
'js/romo/picker.js',
|
65
|
+
'js/romo/color_select.js',
|
64
66
|
'js/romo/datepicker.js',
|
65
67
|
'js/romo/inline.js',
|
66
68
|
'js/romo/inline_form.js',
|
data/lib/romo/version.rb
CHANGED
data/test/unit/dassets_tests.rb
CHANGED
@@ -44,6 +44,7 @@ module Romo::Dassets
|
|
44
44
|
'css/romo/indicator_text_input.css',
|
45
45
|
'css/romo/select.css',
|
46
46
|
'css/romo/picker.css',
|
47
|
+
'css/romo/color_select.css',
|
47
48
|
'css/romo/datepicker.css',
|
48
49
|
'css/romo/tooltip.css',
|
49
50
|
'css/romo/sortable.css',
|
@@ -69,6 +70,7 @@ module Romo::Dassets
|
|
69
70
|
'js/romo/select_dropdown.js',
|
70
71
|
'js/romo/select.js',
|
71
72
|
'js/romo/picker.js',
|
73
|
+
'js/romo/color_select.js',
|
72
74
|
'js/romo/datepicker.js',
|
73
75
|
'js/romo/inline.js',
|
74
76
|
'js/romo/inline_form.js',
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: romo
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.20.
|
4
|
+
version: 0.20.11
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kelly Redding
|
@@ -10,7 +10,7 @@ autorequire:
|
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
12
|
|
13
|
-
date: 2018-
|
13
|
+
date: 2018-03-09 00:00:00 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: assert
|
@@ -61,6 +61,7 @@ files:
|
|
61
61
|
- assets/css/romo/_vars.scss
|
62
62
|
- assets/css/romo/base.scss
|
63
63
|
- assets/css/romo/buttons.scss
|
64
|
+
- assets/css/romo/color_select.scss
|
64
65
|
- assets/css/romo/colors.scss
|
65
66
|
- assets/css/romo/datepicker.scss
|
66
67
|
- assets/css/romo/dropdown.scss
|
@@ -81,6 +82,7 @@ files:
|
|
81
82
|
- assets/css/romo/z_index.scss
|
82
83
|
- assets/js/romo/ajax.js
|
83
84
|
- assets/js/romo/base.js
|
85
|
+
- assets/js/romo/color_select.js
|
84
86
|
- assets/js/romo/currency.js
|
85
87
|
- assets/js/romo/currency_text_input.js
|
86
88
|
- assets/js/romo/date.js
|