iugu-ux 0.9.9 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/iugu-ux/version.rb +1 -1
- data/sandbox/log/development.log +432 -0
- data/sandbox/tmp/cache/assets/BD0/110/sprockets%2F52568313d04166c1237865292979c86d +0 -0
- data/sandbox/tmp/cache/assets/C48/D00/sprockets%2F4a51b39094a347e3e325005c7847551c +0 -0
- data/sandbox/tmp/cache/assets/C49/3B0/sprockets%2F405c7112191eed23e8b860254281e763 +0 -0
- data/sandbox/tmp/cache/assets/C4A/8F0/sprockets%2F736644cea24629d653454c90503a0c45 +0 -0
- data/sandbox/tmp/cache/assets/C4F/3A0/sprockets%2F41918e8d7b402652a5649e4b7134d620 +0 -0
- data/sandbox/tmp/cache/assets/C5A/0F0/sprockets%2F66317254e81572f5a89184618e3c3b5b +0 -0
- data/sandbox/tmp/cache/assets/C7A/F30/sprockets%2F70249181577b261a3ea8851b530f1e7c +0 -0
- data/sandbox/tmp/cache/assets/C86/500/sprockets%2F6990a45a256263b7579492ac7a6a626a +0 -0
- data/sandbox/tmp/cache/assets/C87/F60/sprockets%2F83b4a89e682705a1d0c1e1327608f968 +0 -0
- data/sandbox/tmp/cache/assets/C88/820/sprockets%2Fb50c6382fa02d221d1b29a40402d1641 +0 -0
- data/sandbox/tmp/cache/assets/C97/790/sprockets%2Ffa5602401f5500215f5c4555190dcbd2 +0 -0
- data/sandbox/tmp/cache/assets/CC3/930/sprockets%2F7e2c9302e5050f66e888725be83f862d +0 -0
- data/sandbox/tmp/cache/assets/CC7/EB0/sprockets%2F079d3b368c9e843b78c90079f26d628b +0 -0
- data/sandbox/tmp/cache/assets/CC8/510/sprockets%2F868a1670f8822e6b7847dd22e747a66f +0 -0
- data/sandbox/tmp/cache/assets/CCA/850/sprockets%2F1d05d32f046ec7313b0d3619a232d73f +0 -0
- data/sandbox/tmp/cache/assets/CDB/610/sprockets%2Fb5b20836971a5786ca125712b8e0bf5e +0 -0
- data/sandbox/tmp/cache/assets/CDB/E30/sprockets%2F918458a88fec2cd01991c003b2318ab7 +0 -0
- data/sandbox/tmp/cache/assets/CEC/760/sprockets%2F2e588fd16989acc60b813afe18471562 +0 -0
- data/sandbox/tmp/cache/assets/D08/ED0/sprockets%2Fcb1aee736d3b287a872298b7741b012b +0 -0
- data/sandbox/tmp/cache/assets/D1A/B70/sprockets%2F47ae92dd9d034b32098b19bf8f2475a9 +0 -0
- data/sandbox/tmp/cache/assets/D34/3E0/sprockets%2F46a73c17c9a561115944df004dbbdd7b +0 -0
- data/sandbox/tmp/cache/assets/D3B/BC0/sprockets%2F19510a763bd1521ff5fc70ffe0d837d3 +0 -0
- data/sandbox/tmp/cache/assets/D4A/1A0/sprockets%2Fb746360a8b3ce79c57e74a9c15309fdd +0 -0
- data/sandbox/tmp/cache/assets/D4A/EB0/sprockets%2F601dc7267b0c9e83e7c9bd2bf94e3564 +0 -0
- data/sandbox/tmp/cache/assets/D4F/810/sprockets%2Fa10070d6497ba2b4ea552d4a1bb444cb +0 -0
- data/sandbox/tmp/cache/assets/D53/E90/sprockets%2Fb333afe57100a0a8c1bc6c37405e56bb +0 -0
- data/sandbox/tmp/cache/assets/D55/310/sprockets%2F2b9be79ca64ec7d294d4825e21696ce9 +0 -0
- data/sandbox/tmp/cache/assets/D5C/200/sprockets%2Fcd323e6f7545cee0b3ba1e84d7520b00 +0 -0
- data/sandbox/tmp/cache/assets/D66/7C0/sprockets%2F5afbe1fb48c4015a6ffc9085c0519b05 +0 -0
- data/sandbox/tmp/cache/assets/D6D/AA0/sprockets%2F1cb4a75912d38d0bdde6ee6770644d0f +0 -0
- data/sandbox/tmp/cache/assets/D6E/AE0/sprockets%2Fe193ea7b03f186ad2a9515fc78fa8c21 +0 -0
- data/sandbox/tmp/cache/assets/D74/0A0/sprockets%2Fc1392b79af6b88250b634479cbf2bcfc +0 -0
- data/sandbox/tmp/cache/assets/D79/5A0/sprockets%2Feb399a6f39a8dcd0bf011768e7153d8d +0 -0
- data/sandbox/tmp/cache/assets/D7A/D40/sprockets%2F4d2bc08f2787a3870ff93e0e0f7bc67e +0 -0
- data/sandbox/tmp/cache/assets/D7D/A60/sprockets%2Fad3ac10002e5ebc21d911fe229b6ec40 +0 -0
- data/sandbox/tmp/cache/assets/D82/480/sprockets%2F8945f20bf64a2469e9edbfb085e4b8c8 +0 -0
- data/sandbox/tmp/cache/assets/D92/120/sprockets%2Fbbadd54a208919f24fb50bc9e3d3d107 +0 -0
- data/sandbox/tmp/cache/assets/D96/940/sprockets%2F6a2c3af22b173eb975f382b4cdcd8c41 +0 -0
- data/sandbox/tmp/cache/assets/D96/E90/sprockets%2F0d5f451deca7e6811663f30afc3a4fd4 +0 -0
- data/sandbox/tmp/cache/assets/D97/180/sprockets%2F933323d1c368cfeda7a0cacdbd295933 +0 -0
- data/sandbox/tmp/cache/assets/DAD/190/sprockets%2Fbee62a5d7a8cd35a33763f1cd879de59 +0 -0
- data/sandbox/tmp/cache/assets/DB8/5B0/sprockets%2F35ed47d3f028fe65e7d4f5f4f8f95e1b +0 -0
- data/sandbox/tmp/cache/assets/DC5/340/sprockets%2Fd0dab495f0bbced215dd46e8ca316575 +0 -0
- data/sandbox/tmp/cache/assets/DCA/FD0/sprockets%2F0b59a77adfc61bb863e708ba262ce6bd +0 -0
- data/sandbox/tmp/cache/assets/DCE/E70/sprockets%2Facff0eeec48ccf1c25a1b968242b7827 +0 -0
- data/sandbox/tmp/cache/assets/DD4/040/sprockets%2Fe4c0c08358fdcc373c5f2da767cd08ff +0 -0
- data/sandbox/tmp/cache/assets/DD7/9B0/sprockets%2F9f2c0826bd7ae7b745ae8da6db48c26e +0 -0
- data/sandbox/tmp/cache/assets/DE0/650/sprockets%2F0f87cd6ed404cdfc99c86bb974d0ca59 +0 -0
- data/sandbox/tmp/cache/assets/DE5/390/sprockets%2F24a1cda6893cebd53997dc859def67cd +0 -0
- data/sandbox/tmp/cache/assets/DFC/5B0/sprockets%2Fcece55fa8f17c917fcc78cf6113a01bb +0 -0
- data/sandbox/tmp/cache/assets/E00/1D0/sprockets%2F571f97ca7b6dfdfefafd03ae735127a1 +0 -0
- data/sandbox/tmp/cache/assets/E05/2E0/sprockets%2F92ecbfa92baf6e394ce6c39d731b7cd2 +0 -0
- data/sandbox/tmp/cache/assets/E36/F20/sprockets%2Fd3bd4977eec9eca9c55b9a20b81b9cdb +0 -0
- data/sandbox/tmp/cache/assets/E37/A20/sprockets%2Fec3ccca6dfe2fc4e8793b0d83398e5ba +0 -0
- data/sandbox/tmp/cache/assets/F1C/0B0/sprockets%2Ffb1cb6e9be4bf2cd5aaecfbb1de7d77f +0 -0
- data/sandbox/tmp/cache/sass/8e0849d701bca2f5a178ed1215813b1316068a4d/components.sassc +0 -0
- data/sandbox/tmp/cache/sass/8e0849d701bca2f5a178ed1215813b1316068a4d/typography.sassc +0 -0
- data/sandbox/tmp/cache/sass/8e0849d701bca2f5a178ed1215813b1316068a4d/variables.sassc +0 -0
- data/sandbox/tmp/cache/sass/b49d75942b505963eb360d4c3b43ec26f9ded67e/checkbox.sassc +0 -0
- data/sandbox/tmp/cache/sass/b49d75942b505963eb360d4c3b43ec26f9ded67e/combobox.sassc +0 -0
- data/sandbox/tmp/cache/sass/b49d75942b505963eb360d4c3b43ec26f9ded67e/container.sassc +0 -0
- data/sandbox/tmp/cache/sass/b49d75942b505963eb360d4c3b43ec26f9ded67e/group.sassc +0 -0
- data/sandbox/tmp/cache/sass/b49d75942b505963eb360d4c3b43ec26f9ded67e/input.sassc +0 -0
- data/sandbox/tmp/cache/sass/b49d75942b505963eb360d4c3b43ec26f9ded67e/radio.sassc +0 -0
- data/sandbox/tmp/cache/sass/b49d75942b505963eb360d4c3b43ec26f9ded67e/responsive_box.sassc +0 -0
- data/sandbox/tmp/cache/sass/b49d75942b505963eb360d4c3b43ec26f9ded67e/view.sassc +0 -0
- data/vendor/assets/javascripts/iugu-ux/components/presenters/iugu-ui-table.jst.eco +1 -1
- data/vendor/assets/javascripts/iugu-ux/components/usecode/iugu-ui-button.js.coffee +15 -3
- data/vendor/assets/javascripts/iugu-ux/components/usecode/iugu-ui-combobox.js.coffee +1 -0
- data/vendor/assets/javascripts/iugu-ux/components/usecode/iugu-ui-table.js.coffee +1 -0
- data/vendor/assets/javascripts/iugu-ux/components/usecode/iugu-ui-view.js.coffee +1 -1
- data/vendor/assets/javascripts/vendor.js +2 -3
- data/vendor/assets/javascripts/vendor/backbone.validation.js +1 -1
- data/vendor/assets/javascripts/vendor/numeral.js +2104 -0
- data/vendor/assets/javascripts/vendor/numeral.languages.js +96 -0
- data/vendor/assets/javascripts/web-app/helpers.coffee +1 -1
- data/vendor/assets/stylesheets/iugu-ux/components/combobox.sass +7 -0
- data/vendor/assets/stylesheets/iugu-ux/components/input.sass +11 -0
- data/vendor/assets/stylesheets/iugu-ux/components/notice.sass +6 -0
- metadata +72 -33
- data/vendor/assets/javascripts/vendor/mobiscroll.core-2.3.1.js +0 -966
- data/vendor/assets/javascripts/vendor/mobiscroll.datetime-2.3.js +0 -656
- data/vendor/assets/javascripts/vendor/mobiscroll.select-2.3.1.js +0 -257
@@ -1,257 +0,0 @@
|
|
1
|
-
/*jslint eqeq: true, plusplus: true, undef: true, sloppy: true, vars: true, forin: true */
|
2
|
-
(function ($) {
|
3
|
-
|
4
|
-
var defaults = {
|
5
|
-
inputClass: '',
|
6
|
-
invalid: [],
|
7
|
-
rtl: false,
|
8
|
-
group: false,
|
9
|
-
groupLabel: 'Groups'
|
10
|
-
};
|
11
|
-
|
12
|
-
$.mobiscroll.presetShort('select');
|
13
|
-
|
14
|
-
$.mobiscroll.presets.select = function (inst) {
|
15
|
-
var stg = inst.settings,
|
16
|
-
s = $.extend({}, defaults, stg),
|
17
|
-
elm = $(this),
|
18
|
-
option = elm.val(),
|
19
|
-
group = elm.find('option[value="' + elm.val() + '"]').parent(),
|
20
|
-
prev = group.index() + '',
|
21
|
-
gr = prev,
|
22
|
-
prevent,
|
23
|
-
id = this.id + '_dummy',
|
24
|
-
l1 = $('label[for="' + this.id + '"]').attr('for', id),
|
25
|
-
l2 = $('label[for="' + id + '"]'),
|
26
|
-
label = s.label !== undefined ? s.label : (l2.length ? l2.text() : elm.attr('name')),
|
27
|
-
invalid = [],
|
28
|
-
main = {},
|
29
|
-
grIdx,
|
30
|
-
optIdx,
|
31
|
-
roPre = stg.readonly,
|
32
|
-
w;
|
33
|
-
|
34
|
-
function replace(str) {
|
35
|
-
if (str) {
|
36
|
-
return str.replace(/_/, '');
|
37
|
-
}
|
38
|
-
return '';
|
39
|
-
}
|
40
|
-
|
41
|
-
function genWheels() {
|
42
|
-
var cont,
|
43
|
-
wg = 0,
|
44
|
-
wheel = {},
|
45
|
-
w = [{}];
|
46
|
-
|
47
|
-
if (s.group) {
|
48
|
-
if (s.rtl) {
|
49
|
-
wg = 1;
|
50
|
-
}
|
51
|
-
|
52
|
-
$('optgroup', elm).each(function (index) {
|
53
|
-
wheel['_' + index] = $(this).attr('label');
|
54
|
-
});
|
55
|
-
|
56
|
-
w[wg] = {};
|
57
|
-
w[wg][s.groupLabel] = wheel;
|
58
|
-
cont = group;
|
59
|
-
wg += (s.rtl ? -1 : 1);
|
60
|
-
|
61
|
-
} else {
|
62
|
-
cont = elm;
|
63
|
-
}
|
64
|
-
w[wg] = {};
|
65
|
-
w[wg][label] = {};
|
66
|
-
|
67
|
-
$('option', cont).each(function () {
|
68
|
-
var v = $(this).attr('value');
|
69
|
-
w[wg][label]['_' + v] = $(this).text();
|
70
|
-
if ($(this).prop('disabled')) {
|
71
|
-
invalid.push(v);
|
72
|
-
}
|
73
|
-
});
|
74
|
-
|
75
|
-
return w;
|
76
|
-
}
|
77
|
-
|
78
|
-
// if groups is true and there are no groups fall back to no grouping
|
79
|
-
if (s.group && !$('optgroup', elm).length) {
|
80
|
-
s.group = false;
|
81
|
-
}
|
82
|
-
|
83
|
-
if (!s.invalid.length) {
|
84
|
-
s.invalid = invalid;
|
85
|
-
}
|
86
|
-
|
87
|
-
if (s.group) {
|
88
|
-
if (s.rtl) {
|
89
|
-
grIdx = 1;
|
90
|
-
optIdx = 0;
|
91
|
-
} else {
|
92
|
-
grIdx = 0;
|
93
|
-
optIdx = 1;
|
94
|
-
}
|
95
|
-
} else {
|
96
|
-
grIdx = -1;
|
97
|
-
optIdx = 0;
|
98
|
-
}
|
99
|
-
|
100
|
-
$('#' + id).remove();
|
101
|
-
|
102
|
-
$('option', elm).each(function () {
|
103
|
-
main[$(this).attr('value')] = $(this).text();
|
104
|
-
});
|
105
|
-
|
106
|
-
var input = $('<input type="text" id="' + id + '" value="' + main[elm.val()] + '" class="' + s.inputClass + '" readonly />').insertBefore(elm);
|
107
|
-
|
108
|
-
if (s.showOnFocus) {
|
109
|
-
input.focus(function () {
|
110
|
-
inst.show();
|
111
|
-
});
|
112
|
-
}
|
113
|
-
|
114
|
-
elm.bind('change', function () {
|
115
|
-
if (!prevent && option != elm.val()) {
|
116
|
-
inst.setSelectVal([elm.val()], true);
|
117
|
-
}
|
118
|
-
prevent = false;
|
119
|
-
}).hide().closest('.ui-field-contain').trigger('create');
|
120
|
-
|
121
|
-
inst.setSelectVal = function (d, fill, time) {
|
122
|
-
option = d[0];
|
123
|
-
|
124
|
-
if (s.group) {
|
125
|
-
group = elm.find('option[value="' + option + '"]').parent();
|
126
|
-
gr = group.index();
|
127
|
-
inst.temp = s.rtl ? ['_' + option, '_' + group.index()] : ['_' + group.index(), '_' + option];
|
128
|
-
if (gr !== prev) { // Need to regenerate wheels, if group changed
|
129
|
-
stg.wheels = genWheels();
|
130
|
-
inst.changeWheel([optIdx]);
|
131
|
-
prev = gr + '';
|
132
|
-
}
|
133
|
-
} else {
|
134
|
-
inst.temp = ['_' + option];
|
135
|
-
}
|
136
|
-
|
137
|
-
inst.setValue(true, fill, time);
|
138
|
-
|
139
|
-
// Set input/select values
|
140
|
-
if (fill) {
|
141
|
-
input.val(main[option]);
|
142
|
-
var changed = option !== elm.val();
|
143
|
-
elm.val(option);
|
144
|
-
// Trigger change on element
|
145
|
-
if (changed) {
|
146
|
-
elm.trigger('change');
|
147
|
-
}
|
148
|
-
}
|
149
|
-
};
|
150
|
-
|
151
|
-
inst.getSelectVal = function (temp) {
|
152
|
-
var val = temp ? inst.temp : inst.values;
|
153
|
-
return replace(val[optIdx]);
|
154
|
-
};
|
155
|
-
|
156
|
-
return {
|
157
|
-
width: 50,
|
158
|
-
wheels: w,
|
159
|
-
headerText: false,
|
160
|
-
anchor: input,
|
161
|
-
formatResult: function (d) {
|
162
|
-
return main[replace(d[optIdx])];
|
163
|
-
},
|
164
|
-
parseValue: function () {
|
165
|
-
option = elm.val();
|
166
|
-
group = elm.find('option[value="' + option + '"]').parent();
|
167
|
-
gr = group.index();
|
168
|
-
return s.group && s.rtl ? ['_' + option, '_' + gr] : s.group ? ['_' + gr, '_' + option] : ['_' + option];
|
169
|
-
},
|
170
|
-
validate: function (dw, i) {
|
171
|
-
if (i === grIdx) {
|
172
|
-
gr = replace(inst.temp[grIdx]);
|
173
|
-
|
174
|
-
if (gr !== prev) {
|
175
|
-
group = elm.find('optgroup').eq(gr);
|
176
|
-
gr = group.index();
|
177
|
-
option = group.find('option').eq(0).val();
|
178
|
-
option = option || elm.val();
|
179
|
-
stg.wheels = genWheels();
|
180
|
-
if (s.group) {
|
181
|
-
inst.temp = s.rtl ? ['_' + option, '_' + gr] : ['_' + gr, '_' + option];
|
182
|
-
inst.changeWheel([optIdx]);
|
183
|
-
prev = gr + '';
|
184
|
-
}
|
185
|
-
}
|
186
|
-
stg.readonly = roPre;
|
187
|
-
} else {
|
188
|
-
option = replace(inst.temp[optIdx]);
|
189
|
-
}
|
190
|
-
|
191
|
-
var t = $('ul', dw).eq(optIdx);
|
192
|
-
$.each(s.invalid, function (i, v) {
|
193
|
-
$('li[data-val="_' + v + '"]', t).removeClass('dw-v');
|
194
|
-
});
|
195
|
-
},
|
196
|
-
onAnimStart: function(i) {
|
197
|
-
if (i === grIdx) { // If group wheel is scroller, lock the options wheel
|
198
|
-
stg.readonly = [s.rtl, !s.rtl];
|
199
|
-
}
|
200
|
-
},
|
201
|
-
onBeforeShow: function () {
|
202
|
-
stg.wheels = genWheels();
|
203
|
-
if (s.group) {
|
204
|
-
inst.temp = s.rtl ? ['_' + option, '_' + group.index()] : ['_' + group.index(), '_' + option];
|
205
|
-
}
|
206
|
-
},
|
207
|
-
onSelect: function (v) {
|
208
|
-
input.val(v);
|
209
|
-
prevent = true;
|
210
|
-
elm.val(replace(inst.values[optIdx])).trigger('change');
|
211
|
-
if (s.group) {
|
212
|
-
inst.values = null;
|
213
|
-
}
|
214
|
-
},
|
215
|
-
onCancel: function () {
|
216
|
-
if (s.group) {
|
217
|
-
inst.values = null;
|
218
|
-
}
|
219
|
-
},
|
220
|
-
onChange: function (v) {
|
221
|
-
if (s.display == 'inline') {
|
222
|
-
input.val(v);
|
223
|
-
prevent = true;
|
224
|
-
elm.val(replace(inst.temp[optIdx])).trigger('change');
|
225
|
-
}
|
226
|
-
},
|
227
|
-
onClose: function () {
|
228
|
-
input.blur();
|
229
|
-
},
|
230
|
-
methods: {
|
231
|
-
setValue: function (d, fill, time) {
|
232
|
-
return this.each(function () {
|
233
|
-
var inst = $(this).mobiscroll('getInst');
|
234
|
-
if (inst) {
|
235
|
-
if (inst.setSelectVal) {
|
236
|
-
inst.setSelectVal(d, fill, time);
|
237
|
-
} else {
|
238
|
-
inst.temp = d;
|
239
|
-
inst.setValue(true, fill, time);
|
240
|
-
}
|
241
|
-
}
|
242
|
-
});
|
243
|
-
},
|
244
|
-
getValue: function (temp) {
|
245
|
-
var inst = $(this).mobiscroll('getInst');
|
246
|
-
if (inst) {
|
247
|
-
if (inst.getSelectVal) {
|
248
|
-
return inst.getSelectVal(temp);
|
249
|
-
}
|
250
|
-
return inst.values;
|
251
|
-
}
|
252
|
-
}
|
253
|
-
}
|
254
|
-
};
|
255
|
-
}
|
256
|
-
|
257
|
-
})(jQuery);
|