us-formly-templates
Advanced tools
Comparing version 1.0.4 to 1.0.5
{ | ||
"name": "us-formly-templates", | ||
"version": "1.0.4", | ||
"version": "1.0.5", | ||
"description": "Extensão com templates para usar formly com bootstrap", | ||
@@ -5,0 +5,0 @@ "scripts": { |
@@ -16,3 +16,3 @@ angular.module('usFormlyTemplates', [ | ||
name: 'validation', | ||
types: ['input', 'maskedInput', 'cpf', 'rg', 'cnpj'], | ||
types: ['input', 'maskedInput', 'cpf', 'rg', 'cnpj', 'number', 'fone', 'percent'], | ||
template: ` | ||
@@ -105,7 +105,6 @@ <formly-transclude></formly-transclude> | ||
name: 'rg', | ||
//extends: 'maskedInput', | ||
extends: 'input', | ||
extends: 'maskedInput', | ||
defaultOptions: { | ||
templateOptions: { | ||
//mask: '99.999.999-9', | ||
mask: '99.999.999-9', | ||
} | ||
@@ -216,2 +215,27 @@ } | ||
//Radio | ||
formlyConfigProvider.setType({ | ||
name: 'radioDefault', | ||
extends: 'radio', | ||
template: ` | ||
<div class="checkbox" ng-repeat="(key, option) in to.options"> | ||
<label class="i-checks"> | ||
<input | ||
type="radio" | ||
id="{{id + '_'+ $index}}" | ||
tabindex="0" | ||
ng-value="option[to.valueProp || 'value']" | ||
ng-model="model[options.key]"> | ||
<i></i>{{option[to.labelProp || 'name']}} | ||
</label> | ||
</div>`, | ||
controller: function($scope){ | ||
// console.log($scope.model[$scope.options.key]); | ||
if (!$scope.model[$scope.options.key]) { | ||
$scope.model[$scope.options.key] = $scope.to.checked; | ||
} | ||
} | ||
}); | ||
//Radio Inline | ||
@@ -278,2 +302,17 @@ formlyConfigProvider.setType({ | ||
formlyConfigProvider.setType({ | ||
name: 'percent', | ||
extends: 'input', | ||
template: ` | ||
<input | ||
ui-jq="TouchSpin" | ||
ng-model="model[options.key]" | ||
type="text" | ||
class="form-control" | ||
data-min='0' | ||
data-step="0.1" | ||
data-decimals="2" | ||
data-postfix="%">` | ||
}); | ||
// Select2 | ||
@@ -284,8 +323,8 @@ formlyConfigProvider.setType({ | ||
template: ` | ||
<ui-select ng-model="model[options.key]" required="{{to.required}}" ng-disabled="to.disabled" theme="bootstrap"> | ||
<ui-select ng-model="model[options.key]" required="{{to.required}}" ng-disabled="{{to.disabled}}" theme="bootstrap"> | ||
<ui-select-match placeholder="{{to.placeholder}}" allow-clear="true">{{$select.selected[to.labelProp]}}</ui-select-match> | ||
<ui-select-choices repeat="option[to.valueProp] as option in to.options | filter: $select.search"> | ||
<div ng-bind-html="option[to.labelProp] | highlight: $select.search"></div> | ||
<div ng-bind-html="option[to.labelProp] | highlight: $select.search"></div> | ||
</ui-select-choices> | ||
</ui-select>` | ||
</ui-select>` | ||
}); | ||
@@ -292,0 +331,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
15151
448