nice-elements 1.13.0 → 1.13.1

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.13.1 (30.3.2026)
4
+
5
+ - added transclude to nice upload,
6
+ - worked on nice choice no item error,
7
+ - worked on nice upload example,
8
+ - worked on nice highlight,
9
+ - worked on nice dropdown nullable prop
10
+
3
11
  ## v1.13.0 (20.1.2026)
4
12
 
5
13
  - created nice options component
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.13.0
3
+ # Nice elements v1.13.1
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.13.0",
3
+ "version": "1.13.1",
4
4
  "authors": [
5
5
  "Klemen Kastelic <klemen@olaii.com>"
6
6
  ],
package/dist/nice.js CHANGED
@@ -701,6 +701,7 @@ angular.module('niceElements')
701
701
  }
702
702
 
703
703
  const getFilter = function (item) {
704
+ if (!item) return;
704
705
  // Create filter for finding object by objValue with _.where()
705
706
  const filter = {};
706
707
  if (item.hasOwnProperty($scope.objKey))
@@ -2478,7 +2479,7 @@ angular.module('niceElements')
2478
2479
  objValue: '@', // Optional - default is 'value'
2479
2480
  objKey: '@?', // Optional - default is 'id'. Used only when returnOnlyKey=true.
2480
2481
  selectedIsKey: '@?',
2481
- nullable: '@', // No selection is possible
2482
+ nullable: '=', // No selection is possible
2482
2483
  required: '=', // Model cannot be NULL
2483
2484
  noMargin: '@', // margin-bottom: 0px
2484
2485
  multiple: '@', // Can select multiple items
@@ -2511,7 +2512,6 @@ angular.module('niceElements')
2511
2512
  if (!$scope.selectedText) { $scope.selectedText = gettextCatalog.getString("selected", null, "Nice"); }
2512
2513
  if (!$scope.addButtonFunction) { $scope.addButtonFunction = null; }
2513
2514
  if (!$scope.placement) { $scope.placement = "bottom-start"; }
2514
- $scope.nullable = $scope.nullable === 'true' || $scope.nullable === true;
2515
2515
  $scope.noMargin = $scope.noMargin === 'true' || $scope.noMargin === true;
2516
2516
  $scope.multiple = $scope.multiple === 'true' || $scope.multiple === true;
2517
2517
  $scope.clearOnSelect = $scope.clearOnSelect === 'true' || $scope.clearOnSelect === true;
@@ -6263,13 +6263,32 @@ angular.module('niceElements').filter('niceDate', function () {
6263
6263
  */
6264
6264
  angular.module('niceElements').filter('niceHighlight', function () {
6265
6265
  return function (value, highlightedText) {
6266
- if (!value) return "";
6266
+ if (!value || !highlightedText) return "";
6267
6267
  const regex = new RegExp(highlightedText, 'gmi');
6268
- const newValue = String(value).replace(regex, "<span class='nice-highligh'>$&</span>");
6268
+ const newValue = String(value).replace(regex, "<span class='nice-highlight'>$&</span>");
6269
6269
  return newValue;
6270
6270
  };
6271
6271
  });
6272
6272
 
6273
+ angular.module('niceElements')
6274
+ .filter('h', function ($sce, $sanitize) {
6275
+ return function (text, phrase) {
6276
+ if (!phrase || !text) return text;
6277
+
6278
+ // 1. Sanitize the original text to prevent XSS
6279
+ let cleanText = $sanitize(text);
6280
+
6281
+ // 2. Create the case-insensitive global Regex
6282
+ const regex = new RegExp('(' + phrase + ')', 'gi');
6283
+
6284
+ // 3. Replace matches with the h element
6285
+ const highlighted = cleanText.replace(regex, '<h>$1</h>');
6286
+
6287
+ // 4. Trust the result so ng-bind-html renders it
6288
+ return $sce.trustAsHtml(highlighted);
6289
+ };
6290
+ });
6291
+
6273
6292
  'use strict';
6274
6293
 
6275
6294
  /**
@@ -6506,7 +6525,7 @@ angular.module('niceElements')
6506
6525
  .service('NiceService', function ($rootScope) {
6507
6526
  const service = {
6508
6527
  name: "Nice elements",
6509
- version: "1.13.0",
6528
+ version: "1.13.1",
6510
6529
  getHeader: function () {
6511
6530
  return {};
6512
6531
  },
@@ -9192,7 +9211,9 @@ angular.module('niceElements').run(['$templateCache', function($templateCache) {
9192
9211
  " <div class=\"text text-placeholder\" ng-if=\"dragging\" translate translate-group=\"Nice\">Drop file here</div>\n" +
9193
9212
  " <div class=\"error\" ng-if=\"error\">{{ error }}</div>\n" +
9194
9213
  " </div>\n" +
9195
- " <img ng-if=\"imageSource\" data-ng-src=\"{{ imageSource }}\">\n" +
9214
+ " <div ng-if=\"imageSource\" ng-transclude>\n" +
9215
+ " <img data-ng-src=\"{{ imageSource }}\">\n" +
9216
+ " </div>\n" +
9196
9217
  " </div>\n" +
9197
9218
  " <input class=\"input-file\" type=\"file\" accept=\"{{ accept }}\" ng-model=\"file\" ng-required=\"required\" ng-disabled=\"isDisabled || loading\">\n" +
9198
9219
  " <nice-loader fulldiv=\"true\" ng-if=\"loading\"></nice-loader>\n" +