nice-elements 1.4.9 → 1.4.11

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.
@@ -1,5 +1,8 @@
1
1
  {
2
2
  "editor.formatOnSave": true,
3
3
  "html.format.wrapLineLength": 0,
4
- "prettier.printWidth": 0
4
+ "prettier.printWidth": 0,
5
+ "[scss]": {
6
+ "editor.defaultFormatter": "vscode.css-language-features"
7
+ }
5
8
  }
package/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # Changelog
2
2
 
3
+ ## v1.4.11 (26.10.2022)
4
+
5
+ - added dropdown distance prop
6
+
7
+ ## v1.4.10 (13.10.2022)
8
+
9
+ - used popper for nice help
10
+
3
11
  ## v1.4.9 (23.9.2022)
4
12
 
5
13
  - fixed nice-datetimerange-picker-2 model change
package/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # Nice elements v1.4.9
1
+ # Nice elements v1.4.11
2
2
 
3
3
  Nice elements is an AngularJS v1.5.8 module that contains nice form elements like inputs, choice fields, search, toggle, dropdown, etc.
4
4
 
package/bower.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nice-elements",
3
- "version": "1.4.9",
3
+ "version": "1.4.11",
4
4
  "authors": [
5
5
  "Klemen Kastelic <klemen@olaii.com>"
6
6
  ],
package/dist/nice.js CHANGED
@@ -2222,11 +2222,13 @@ angular.module('niceElements')
2222
2222
  searchText: '@',
2223
2223
  nullableText: '@',
2224
2224
  selectedText: '@',
2225
+ dropdownDistance: '@',
2225
2226
  searchFunction: '=?',
2226
2227
  isInline: '=',
2227
2228
  clearOnSelect: '@'
2228
2229
  },
2229
2230
  controller: function ($scope, $element, $timeout, gettextCatalog) {
2231
+ if (!$scope.dropdownDistance) { $scope.dropdownDistance = 5; }
2230
2232
  if (!$scope.objValue) { $scope.objValue = 'value'; }
2231
2233
  if (!$scope.objKey) { $scope.objKey = 'id'; }
2232
2234
  if (!$scope.noOptionsText) { $scope.noOptionsText = gettextCatalog.getString("No options", null, "Nice"); }
@@ -2253,7 +2255,7 @@ angular.module('niceElements')
2253
2255
 
2254
2256
  // Setup popper
2255
2257
  // https://popper.js.org/docs/v2/constructors/
2256
- $scope.setupPopper = function() {
2258
+ $scope.setupPopper = function () {
2257
2259
  var button = $element[0].getElementsByClassName('btn-dropdown')[0];
2258
2260
  var tooltip = $element[0].getElementsByClassName('nice-dropdown-menu-wrapper')[0];
2259
2261
  $scope.popper = Popper.createPopper(button, tooltip, {
@@ -2264,7 +2266,7 @@ angular.module('niceElements')
2264
2266
  {
2265
2267
  name: 'offset',
2266
2268
  options: {
2267
- offset: [0, 5],
2269
+ offset: [0, $scope.dropdownDistance],
2268
2270
  },
2269
2271
  },
2270
2272
  {
@@ -2272,13 +2274,13 @@ angular.module('niceElements')
2272
2274
  enabled: true,
2273
2275
  phase: "beforeWrite",
2274
2276
  requires: ["computeStyles"],
2275
- fn: function(e) {
2277
+ fn: function (e) {
2276
2278
  var state = e.state;
2277
2279
  state.styles.popper.width = state.rects.reference.width + "px";
2278
2280
  },
2279
- effect: function(e) {
2281
+ effect: function (e) {
2280
2282
  var state = e.state;
2281
- state.elements.popper.style.width = state.elements.reference.offsetWidth + "px";
2283
+ state.elements.popper.style.width = state.elements.reference.offsetWidth + "px";
2282
2284
  }
2283
2285
  }
2284
2286
  ],
@@ -3409,6 +3411,42 @@ angular.module('niceElements')
3409
3411
  restrict: 'E',
3410
3412
  scope: {
3411
3413
  text: '@'
3414
+ },
3415
+ controller: function ($scope, $element, $timeout) {
3416
+ // Setup popper
3417
+ // https://popper.js.org/docs/v2/constructors/
3418
+ $scope.setupPopper = function () {
3419
+ var button = $element[0].getElementsByClassName('nice-help-button')[0];
3420
+ var tooltip = $element[0].getElementsByClassName('nice-help-popup')[0];
3421
+ $scope.popper = Popper.createPopper(button, tooltip, {
3422
+ strategy: 'fixed',
3423
+ placement: 'top',
3424
+ scroll: true,
3425
+ resize: true,
3426
+ modifiers: [
3427
+ {
3428
+ name: 'offset',
3429
+ options: {
3430
+ offset: [0, 5],
3431
+ },
3432
+ },
3433
+ {
3434
+ name: 'arrow',
3435
+ options: {
3436
+ padding: 2,
3437
+ },
3438
+ }
3439
+ ],
3440
+ });
3441
+ };
3442
+
3443
+ // $timeout(function () {
3444
+ // $scope.setupPopper();
3445
+ // });
3446
+
3447
+ $scope.onHover = function () {
3448
+ $scope.setupPopper();
3449
+ }
3412
3450
  }
3413
3451
  };
3414
3452
  });
@@ -5568,10 +5606,13 @@ angular.module('niceElements').run(['$templateCache', function($templateCache) {
5568
5606
 
5569
5607
 
5570
5608
  $templateCache.put('src/components/nice-help/nice-help.html',
5571
- "<div class=\"nice-help\">\n" +
5572
- "<i class=\"fa fa-question-circle\"></i>\n" +
5573
- "<div class=\"help-window\" ng-bind-html=\"text\">{{ text }}</div>\n" +
5574
- "</div>\n"
5609
+ "<div class=\"nice-help\" ng-mouseover=\"onHover()\">\n" +
5610
+ "<i class=\"fa fa-question-circle nice-help-button\" aria-label=\"\"></i>\n" +
5611
+ "<div class=\"nice-help-popup\">\n" +
5612
+ "<span ng-bind-html=\"text\">{{ text }}</span>\n" +
5613
+ "<div data-popper-arrow class=\"nice-help-arrow\"></div>\n" +
5614
+ "</div>\n" +
5615
+ "</div>"
5575
5616
  );
5576
5617
 
5577
5618