material_raingular 0.1.1 → 0.1.2

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: ca25f62ed20ba508fe00801587895b28329ad328
4
- data.tar.gz: 818e8b319126d6f5cb154e5ca04c598db286acc1
3
+ metadata.gz: d5758cbbb60a81e13a8f9ee724676bbb1daf1351
4
+ data.tar.gz: 003e3ccf07f0befbddd525fba209cd0cfaab8601
5
5
  SHA512:
6
- metadata.gz: 4cf7d64d6dfc4921db568f48de7956fb111c5de8f70d82da582755ac80e5469b9c59b528e00e7e94b26fcf3aea18d4e2cdf9e441b6eead9a2e867a5756c5432d
7
- data.tar.gz: c38201d4f38f35a97bda236dea815e03c4b7c76468ccb60540b888bb3a204d515b847c6c388004ea061aa857fa9ecaf908091dd5e9c8809255825ee13d3cf77d
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())
@@ -1,3 +1,3 @@
1
1
  module MaterialRaingular
2
- VERSION = "0.1.1"
2
+ VERSION = "0.1.2"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: material_raingular
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chris Moody