nice-elements 1.10.1 → 1.10.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.
- package/CHANGELOG.md +5 -0
- package/README.md +1 -1
- package/bower.json +1 -1
- package/dist/nice.js +20 -63
- package/dist/nice.min.js +1 -1
- package/dist/style.css +51 -7
- package/dist/style.css.map +1 -1
- package/dist/style.min.css +1 -1
- package/package.json +1 -1
- package/src/components/nice-toggle/nice-toggle.html +2 -2
- package/src/components/nice-toggle/nice-toggle.js +14 -57
- package/src/components/nice-toggle/nice-toggle.scss +61 -8
- package/src/services/nice-service.js +1 -1
package/CHANGELOG.md
CHANGED
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|

|
|
2
2
|
|
|
3
|
-
# Nice elements v1.10.
|
|
3
|
+
# Nice elements v1.10.2
|
|
4
4
|
|
|
5
5
|
Nice elements is an AngularJS v1.5.8 module that contains nice form elements like inputs, choice fields, search, toggle, dropdown, etc.
|
|
6
6
|
|
package/bower.json
CHANGED
package/dist/nice.js
CHANGED
|
@@ -5486,79 +5486,36 @@ angular.module('niceElements')
|
|
|
5486
5486
|
isDisabled: '=',
|
|
5487
5487
|
fieldWidth: '@',
|
|
5488
5488
|
labelWidth: '@',
|
|
5489
|
-
defaultFalse: '@',
|
|
5490
5489
|
noMargin: '@',
|
|
5491
5490
|
onChange: '&?',
|
|
5492
5491
|
isInline: '=',
|
|
5492
|
+
isBlock: '=',
|
|
5493
|
+
titleRight: '=',
|
|
5493
5494
|
help: '@'
|
|
5494
5495
|
},
|
|
5495
|
-
controller: function ($scope) {
|
|
5496
|
+
controller: function ($scope, $timeout) {
|
|
5496
5497
|
if (!$scope.title) { $scope.title = ''; }
|
|
5497
5498
|
if (!$scope.fieldWidth) { $scope.fieldWidth = 'col-sm-8'; }
|
|
5498
5499
|
if (!$scope.labelWidth) { $scope.labelWidth = 'col-sm-4'; }
|
|
5499
5500
|
|
|
5500
|
-
// ------------------------- Set overlay button position based on passed state in $scope.model -------------------------
|
|
5501
|
-
$scope.setButtonPosition = function (state) {
|
|
5502
|
-
if (state) {
|
|
5503
|
-
$scope.buttonClass = "yesno-button-yes";
|
|
5504
|
-
} else {
|
|
5505
|
-
$scope.buttonClass = "yesno-button-no";
|
|
5506
|
-
}
|
|
5507
|
-
};
|
|
5508
|
-
|
|
5509
|
-
// ------------------------- Watch for changes from outside -------------------------
|
|
5510
|
-
$scope.$watch('model', function (value_new, value_old) {
|
|
5511
|
-
if (angular.isDefined($scope.model)) {
|
|
5512
|
-
$scope.setButtonLabel($scope.model);
|
|
5513
|
-
$scope.setButtonPosition($scope.model);
|
|
5514
|
-
}
|
|
5515
|
-
});
|
|
5516
|
-
|
|
5517
|
-
// ------------------------- Watch for model value -------------------------
|
|
5518
|
-
$scope.$watch('modelValue', function (value_new, value_old) {
|
|
5519
|
-
if ($scope.options) {
|
|
5520
|
-
$scope.model = $scope.modelValue == $scope.options[0];
|
|
5521
|
-
}
|
|
5522
|
-
});
|
|
5523
|
-
|
|
5524
|
-
// ------------------------- Set button label -------------------------
|
|
5525
|
-
$scope.setButtonLabel = function (state) {
|
|
5526
|
-
if (state) {
|
|
5527
|
-
$scope.state = $scope.yes;
|
|
5528
|
-
} else {
|
|
5529
|
-
$scope.state = $scope.no;
|
|
5530
|
-
}
|
|
5531
|
-
};
|
|
5532
|
-
|
|
5533
|
-
// ------------------------- Set width -------------------------
|
|
5534
|
-
$scope.setWidth = function (width, el) {
|
|
5535
|
-
el.style.width = width;
|
|
5536
|
-
};
|
|
5537
|
-
|
|
5538
|
-
|
|
5539
5501
|
// ------------------------- Switch -------------------------
|
|
5540
|
-
$scope.
|
|
5541
|
-
if (
|
|
5542
|
-
|
|
5502
|
+
$scope.toggle = function () {
|
|
5503
|
+
if ($scope.isDisabled) return;
|
|
5504
|
+
$scope.model = !$scope.model;
|
|
5543
5505
|
|
|
5544
|
-
|
|
5545
|
-
|
|
5546
|
-
|
|
5547
|
-
|
|
5548
|
-
|
|
5549
|
-
}
|
|
5506
|
+
if ($scope.options) {
|
|
5507
|
+
if ($scope.model) {
|
|
5508
|
+
$scope.modelValue = $scope.options[0];
|
|
5509
|
+
} else {
|
|
5510
|
+
$scope.modelValue = $scope.options[1];
|
|
5550
5511
|
}
|
|
5512
|
+
}
|
|
5551
5513
|
|
|
5514
|
+
$timeout(function() {
|
|
5552
5515
|
if ($scope.onChange) $scope.onChange({ model: $scope.model });
|
|
5553
5516
|
$scope.formToggle.$setDirty();
|
|
5554
|
-
}
|
|
5517
|
+
});
|
|
5555
5518
|
};
|
|
5556
|
-
|
|
5557
|
-
// Call it first time
|
|
5558
|
-
$scope.setButtonPosition($scope.model);
|
|
5559
|
-
|
|
5560
|
-
// Set label based on state passed in $scope.model
|
|
5561
|
-
$scope.setButtonLabel($scope.model);
|
|
5562
5519
|
}
|
|
5563
5520
|
};
|
|
5564
5521
|
});
|
|
@@ -5946,7 +5903,7 @@ angular.module('niceElements')
|
|
|
5946
5903
|
.service('NiceService', function () {
|
|
5947
5904
|
var service = {
|
|
5948
5905
|
name: "Nice elements",
|
|
5949
|
-
version: "1.10.
|
|
5906
|
+
version: "1.10.2",
|
|
5950
5907
|
getHeader: function () {
|
|
5951
5908
|
return {};
|
|
5952
5909
|
}
|
|
@@ -6022,7 +5979,7 @@ angular.module('niceElements')
|
|
|
6022
5979
|
};
|
|
6023
5980
|
});
|
|
6024
5981
|
|
|
6025
|
-
angular.module('niceElements').run(['$templateCache', function($templateCache) {
|
|
5982
|
+
angular.module('niceElements').run(['$templateCache', function($templateCache) {
|
|
6026
5983
|
'use strict';
|
|
6027
5984
|
|
|
6028
5985
|
$templateCache.put('src/components/nice-button-toggle/nice-button-toggle.html',
|
|
@@ -8016,11 +7973,11 @@ angular.module('niceElements').run(['$templateCache', function($templateCache) {
|
|
|
8016
7973
|
|
|
8017
7974
|
|
|
8018
7975
|
$templateCache.put('src/components/nice-toggle/nice-toggle.html',
|
|
8019
|
-
"<div class=\"nice-component nice-toggle\" ng-class=\"{ 'margin-bottom-0' : noMargin, 'nice-component-inline': isInline, 'active': model }\" ng-form=\"formToggle\">\n" +
|
|
7976
|
+
"<div class=\"nice-component nice-toggle\" ng-class=\"{ 'margin-bottom-0' : noMargin, 'title-right': titleRight, 'nice-component-inline': isInline, 'nice-component-block': isBlock, 'active': model }\" ng-form=\"formToggle\">\n" +
|
|
8020
7977
|
"<div class=\"row\">\n" +
|
|
8021
7978
|
"<nice-title text=\"title\" help=\"help\" required=\"required\" label-width=\"labelWidth\"></nice-title>\n" +
|
|
8022
7979
|
"<div class=\"nice-field col-xs-12\" ng-class=\"[fieldWidth ? fieldWidth : 'col-sm-8', { 'nice-disabled': isDisabled }]\">\n" +
|
|
8023
|
-
"<button type=\"button\" class=\"nice-toggle-field\" ng-click=\"
|
|
7980
|
+
"<button type=\"button\" class=\"nice-toggle-field\" ng-click=\"toggle()\" ng-disabled=\"isDisabled\">\n" +
|
|
8024
7981
|
"<div class=\"nice-toggle-field-handle\">{{ state }}</div>\n" +
|
|
8025
7982
|
"</button>\n" +
|
|
8026
7983
|
"</div>\n" +
|
|
@@ -8111,5 +8068,5 @@ angular.module('niceElements').run(['$templateCache', function($templateCache) {
|
|
|
8111
8068
|
"</div>\n" +
|
|
8112
8069
|
"</div>"
|
|
8113
8070
|
);
|
|
8114
|
-
|
|
8115
|
-
}]);
|
|
8071
|
+
|
|
8072
|
+
}]);
|