vhx-quartz 0.10.0 → 0.10.1
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 954d84fa066952eb4c4f79c1b3c67ad5b3993ffb
|
4
|
+
data.tar.gz: 83562c33164cb3d6d7777d5499a2c266966a5d83
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 083ab461afbaf291de96631ca1840046209cbca5ef40450b04cb58ba4e726a96ab5852ac38c55602c562c615945bb3573ecddf7ab1f69799a77caa561ebd3006
|
7
|
+
data.tar.gz: f4d9e1c902223234ea9efe5fe68b6d50195152b73f2703a7785007ef386470f67856c6e77fed7fab47c18b09f5e9ebe64a73d72426abc7b078698f84fa7eb2a6
|
data/lib/vhx/quartz/version.rb
CHANGED
@@ -85,9 +85,6 @@ vhxm.components.shared.select.controller = function (opts) {
|
|
85
85
|
}
|
86
86
|
|
87
87
|
self.state.isDropdownOpen(!self.state.isDropdownOpen());
|
88
|
-
|
89
|
-
self.state.highlightIndex(-1);
|
90
|
-
|
91
88
|
self.scrollOptionsList(container);
|
92
89
|
};
|
93
90
|
|
@@ -116,11 +113,12 @@ vhxm.components.shared.select.controller = function (opts) {
|
|
116
113
|
|
117
114
|
self.state.selected(selected);
|
118
115
|
self.state.isDropdownOpen(self.multiselect ? true : false);
|
119
|
-
|
120
|
-
if (
|
116
|
+
|
117
|
+
if (self.multiselect) {
|
121
118
|
self.state.highlightIndex(-1);
|
122
|
-
self.scrollOptionsList(0);
|
123
119
|
}
|
120
|
+
|
121
|
+
self.state.onSelect(self.state.selected());
|
124
122
|
};
|
125
123
|
|
126
124
|
self.handleAction = function (event) {
|
@@ -146,21 +144,17 @@ vhxm.components.shared.select.controller = function (opts) {
|
|
146
144
|
|
147
145
|
self.setHighlightedState = function (direction, container, input) {
|
148
146
|
if (direction === 'down') {
|
149
|
-
self.state.highlightIndex(self.
|
150
|
-
|
151
|
-
self.state.scrollIndex(self.state.scrollIndex() + 1);
|
147
|
+
if (self.state.highlightIndex() < self.model.items().length - 1) {
|
148
|
+
self.state.highlightIndex(self.state.highlightIndex() + 1);
|
152
149
|
} else {
|
153
150
|
self.state.highlightIndex(self.model.items().length - 1);
|
154
151
|
}
|
155
152
|
} else if (direction === 'up') {
|
156
|
-
self.state.highlightIndex(self.state.highlightIndex() - 1);
|
157
153
|
if (self.state.highlightIndex() > 0) {
|
158
|
-
self.state.
|
159
|
-
} else if (self.state.highlightIndex()
|
154
|
+
self.state.highlightIndex(self.state.highlightIndex() - 1);
|
155
|
+
} else if (self.state.highlightIndex() <= 0) {
|
160
156
|
self.state.highlightIndex(-1);
|
161
157
|
input.focus();
|
162
|
-
} else {
|
163
|
-
self.state.highlightIndex(0);
|
164
158
|
}
|
165
159
|
}
|
166
160
|
self.scrollOptionsList(container);
|
@@ -185,10 +179,8 @@ vhxm.components.shared.select.state = function () {
|
|
185
179
|
this.selected = m.prop(null);
|
186
180
|
this.highlighted = m.prop({});
|
187
181
|
this.isDropdownOpen = m.prop(false);
|
188
|
-
this.highlightIndex = m.prop(
|
189
|
-
this.scrollIndex = m.prop(0);
|
182
|
+
this.highlightIndex = m.prop(-1);
|
190
183
|
this.optionHeight = m.prop(0);
|
191
|
-
this.optionsHeight = m.prop(0);
|
192
184
|
this.isLoading = m.prop(false);
|
193
185
|
this.searchInputValue = m.prop('');
|
194
186
|
this.footerLoading = m.prop(false);
|
@@ -207,11 +199,12 @@ vhxm.components.shared.select.ui.container = {
|
|
207
199
|
view: function view(ctrl, opts) {
|
208
200
|
var options = opts.search ? '.has-search' : '';
|
209
201
|
options += opts.trigger ? '.has-trigger' : '';
|
202
|
+
options += opts.type === 'media' ? '.has-media' : '';
|
210
203
|
options += opts.inline ? '.inline' : '';
|
211
204
|
|
212
205
|
if (opts.trigger) {
|
213
206
|
opts.trigger.attrs.onclick = ctrl.handleClick;
|
214
|
-
opts.trigger.attrs.className
|
207
|
+
opts.trigger.attrs.className = opts.trigger.attrs.className ? opts.trigger.attrs.className + ' c-select--trigger' : 'c-select--trigger';
|
215
208
|
}
|
216
209
|
|
217
210
|
return m('.c-select--container.relative.form' + options, {
|
@@ -268,6 +261,9 @@ vhxm.components.shared.select.ui.item_media = {
|
|
268
261
|
var opts = params.opts;
|
269
262
|
|
270
263
|
return m('.c-media-item--container.padding-horz-medium.padding-vert-small.clearfix' + (index === ctrl.state.highlightIndex() ? '.is-selected' : ''), {
|
264
|
+
config: function config(el) {
|
265
|
+
ctrl.state.optionHeight($(el).outerHeight());
|
266
|
+
},
|
271
267
|
onmouseover: function onmouseover() {
|
272
268
|
ctrl.state.highlightIndex(index);
|
273
269
|
},
|
@@ -278,7 +274,7 @@ vhxm.components.shared.select.ui.item_media = {
|
|
278
274
|
src: item[opts.prop_map.img],
|
279
275
|
width: 70,
|
280
276
|
height: 40
|
281
|
-
})]), m('.c-media-item--content.clearfix.left', [m('p.text--navy', item[opts.prop_map.label]), m('p.text--gray', item[opts.prop_map.descriptor])]), m('.c-media-item--action.clearfix.right', [m('.c-item-toggle.icon--xsmall.icon-check-navy.border' + (ctrl.state.selected() && ctrl.state.selected()[item[opts.prop_map.key]] ? '.is-selected.icon-check-navy' : '.icon-plus-thin-white'))])]);
|
277
|
+
})]), m('.c-media-item--content.clearfix.left', [m('p.text--navy', item[opts.prop_map.label]), m('p.text--gray', item[opts.prop_map.descriptor])]), ctrl.parent.multiselect ? m('.c-media-item--action.clearfix.right', [m('.c-item-toggle.icon--xsmall.icon-check-navy.border' + (ctrl.state.selected() && ctrl.state.selected()[item[opts.prop_map.key]] ? '.is-selected.icon-check-navy' : '.icon-plus-thin-white'))]) : '']);
|
282
278
|
}
|
283
279
|
};
|
284
280
|
|
@@ -292,7 +288,7 @@ vhxm.components.shared.select.ui.item_standard = {
|
|
292
288
|
var ctrl = params.ctrl;
|
293
289
|
var opts = params.opts;
|
294
290
|
|
295
|
-
return m('li.c-select--option.padding-horz-medium
|
291
|
+
return m('li.c-select--option.padding-horz-medium' + (index === ctrl.state.highlightIndex() ? '.is-selected' : ''), {
|
296
292
|
config: function config(el) {
|
297
293
|
ctrl.state.optionHeight($(el).outerHeight());
|
298
294
|
},
|
@@ -330,11 +326,7 @@ vhxm.components.shared.select.ui.list.container = {
|
|
330
326
|
return new vhxm.components.shared.select.ui.list.controller(opts, parent);
|
331
327
|
},
|
332
328
|
view: function view(ctrl, opts) {
|
333
|
-
return m('ul.c-select--options.margin-left-reset.loader-slate.loader--transparent' + (ctrl.state.isLoading() ? '.is-loading' : ''), {
|
334
|
-
config: function config(el) {
|
335
|
-
ctrl.state.optionsHeight($(el).outerHeight());
|
336
|
-
}
|
337
|
-
}, [ctrl.hasItems() ? ctrl.model.items().map(function (item, index) {
|
329
|
+
return m('ul.c-select--options.margin-left-reset.loader-slate.loader--transparent' + (ctrl.state.isLoading() ? '.is-loading' : ''), [ctrl.hasItems() ? ctrl.model.items().map(function (item, index) {
|
338
330
|
return m.component(vhxm.components.shared.select.ui['item_' + ctrl.parent.type], {
|
339
331
|
item: item,
|
340
332
|
index: index,
|
@@ -71,13 +71,13 @@
|
|
71
71
|
margin-top: 80px; }
|
72
72
|
|
73
73
|
.c-select--options {
|
74
|
-
margin-top: 15px;
|
75
|
-
margin-bottom: 15px;
|
76
74
|
overflow-y: auto;
|
77
|
-
max-height:
|
75
|
+
max-height: 200px; }
|
78
76
|
|
79
77
|
.c-select--option {
|
80
|
-
color: #233741;
|
78
|
+
color: #233741;
|
79
|
+
line-height: 25px;
|
80
|
+
padding-top: 7px; }
|
81
81
|
.c-select--option.is-selected {
|
82
82
|
cursor: pointer;
|
83
83
|
background-color: #F0F2F4; }
|