nice-elements 1.7.7 → 1.7.9

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 CHANGED
@@ -1,5 +1,13 @@
1
1
  # Changelog
2
2
 
3
+ ## v1.7.9 (17.2.2023)
4
+
5
+ - worked on nice dropdown transclude
6
+
7
+ ## v1.7.8 (10.2.2023)
8
+
9
+ - worked on nice-quantity component
10
+
3
11
  ## v1.7.7 (10.1.2023)
4
12
 
5
13
  - fixed nice-checkbox shrink problem,
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  ![Nice elements](https://github.com/Klemen1337/angularjs-nice-elements/raw/master/demo/assets/logo.png)
2
2
 
3
- # Nice elements v1.7.7
3
+ # Nice elements v1.7.9
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nice-elements",
3
- "version": "1.7.7",
3
+ "version": "1.7.9",
4
4
  "authors": [
5
5
  "Klemen Kastelic <klemen@olaii.com>"
6
6
  ],
package/dist/nice.js CHANGED
@@ -4382,7 +4382,8 @@ angular.module('niceElements')
4382
4382
  scope: {
4383
4383
  title: '@',
4384
4384
  model: '=',
4385
- max: '=',
4385
+ min: '=?',
4386
+ max: '=?',
4386
4387
  onChange: '&?',
4387
4388
  noMargin: '@',
4388
4389
  fieldWidth: '@',
@@ -4392,32 +4393,29 @@ angular.module('niceElements')
4392
4393
  help: '@',
4393
4394
  },
4394
4395
  controller: function ($scope) {
4395
- if (!$scope.model) {
4396
- $scope.model = 0;
4397
- }
4396
+ $scope.min = Number($scope.min) || 0;
4397
+ $scope.max = Number($scope.max) || Infinity;
4398
+ if (!$scope.model) $scope.model = Number($scope.min);
4398
4399
 
4399
4400
  $scope.add = function () {
4400
- if ($scope.max) {
4401
- if ($scope.max >= $scope.model + 1) {
4402
- $scope.model += 1;
4403
- if ($scope.onChange) $scope.onChange({ model: $scope.model });
4404
- }
4405
- } else {
4406
- $scope.model += 1;
4407
- if ($scope.onChange) $scope.onChange({ model: $scope.model });
4408
- }
4401
+ $scope.model += 1;
4402
+ $scope.handleChange();
4409
4403
  };
4410
4404
 
4411
4405
  $scope.sub = function () {
4412
- if ($scope.model - 1 >= 0) {
4413
- $scope.model -= 1;
4414
- if ($scope.onChange) $scope.onChange({ model: $scope.model });
4415
- }
4406
+ $scope.model -= 1;
4407
+ $scope.handleChange();
4416
4408
  };
4417
4409
 
4418
4410
  $scope.handleChange = function () {
4419
- if ($scope.model) {
4411
+ if ($scope.model != undefined) {
4420
4412
  $scope.model = Number($scope.model);
4413
+ if ($scope.model < $scope.min) $scope.model = angular.copy($scope.min);
4414
+ if ($scope.model > $scope.max) $scope.model = angular.copy($scope.max);
4415
+ if ($scope.onChange) $scope.onChange({ model: $scope.model });
4416
+ } else {
4417
+ $scope.model = angular.copy($scope.min);
4418
+ $scope.handleChange();
4421
4419
  }
4422
4420
  };
4423
4421
  }
@@ -5924,10 +5922,8 @@ angular.module('niceElements').run(['$templateCache', function($templateCache) {
5924
5922
  "{{ nullableText }}\n" +
5925
5923
  "</div>\n" +
5926
5924
  "<div class=\"nice-dropdown-item\" ng-repeat=\"item in internalList\" ng-click=\"handleSelected(item, $index)\" ng-class=\"{ 'selected': item._selected, 'hover': $index == selectedIndex }\">\n" +
5927
- "<span class=\"choice-checkbox\" ng-if=\"multiple\"><i class=\"fa fa-check\"></i></span>\n" +
5928
- "<span ng-transclude=\"option\">\n" +
5929
- "<span ng-class=\"{ 'multiple-item': multiple }\">{{ item[objValue] }}</span>\n" +
5930
- "</span>\n" +
5925
+ "<div class=\"choice-checkbox\" ng-if=\"multiple\"><i class=\"fa fa-check\"></i></div>\n" +
5926
+ "<div class=\"choice-option\" ng-transclude=\"option\" ng-class=\"{ 'multiple-item': multiple }\">{{ item[objValue] }}</div>\n" +
5931
5927
  "</div>\n" +
5932
5928
  "</div>\n" +
5933
5929
  "</div>\n" +
@@ -6211,11 +6207,11 @@ angular.module('niceElements').run(['$templateCache', function($templateCache) {
6211
6207
  "<nice-title title=\"title\" help=\"help\" required=\"required\" label-width=\"labelWidth\"></nice-title>\n" +
6212
6208
  "<div class=\"nice-field col-xs-12\" ng-class=\"[fieldWidth ? fieldWidth : 'col-sm-8', { 'nice-disabled': isDisabled }]\">\n" +
6213
6209
  "<div class=\"input-group\">\n" +
6214
- "<button class=\"btn btn-default btn-left\" ng-click=\"sub()\" type=\"button\" ng-disabled=\"isDisabled\" tabindex=\"-1\">\n" +
6210
+ "<button class=\"btn btn-default btn-left\" ng-click=\"sub()\" type=\"button\" ng-disabled=\"model <= min || isDisabled\" tabindex=\"-1\">\n" +
6215
6211
  "<nice-icon icon=\"icon-minus\"></nice-icon>\n" +
6216
6212
  "</button>\n" +
6217
- "<input class=\"value form-control\" ng-model=\"model\" type=\"number\" ng-change=\"handleChange()\" ng-disabled=\"isDisabled\">\n" +
6218
- "<button class=\"btn btn-default btn-right\" ng-click=\"add()\" type=\"button\" ng-disabled=\"isDisabled\" tabindex=\"-1\">\n" +
6213
+ "<input class=\"value form-control\" ng-model=\"model\" type=\"number\" min=\"{{ min }}\" max=\"{{ max }}\" ng-change=\"handleChange()\" ng-disabled=\"isDisabled\">\n" +
6214
+ "<button class=\"btn btn-default btn-right\" ng-click=\"add()\" type=\"button\" ng-disabled=\"model >= max || isDisabled\" tabindex=\"-1\">\n" +
6219
6215
  "<nice-icon icon=\"icon-plus\"></nice-icon>\n" +
6220
6216
  "</button>\n" +
6221
6217
  "</div>\n" +