nice-elements 1.8.6 → 1.8.8

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.8.8 (28.6.2023)
4
+
5
+ - added numbersOnly to nice-input component - OLA-650
6
+
7
+ ## v1.8.7 (26.6.2023)
8
+
9
+ - changed trash can with x - OLA-639
10
+
3
11
  ## v1.8.6 (8.6.2023)
4
12
 
5
13
  - worked on nice-dropdown filter function,
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.8.6
3
+ # Nice elements v1.8.8
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.8.6",
3
+ "version": "1.8.8",
4
4
  "authors": [
5
5
  "Klemen Kastelic <klemen@olaii.com>"
6
6
  ],
package/dist/nice.js CHANGED
@@ -3708,7 +3708,8 @@ angular.module('niceElements')
3708
3708
  tabIndex: '@',
3709
3709
  isFocused: '@',
3710
3710
  isInline: '=',
3711
- onChange: '&?'
3711
+ onChange: '&?',
3712
+ numbersOnly: '=', // Allow only numbers in the input
3712
3713
  },
3713
3714
 
3714
3715
  link: function (scope, element, attrs) {
@@ -3804,6 +3805,15 @@ angular.module('niceElements')
3804
3805
  $scope.id = Math.random().toString(36).substring(7);
3805
3806
 
3806
3807
  $scope.keypress = function (event) {
3808
+ if ($scope.numbersOnly) {
3809
+ if ((event.charCode >= 48 && event.charCode <= 58) || event.charCode == 0) { // Allow only numbers
3810
+ return true;
3811
+ } else { // Prevent everything else
3812
+ event.preventDefault();
3813
+ return false;
3814
+ }
3815
+ }
3816
+
3807
3817
  if ($scope.type == "number" || $scope.type == "integer") {
3808
3818
  if (event.charCode == 46 || event.charCode == 44) { // Handle "." and "," key (only one allowed)
3809
3819
  if ($scope.type == "number") {
@@ -5632,7 +5642,7 @@ angular.module('niceElements')
5632
5642
  .service('NiceService', function () {
5633
5643
  var service = {
5634
5644
  name: "Nice elements",
5635
- version: "1.8.6",
5645
+ version: "1.8.8",
5636
5646
  getHeader: function () {
5637
5647
  return {};
5638
5648
  }
@@ -6101,7 +6111,7 @@ angular.module('niceElements').run(['$templateCache', function ($templateCache)
6101
6111
  "<input ng-model=\"internal.search\" ng-model-options=\"{ debounce: 500 }\" ng-change=\"handleSearch()\" placeholder=\"{{ searchText }}\">\n" +
6102
6112
  "<div class=\"count\" ng-if=\"internalList && internalList._metadata && enableLoadMore\">{{ internalList.length }}/{{ internalList._metadata.count }}</div>\n" +
6103
6113
  "<nice-icon ng-if=\"!internal.search\" class=\"icon\" icon=\"icon-search\"></nice-icon>\n" +
6104
- "<nice-icon ng-if=\"internal.search\" class=\"icon icon-trash\" icon=\"icon-trash\" ng-click=\"clearSearch()\"></nice-icon>\n" +
6114
+ "<nice-icon ng-if=\"internal.search\" class=\"icon\" icon=\"icon-x\" ng-click=\"clearSearch()\"></nice-icon>\n" +
6105
6115
  "</div>\n" +
6106
6116
  "<div class=\"nice-dropdown-items\" aria-labelledby=\"nice-dropdown-{{ id }}\" role=\"listbox\">\n" +
6107
6117
  "<div role=\"none\" class=\"nice-no-data\" ng-if=\"internalList && internalList.length == 0\">{{ noDataText }}</div>\n" +
@@ -6457,8 +6467,9 @@ angular.module('niceElements').run(['$templateCache', function ($templateCache)
6457
6467
  "<div class=\"nice-field col-xs-12\" ng-class=\"[fieldWidth ? fieldWidth : 'col-sm-8', { 'nice-disabled': isDisabled }]\" click-outside=\"close()\">\n" +
6458
6468
  "<div class=\"nice-search-button input-group\" ng-class=\"{ 'disabled': isDisabled }\">\n" +
6459
6469
  "<input class=\"form-control\" type=\"text\" id=\"{{ id }}\" ng-model=\"model\" placeholder=\"{{ placeholder }}\" ng-disabled=\"isDisabled\" ng-change=\"updateSearch()\" ng-focus=\"onFocus()\" tabindex=\"{{ tabIndex }}\">\n" +
6460
- "<span class=\"input-group-addon clickable\" ng-click=\"onFocus()\">\n" +
6461
- "<nice-icon ng-show=\"!loading\" icon=\"icon-search\"></nice-icon>\n" +
6470
+ "<span class=\"input-group-addon\">\n" +
6471
+ "<nice-icon class=\"clickable\" ng-show=\"!loading && model != ''\" icon=\"icon-x\" ng-click=\"clear()\"></nice-icon>\n" +
6472
+ "<nice-icon class=\"clickable\" ng-show=\"!loading && model == ''\" icon=\"icon-search\" ng-click=\"onFocus()\"></nice-icon>\n" +
6462
6473
  "<nice-loader ng-if=\"loading\"></nice-loader>\n" +
6463
6474
  "</span>\n" +
6464
6475
  "</div>\n" +