material_raingular 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d5758cbbb60a81e13a8f9ee724676bbb1daf1351
|
4
|
+
data.tar.gz: 003e3ccf07f0befbddd525fba209cd0cfaab8601
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5e7bc01cb048abdb22363ba8d000f6d9a864bf7bdf9169c525b1b9a5f7d213452f191993d5e5bea15d1c7136173058dfc3f62c7507aa4976ec787a458c4c7bb2
|
7
|
+
data.tar.gz: ff49fc825f94c229299489eab7d898233515121061e39d7b6129ae2391f2cb66ff6d34d84ccf4d288ebf32f45154e0edd562c8ab9bc10a1c5abb789b700184fd
|
@@ -1,3 +1,4 @@
|
|
1
|
+
# TODO:: Figure out how to prevent second focus on 'phase code' from changing value... class variable on focus on blur
|
1
2
|
class SelectOptions
|
2
3
|
REGEXP: /^\s*([\s\S]+?)(?:\s+as\s+([\s\S]+?))?(?:\s+group\s+by\s+([\s\S]+?))?(?:\s+disable\s+when\s+([\s\S]+?))?\s+for\s+(?:([\$\w][\$\w]*)|(?:\(\s*([\$\w][\$\w]*)\s*,\s*([\$\w][\$\w]*)\s*\)))\s+in\s+([\s\S]+?)(?:\s+track\s+by\s+([\s\S]+?))?$/;
|
3
4
|
# 1: Model Value
|
@@ -23,13 +24,14 @@ PrimitiveValueFunction = (s,l,a,i) ->
|
|
23
24
|
return s
|
24
25
|
|
25
26
|
class SelectFunctions
|
26
|
-
constructor: (match,parse) ->
|
27
|
+
constructor: (match,parse,options) ->
|
27
28
|
@collection = parse(match[8])
|
28
29
|
@modelValue = match[1].replace(match[5] + '.','')
|
29
30
|
@viewValue = if match[2] then match[2].replace(match[5] + '.','') else @modelValue
|
30
31
|
@modelValueFn = if @modelValue == match[5] then PrimitiveValueFunction else parse(@modelValue || @viewValue)
|
31
32
|
@viewValueFn = if @viewValue == match[5] then PrimitiveValueFunction else parse(@viewValue || @modelValue)
|
32
33
|
@isPrimative = @viewValue == match[5]
|
34
|
+
@altValue = parse(options.showAs)
|
33
35
|
|
34
36
|
class MobileTemplate
|
35
37
|
constructor: (@element,functions) ->
|
@@ -230,7 +232,6 @@ angular.module('FilteredSelect', [])
|
|
230
232
|
obj[functions.viewValue] = elements.search.val()[0..location - 1].replace(/^\s+/g,'') || ''
|
231
233
|
return unless functions.collection(scope)
|
232
234
|
fList = $filter('orderBy')($filter('filter')(functions.collection(scope), obj,bool), viewOptions.orderBy || functions.viewValue)
|
233
|
-
console.dir fList
|
234
235
|
for filter in options.filters
|
235
236
|
[filterType,value] = filter.replace(/\s+/,'').split(':')
|
236
237
|
fList = $filter(filterType)(fList, value)
|
@@ -262,7 +263,7 @@ angular.module('FilteredSelect', [])
|
|
262
263
|
obj[functions.modelValue] = model
|
263
264
|
list = $filter('filter')(functions.collection(scope), obj,equiv)
|
264
265
|
viewScope = list[0] if list
|
265
|
-
val = if viewScope then functions.viewValueFn(viewScope).replace(/^\s+/g,'') else ''
|
266
|
+
val = if viewScope then (functions.altValue(viewScope) || functions.viewValueFn(viewScope)).replace(/^\s+/g,'') else ''
|
266
267
|
elements.search.val(val)
|
267
268
|
elements.typeAhead.html(elements.search.val())
|
268
269
|
else
|
@@ -308,7 +309,7 @@ angular.module('FilteredSelect', [])
|
|
308
309
|
return false
|
309
310
|
|
310
311
|
options = new SelectOptions(attrs.ngSelectOptions,element[0].outerHTML)
|
311
|
-
functions = new SelectFunctions(options.match,$parse)
|
312
|
+
functions = new SelectFunctions(options.match,$parse,viewOptions)
|
312
313
|
eFunctions = new EventFunctions(functions,buildTemplate,updateValue,filteredList,$filter,$timeout,$parse,scope,disabled,viewOptions)
|
313
314
|
if isMobile = typeof attrs.ngMobile != 'undefined'
|
314
315
|
elements = new MobileTemplate(element,eFunctions.mobile())
|