nice-elements 1.15.1 → 1.16.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.
Files changed (48) hide show
  1. package/CHANGELOG.md +24 -0
  2. package/CLAUDE.md +1 -0
  3. package/README.md +1 -1
  4. package/bower.json +1 -1
  5. package/dist/nice.js +620 -509
  6. package/dist/nice.min.js +1 -1
  7. package/dist/style.css +145 -126
  8. package/dist/style.css.map +1 -1
  9. package/dist/style.min.css +2 -2
  10. package/package.json +5 -6
  11. package/src/components/nice-calendar/nice-calendar.html +3 -4
  12. package/src/components/nice-calendar/nice-calendar.scss +0 -9
  13. package/src/components/nice-date/nice-date-picker.html +60 -0
  14. package/src/components/nice-date/nice-date.html +29 -86
  15. package/src/components/nice-date/nice-date.js +7 -35
  16. package/src/components/nice-date/nice-date.scss +6 -15
  17. package/src/components/nice-datetime-picker/nice-datetime-picker.html +1 -4
  18. package/src/components/nice-datetime-picker/nice-datetime-picker.scss +9 -12
  19. package/src/components/nice-datetimerange-picker/nice-datetimerange-picker.html +1 -3
  20. package/src/components/nice-datetimerange-picker-2/nice-datetimerange-picker-2.html +32 -30
  21. package/src/components/nice-datetimerange-picker-2/nice-datetimerange-picker-2.js +1 -33
  22. package/src/components/nice-datetimerange-picker-2/nice-datetimerange-picker-2.scss +7 -12
  23. package/src/components/nice-dropdown/nice-dropdown.html +42 -40
  24. package/src/components/nice-dropdown/nice-dropdown.js +52 -54
  25. package/src/components/nice-dropdown/nice-dropdown.scss +25 -4
  26. package/src/components/nice-dropdown-old/nice-dropdown-old.html +1 -1
  27. package/src/components/nice-dropdown-old/nice-dropdown-old.scss +8 -2
  28. package/src/components/nice-dtp/nice-dtp.html +7 -7
  29. package/src/components/nice-notification/nice-notification.html +6 -6
  30. package/src/components/nice-notification/nice-notification.scss +7 -6
  31. package/src/components/nice-options/nice-options.scss +4 -0
  32. package/src/components/nice-popup/nice-popup.html +4 -4
  33. package/src/components/nice-popup/nice-popup.js +61 -75
  34. package/src/components/nice-popup/nice-popup.scss +10 -31
  35. package/src/components/nice-search/nice-search.html +21 -26
  36. package/src/components/nice-search/nice-search.js +9 -12
  37. package/src/components/nice-search/nice-search.scss +9 -10
  38. package/src/components/nice-search2/nice-search2.html +22 -18
  39. package/src/components/nice-search2/nice-search2.js +12 -56
  40. package/src/components/nice-search2/nice-search2.scss +3 -2
  41. package/src/components/nice-svgs/nice-svgs.html +8 -0
  42. package/src/components/nice-time-picker/nice-time-picker.html +1 -3
  43. package/src/components/nice-time-picker/nice-time-picker.scss +0 -8
  44. package/src/directives/nice-tooltip/_nice-tooltip.scss +7 -28
  45. package/src/directives/nice-tooltip/nice-tooltip.js +16 -29
  46. package/src/services/nice-service.js +236 -1
  47. package/src/styles/_nice-anchored.scss +75 -0
  48. package/src/styles/_nice.scss +1 -0
package/dist/nice.js CHANGED
@@ -1374,7 +1374,7 @@ angular.module('niceElements')
1374
1374
  required: '=',
1375
1375
  nullable: '=',
1376
1376
  placeholder: '@',
1377
- placement: '@', // Describes the preferred placement of the popper
1377
+ placement: '@', // Preferred placement of the dropdown (nice-popup)
1378
1378
  },
1379
1379
  controller: function ($scope, $attrs, $element, $timeout, gettextCatalog, NiceService) {
1380
1380
  NiceService.bindFlag($scope, $attrs, 'inline');
@@ -1437,37 +1437,6 @@ angular.module('niceElements')
1437
1437
  if ($scope.minDate) $scope.minDate = moment($scope.minDate);
1438
1438
 
1439
1439
 
1440
- // Setup popper
1441
- // https://popper.js.org/docs/v2/constructors/
1442
- $scope.setupPopper = function () {
1443
- const button = $element[0].getElementsByClassName('nice-date-button')[0];
1444
- const tooltip = $element[0].getElementsByClassName('nice-date-dropdown-wrapper')[0];
1445
- $scope.popper = Popper.createPopper(button, tooltip, {
1446
- strategy: 'fixed',
1447
- placement: $scope.placement,
1448
- modifiers: [
1449
- {
1450
- name: 'offset',
1451
- options: {
1452
- offset: [0, 5],
1453
- },
1454
- }
1455
- ],
1456
- });
1457
- };
1458
-
1459
- const setupTimer = $timeout(function () {
1460
- if (!$scope.inline) $scope.setupPopper();
1461
- }, 100);
1462
-
1463
- // Popper adds scroll/resize listeners to window; remove them with the component
1464
- $scope.$on('$destroy', function () {
1465
- $timeout.cancel(setupTimer);
1466
- if ($scope.popper) $scope.popper.destroy();
1467
- $scope.popper = null;
1468
- });
1469
-
1470
-
1471
1440
  // ------------------ Time changes ------------------
1472
1441
  $scope.timeChange = function () {
1473
1442
  let selectedDate = angular.copy($scope.model);
@@ -1766,13 +1735,16 @@ angular.module('niceElements')
1766
1735
  $scope.bootstrap();
1767
1736
 
1768
1737
 
1738
+ // ------------------ Close (click outside) ------------------
1739
+ $scope.close = function () {
1740
+ $scope.isOpen = false;
1741
+ };
1742
+
1743
+
1769
1744
  // ------------------ Toggle open ------------------
1770
1745
  $scope.toggleOpen = function () {
1771
1746
  if (!$scope.isDisabled) {
1772
1747
  $scope.isOpen = !$scope.isOpen;
1773
- $timeout(function () {
1774
- if ($scope.popper) $scope.popper.update();
1775
- });
1776
1748
  }
1777
1749
  };
1778
1750
  }
@@ -1905,7 +1877,7 @@ angular.module('niceElements')
1905
1877
  isInline: '=',
1906
1878
  onChange: '&?',
1907
1879
  required: '=',
1908
- placement: '@', // Describes the preferred placement of the popper
1880
+ placement: '@', // Preferred placement of the dropdown (nice-popup)
1909
1881
  },
1910
1882
  templateUrl: 'src/components/nice-datetimerange-picker-2/nice-datetimerange-picker-2.html',
1911
1883
  controller: function ($element, $timeout, $scope) {
@@ -1941,37 +1913,6 @@ angular.module('niceElements')
1941
1913
  }
1942
1914
 
1943
1915
 
1944
- // Setup popper
1945
- // https://popper.js.org/docs/v2/constructors/
1946
- $scope.setupPopper = function () {
1947
- const button = $element[0].getElementsByClassName('nice-daterange-picker-button')[0];
1948
- const tooltip = $element[0].getElementsByClassName('nice-daterange-picker-wrapper')[0];
1949
- $scope.popper = Popper.createPopper(button, tooltip, {
1950
- strategy: 'fixed',
1951
- placement: $scope.placement,
1952
- modifiers: [
1953
- {
1954
- name: 'offset',
1955
- options: {
1956
- offset: [0, 5],
1957
- },
1958
- }
1959
- ],
1960
- });
1961
- };
1962
-
1963
- const setupTimer = $timeout(function () {
1964
- $scope.setupPopper();
1965
- });
1966
-
1967
- // Popper adds scroll/resize listeners to window; remove them with the component
1968
- $scope.$on('$destroy', function () {
1969
- $timeout.cancel(setupTimer);
1970
- if ($scope.popper) $scope.popper.destroy();
1971
- $scope.popper = null;
1972
- });
1973
-
1974
-
1975
1916
  $scope.format = function () {
1976
1917
  $scope.modelFormat = $scope.startDate.format($scope.formatString) + " - " + $scope.endDate.format($scope.formatString);
1977
1918
  };
@@ -1980,7 +1921,6 @@ angular.module('niceElements')
1980
1921
  $scope.open = function () {
1981
1922
  if (!$scope.isDisabled) {
1982
1923
  $scope.isOpen = true;
1983
- if ($scope.popper) $scope.popper.update();
1984
1924
  }
1985
1925
  };
1986
1926
 
@@ -2878,12 +2818,13 @@ angular.module('niceElements')
2878
2818
  dropdownDistance: '@',
2879
2819
  searchFunction: '=?',
2880
2820
  filterFunction: '=?',
2821
+ selectedFunction: '=?', // Loads selected options missing from the list: function(keys) → promise of objects
2881
2822
  isInline: '=',
2882
2823
  clearOnSelect: '@',
2883
2824
  enableLoadMore: '@', // Enable load more
2884
- placement: '@', // Describes the preferred placement of the popper
2825
+ placement: '@', // Preferred placement of the menu
2885
2826
  },
2886
- controller: function ($scope, $attrs, $http, $element, $timeout, gettextCatalog, NiceService) {
2827
+ controller: function ($scope, $attrs, $http, $q, $element, $timeout, gettextCatalog, NiceService) {
2887
2828
  NiceService.bindFlag($scope, $attrs, 'selectedIsKey');
2888
2829
  NiceService.bindFlag($scope, $attrs, 'enableLoadMore');
2889
2830
 
@@ -2908,7 +2849,6 @@ angular.module('niceElements')
2908
2849
  $scope.isOpen = false;
2909
2850
  $scope.selected = null;
2910
2851
  // $scope.selectedIndex = 0;
2911
- $scope.popper = null;
2912
2852
 
2913
2853
  $scope.internal = {
2914
2854
  search: ""
@@ -2918,52 +2858,9 @@ angular.module('niceElements')
2918
2858
  $scope.originalList = angular.copy($scope.list);
2919
2859
  }
2920
2860
 
2921
- // Setup popper
2922
- // https://popper.js.org/docs/v2/constructors/
2923
- $scope.setupPopper = function () {
2924
- const button = $element[0].getElementsByClassName('btn-dropdown')[0];
2925
- const tooltip = $element[0].getElementsByClassName('nice-dropdown-menu-wrapper')[0];
2926
- $scope.popper = Popper.createPopper(button, tooltip, {
2927
- strategy: 'fixed',
2928
- placement: $scope.placement,
2929
- modifiers: [
2930
- {
2931
- name: 'offset',
2932
- options: {
2933
- offset: [0, $scope.dropdownDistance],
2934
- },
2935
- },
2936
- {
2937
- name: "sameWidth",
2938
- enabled: true,
2939
- phase: "beforeWrite",
2940
- requires: ["computeStyles"],
2941
- fn: function (e) {
2942
- const state = e.state;
2943
- let width = state.rects.reference.width;
2944
- if (width < 200) width = 200;
2945
- state.styles.popper.width = width + "px";
2946
- },
2947
- effect: function (e) {
2948
- const state = e.state;
2949
- let width = state.elements.reference.width;
2950
- if (width < 200) width = 200;
2951
- state.elements.popper.style.width = width + "px";
2952
- }
2953
- }
2954
- ],
2955
- });
2956
- };
2957
-
2958
- const setupTimer = $timeout(function () {
2959
- $scope.setupPopper();
2960
- });
2961
-
2962
- // Popper adds scroll/resize listeners to window; remove them with the component
2963
- $scope.$on('$destroy', function () {
2964
- $timeout.cancel(setupTimer);
2965
- if ($scope.popper) $scope.popper.destroy();
2966
- $scope.popper = null;
2861
+ // The menu is a nice-popup (positioning, Escape); on-close fires on every close
2862
+ $scope.$watch('isOpen', function (isOpen, wasOpen) {
2863
+ if (wasOpen && !isOpen && $scope.onClose) $scope.onClose();
2967
2864
  });
2968
2865
 
2969
2866
 
@@ -2978,18 +2875,13 @@ angular.module('niceElements')
2978
2875
 
2979
2876
  $scope.close = function () {
2980
2877
  $scope.isOpen = false;
2981
- if ($scope.onClose) $scope.onClose();
2982
2878
  };
2983
2879
 
2984
2880
  $scope.open = function () {
2985
- if ($scope.popper) $scope.popper.update();
2986
2881
  if ($scope.filterFunction) $scope.internalList = $scope.filterFunction($scope.originalList, $scope.model);
2987
2882
  $timeout(function () {
2988
2883
  $scope.isOpen = true;
2989
2884
  if ($scope.onOpen) $scope.onOpen();
2990
- $timeout(function () {
2991
- if ($scope.popper) $scope.popper.update();
2992
- });
2993
2885
  });
2994
2886
  $timeout(function () {
2995
2887
  $scope.focusInput();
@@ -3235,10 +3127,17 @@ angular.module('niceElements')
3235
3127
  $scope.handleModelChange();
3236
3128
  });
3237
3129
 
3130
+ // Options seen so far by key (lists, search results, loaded with selected-function),
3131
+ // so selected keys keep their label when they are not in the current list
3132
+ const knownItems = {};
3133
+ // Keys already passed to selected-function (load each one only once)
3134
+ const requestedKeys = {};
3135
+
3238
3136
  $scope.handleModelChange = function () {
3239
3137
  $scope.selected = angular.copy($scope.model);
3240
3138
  angular.forEach($scope.internalList, function (i, index) {
3241
3139
  i._selected = false;
3140
+ knownItems[i[$scope.objKey]] = i;
3242
3141
 
3243
3142
  if ($scope.selectedIsKey) {
3244
3143
  // Not object
@@ -3284,10 +3183,49 @@ angular.module('niceElements')
3284
3183
  }
3285
3184
  });
3286
3185
 
3186
+ // Selected keys that are not in the list are still raw keys here
3187
+ if ($scope.selectedIsKey && $scope.selected != null) {
3188
+ if ($scope.multiple) $scope.selected = $scope.selected.map($scope.resolveKey);
3189
+ else $scope.selected = $scope.resolveKey($scope.selected);
3190
+ $scope.loadMissingSelected();
3191
+ }
3192
+
3287
3193
  // Handle required
3288
3194
  $timeout($scope.checkRequired);
3289
3195
  }
3290
3196
 
3197
+ // ----------------------------------- Selected keys missing from the list -----------------------------------
3198
+ // Turn a selected key into an option: one from the list, one seen before,
3199
+ // or a placeholder that shows the key (until selected-function loads it)
3200
+ $scope.resolveKey = function (key) {
3201
+ if (angular.isObject(key)) return key; // already an option from the list
3202
+ if (knownItems[key]) return knownItems[key];
3203
+ const placeholder = { _missing: true };
3204
+ placeholder[$scope.objKey] = key;
3205
+ placeholder[$scope.objValue] = String(key);
3206
+ return placeholder;
3207
+ };
3208
+
3209
+ // Ask selected-function for the options of placeholder keys, then show them
3210
+ $scope.loadMissingSelected = function () {
3211
+ if (!$scope.selectedFunction) return;
3212
+ const selected = $scope.multiple ? $scope.selected : [$scope.selected];
3213
+ const keys = selected.filter(function (s) {
3214
+ return s._missing && !requestedKeys[s[$scope.objKey]];
3215
+ }).map(function (s) {
3216
+ return s[$scope.objKey];
3217
+ });
3218
+ if (keys.length == 0) return;
3219
+
3220
+ keys.forEach(function (key) { requestedKeys[key] = true; });
3221
+ $q.when($scope.selectedFunction(keys)).then(function (items) {
3222
+ angular.forEach(items, function (item) {
3223
+ knownItems[item[$scope.objKey]] = item;
3224
+ });
3225
+ $scope.handleModelChange();
3226
+ });
3227
+ };
3228
+
3291
3229
  // ----------------------------------- Required -----------------------------------
3292
3230
  // Form is invalid when required and nothing is selected
3293
3231
  $scope.checkRequired = function () {
@@ -5284,6 +5222,12 @@ angular.module('niceElements')
5284
5222
  * @name niceElements.directive:nicePopup
5285
5223
  * @description
5286
5224
  * # nicePopup
5225
+ * Shows content next to a target. Positioned with NiceService.anchor()
5226
+ * (native popover + CSS anchor positioning, Popper fallback).
5227
+ *
5228
+ * trigger="click" (default): clicking the target toggles it, clicking outside closes it.
5229
+ * trigger="manual": the parent opens and closes it through is-open.
5230
+ * Escape always closes it (also in "manual", is-open is set to false).
5287
5231
  */
5288
5232
  angular.module('niceElements')
5289
5233
  .directive('nicePopup', function () {
@@ -5295,92 +5239,69 @@ angular.module('niceElements')
5295
5239
  'content': '?nicePopupContent'
5296
5240
  },
5297
5241
  scope: {
5298
- offsetDistance: '@', // distance, displaces the popper away from, or toward, the reference element in the direction of its placement
5299
- offsetSkidding: '@', // skidding, displaces the popper along the reference element.
5300
- placement: '@', // Describes the preferred placement of the popper
5301
- strategy: '@',
5242
+ isOpen: '=?', // two-way open state
5243
+ trigger: '@', // "click" (default) or "manual"
5244
+ offsetDistance: '@', // gap in px between the target and the content
5245
+ offsetSkidding: '@', // shift in px along the target
5246
+ placement: '@', // preferred placement, e.g. "bottom-start"
5247
+ strategy: '@', // Popper strategy (fallback only)
5302
5248
  showArrow: '@',
5249
+ sameWidth: '@', // content as wide as the target
5303
5250
  onChange: '&?',
5304
5251
  },
5305
- controller: function ($scope, $element, $timeout) {
5306
- $scope.isOpen = false;
5307
- if (!$scope.showArrow) { $scope.showArrow = false; }
5308
- if (!$scope.offsetDistance && $scope.showArrow) { $scope.offsetDistance = 8; }
5309
- if (!$scope.offsetDistance) { $scope.offsetDistance = 5; }
5310
- if (!$scope.offsetSkidding) { $scope.offsetSkidding = 0; }
5252
+ controller: function ($scope, $element, $attrs, $timeout, NiceService) {
5253
+ NiceService.bindFlag($scope, $attrs, 'showArrow');
5254
+ NiceService.bindFlag($scope, $attrs, 'sameWidth');
5255
+ if (!$scope.isOpen) { $scope.isOpen = false; }
5256
+ if (!$scope.trigger) { $scope.trigger = "click"; }
5311
5257
  if (!$scope.placement) { $scope.placement = "auto"; }
5312
- if (!$scope.strategy) { $scope.strategy = "fixed"; }
5313
-
5314
- // Placements
5315
- // [
5316
- // 'auto',
5317
- // 'auto-start',
5318
- // 'auto-end',
5319
- // 'top',
5320
- // 'top-start',
5321
- // 'top-end',
5322
- // 'bottom',
5323
- // 'bottom-start',
5324
- // 'bottom-end',
5325
- // 'right',
5326
- // 'right-start',
5327
- // 'right-end',
5328
- // 'left',
5329
- // 'left-start',
5330
- // 'left-end'
5331
- // ]
5332
-
5333
- // Setup popper
5334
- // https://popper.js.org/docs/v2/constructors/
5335
- $scope.setupPopper = function () {
5258
+ if (!$scope.offsetDistance) { $scope.offsetDistance = $scope.showArrow ? 8 : 5; }
5259
+ if (!$scope.offsetSkidding) { $scope.offsetSkidding = 0; }
5260
+
5261
+ // Placements: auto, auto-start, auto-end, top, top-start, top-end, bottom, bottom-start,
5262
+ // bottom-end, right, right-start, right-end, left, left-start, left-end
5263
+
5264
+ let anchored = null;
5265
+
5266
+ // Template is in the DOM after the first digest
5267
+ const setupTimer = $timeout(function () {
5336
5268
  const target = $element[0].getElementsByClassName('nice-popup-target')[0];
5337
5269
  const content = $element[0].getElementsByClassName('nice-popup-content')[0];
5338
- $scope.popper = Popper.createPopper(target, content, {
5270
+ const arrow = $element[0].getElementsByClassName('nice-popup-arrow')[0];
5271
+ anchored = NiceService.anchor(target, content, {
5339
5272
  placement: $scope.placement,
5273
+ offset: parseInt($scope.offsetDistance),
5274
+ skidding: parseInt($scope.offsetSkidding),
5275
+ sameWidth: $scope.sameWidth,
5340
5276
  strategy: $scope.strategy,
5341
- modifiers: [
5342
- {
5343
- name: 'offset',
5344
- options: {
5345
- offset: [$scope.offsetSkidding, $scope.offsetDistance],
5346
- },
5347
- },
5348
- {
5349
- name: 'arrow',
5350
- options: {
5351
- padding: 5, // 5px from the edges of the popper
5352
- },
5353
- },
5354
- // {
5355
- // name: "sameWidth",
5356
- // enabled: true,
5357
- // phase: "beforeWrite",
5358
- // requires: ["computeStyles"],
5359
- // fn: function (e) {
5360
- // var state = e.state;
5361
- // state.styles.popper.width = state.rects.reference.width + "px";
5362
- // },
5363
- // effect: function (e) {
5364
- // var state = e.state;
5365
- // state.elements.popper.style.width = state.elements.reference.offsetWidth + "px";
5366
- // }
5367
- // }
5368
- ],
5277
+ arrow: arrow,
5278
+ onEscape: function () {
5279
+ $timeout(function () { $scope.close(); });
5280
+ }
5369
5281
  });
5370
- };
5282
+ if ($scope.isOpen) anchored.open();
5283
+ });
5371
5284
 
5372
- const setupTimer = $timeout(function () {
5373
- $scope.setupPopper();
5285
+ // Show or hide the content when the state changes
5286
+ $scope.$watch('isOpen', function (isOpen, wasOpen) {
5287
+ if (!anchored) return;
5288
+ if (isOpen) {
5289
+ anchored.open();
5290
+ // Content is rendered with ng-if, update once it's there
5291
+ $timeout(function () { if (anchored) anchored.update(); });
5292
+ } else {
5293
+ anchored.close();
5294
+ }
5295
+ if (isOpen !== wasOpen && $scope.onChange) $scope.onChange({ isOpen: isOpen });
5374
5296
  });
5375
5297
 
5376
- // Popper adds scroll/resize listeners to window; remove them with the component
5377
5298
  $scope.$on('$destroy', function () {
5378
5299
  $timeout.cancel(setupTimer);
5379
- if ($scope.popper) $scope.popper.destroy();
5380
- $scope.popper = null;
5300
+ if (anchored) anchored.destroy();
5301
+ anchored = null;
5381
5302
  });
5382
5303
 
5383
- // -----------------------------------Open -----------------------------------
5304
+ // ----------------------------------- Open -----------------------------------
5384
5305
  $scope.toggle = function () {
5385
5306
  if ($scope.isOpen) {
5386
5307
  $scope.close();
@@ -5391,20 +5312,24 @@ angular.module('niceElements')
5391
5312
 
5392
5313
  $scope.close = function () {
5393
5314
  $scope.isOpen = false;
5394
- if ($scope.onChange) $scope.onChange({ isOpen: $scope.isOpen });
5395
5315
  };
5396
5316
 
5397
5317
  $scope.open = function () {
5398
- if ($scope.popper) $scope.popper.update();
5399
5318
  $scope.isOpen = true;
5400
- if ($scope.onChange) $scope.onChange({ isOpen: $scope.isOpen });
5401
- $timeout(function () {
5402
- if ($scope.popper) $scope.popper.update();
5403
- });
5319
+ };
5320
+
5321
+ // Click on target / outside only does something in "click" mode
5322
+ $scope.targetClicked = function () {
5323
+ if ($scope.trigger != 'manual') $scope.toggle();
5324
+ };
5325
+
5326
+ $scope.clickedOutside = function () {
5327
+ if ($scope.trigger != 'manual') $scope.close();
5404
5328
  };
5405
5329
  }
5406
5330
  };
5407
5331
  });
5332
+
5408
5333
  'use strict';
5409
5334
 
5410
5335
  /**
@@ -5642,19 +5567,12 @@ angular.module('niceElements')
5642
5567
  //scope.$apply();
5643
5568
  };
5644
5569
 
5645
- // Close the dropdown if clicked outside
5646
- const onClick = function (event) {
5647
- const isClickedElementChildOfPopup = element.find(event.target).length > 0;
5648
-
5649
- if (isClickedElementChildOfPopup) return;
5650
-
5570
+ // Close the dropdown (called by click-outside in the template)
5571
+ scope.closeDropdown = function () {
5651
5572
  scope.results = [];
5652
5573
  scope.noResults = false;
5653
- scope.$apply();
5654
5574
  };
5655
5575
 
5656
- angular.element(element).on('click', onClick);
5657
-
5658
5576
  // Keyboard up/down on search results
5659
5577
  const onKeyDown = function (event) {
5660
5578
  if ((event.keyCode == 38 || event.keyCode == 40 || event.keyCode == 13 || event.keyCode == 27) && scope.results && scope.results.length > 0) {
@@ -5686,7 +5604,6 @@ angular.module('niceElements')
5686
5604
  angular.element(element).on('keydown', onKeyDown);
5687
5605
 
5688
5606
  scope.$on('$destroy', function () {
5689
- angular.element(element).off('click', onClick);
5690
5607
  angular.element(element).off('keydown', onKeyDown);
5691
5608
  });
5692
5609
 
@@ -5739,10 +5656,15 @@ angular.module('niceElements')
5739
5656
  }
5740
5657
  $scope.requests = $scope.requests + 1;
5741
5658
  const requestNumber = angular.copy($scope.requests);
5659
+ // $timeout so the view updates also when refreshFunction returns a native Promise
5742
5660
  $scope.refreshFunction($scope.modelString).then(function (response) {
5743
- updateList(response, requestNumber);
5661
+ $timeout(function () {
5662
+ updateList(response, requestNumber);
5663
+ });
5744
5664
  }, function (error) {
5745
- $scope.loading = false;
5665
+ $timeout(function () {
5666
+ $scope.loading = false;
5667
+ });
5746
5668
  });
5747
5669
  // Why was this here?
5748
5670
  // $scope.model = $scope.modelString;
@@ -5812,7 +5734,7 @@ angular.module('niceElements')
5812
5734
  labelWidth: '@',
5813
5735
  refreshFunction: '=',
5814
5736
  refreshSelectedCallback: '=',
5815
- onSelect: '=',
5737
+ onSelect: '&?',
5816
5738
  onChange: '&?',
5817
5739
  noMargin: '@',
5818
5740
  tabIndex: '@',
@@ -5821,7 +5743,7 @@ angular.module('niceElements')
5821
5743
  isInline: '=',
5822
5744
  help: '@',
5823
5745
  required: '=',
5824
- placement: '@', // Describes the preferred placement of the popper
5746
+ placement: '@', // Preferred placement of the dropdown (nice-popup)
5825
5747
  },
5826
5748
  controller: function ($scope, $timeout, $element) {
5827
5749
  $scope.loading = false;
@@ -5836,51 +5758,14 @@ angular.module('niceElements')
5836
5758
  if (!$scope.model) $scope.model = "";
5837
5759
  if (!$scope.placement) { $scope.placement = "bottom-start"; }
5838
5760
 
5839
- // Setup popper
5840
- // https://popper.js.org/docs/v2/constructors/
5841
- $scope.setupPopper = function () {
5842
- const button = $element[0].getElementsByClassName('nice-search-button')[0];
5843
- const tooltip = $element[0].getElementsByClassName('nice-search-dropdown-wrapper')[0];
5844
- $scope.popper = Popper.createPopper(button, tooltip, {
5845
- strategy: 'fixed',
5846
- placement: $scope.placement,
5847
- modifiers: [
5848
- {
5849
- name: 'offset',
5850
- options: {
5851
- offset: [0, 5],
5852
- },
5853
- },
5854
- {
5855
- name: "sameWidth",
5856
- enabled: true,
5857
- phase: "beforeWrite",
5858
- requires: ["computeStyles"],
5859
- fn: function (e) {
5860
- const state = e.state;
5861
- state.styles.popper.width = state.rects.reference.width + "px";
5862
- },
5863
- effect: function (e) {
5864
- const state = e.state;
5865
- state.elements.popper.style.width = state.elements.reference.offsetWidth + "px";
5866
- }
5867
- }
5868
- ],
5869
- });
5761
+ // ------------------- Model accessor -------------------
5762
+ // Input lives inside nice-popup's transcluded (child) scope, so a plain ng-model="model"
5763
+ // would write to the child scope only. Bind through a getter/setter instead.
5764
+ $scope.modelAccessor = function (value) {
5765
+ if (arguments.length) $scope.model = value;
5766
+ return $scope.model;
5870
5767
  };
5871
5768
 
5872
- const setupTimer = $timeout(function () {
5873
- $scope.setupPopper();
5874
- });
5875
-
5876
- // Popper adds scroll/resize listeners to window; remove them with the component
5877
- $scope.$on('$destroy', function () {
5878
- $timeout.cancel(setupTimer);
5879
- if ($scope.popper) $scope.popper.destroy();
5880
- $scope.popper = null;
5881
- });
5882
-
5883
-
5884
5769
  // ------------------- On focus -------------------
5885
5770
  $scope.onFocus = function () {
5886
5771
  if ($scope.showDropdown && $scope.results.length == 0) {
@@ -5903,22 +5788,12 @@ angular.module('niceElements')
5903
5788
  // ------------------- On focus -------------------
5904
5789
  $scope.open = function () {
5905
5790
  $scope.isOpen = true;
5906
- $timeout(function () {
5907
- if ($scope.popper) $scope.popper.update();
5908
- });
5909
5791
  };
5910
5792
 
5911
5793
 
5912
5794
  // ------------------- On blur -------------------
5913
5795
  $scope.close = function () {
5914
5796
  $scope.isOpen = false;
5915
-
5916
- // const input = $element[0].getElementsByTagName('input')[0];
5917
- // if (input) input.blur();
5918
-
5919
- $timeout(function () {
5920
- if ($scope.popper) $scope.popper.update();
5921
- });
5922
5797
  };
5923
5798
 
5924
5799
 
@@ -5994,7 +5869,10 @@ angular.module('niceElements')
5994
5869
  // ------------------------ Select item ------------------------
5995
5870
  $scope.selectItem = function (item) {
5996
5871
  if ($scope.onSelect) {
5997
- $scope.onSelect(item);
5872
+ // Supports on-select="fn(model)" (expression) and on-select="fn" (function reference):
5873
+ // the expression form is evaluated directly, the reference form returns the function to call.
5874
+ const result = $scope.onSelect({ model: item });
5875
+ if (angular.isFunction(result)) result(item);
5998
5876
  $scope.clear();
5999
5877
  $scope.close();
6000
5878
  }
@@ -7104,24 +6982,27 @@ angular.module('niceElements')
7104
6982
  * @name niceElements.directive:niceTooltip
7105
6983
  * @description
7106
6984
  * # niceTooltip
6985
+ * Positioned with NiceService.anchor() (native popover + CSS anchor positioning, Popper fallback).
7107
6986
  */
7108
6987
  angular.module('niceElements')
7109
6988
  .directive('niceTooltip', function () {
7110
6989
  return {
7111
6990
  restrict: 'A',
7112
- controller: function ($scope, $element, $attrs, $injector) {
6991
+ controller: function ($scope, $element, $attrs, $injector, NiceService) {
7113
6992
  const id = Math.random().toString(36).substring(7);
7114
6993
  const showEvents = ['mouseenter', 'focus'];
7115
6994
  const hideEvents = ['mouseleave', 'blur'];
7116
- const placement = $attrs.niceTooltipPlacement || "top";
6995
+ // "auto" variants → top variants (flips when there is no space)
6996
+ const placement = ($attrs.niceTooltipPlacement || 'top').replace(/^auto/, 'top');
7117
6997
 
7118
- // Create popper window
7119
- $element.addClass("nice-tooltip");
6998
+ // Create tooltip window
6999
+ $element.addClass('nice-tooltip');
7120
7000
  const tooltipWindow = document.createElement('div');
7121
7001
  tooltipWindow.className = 'nice-tooltip-window';
7122
7002
  tooltipWindow.id = 'nice-tooltip-window-' + id;
7003
+ tooltipWindow.setAttribute('role', 'tooltip');
7123
7004
 
7124
- // Popper body. The attribute's {{ }} is interpolated by Angular, but the
7005
+ // Tooltip body. The attribute's {{ }} is interpolated by Angular, but the
7125
7006
  // resulting text is never compiled, so user data can't run as a template.
7126
7007
  // Safe HTML is kept when the app loads ngSanitize; otherwise it's plain text.
7127
7008
  const content = document.createElement('div');
@@ -7135,44 +7016,28 @@ angular.module('niceElements')
7135
7016
  else content.textContent = value;
7136
7017
  });
7137
7018
 
7138
- // Popper arrow
7019
+ // Arrow
7139
7020
  const tooltipWindowArrow = document.createElement('div');
7140
7021
  tooltipWindowArrow.className = 'nice-tooltip-window-arrow';
7141
- tooltipWindowArrow.setAttribute("data-popper-arrow", "");
7142
7022
  tooltipWindow.append(tooltipWindowArrow);
7143
7023
 
7144
7024
  // Add to body
7145
7025
  document.body.append(tooltipWindow);
7146
7026
 
7147
- // Setup popper
7148
- const popper = Popper.createPopper($element[0], tooltipWindow, {
7027
+ const anchored = NiceService.anchor($element[0], tooltipWindow, {
7149
7028
  placement: placement,
7150
- strategy: 'fixed',
7151
- modifiers: [
7152
- {
7153
- name: 'offset',
7154
- options: {
7155
- offset: [0, 8],
7156
- },
7157
- },
7158
- {
7159
- name: 'arrow',
7160
- options: {
7161
- element: tooltipWindowArrow,
7162
- padding: 3
7163
- },
7164
- },
7165
- ],
7029
+ offset: 8,
7030
+ arrow: tooltipWindowArrow,
7031
+ onEscape: hide
7166
7032
  });
7167
7033
 
7168
7034
  function show() {
7169
7035
  if ($attrs.niceTooltipDisabled == true || $attrs.niceTooltipDisabled == "true") return;
7170
- tooltipWindow.setAttribute('data-show', '');
7171
- popper.update();
7036
+ anchored.open();
7172
7037
  }
7173
7038
 
7174
7039
  function hide() {
7175
- tooltipWindow.removeAttribute('data-show');
7040
+ anchored.close();
7176
7041
  }
7177
7042
 
7178
7043
  showEvents.forEach((event) => {
@@ -7185,8 +7050,8 @@ angular.module('niceElements')
7185
7050
 
7186
7051
  // On destroy
7187
7052
  $scope.$on('$destroy', function () {
7053
+ anchored.destroy();
7188
7054
  tooltipWindow.remove();
7189
- if (popper) popper.destroy();
7190
7055
  });
7191
7056
  }
7192
7057
  };
@@ -7202,9 +7067,147 @@ angular.module('niceElements')
7202
7067
  */
7203
7068
  angular.module('niceElements')
7204
7069
  .service('NiceService', function ($rootScope) {
7070
+ // Can `el` scroll further in the wheel's direction?
7071
+ function canScroll(el, deltaY) {
7072
+ if (!/(auto|scroll)/.test(getComputedStyle(el).overflowY)) return false;
7073
+ if (deltaY > 0) return el.scrollTop + el.clientHeight < el.scrollHeight;
7074
+ return el.scrollTop > 0;
7075
+ }
7076
+
7077
+ // Nearest scrollable ancestor of `el` (null when only the page itself scrolls)
7078
+ function scrollParent(el) {
7079
+ for (el = el.parentElement; el && el !== document.body; el = el.parentElement) {
7080
+ if (/(auto|scroll)/.test(getComputedStyle(el).overflowY) && el.scrollHeight > el.clientHeight) return el;
7081
+ }
7082
+ return null;
7083
+ }
7084
+
7085
+ // Turns show/hide of NiceService.anchor() into open/close that, while open:
7086
+ // - listen for Escape (options.onEscape decides what happens)
7087
+ // - let the mouse wheel over the content scroll the page behind it
7088
+ // - clip the content where the target scrolled out of its scroll container
7089
+ function withEvents(target, content, options, mode) {
7090
+ function onKeydown(event) {
7091
+ if (event.key === 'Escape' && options.onEscape) options.onEscape(event);
7092
+ }
7093
+
7094
+ // The content is position: fixed, so the browser only passes the wheel on to the
7095
+ // window, never to the scroll container the target is in. Do that ourselves.
7096
+ function onWheel(event) {
7097
+ // Scrollable parts of the content (e.g. a long list) scroll themselves first
7098
+ for (let el = event.target; el && el !== content.parentElement; el = el.parentElement) {
7099
+ if (canScroll(el, event.deltaY)) return;
7100
+ }
7101
+ const scroller = scrollParent(target);
7102
+ if (!scroller) return; // the window scrolls by itself
7103
+ const lineHeight = event.deltaMode === 1 ? 16 : 1; // Firefox can report lines
7104
+ scroller.scrollBy(event.deltaX * lineHeight, event.deltaY * lineHeight);
7105
+ }
7106
+
7107
+ // The content is in the top layer, so the target's scroll container doesn't clip it.
7108
+ // When the target scrolls out of that container (e.g. under the nice-view header),
7109
+ // cut the content off at the container's edge on that side, so it slides under the
7110
+ // header like normal content. Other sides stay open, so it can still stick out of
7111
+ // a small scroll box or modal.
7112
+ //
7113
+ // The browser moves anchored content one frame after a scroll, so its position
7114
+ // can't be read while scrolling. It moves together with the target though, so we
7115
+ // measure its offset from the target once it has settled and add that to the
7116
+ // target's (always current) position.
7117
+ let offset = null;
7118
+ function measure() {
7119
+ const t = target.getBoundingClientRect();
7120
+ const c = content.getBoundingClientRect();
7121
+ offset = { top: c.top - t.top, left: c.left - t.left };
7122
+ }
7123
+
7124
+ function clip() {
7125
+ const scroller = scrollParent(target);
7126
+ if (!scroller || !offset) {
7127
+ content.style.clipPath = '';
7128
+ return;
7129
+ }
7130
+
7131
+ const box = scroller.getBoundingClientRect();
7132
+ const t = target.getBoundingClientRect();
7133
+ // Where the content is now: target position + measured offset
7134
+ const c = {
7135
+ top: t.top + offset.top,
7136
+ left: t.left + offset.left,
7137
+ bottom: t.top + offset.top + content.offsetHeight,
7138
+ right: t.left + offset.left + content.offsetWidth
7139
+ };
7140
+ const open = -9999; // negative inset = no clipping (keeps arrow and shadow)
7141
+ const top = t.top < box.top ? box.top - c.top : open;
7142
+ const right = t.right > box.right ? c.right - box.right : open;
7143
+ const bottom = t.bottom > box.bottom ? c.bottom - box.bottom : open;
7144
+ const left = t.left < box.left ? box.left - c.left : open;
7145
+
7146
+ if (top == open && right == open && bottom == open && left == open) content.style.clipPath = '';
7147
+ else content.style.clipPath = 'inset(' + top + 'px ' + right + 'px ' + bottom + 'px ' + left + 'px)';
7148
+ }
7149
+
7150
+ // Measure again once things settled (two frames: the browser is one frame behind),
7151
+ // e.g. after opening, a resize, or when scrolling stopped (it may have flipped)
7152
+ let settleTimer = null;
7153
+ function measureLater(delay) {
7154
+ clearTimeout(settleTimer);
7155
+ settleTimer = setTimeout(function () {
7156
+ requestAnimationFrame(function () {
7157
+ requestAnimationFrame(function () {
7158
+ measure();
7159
+ clip();
7160
+ });
7161
+ });
7162
+ }, delay);
7163
+ }
7164
+
7165
+ function onScroll() {
7166
+ clip();
7167
+ measureLater(100);
7168
+ }
7169
+
7170
+ function removeListeners() {
7171
+ document.removeEventListener('keydown', onKeydown);
7172
+ content.removeEventListener('wheel', onWheel);
7173
+ document.removeEventListener('scroll', onScroll, true); // true: scroll of any element
7174
+ window.removeEventListener('resize', onScroll);
7175
+ clearTimeout(settleTimer);
7176
+ }
7177
+
7178
+ function close() {
7179
+ mode.hide();
7180
+ removeListeners();
7181
+ content.style.clipPath = '';
7182
+ }
7183
+
7184
+ return {
7185
+ open: function () {
7186
+ mode.show();
7187
+ // remove first, so opening twice doesn't add them twice
7188
+ removeListeners();
7189
+ document.addEventListener('keydown', onKeydown);
7190
+ content.addEventListener('wheel', onWheel, { passive: true });
7191
+ document.addEventListener('scroll', onScroll, { capture: true, passive: true });
7192
+ window.addEventListener('resize', onScroll);
7193
+ offset = null;
7194
+ measureLater(0);
7195
+ },
7196
+ close: close,
7197
+ update: function () {
7198
+ mode.update();
7199
+ measureLater(0);
7200
+ },
7201
+ destroy: function () {
7202
+ close();
7203
+ mode.destroy();
7204
+ }
7205
+ };
7206
+ }
7207
+
7205
7208
  const service = {
7206
7209
  name: "Nice elements",
7207
- version: "1.15.1",
7210
+ version: "1.16.1",
7208
7211
  getHeader: function () {
7209
7212
  return {};
7210
7213
  },
@@ -7226,6 +7229,103 @@ angular.module('niceElements')
7226
7229
  $scope[name] = service.isOn(value);
7227
7230
  });
7228
7231
  },
7232
+ // Can the browser position popovers natively (popover API + CSS anchor positioning)?
7233
+ supportsAnchor: function () {
7234
+ return !!(window.CSS && CSS.supports('anchor-name', '--a') && ('popover' in HTMLElement.prototype));
7235
+ },
7236
+ // Position `content` next to `target` (used by nice-popup and nice-tooltip).
7237
+ // Native: content becomes a manual popover (top layer) positioned with CSS anchor
7238
+ // positioning, see src/styles/_nice-anchored.scss. Fallback: Popper.js.
7239
+ // options: placement ("bottom-start", "auto", ...), offset (px gap), skidding (px shift
7240
+ // along the target), sameWidth (content as wide as target), arrow (element inside content),
7241
+ // onEscape (called when Escape is pressed while open; the owner closes it).
7242
+ // While open, the mouse wheel over the content scrolls the page behind it.
7243
+ // Returns { open(), close(), update(), destroy() }
7244
+ anchor: function (target, content, options) {
7245
+ options = options || {};
7246
+ const placement = options.placement || 'bottom';
7247
+ const offset = options.offset || 0;
7248
+ const skidding = options.skidding || 0;
7249
+
7250
+ if (service.supportsAnchor()) {
7251
+ // "auto" → bottom, CSS flips it when there is no space
7252
+ const native = placement.replace(/^auto/, 'bottom');
7253
+ const side = native.split('-')[0];
7254
+ const align = native.split('-')[1];
7255
+ const vertical = side == 'top' || side == 'bottom';
7256
+
7257
+ // position-area: side + alignment (start/end = align with the target's start/end edge)
7258
+ let area = side;
7259
+ if (align == 'start') area += vertical ? ' span-right' : ' span-bottom';
7260
+ if (align == 'end') area += vertical ? ' span-left' : ' span-top';
7261
+
7262
+ // Unique anchor names: one for the target, one for the content (the arrow uses both)
7263
+ const name = '--nice-anchor-' + Math.random().toString(36).substring(7);
7264
+ target.style.anchorName = name;
7265
+ content.setAttribute('popover', 'manual');
7266
+ content.classList.add('nice-anchored', 'nice-anchored--' + side);
7267
+ if (options.sameWidth) content.classList.add('nice-anchored--same-width');
7268
+ content.style.positionAnchor = name;
7269
+ content.style.positionArea = area;
7270
+ content.style.anchorName = name + '-content';
7271
+ content.style.setProperty('--nice-anchored', name + '-content');
7272
+ content.style.setProperty('--nice-anchored-offset', offset + 'px');
7273
+ // Skidding is a translate. Only set when used: translate makes the content the
7274
+ // containing block of the fixed arrow, so the arrow can't use anchor() any more.
7275
+ if (skidding) content.style.translate = vertical ? skidding + 'px 0' : '0 ' + skidding + 'px';
7276
+ if (options.arrow) options.arrow.classList.add('nice-anchored-arrow');
7277
+
7278
+ const isOpen = function () { return content.matches(':popover-open'); };
7279
+ return withEvents(target, content, options, {
7280
+ show: function () { if (!isOpen() && content.isConnected) content.showPopover(); },
7281
+ hide: function () { if (isOpen()) content.hidePopover(); },
7282
+ update: function () { }, // the browser keeps it positioned
7283
+ destroy: function () { }
7284
+ });
7285
+ }
7286
+
7287
+ // Fallback: Popper.js (content is shown with the [data-show] attribute)
7288
+ // https://popper.js.org/docs/v2/constructors/
7289
+ content.classList.add('nice-anchored-fallback');
7290
+ if (options.arrow) {
7291
+ options.arrow.classList.add('nice-anchored-arrow');
7292
+ options.arrow.setAttribute('data-popper-arrow', '');
7293
+ }
7294
+
7295
+ const modifiers = [
7296
+ { name: 'offset', options: { offset: [skidding, offset] } },
7297
+ { name: 'arrow', options: { padding: 5 } }
7298
+ ];
7299
+ if (options.sameWidth) {
7300
+ modifiers.push({
7301
+ name: 'sameWidth',
7302
+ enabled: true,
7303
+ phase: 'beforeWrite',
7304
+ requires: ['computeStyles'],
7305
+ fn: function (e) {
7306
+ e.state.styles.popper.width = e.state.rects.reference.width + 'px';
7307
+ }
7308
+ });
7309
+ }
7310
+
7311
+ const popper = Popper.createPopper(target, content, {
7312
+ placement: placement,
7313
+ strategy: options.strategy || 'fixed',
7314
+ modifiers: modifiers
7315
+ });
7316
+
7317
+ return withEvents(target, content, options, {
7318
+ show: function () {
7319
+ content.setAttribute('data-show', '');
7320
+ popper.update();
7321
+ },
7322
+ hide: function () {
7323
+ content.removeAttribute('data-show');
7324
+ },
7325
+ update: function () { popper.update(); },
7326
+ destroy: function () { popper.destroy(); }
7327
+ });
7328
+ },
7229
7329
  // Check if value is a Decimal.js object (also Decimal.clone() instances)
7230
7330
  isDecimal: function (value) {
7231
7331
  return typeof Decimal !== 'undefined' && Decimal.isDecimal(value);
@@ -7397,17 +7497,17 @@ angular.module('niceElements').run(['$templateCache', function($templateCache) {
7397
7497
  "\n" +
7398
7498
  " \n" +
7399
7499
  " <button title=\"{{ 'Previous month' | translate:'Nice' }}\" type=\"button\" class=\"btn\" ng-click=\"previous()\" ng-disabled=\"isDisabled\">\n" +
7400
- " <i class=\"fa fa-angle-left\"></i>\n" +
7500
+ " <nice-icon icon=\"icon-chevron-left\"></nice-icon>\n" +
7401
7501
  " </button>\n" +
7402
7502
  "\n" +
7403
7503
  " \n" +
7404
7504
  " <button title=\"{{ 'Today' | translate:'Nice' }}\" type=\"button\" class=\"btn\" ng-click=\"today()\" ng-disabled=\"isDisabled\">\n" +
7405
- " <nice-icon icon=\"icon-circle\"></nice-icon>\n" +
7505
+ " <nice-icon icon=\"icon-dot\"></nice-icon>\n" +
7406
7506
  " </button>\n" +
7407
7507
  "\n" +
7408
7508
  " \n" +
7409
7509
  " <button title=\"{{ 'Next month' | translate:'Nice' }}\" type=\"button\" class=\"btn\" ng-click=\"next()\" ng-disabled=\"isDisabled\">\n" +
7410
- " <i class=\"fa fa-angle-right\"></i>\n" +
7510
+ " <nice-icon icon=\"icon-chevron-right\"></nice-icon>\n" +
7411
7511
  " </button>\n" +
7412
7512
  " </div>\n" +
7413
7513
  "\n" +
@@ -7456,7 +7556,6 @@ angular.module('niceElements').run(['$templateCache', function($templateCache) {
7456
7556
  " </div>\n" +
7457
7557
  "\n" +
7458
7558
  " <div class=\"time-picker-icon\">\n" +
7459
- " \n" +
7460
7559
  " <nice-icon icon=\"icon-clock\"></nice-icon>\n" +
7461
7560
  " </div>\n" +
7462
7561
  "\n" +
@@ -7634,103 +7733,108 @@ angular.module('niceElements').run(['$templateCache', function($templateCache) {
7634
7733
  );
7635
7734
 
7636
7735
 
7736
+ $templateCache.put('src/components/nice-date/nice-date-picker.html',
7737
+ "\n" +
7738
+ "<div class=\"nice-date-date\" ng-if=\"date\" role=\"grid\">\n" +
7739
+ " <div class=\"nice-date-header\">\n" +
7740
+ " <span>\n" +
7741
+ " <select class=\"year-picker\" ng-model=\"innerDate.year\" ng-change=\"handleDateChange()\" ng-options=\"year for year in years\" ng-disabled=\"isDisabled\"></select>\n" +
7742
+ " <span class=\"nice-date-header-comma\">,</span>\n" +
7743
+ " <select class=\"month-picker\" ng-model=\"innerDate.month\" ng-change=\"handleDateChange()\" ng-options=\"month.value as month.name for month in months\" ng-disabled=\"isDisabled\"></select>\n" +
7744
+ " </span>\n" +
7745
+ " <button type=\"button\" class=\"btn btn-default-naked\" ng-disabled=\"isDisabled\" ng-click=\"previous()\" title=\"{{ 'Previous month' | translate:'Nice' }}\">\n" +
7746
+ " <nice-icon icon=\"icon-chevron-left\"></nice-icon>\n" +
7747
+ " </button>\n" +
7748
+ " <button type=\"button\" class=\"btn btn-default-naked\" ng-disabled=\"isDisabled\" ng-click=\"today()\" title=\"{{ 'Today' | translate:'Nice' }}\">\n" +
7749
+ " <nice-icon icon=\"icon-dot\"></nice-icon>\n" +
7750
+ " </button>\n" +
7751
+ " <button type=\"button\" class=\"btn btn-default-naked\" ng-disabled=\"isDisabled\" ng-click=\"next()\" title=\"{{ 'Next month' | translate:'Nice' }}\">\n" +
7752
+ " <nice-icon icon=\"icon-chevron-right\"></nice-icon>\n" +
7753
+ " </button>\n" +
7754
+ " </div>\n" +
7755
+ "\n" +
7756
+ " <div class=\"nice-date-grid nice-date-grid-names\">\n" +
7757
+ " <span class=\"nice-date-day\" ng-class=\"{ 'weekend': $index == 6 || $index == 5 }\" ng-repeat=\"day in weekdays\">{{ day }}</span>\n" +
7758
+ " </div>\n" +
7759
+ "\n" +
7760
+ " <div class=\"nice-date-grid\">\n" +
7761
+ " <button type=\"button\" class=\"nice-date-day\" role=\"gridcell\" title=\"{{ day.text }}\" ng-class=\"{\n" +
7762
+ " 'today': day.isToday,\n" +
7763
+ " 'different-month': !day.isCurrentMonth,\n" +
7764
+ " 'selected': isSameDay(model, day.date),\n" +
7765
+ " 'weekend': day.isWeekday,\n" +
7766
+ " 'disabled': day.isDisabled,\n" +
7767
+ " 'between': isBetween(day.date, model, nextDate)\n" +
7768
+ " }\" ng-click=\"select(day)\" ng-repeat=\"day in days\" ng-disabled=\"isDisabled\">\n" +
7769
+ " <span>{{ day.name }}</span>\n" +
7770
+ " </button>\n" +
7771
+ " </div>\n" +
7772
+ "</div>\n" +
7773
+ "\n" +
7774
+ "\n" +
7775
+ "<div class=\"nice-date-time\" ng-if=\"time\">\n" +
7776
+ " <nice-icon icon=\"icon-clock\"></nice-icon>\n" +
7777
+ "\n" +
7778
+ " <div class=\"time-picker time-picker-hour\">\n" +
7779
+ " <select ng-disabled=\"isDisabled\" ng-model=\"innerDate.hour\" ng-change=\"timeChange()\" ng-options=\"hour as hour for hour in hours track by hour\" ng-disabled=\"isDisabled\"></select>\n" +
7780
+ " </div>\n" +
7781
+ "\n" +
7782
+ " <div class=\"divider\">:</div>\n" +
7783
+ "\n" +
7784
+ " <div class=\"time-picker time-picker-minute\">\n" +
7785
+ " <select ng-disabled=\"isDisabled\" ng-model=\"innerDate.minute\" ng-change=\"timeChange()\" ng-options=\"minute as minute for minute in minutes track by minute\" ng-disabled=\"isDisabled\"></select>\n" +
7786
+ " </div>\n" +
7787
+ "</div>\n"
7788
+ );
7789
+
7790
+
7637
7791
  $templateCache.put('src/components/nice-date/nice-date.html',
7638
7792
  "<div class=\"nice-component nice-date\" ng-form=\"forma\" ng-class=\"{ 'margin-bottom-0': noMargin, 'nice-component-inline': isInline }\">\n" +
7639
- " <div class=\"nice-date-background\" ng-click=\"toggleOpen()\" ng-if=\"isOpen && !inline\"></div>\n" +
7640
- "\n" +
7641
7793
  " <div class=\"row\">\n" +
7642
7794
  " \n" +
7643
7795
  " <nice-title text=\"title || niceTitle\" help=\"help\" required=\"required\" description=\"description\" label-width=\"labelWidth\"></nice-title>\n" +
7644
7796
  "\n" +
7645
7797
  " \n" +
7646
- " <div class=\"nice-field col-xs-12\" ng-class=\"[fieldWidth ? fieldWidth : 'col-sm-8', { 'nice-disabled': isDisabled }]\">\n" +
7798
+ " <div class=\"nice-field col-xs-12\" ng-class=\"[fieldWidth ? fieldWidth : 'col-sm-8', { 'nice-disabled': isDisabled }]\" click-outside=\"close()\">\n" +
7647
7799
  " <div class=\"disabled-shield\" ng-if=\"isDisabled\"></div>\n" +
7648
7800
  "\n" +
7649
7801
  " \n" +
7650
- " <div class=\"nice-date-button input-group\" ng-class=\"{ 'open': isOpen }\" ng-show=\"!inline\" ng-click=\"toggleOpen()\">\n" +
7651
- " <input type=\"text\" class=\"form-control\" ng-model=\"innerDate.value\" placeholder=\"{{ placeholder }}\" ng-required=\"required\" ng-disabled=\"isDisabled\" ng-blur=\"parseTypedDate()\" ng-keydown=\"typedDateKeydown($event)\">\n" +
7652
- " <span class=\"input-group-btn\">\n" +
7653
- " <button type=\"button\" class=\"btn btn-default btn-right\" ng-disabled=\"isDisabled\" ng-if=\"!(model && nullable)\">\n" +
7654
- " <nice-icon icon=\"icon-calendar\"></nice-icon>\n" +
7655
- " </button>\n" +
7656
- " <button type=\"button\" class=\"btn btn-default btn-right\" ng-disabled=\"isDisabled\" ng-if=\"model && nullable\" ng-click=\"clear()\">\n" +
7657
- " <nice-icon icon=\"icon-x\"></nice-icon>\n" +
7658
- " </button>\n" +
7659
- " </span>\n" +
7660
- " </div>\n" +
7661
- "\n" +
7662
- " \n" +
7663
- " <div ng-class=\"{ 'nice-date-dropdown-wrapper': !inline }\">\n" +
7664
- " <div ng-class=\"{ 'nice-date-dropdown': !inline, 'with-time': time, 'no-date': !date }\" ng-if=\"inline || isOpen\">\n" +
7665
- " \n" +
7666
- " <div class=\"nice-date-date\" ng-if=\"date\" role=\"grid\">\n" +
7667
- " <div class=\"nice-date-header\">\n" +
7668
- " <span>\n" +
7669
- " <select class=\"year-picker\" ng-model=\"innerDate.year\" ng-change=\"handleDateChange()\" ng-options=\"year for year in years\" ng-disabled=\"isDisabled\"></select>\n" +
7670
- " <span class=\"nice-date-header-comma\">,</span>\n" +
7671
- " <select class=\"month-picker\" ng-model=\"innerDate.month\" ng-change=\"handleDateChange()\" ng-options=\"month.value as month.name for month in months\" ng-disabled=\"isDisabled\"></select>\n" +
7672
- " </span>\n" +
7673
- " <button type=\"button\" class=\"btn btn-default-naked\" ng-disabled=\"isDisabled\" ng-click=\"previous()\" title=\"{{ 'Previous month' | translate:'Nice' }}\">\n" +
7674
- " <nice-icon icon=\"icon-chevron-left\"></nice-icon>\n" +
7675
- " </button>\n" +
7676
- " <button type=\"button\" class=\"btn btn-default-naked\" ng-disabled=\"isDisabled\" ng-click=\"today()\" title=\"{{ 'Today' | translate:'Nice' }}\">\n" +
7677
- " <nice-icon icon=\"icon-circle\"></nice-icon>\n" +
7678
- " </button>\n" +
7679
- " <button type=\"button\" class=\"btn btn-default-naked\" ng-disabled=\"isDisabled\" ng-click=\"next()\" title=\"{{ 'Next month' | translate:'Nice' }}\">\n" +
7680
- " <nice-icon icon=\"icon-chevron-right\"></nice-icon>\n" +
7802
+ " <nice-popup ng-show=\"!inline\" trigger=\"manual\" is-open=\"isOpen\" placement=\"{{ placement }}\">\n" +
7803
+ " <nice-popup-target>\n" +
7804
+ " <div class=\"nice-date-button input-group\" ng-class=\"{ 'open': isOpen }\" ng-click=\"toggleOpen()\">\n" +
7805
+ " <input type=\"text\" class=\"form-control\" ng-model=\"innerDate.value\" placeholder=\"{{ placeholder }}\" ng-required=\"required\" ng-disabled=\"isDisabled\" ng-blur=\"parseTypedDate()\" ng-keydown=\"typedDateKeydown($event)\">\n" +
7806
+ " <span class=\"input-group-btn\">\n" +
7807
+ " <button type=\"button\" class=\"btn btn-default btn-right\" ng-disabled=\"isDisabled\" ng-if=\"!(model && nullable)\">\n" +
7808
+ " <nice-icon icon=\"icon-calendar\"></nice-icon>\n" +
7681
7809
  " </button>\n" +
7682
- " </div>\n" +
7683
- "\n" +
7684
- " <div class=\"nice-date-grid nice-date-grid-names\">\n" +
7685
- " <span class=\"nice-date-day\" ng-class=\"{ 'weekend': $index == 6 || $index == 5 }\" ng-repeat=\"day in weekdays\">{{ day }}</span>\n" +
7686
- " </div>\n" +
7687
- "\n" +
7688
- " <div class=\"nice-date-grid\">\n" +
7689
- " <button type=\"button\" class=\"nice-date-day\" role=\"gridcell\" title=\"{{ day.text }}\" ng-class=\"{\n" +
7690
- " 'today': day.isToday,\n" +
7691
- " 'different-month': !day.isCurrentMonth,\n" +
7692
- " 'selected': isSameDay(model, day.date),\n" +
7693
- " 'weekend': day.isWeekday,\n" +
7694
- " 'disabled': day.isDisabled,\n" +
7695
- " 'between': isBetween(day.date, model, nextDate)\n" +
7696
- " }\" ng-click=\"select(day)\" ng-repeat=\"day in days\" ng-disabled=\"isDisabled\">\n" +
7697
- " <span>{{ day.name }}</span>\n" +
7810
+ " <button type=\"button\" class=\"btn btn-default btn-right\" ng-disabled=\"isDisabled\" ng-if=\"model && nullable\" ng-click=\"clear()\">\n" +
7811
+ " <nice-icon icon=\"icon-x\"></nice-icon>\n" +
7698
7812
  " </button>\n" +
7699
- " </div>\n" +
7813
+ " </span>\n" +
7700
7814
  " </div>\n" +
7815
+ " </nice-popup-target>\n" +
7701
7816
  "\n" +
7702
- " \n" +
7703
- " <div class=\"nice-date-time\" ng-if=\"time\">\n" +
7704
- " <nice-icon icon=\"icon-clock\"></nice-icon>\n" +
7705
- "\n" +
7706
- " <div class=\"time-picker time-picker-hour\">\n" +
7707
- " <select ng-disabled=\"isDisabled\" ng-model=\"innerDate.hour\" ng-change=\"timeChange()\" ng-options=\"hour as hour for hour in hours track by hour\" ng-disabled=\"isDisabled\"></select>\n" +
7708
- " </div>\n" +
7709
- "\n" +
7710
- " <div class=\"divider\">:</div>\n" +
7817
+ " <nice-popup-content>\n" +
7818
+ " <div class=\"nice-date-dropdown\" ng-class=\"{ 'with-time': time, 'no-date': !date }\" ng-include=\"'src/components/nice-date/nice-date-picker.html'\"></div>\n" +
7819
+ " </nice-popup-content>\n" +
7820
+ " </nice-popup>\n" +
7711
7821
  "\n" +
7712
- " <div class=\"time-picker time-picker-minute\">\n" +
7713
- " <select ng-disabled=\"isDisabled\" ng-model=\"innerDate.minute\" ng-change=\"timeChange()\" ng-options=\"minute as minute for minute in minutes track by minute\" ng-disabled=\"isDisabled\"></select>\n" +
7714
- " </div>\n" +
7715
- " </div>\n" +
7716
- " </div>\n" +
7717
- " </div>\n" +
7822
+ " \n" +
7823
+ " <div ng-if=\"inline\" ng-class=\"{ 'with-time': time, 'no-date': !date }\" ng-include=\"'src/components/nice-date/nice-date-picker.html'\"></div>\n" +
7718
7824
  " </div>\n" +
7719
7825
  " </div>\n" +
7720
- "</div>"
7826
+ "</div>\n"
7721
7827
  );
7722
7828
 
7723
7829
 
7724
7830
  $templateCache.put('src/components/nice-datetime-picker/nice-datetime-picker.html',
7725
7831
  "<div class=\"nice-component nice-datetime-picker\" name=\"form\" ng-class=\"{ 'margin-bottom-0': noMargin, 'nice-component-inline': isInline }\">\n" +
7726
- " <div class=\"nice-dtp-background\" ng-click=\"closeDtp(true)\" ng-if=\"isOpen\"></div>\n" +
7727
- "\n" +
7728
7832
  " <div class=\"row\">\n" +
7729
7833
  " \n" +
7730
7834
  " <nice-title text=\"title || niceTitle\" help=\"help\" required=\"required\" description=\"description\" label-width=\"labelWidth\"></nice-title>\n" +
7731
7835
  "\n" +
7732
7836
  " \n" +
7733
- " <div class=\"nice-field col-xs-12\" ng-class=\"[fieldWidth ? fieldWidth : 'col-sm-8', { 'nice-disabled': isDisabled }]\">\n" +
7837
+ " <div class=\"nice-field col-xs-12\" ng-class=\"[fieldWidth ? fieldWidth : 'col-sm-8', { 'nice-disabled': isDisabled }]\" click-outside=\"closeDtp(true)\" is-open=\"{{ isOpen }}\">\n" +
7734
7838
  " \n" +
7735
7839
  " <div ng-form=\"formDatetimePicker\"></div>\n" +
7736
7840
  "\n" +
@@ -7738,7 +7842,6 @@ angular.module('niceElements').run(['$templateCache', function($templateCache) {
7738
7842
  " <input type=\"text\" class=\"form-control\" value=\"{{ value }}\" ng-click=\"openDtp()\" ng-disabled=\"isDisabled\">\n" +
7739
7843
  " <span class=\"input-group-btn\">\n" +
7740
7844
  " <button type=\"button\" class=\"btn btn-default\" ng-click=\"openDtp()\">\n" +
7741
- " \n" +
7742
7845
  " <nice-icon ng-if=\"isTrue(date)\" icon=\"icon-calendar\"></nice-icon>\n" +
7743
7846
  " <nice-icon ng-if=\"!isTrue(date)\" icon=\"icon-clock\"></nice-icon>\n" +
7744
7847
  " </button>\n" +
@@ -7760,47 +7863,49 @@ angular.module('niceElements').run(['$templateCache', function($templateCache) {
7760
7863
 
7761
7864
  $templateCache.put('src/components/nice-datetimerange-picker-2/nice-datetimerange-picker-2.html',
7762
7865
  "<div class=\"nice-component nice-datetimerange-picker-2\" ng-form=\"formDateRangePicker\" ng-class=\"{ 'margin-bottom-0': noMargin, 'nice-component-inline': isInline }\">\n" +
7763
- " <div class=\"nice-dtp-background\" ng-click=\"close()\" ng-if=\"isOpen\"></div>\n" +
7764
- "\n" +
7765
7866
  " <div class=\"row\">\n" +
7766
7867
  " \n" +
7767
7868
  " <nice-title text=\"title || niceTitle\" help=\"help\" required=\"required\" description=\"description\" label-width=\"labelWidth\"></nice-title>\n" +
7768
7869
  "\n" +
7769
7870
  " \n" +
7770
- " <div class=\"nice-field col-xs-12\" ng-class=\"[fieldWidth ? fieldWidth : 'col-sm-8', { 'nice-disabled': isDisabled }]\">\n" +
7771
- " <div class=\"nice-daterange-picker-button input-group\" ng-class=\"{ 'open': isOpen }\" ng-click=\"open()\">\n" +
7772
- " <input type=\"text\" class=\"form-control\" value=\"{{ modelFormat }}\" readonly=\"readonly\" ng-disabled=\"isDisabled\">\n" +
7773
- " \n" +
7774
- " <button type=\"button\" class=\"btn input-group-addon\" ng-disabled=\"isDisabled\">\n" +
7775
- " <nice-icon icon=\"icon-calendar\"></nice-icon>\n" +
7776
- " </button>\n" +
7777
- " </div>\n" +
7871
+ " <div class=\"nice-field col-xs-12\" ng-class=\"[fieldWidth ? fieldWidth : 'col-sm-8', { 'nice-disabled': isDisabled }]\" click-outside=\"isOpen && close()\">\n" +
7872
+ " <nice-popup trigger=\"manual\" is-open=\"isOpen\" placement=\"{{ placement }}\" on-change=\"isOpen || close()\">\n" +
7873
+ " <nice-popup-target>\n" +
7874
+ " <div class=\"nice-daterange-picker-button input-group\" ng-class=\"{ 'open': isOpen }\" ng-click=\"open()\">\n" +
7875
+ " <input type=\"text\" class=\"form-control\" value=\"{{ modelFormat }}\" readonly=\"readonly\" ng-disabled=\"isDisabled\">\n" +
7876
+ " \n" +
7877
+ " <button type=\"button\" class=\"btn input-group-addon\" ng-disabled=\"isDisabled\">\n" +
7878
+ " <nice-icon icon=\"icon-calendar\"></nice-icon>\n" +
7879
+ " </button>\n" +
7880
+ " </div>\n" +
7881
+ " </nice-popup-target>\n" +
7882
+ "\n" +
7883
+ " <nice-popup-content>\n" +
7884
+ " <div class=\"dtp-wrapper\">\n" +
7885
+ " <div class=\"dtp-buttons-left\">\n" +
7886
+ " <div class=\"dtp-buttons-top\">\n" +
7887
+ " <a class=\"btn btn-primary btn-block\" ng-click=\"selectToday()\" translate translate-context=\"Nice\">Last 24 hours</a>\n" +
7888
+ " <a class=\"btn btn-primary btn-block\" ng-click=\"selectLastNDays(7)\" translate translate-context=\"Nice\">Last 7 days</a>\n" +
7889
+ " <a class=\"btn btn-primary btn-block\" ng-click=\"selectLastMonth()\" translate translate-context=\"Nice\">Last month</a>\n" +
7890
+ " <a class=\"btn btn-primary btn-block\" ng-click=\"selectThisMonth()\" translate translate-context=\"Nice\">This month</a>\n" +
7891
+ " </div>\n" +
7778
7892
  "\n" +
7779
- " <div class=\"nice-daterange-picker-wrapper\">\n" +
7780
- " <div class=\"dtp-wrapper\" ng-if=\"isOpen\">\n" +
7781
- " <div class=\"dtp-buttons-left\">\n" +
7782
- " <div class=\"dtp-buttons-top\">\n" +
7783
- " <a class=\"btn btn-primary btn-block\" ng-click=\"selectToday()\" translate translate-context=\"Nice\">Last 24 hours</a>\n" +
7784
- " <a class=\"btn btn-primary btn-block\" ng-click=\"selectLastNDays(7)\" translate translate-context=\"Nice\">Last 7 days</a>\n" +
7785
- " <a class=\"btn btn-primary btn-block\" ng-click=\"selectLastMonth()\" translate translate-context=\"Nice\">Last month</a>\n" +
7786
- " <a class=\"btn btn-primary btn-block\" ng-click=\"selectThisMonth()\" translate translate-context=\"Nice\">This month</a>\n" +
7893
+ " <div class=\"dtp-buttons-bottom\">\n" +
7894
+ " <a class=\"btn btn-danger btn-block\" ng-click=\"close()\" translate translate-context=\"Nice\">Cancel</a>\n" +
7895
+ " <a class=\"btn btn-success btn-block\" ng-click=\"confirm()\" translate translate-context=\"Nice\">OK</a>\n" +
7896
+ " </div>\n" +
7787
7897
  " </div>\n" +
7788
7898
  "\n" +
7789
- " <div class=\"dtp-buttons-bottom\">\n" +
7790
- " <a class=\"btn btn-danger btn-block\" ng-click=\"close()\" translate translate-context=\"Nice\">Cancel</a>\n" +
7791
- " <a class=\"btn btn-success btn-block\" ng-click=\"confirm()\" translate translate-context=\"Nice\">OK</a>\n" +
7899
+ " <div class=\"dtp-left\">\n" +
7900
+ " <nice-date model=\"model.innerStartDate\" next-date=\"model.innerEndDate\" is-inline=\"true\" no-margin=\"true\" inline=\"true\" time=\"time\" min-date=\"minDate\" max-date=\"maxDate\" on-change=\"dateChanged(model)\"></nice-date>\n" +
7792
7901
  " </div>\n" +
7793
- " </div>\n" +
7794
7902
  "\n" +
7795
- " <div class=\"dtp-left\">\n" +
7796
- " <nice-date model=\"model.innerStartDate\" next-date=\"model.innerEndDate\" is-inline=\"true\" no-margin=\"true\" inline=\"true\" time=\"time\" min-date=\"minDate\" max-date=\"maxDate\" on-change=\"dateChanged(model)\"></nice-date>\n" +
7797
- " </div>\n" +
7798
- "\n" +
7799
- " <div class=\"dtp-right\">\n" +
7800
- " <nice-date model=\"model.innerEndDate\" next-date=\"model.innerStartDate\" is-inline=\"true\" no-margin=\"true\" inline=\"true\" time=\"time\" min-date=\"minDate\" max-date=\"maxDate\" on-change=\"dateChanged(model)\"></nice-date>\n" +
7903
+ " <div class=\"dtp-right\">\n" +
7904
+ " <nice-date model=\"model.innerEndDate\" next-date=\"model.innerStartDate\" is-inline=\"true\" no-margin=\"true\" inline=\"true\" time=\"time\" min-date=\"minDate\" max-date=\"maxDate\" on-change=\"dateChanged(model)\"></nice-date>\n" +
7905
+ " </div>\n" +
7801
7906
  " </div>\n" +
7802
- " </div>\n" +
7803
- " </div>\n" +
7907
+ " </nice-popup-content>\n" +
7908
+ " </nice-popup>\n" +
7804
7909
  " </div>\n" +
7805
7910
  " </div>\n" +
7806
7911
  "</div>"
@@ -7809,14 +7914,12 @@ angular.module('niceElements').run(['$templateCache', function($templateCache) {
7809
7914
 
7810
7915
  $templateCache.put('src/components/nice-datetimerange-picker/nice-datetimerange-picker.html',
7811
7916
  "<div class=\"nice-component nice-datetime-picker nice-datetimerange-picker\" name=\"form\" ng-class=\"{ 'margin-bottom-0': noMargin, 'nice-component-inline': isInline }\">\n" +
7812
- " <div class=\"nice-dtp-background\" ng-click=\"cancelClick()\" ng-if=\"showDtpRange\"></div>\n" +
7813
- "\n" +
7814
7917
  " <div class=\"row\">\n" +
7815
7918
  " \n" +
7816
7919
  " <nice-title text=\"title || niceTitle\" help=\"help\" required=\"required\" description=\"description\" label-width=\"labelWidth\"></nice-title>\n" +
7817
7920
  "\n" +
7818
7921
  " \n" +
7819
- " <div class=\"nice-field col-xs-12\" ng-class=\"[fieldWidth ? fieldWidth : 'col-sm-8', { 'nice-disabled': isDisabled }]\">\n" +
7922
+ " <div class=\"nice-field col-xs-12\" ng-class=\"[fieldWidth ? fieldWidth : 'col-sm-8', { 'nice-disabled': isDisabled }]\" click-outside=\"cancelClick()\" is-open=\"{{ showDtpRange }}\">\n" +
7820
7923
  " \n" +
7821
7924
  " <div ng-form=\"formDatetimeRangePicker\"></div>\n" +
7822
7925
  "\n" +
@@ -7948,7 +8051,7 @@ angular.module('niceElements').run(['$templateCache', function($templateCache) {
7948
8051
  " <ul id=\"{{id}}\" class=\"dropdown-menu\" role=\"menu\">\n" +
7949
8052
  " <li id=\"{{id}}-{{$index}}\" ng-repeat=\"item in internalList\" ng-click=\"clicked(item)\">\n" +
7950
8053
  " <a href>\n" +
7951
- " <span class=\"choice-checkbox\" ng-if=\"multiple\" ng-class=\"{ 'selected' : isItemSelected(item) }\"><i class=\"fa fa-check\"></i></span>\n" +
8054
+ " <span class=\"choice-checkbox\" ng-if=\"multiple\" ng-class=\"{ 'selected' : isItemSelected(item) }\"><nice-icon icon=\"icon-check\"></nice-icon></span>\n" +
7952
8055
  " <span ng-if=\"item.color_hex_code\" class=\"dropdown-color\" ng-style=\"{'background': item.color_hex_code}\"></span>\n" +
7953
8056
  " <span ng-class=\"{'multiple-item': multiple}\">{{ getLabel(item) }}</span>\n" +
7954
8057
  " \n" +
@@ -7979,49 +8082,51 @@ angular.module('niceElements').run(['$templateCache', function($templateCache) {
7979
8082
  " <div class=\"nice-field col-xs-12\" ng-class=\"[ fieldWidth ? fieldWidth : 'col-sm-8', { 'open': isOpen, 'nice-disabled': isDisabled || emptyList } ]\" click-outside=\"close()\" is-open=\"{{ isOpen }}\">\n" +
7980
8083
  " <div class=\"nice-field-wrapper\">\n" +
7981
8084
  " \n" +
7982
- " <button type=\"button\" class=\"btn btn-dropdown\" type=\"button\" ng-ref=\"dropdown-button\" ng-click=\"toggle()\" ng-disabled=\"isDisabled || emptyList\" aria-expanded=\"{{ isOpen }}\" aria-haspopup=\"true\" aria-controls=\"menu\" id=\"nice-dropdown-{{ id }}\">\n" +
7983
- " <input class=\"hidden-input\" ng-model=\"model\" ng-required=\"required\" ng-disabled=\"disabled\" tabindex=\"-1\">\n" +
7984
- " <div class=\"btn-dropdown-inside\" ng-transclude=\"button\" ng-if=\"selected != null\">\n" +
7985
- " <span ng-if=\"!multiple\">{{ selected[objValue] }}</span>\n" +
7986
- " <span ng-if=\"multiple\" class=\"multiple-selected\" ng-class=\"{ 'has-more': selected.length > maxSelectedShown }\">\n" +
7987
- " <span ng-if=\"selected.length > 0\" class=\"multiple-selected-values\"><span ng-repeat=\"item in selected | limitTo: maxSelectedShown\">{{ item[objValue] }}{{ $last ? '' : ', ' }}</span></span>\n" +
7988
- " <span ng-if=\"selected.length > maxSelectedShown\" class=\"multiple-selected-more\">+{{ selected.length - maxSelectedShown }} {{ moreText }}</span>\n" +
7989
- " <span ng-if=\"selected.length == 0\" class=\"not-selected\">{{ nullableText }}</span>\n" +
7990
- " </span>\n" +
7991
- " </div>\n" +
7992
- "\n" +
7993
- " <div class=\"not-selected\" ng-if=\"selected == null\">{{ selectText }}</div>\n" +
7994
- "\n" +
7995
- " <span class=\"caret\" ng-show=\"!loading\"></span>\n" +
7996
- " <nice-loader ng-if=\"loading\"></nice-loader>\n" +
7997
- " </button>\n" +
8085
+ " <nice-popup trigger=\"manual\" is-open=\"isOpen\" placement=\"{{ placement }}\" offset-distance=\"{{ dropdownDistance }}\" same-width=\"true\">\n" +
8086
+ " <nice-popup-target>\n" +
8087
+ " <button type=\"button\" class=\"btn btn-dropdown\" type=\"button\" ng-ref=\"dropdown-button\" ng-click=\"toggle()\" ng-disabled=\"isDisabled || emptyList\" aria-expanded=\"{{ isOpen }}\" aria-haspopup=\"true\" aria-controls=\"menu\" id=\"nice-dropdown-{{ id }}\">\n" +
8088
+ " <input class=\"hidden-input\" ng-model=\"model\" ng-required=\"required\" ng-disabled=\"disabled\" tabindex=\"-1\">\n" +
8089
+ " <div class=\"btn-dropdown-inside\" ng-transclude=\"button\" ng-if=\"selected != null\">\n" +
8090
+ " <span ng-if=\"!multiple\">{{ selected[objValue] }}</span>\n" +
8091
+ " <span ng-if=\"multiple\" class=\"multiple-selected\" ng-class=\"{ 'has-more': selected.length > maxSelectedShown }\">\n" +
8092
+ " <span ng-if=\"selected.length > 0\" class=\"multiple-selected-values\"><span ng-repeat=\"item in selected | limitTo: maxSelectedShown\">{{ item[objValue] }}{{ $last ? '' : ', ' }}</span></span>\n" +
8093
+ " <span ng-if=\"selected.length > maxSelectedShown\" class=\"multiple-selected-more\">+{{ selected.length - maxSelectedShown }} {{ moreText }}</span>\n" +
8094
+ " <span ng-if=\"selected.length == 0\" class=\"not-selected\">{{ nullableText }}</span>\n" +
8095
+ " </span>\n" +
8096
+ " </div>\n" +
7998
8097
  "\n" +
8098
+ " <div class=\"not-selected\" ng-if=\"selected == null\">{{ selectText }}</div>\n" +
7999
8099
  "\n" +
8000
- " \n" +
8001
- " <div class=\"nice-dropdown-menu-wrapper\">\n" +
8002
- " <div class=\"nice-dropdown-menu\" ng-if=\"isOpen\">\n" +
8003
- " <div class=\"search-bar\" ng-if=\"!noSearch && searchFunction\">\n" +
8004
- " <input class=\"search-bar-input\" ng-model=\"internal.search\" ng-model-options=\"{ debounce: 500 }\" ng-change=\"handleSearch()\" placeholder=\"{{ searchText }}\">\n" +
8005
- " <div class=\"count\" ng-if=\"internalList && internalList._metadata && enableLoadMore\">{{ internalList.length }}/{{ internalList._metadata.count }}</div>\n" +
8006
- " <nice-icon ng-if=\"!internal.search\" class=\"icon\" icon=\"icon-search\"></nice-icon>\n" +
8007
- " <nice-icon ng-if=\"internal.search\" class=\"icon\" icon=\"icon-x\" ng-click=\"clearSearch()\"></nice-icon>\n" +
8008
- " </div>\n" +
8009
- " <div class=\"nice-dropdown-actions\" ng-if=\"multiple\">\n" +
8010
- " <button type=\"button\" class=\"btn btn-default btn-sm\" ng-click=\"selectAll()\" translate translate-context=\"Nice\">All</button>\n" +
8011
- " <button type=\"button\" class=\"btn btn-default btn-sm\" ng-click=\"selectNone()\">{{ nullableText }}</button>\n" +
8012
- " </div>\n" +
8013
- " <div class=\"nice-dropdown-items\" aria-labelledby=\"nice-dropdown-{{ id }}\" role=\"listbox\">\n" +
8014
- " <div role=\"none\" type=\"button\" class=\"nice-no-data\" ng-if=\"internalList && internalList.length == 0\">{{ noDataText }}</div>\n" +
8015
- " <button type=\"button\" role=\"option\" class=\"nice-dropdown-item null-item\" ng-if=\"!multiple && nullable && internalList.length != 0\" ng-click=\"handleSelected(null, -1)\" ng-disabled=\"isDisabled\">\n" +
8016
- " {{ nullableText }}\n" +
8017
- " </button>\n" +
8018
- " <button type=\"button\" role=\"option\" class=\"nice-dropdown-item\" ng-repeat=\"item in internalList\" ng-click=\"handleSelected(item, $index)\" ng-class=\"{ 'selected': item._selected }\" ng-disabled=\"isDisabled\">\n" +
8019
- " <div class=\"choice-checkbox\" ng-if=\"multiple\" role=\"menuitemcheckbox\"><i class=\"fa fa-check\"></i></div>\n" +
8020
- " <div class=\"choice-option\" ng-transclude=\"option\" ng-class=\"{ 'multiple-item': multiple }\">{{ item[objValue] }}</div>\n" +
8021
- " </button>\n" +
8100
+ " <span class=\"caret\" ng-show=\"!loading\"></span>\n" +
8101
+ " <nice-loader ng-if=\"loading\"></nice-loader>\n" +
8102
+ " </button>\n" +
8103
+ " </nice-popup-target>\n" +
8104
+ "\n" +
8105
+ " <nice-popup-content>\n" +
8106
+ " <div class=\"nice-dropdown-menu\" ng-if=\"isOpen\">\n" +
8107
+ " <div class=\"search-bar\" ng-if=\"!noSearch && searchFunction\">\n" +
8108
+ " <input class=\"search-bar-input\" ng-model=\"internal.search\" ng-model-options=\"{ debounce: 500 }\" ng-change=\"handleSearch()\" placeholder=\"{{ searchText }}\">\n" +
8109
+ " <div class=\"count\" ng-if=\"internalList && internalList._metadata && enableLoadMore\">{{ internalList.length }}/{{ internalList._metadata.count }}</div>\n" +
8110
+ " <nice-icon ng-if=\"!internal.search\" class=\"icon\" icon=\"icon-search\"></nice-icon>\n" +
8111
+ " <nice-icon ng-if=\"internal.search\" class=\"icon\" icon=\"icon-x\" ng-click=\"clearSearch()\"></nice-icon>\n" +
8112
+ " </div>\n" +
8113
+ " <div class=\"nice-dropdown-actions\" ng-if=\"multiple\">\n" +
8114
+ " <button type=\"button\" class=\"btn btn-default btn-sm\" ng-click=\"selectAll()\" translate translate-context=\"Nice\">All</button>\n" +
8115
+ " <button type=\"button\" class=\"btn btn-default btn-sm\" ng-click=\"selectNone()\">{{ nullableText }}</button>\n" +
8116
+ " </div>\n" +
8117
+ " <div class=\"nice-dropdown-items\" aria-labelledby=\"nice-dropdown-{{ id }}\" role=\"listbox\">\n" +
8118
+ " <div role=\"none\" type=\"button\" class=\"nice-no-data\" ng-if=\"internalList && internalList.length == 0\">{{ noDataText }}</div>\n" +
8119
+ " <button type=\"button\" role=\"option\" class=\"nice-dropdown-item null-item\" ng-if=\"!multiple && nullable && internalList.length != 0\" ng-click=\"handleSelected(null, -1)\" ng-disabled=\"isDisabled\">\n" +
8120
+ " {{ nullableText }}\n" +
8121
+ " </button>\n" +
8122
+ " <button type=\"button\" role=\"option\" class=\"nice-dropdown-item\" ng-repeat=\"item in internalList\" ng-click=\"handleSelected(item, $index)\" ng-class=\"{ 'selected': item._selected }\" ng-disabled=\"isDisabled\">\n" +
8123
+ " <div class=\"choice-checkbox\" ng-if=\"multiple\" role=\"menuitemcheckbox\"><nice-icon icon=\"icon-check\"></nice-icon></div>\n" +
8124
+ " <div class=\"choice-option\" ng-transclude=\"option\" ng-class=\"{ 'multiple-item': multiple }\">{{ item[objValue] }}</div>\n" +
8125
+ " </button>\n" +
8126
+ " </div>\n" +
8022
8127
  " </div>\n" +
8023
- " </div>\n" +
8024
- " </div>\n" +
8128
+ " </nice-popup-content>\n" +
8129
+ " </nice-popup>\n" +
8025
8130
  "\n" +
8026
8131
  "\n" +
8027
8132
  " \n" +
@@ -8042,27 +8147,27 @@ angular.module('niceElements').run(['$templateCache', function($templateCache) {
8042
8147
  " <div class=\"dtp-date-view\">\n" +
8043
8148
  " <div class=\"dtp-header\" ng-if=\"!inline\">\n" +
8044
8149
  " <div class=\"dtp-actual-day\">{{actualDay}}</div>\n" +
8045
- " <div class=\"dtp-close\" ng-if=\"!inline\"><a href=\"javascript:void(0);\" ng-click=\"onCloseClick()\"><i class=\"fa fa-close\"></i></a></div>\n" +
8150
+ " <div class=\"dtp-close\" ng-if=\"!inline\"><a href=\"javascript:void(0);\" ng-click=\"onCloseClick()\"><nice-icon icon=\"icon-x\"></nice-icon></a></div>\n" +
8046
8151
  " </div>\n" +
8047
8152
  " <div class=\"dtp-date\" ng-if=\"!inline\" ng-class=\"{'hidden': !showDateHeader}\">\n" +
8048
8153
  " <div>\n" +
8049
8154
  " <div class=\"left center p10\">\n" +
8050
- " <a href=\"javascript:void(0);\" class=\"dtp-select-month-before\" ng-click=\"onMonthBeforeClick()\" ng-class=\"{'disabled': !btnMonthBeforeEnabled}\"><i class=\"fa fa-chevron-left\"></i></a>\n" +
8155
+ " <a href=\"javascript:void(0);\" class=\"dtp-select-month-before\" ng-click=\"onMonthBeforeClick()\" ng-class=\"{'disabled': !btnMonthBeforeEnabled}\"><nice-icon icon=\"icon-chevron-left\"></nice-icon></a>\n" +
8051
8156
  " </div>\n" +
8052
8157
  " <div class=\"dtp-actual-month p80\" ng-click=\"initDate()\">{{actualMonth}}</div>\n" +
8053
8158
  " <div class=\"right center p10\">\n" +
8054
- " <a href=\"javascript:void(0);\" class=\"dtp-select-month-after\" ng-click=\"onMonthAfterClick()\" ng-class=\"{'disabled': !btnMonthAfterEnabled}\"><i class=\"fa fa-chevron-right\"></i></a>\n" +
8159
+ " <a href=\"javascript:void(0);\" class=\"dtp-select-month-after\" ng-click=\"onMonthAfterClick()\" ng-class=\"{'disabled': !btnMonthAfterEnabled}\"><nice-icon icon=\"icon-chevron-right\"></nice-icon></a>\n" +
8055
8160
  " </div>\n" +
8056
8161
  " <div class=\"clearfix\"></div>\n" +
8057
8162
  " </div>\n" +
8058
8163
  " <div class=\"dtp-actual-num\" ng-click=\"initDate()\">{{actualNum}}</div>\n" +
8059
8164
  " <div>\n" +
8060
8165
  " <div class=\"left center p10\">\n" +
8061
- " <a href=\"javascript:void(0);\" class=\"dtp-select-year-before\" ng-click=\"onYearBeforeClick()\" ng-class=\"{'disabled': !btnYearBeforeEnabled}\"><i class=\"fa fa-chevron-left\"></i></a>\n" +
8166
+ " <a href=\"javascript:void(0);\" class=\"dtp-select-year-before\" ng-click=\"onYearBeforeClick()\" ng-class=\"{'disabled': !btnYearBeforeEnabled}\"><nice-icon icon=\"icon-chevron-left\"></nice-icon></a>\n" +
8062
8167
  " </div>\n" +
8063
8168
  " <div class=\"dtp-actual-year p80\" ng-click=\"initDate()\">{{actualYear}}</div>\n" +
8064
8169
  " <div class=\"right center p10\">\n" +
8065
- " <a href=\"javascript:void(0);\" class=\"dtp-select-year-after\" ng-click=\"onYearAfterClick()\" ng-class=\"{'disabled': !btnYearAfterEnabled}\"><i class=\"fa fa-chevron-right\"></i></a>\n" +
8170
+ " <a href=\"javascript:void(0);\" class=\"dtp-select-year-after\" ng-click=\"onYearAfterClick()\" ng-class=\"{'disabled': !btnYearAfterEnabled}\"><nice-icon icon=\"icon-chevron-right\"></nice-icon></a>\n" +
8066
8171
  " </div>\n" +
8067
8172
  " <div class=\"clearfix\"></div>\n" +
8068
8173
  " </div>\n" +
@@ -8076,11 +8181,11 @@ angular.module('niceElements').run(['$templateCache', function($templateCache) {
8076
8181
  " <div class=\"dtp-picker-calendar\" ng-class=\"{'hidden': !showCalendar}\">\n" +
8077
8182
  " <div>\n" +
8078
8183
  " <div ng-if=\"inline\" class=\"left center p10\">\n" +
8079
- " <a href=\"javascript:void(0);\" class=\"dtp-select-month-before\" ng-click=\"onMonthBeforeClick()\" ng-class=\"{'disabled': !btnMonthBeforeEnabled}\"><i class=\"fa fa-chevron-left\"></i></a>\n" +
8184
+ " <a href=\"javascript:void(0);\" class=\"dtp-select-month-before\" ng-click=\"onMonthBeforeClick()\" ng-class=\"{'disabled': !btnMonthBeforeEnabled}\"><nice-icon icon=\"icon-chevron-left\"></nice-icon></a>\n" +
8080
8185
  " </div>\n" +
8081
8186
  " <div class=\"dtp-picker-month\" ng-class=\"{'p80': inline}\">{{monthAndYear}}</div>\n" +
8082
8187
  " <div class=\"right center p10\" ng-if=\"inline\">\n" +
8083
- " <a href=\"javascript:void(0);\" class=\"dtp-select-month-after\" ng-click=\"onMonthAfterClick()\" ng-class=\"{'disabled': !btnMonthAfterEnabled}\"><i class=\"fa fa-chevron-right\"></i></a>\n" +
8188
+ " <a href=\"javascript:void(0);\" class=\"dtp-select-month-after\" ng-click=\"onMonthAfterClick()\" ng-class=\"{'disabled': !btnMonthAfterEnabled}\"><nice-icon icon=\"icon-chevron-right\"></nice-icon></a>\n" +
8084
8189
  " </div>\n" +
8085
8190
  " </div>\n" +
8086
8191
  "\n" +
@@ -8244,12 +8349,12 @@ angular.module('niceElements').run(['$templateCache', function($templateCache) {
8244
8349
 
8245
8350
 
8246
8351
  $templateCache.put('src/components/nice-notification/nice-notification.html',
8247
- "<div class=\"notification\" ng-class=\"{ 'has-icon': icon }\">\n" +
8248
- " <div class=\"notification-inner\">\n" +
8249
- " <nice-icon ng-if=\"icon\" class=\"notification-icon\" icon=\"{{ icon }}\"></nice-icon>\n" +
8250
- " <div class=\"notification-content\">\n" +
8251
- " <div class=\"notification-title\" ng-show=\"title\" ng-bind-html=\"title\"></div>\n" +
8252
- " <div class=\"notification-message\" ng-bind-html=\"message\"></div>\n" +
8352
+ "<div class=\"nice-notification\" ng-class=\"{ 'has-icon': icon }\">\n" +
8353
+ " <div class=\"nice-notification-inner\">\n" +
8354
+ " <nice-icon ng-if=\"icon\" class=\"nice-notification-icon\" icon=\"{{ icon }}\"></nice-icon>\n" +
8355
+ " <div class=\"nice-notification-content\">\n" +
8356
+ " <div class=\"nice-notification-title\" ng-show=\"title\" ng-bind-html=\"title\"></div>\n" +
8357
+ " <div class=\"nice-notification-message\" ng-bind-html=\"message\"></div>\n" +
8253
8358
  " </div>\n" +
8254
8359
  " </div>\n" +
8255
8360
  "</div>\n"
@@ -8369,13 +8474,13 @@ angular.module('niceElements').run(['$templateCache', function($templateCache) {
8369
8474
 
8370
8475
 
8371
8476
  $templateCache.put('src/components/nice-popup/nice-popup.html',
8372
- "<div class=\"nice-popup\" click-outside=\"close()\">\n" +
8373
- " <div class=\"nice-popup-target\" ng-transclude=\"target\" ng-click=\"toggle()\"></div>\n" +
8477
+ "<div class=\"nice-popup\" click-outside=\"clickedOutside()\">\n" +
8478
+ " <div class=\"nice-popup-target\" ng-transclude=\"target\" ng-click=\"targetClicked()\"></div>\n" +
8374
8479
  " <div class=\"nice-popup-content\">\n" +
8375
- " <div class=\"nice-popup-arrow\" data-popper-arrow ng-show=\"isOpen && showArrow\"></div>\n" +
8480
+ " <div class=\"nice-popup-arrow\" ng-show=\"isOpen && showArrow\"></div>\n" +
8376
8481
  " <div ng-transclude=\"content\" ng-if=\"isOpen\"></div>\n" +
8377
8482
  " </div>\n" +
8378
- "</div>"
8483
+ "</div>\n"
8379
8484
  );
8380
8485
 
8381
8486
 
@@ -8434,35 +8539,31 @@ angular.module('niceElements').run(['$templateCache', function($templateCache) {
8434
8539
  "\n" +
8435
8540
  " \n" +
8436
8541
  " <div class=\"nice-field col-xs-12\" ng-class=\"[fieldWidth ? fieldWidth : 'col-sm-8', { 'nice-disabled': isDisabled }]\">\n" +
8437
- " <div class=\"input-group\" ng-class=\"{ 'disabled': isDisabled }\">\n" +
8438
- " <input class=\"form-control\" type=\"text\" id=\"{{ id }}\" ng-model=\"modelString\" ng-keypress=\"keypress($event)\" placeholder=\"{{ placeholder }}\" ng-disabled=\"isDisabled\" ng-change=\"updateSearch()\" ng-required=\"required\" tabindex=\"{{ tabIndex }}\">\n" +
8542
+ " <div class=\"nice-search-field\" click-outside=\"closeDropdown()\" is-open=\"{{ results.length > 0 || noResults }}\">\n" +
8543
+ " <div class=\"input-group\" ng-class=\"{ 'disabled': isDisabled }\">\n" +
8544
+ " <input class=\"form-control\" type=\"text\" id=\"{{ id }}\" ng-model=\"modelString\" ng-keypress=\"keypress($event)\" placeholder=\"{{ placeholder }}\" ng-disabled=\"isDisabled\" ng-change=\"updateSearch()\" ng-required=\"required\" tabindex=\"{{ tabIndex }}\">\n" +
8439
8545
  "\n" +
8440
- " <button type=\"button\" class=\"btn input-group-addon\" ng-click=\"search()\" ng-if=\"!model\" ng-disabled=\"isDisabled\">\n" +
8441
- " \n" +
8442
- " \n" +
8443
- " <nice-icon ng-show=\"!loading\" icon=\"icon-search\"></nice-icon>\n" +
8444
- " <nice-loader ng-if=\"loading\"></nice-loader>\n" +
8445
- " </button>\n" +
8546
+ " <button type=\"button\" class=\"btn input-group-addon\" ng-click=\"search()\" ng-if=\"!model\" ng-disabled=\"isDisabled\">\n" +
8547
+ " \n" +
8548
+ " <nice-icon ng-show=\"!loading\" icon=\"icon-search\"></nice-icon>\n" +
8549
+ " <nice-loader ng-if=\"loading\"></nice-loader>\n" +
8550
+ " </button>\n" +
8446
8551
  "\n" +
8447
- " <button type=\"button\" class=\"btn input-group-addon\" ng-click=\"remove()\" ng-if=\"model\" ng-disabled=\"isDisabled\">\n" +
8448
- " \n" +
8449
- " <nice-icon ng-show=\"!loading\" icon=\"icon-x\"></nice-icon>\n" +
8450
- " </button>\n" +
8451
- " </div>\n" +
8452
- " </div>\n" +
8453
- " </div>\n" +
8552
+ " <button type=\"button\" class=\"btn input-group-addon\" ng-click=\"remove()\" ng-if=\"model\" ng-disabled=\"isDisabled\">\n" +
8553
+ " <nice-icon ng-show=\"!loading\" icon=\"icon-x\"></nice-icon>\n" +
8554
+ " </button>\n" +
8555
+ " </div>\n" +
8454
8556
  "\n" +
8455
- " <div class=\"row\" ng-if=\"noResults || results.length\">\n" +
8456
- " <div ng-class=\"labelWidth ? labelWidth : 'col-sm-4'\" ng-if=\"title\"></div>\n" +
8457
- " <div class=\"nice-field col-xs-12\" ng-class=\"fieldWidth ? fieldWidth : 'col-sm-8'\">\n" +
8458
- " <div class=\"nice-dropdown-empty\" ng-if=\"noResults\">\n" +
8459
- " <div class=\"nice-search-row\" translate translate-context=\"Nice\">No results found.</div>\n" +
8460
- " </div>\n" +
8557
+ " \n" +
8558
+ " <div class=\"nice-dropdown-empty\" ng-if=\"noResults\">\n" +
8559
+ " <div class=\"nice-search-row\" translate translate-context=\"Nice\">No results found.</div>\n" +
8560
+ " </div>\n" +
8461
8561
  "\n" +
8462
- " <div class=\"nice-dropdown\" ng-if=\"results.length\">\n" +
8463
- " <div ng-repeat=\"result in results\" class=\"nice-search-row\" ng-class=\"{'active': selectedIndex == $index}\" ng-click=\"selectRow(result)\">\n" +
8464
- " <span class=\"text-bold\" ng-if=\"!hasRowTemplate\">{{ result[keyForInputLabel] }}</span>\n" +
8465
- " <div ng-if=\"hasRowTemplate\" nice-search-row-transclude></div>\n" +
8562
+ " <div class=\"nice-dropdown\" ng-if=\"results.length\">\n" +
8563
+ " <div ng-repeat=\"result in results\" class=\"nice-search-row\" ng-class=\"{'active': selectedIndex == $index}\" ng-click=\"selectRow(result)\">\n" +
8564
+ " <span class=\"text-bold\" ng-if=\"!hasRowTemplate\">{{ result[keyForInputLabel] }}</span>\n" +
8565
+ " <div ng-if=\"hasRowTemplate\" nice-search-row-transclude></div>\n" +
8566
+ " </div>\n" +
8466
8567
  " </div>\n" +
8467
8568
  " </div>\n" +
8468
8569
  " </div>\n" +
@@ -8480,29 +8581,33 @@ angular.module('niceElements').run(['$templateCache', function($templateCache) {
8480
8581
  "\n" +
8481
8582
  " \n" +
8482
8583
  " <div class=\"nice-field col-xs-12\" ng-class=\"[fieldWidth ? fieldWidth : 'col-sm-8', { 'nice-disabled': isDisabled }]\" click-outside=\"close()\">\n" +
8483
- " <div class=\"nice-search-button input-group\" ng-class=\"{ 'disabled': isDisabled }\">\n" +
8484
- " <input class=\"form-control\" type=\"text\" id=\"{{ id }}\" ng-model=\"model\" placeholder=\"{{ placeholder }}\" ng-disabled=\"isDisabled\" ng-change=\"updateSearch()\" ng-focus=\"onFocus()\" ng-required=\"required\" tabindex=\"{{ tabIndex }}\">\n" +
8485
- "\n" +
8486
- " <button type=\"button\" class=\"btn input-group-addon\" ng-disabled=\"isDisabled\" ng-click=\"buttonClicked()\">\n" +
8487
- " <nice-icon ng-show=\"!loading && model != ''\" icon=\"icon-x\"></nice-icon>\n" +
8488
- " <nice-icon ng-show=\"!loading && model == ''\" icon=\"icon-search\"></nice-icon>\n" +
8489
- " <nice-loader ng-if=\"loading\"></nice-loader>\n" +
8490
- " </button>\n" +
8491
- " </div>\n" +
8492
- "\n" +
8493
- " <div class=\"nice-search-dropdown-wrapper\">\n" +
8494
- " <div class=\"nice-search-dropdown\" ng-if=\"showDropdown && isOpen\">\n" +
8495
- " <div class=\"nice-search-row nice-search-row-loading\" ng-if=\"loading && results.length == 0\">\n" +
8496
- " <nice-loader ng-if=\"loading\"></nice-loader>\n" +
8584
+ " <nice-popup trigger=\"manual\" is-open=\"isOpen\" placement=\"{{ placement }}\" same-width=\"true\">\n" +
8585
+ " <nice-popup-target>\n" +
8586
+ " <div class=\"nice-search-button input-group\" ng-class=\"{ 'disabled': isDisabled }\">\n" +
8587
+ " <input class=\"form-control\" type=\"text\" id=\"{{ id }}\" ng-model=\"modelAccessor\" ng-model-options=\"{ getterSetter: true }\" placeholder=\"{{ placeholder }}\" ng-disabled=\"isDisabled\" ng-change=\"updateSearch()\" ng-focus=\"onFocus()\" ng-required=\"required\" tabindex=\"{{ tabIndex }}\">\n" +
8588
+ "\n" +
8589
+ " <button type=\"button\" class=\"btn input-group-addon\" ng-disabled=\"isDisabled\" ng-click=\"buttonClicked()\">\n" +
8590
+ " <nice-icon ng-show=\"!loading && model != ''\" icon=\"icon-x\"></nice-icon>\n" +
8591
+ " <nice-icon ng-show=\"!loading && model == ''\" icon=\"icon-search\"></nice-icon>\n" +
8592
+ " <nice-loader ng-if=\"loading\"></nice-loader>\n" +
8593
+ " </button>\n" +
8497
8594
  " </div>\n" +
8595
+ " </nice-popup-target>\n" +
8596
+ "\n" +
8597
+ " <nice-popup-content>\n" +
8598
+ " <div class=\"nice-search-dropdown\" ng-if=\"showDropdown && isOpen\">\n" +
8599
+ " <div class=\"nice-search-row nice-search-row-loading\" ng-if=\"loading && results.length == 0\">\n" +
8600
+ " <nice-loader ng-if=\"loading\"></nice-loader>\n" +
8601
+ " </div>\n" +
8498
8602
  "\n" +
8499
- " <div class=\"nice-search-row nice-search-row-empty\" ng-if=\"!loading && results.length == 0\" translate translate-context=\"Nice\">No results found.</div>\n" +
8603
+ " <div class=\"nice-search-row nice-search-row-empty\" ng-if=\"!loading && results.length == 0\" translate translate-context=\"Nice\">No results found.</div>\n" +
8500
8604
  "\n" +
8501
- " <div ng-repeat=\"result in results\" class=\"nice-search-row\" ng-class=\"{'active': selectedIndex == $index}\" ng-click=\"selectItem(result)\">\n" +
8502
- " <ng-transclude>{{ result[keyForInputLabel] }}</ng-transclude>\n" +
8605
+ " <div ng-repeat=\"result in results\" class=\"nice-search-row\" ng-class=\"{'active': selectedIndex == $index}\" ng-click=\"selectItem(result)\">\n" +
8606
+ " <ng-transclude>{{ result[keyForInputLabel] }}</ng-transclude>\n" +
8607
+ " </div>\n" +
8503
8608
  " </div>\n" +
8504
- " </div>\n" +
8505
- " </div>\n" +
8609
+ " </nice-popup-content>\n" +
8610
+ " </nice-popup>\n" +
8506
8611
  " </div>\n" +
8507
8612
  " </div>\n" +
8508
8613
  "</ng-form>"
@@ -8772,6 +8877,10 @@ angular.module('niceElements').run(['$templateCache', function($templateCache) {
8772
8877
  " <path d=\"M23 12c0-3.037-1.232-5.789-3.222-7.778s-4.741-3.222-7.778-3.222-5.789 1.232-7.778 3.222-3.222 4.741-3.222 7.778 1.232 5.789 3.222 7.778 4.741 3.222 7.778 3.222 5.789-1.232 7.778-3.222 3.222-4.741 3.222-7.778zM21 12c0 2.486-1.006 4.734-2.636 6.364s-3.878 2.636-6.364 2.636-4.734-1.006-6.364-2.636-2.636-3.878-2.636-6.364 1.006-4.734 2.636-6.364 3.878-2.636 6.364-2.636 4.734 1.006 6.364 2.636 2.636 3.878 2.636 6.364z\"></path>\n" +
8773
8878
  " </symbol>\n" +
8774
8879
  "\n" +
8880
+ " <symbol id=\"icon-dot\" viewBox=\"0 0 24 24\">\n" +
8881
+ " <path d=\"M12 6a6 6 0 1 1 0 12a6 6 0 1 1 0-12z\"></path>\n" +
8882
+ " </symbol>\n" +
8883
+ "\n" +
8775
8884
  " <symbol id=\"icon-clipboard\" viewBox=\"0 0 24 24\">\n" +
8776
8885
  " <path d=\"M7 5c0 0.552 0.225 1.053 0.586 1.414s0.862 0.586 1.414 0.586h6c0.552 0 1.053-0.225 1.414-0.586s0.586-0.862 0.586-1.414h1c0.276 0 0.525 0.111 0.707 0.293s0.293 0.431 0.293 0.707v14c0 0.276-0.111 0.525-0.293 0.707s-0.431 0.293-0.707 0.293h-12c-0.276 0-0.525-0.111-0.707-0.293s-0.293-0.431-0.293-0.707v-14c0-0.276 0.111-0.525 0.293-0.707s0.431-0.293 0.707-0.293zM9 1c-0.552 0-1.053 0.225-1.414 0.586s-0.586 0.862-0.586 1.414h-1c-0.828 0-1.58 0.337-2.121 0.879s-0.879 1.293-0.879 2.121v14c0 0.828 0.337 1.58 0.879 2.121s1.293 0.879 2.121 0.879h12c0.828 0 1.58-0.337 2.121-0.879s0.879-1.293 0.879-2.121v-14c0-0.828-0.337-1.58-0.879-2.121s-1.293-0.879-2.121-0.879h-1c0-0.552-0.225-1.053-0.586-1.414s-0.862-0.586-1.414-0.586zM9 3h6v2h-6z\"></path>\n" +
8777
8886
  " </symbol>\n" +
@@ -9305,6 +9414,10 @@ angular.module('niceElements').run(['$templateCache', function($templateCache) {
9305
9414
  " </symbol>\n" +
9306
9415
  "\n" +
9307
9416
  " <symbol id=\"icon-plus\" viewBox=\"0 0 24 24\">\n" +
9417
+ " <path d=\"M10.5 5.5a1.5 1.5 0 0 1 3 0v5h5a1.5 1.5 0 0 1 0 3h-5v5a1.5 1.5 0 0 1-3 0v-5h-5a1.5 1.5 0 0 1 0-3h5z\"></path>\n" +
9418
+ " </symbol>\n" +
9419
+ "\n" +
9420
+ " <symbol id=\"icon-plus-2\" viewBox=\"0 0 24 24\">\n" +
9308
9421
  " <path d=\"M5 13h6v6c0 0.552 0.448 1 1 1s1-0.448 1-1v-6h6c0.552 0 1-0.448 1-1s-0.448-1-1-1h-6v-6c0-0.552-0.448-1-1-1s-1 0.448-1 1v6h-6c-0.552 0-1 0.448-1 1s0.448 1 1 1z\"></path>\n" +
9309
9422
  " </symbol>\n" +
9310
9423
  "\n" +
@@ -10058,7 +10171,7 @@ angular.module('niceElements').run(['$templateCache', function($templateCache) {
10058
10171
  " <nice-title text=\"title || niceTitle\" help=\"help\" required=\"required\" description=\"description\" label-width=\"labelWidth\"></nice-title>\n" +
10059
10172
  "\n" +
10060
10173
  " \n" +
10061
- " <div class=\"nice-field col-xs-12\" ng-class=\"fieldWidth ? fieldWidth : 'col-sm-8'\">\n" +
10174
+ " <div class=\"nice-field col-xs-12\" ng-class=\"fieldWidth ? fieldWidth : 'col-sm-8'\" click-outside=\"close()\" is-open=\"{{ open }}\">\n" +
10062
10175
  " <div class=\"input-group\" ng-class=\"{\n" +
10063
10176
  " 'has-warning': !isDisabled && forma.$invalid && forma.$dirty,\n" +
10064
10177
  " 'disabled': isDisabled\n" +
@@ -10093,8 +10206,6 @@ angular.module('niceElements').run(['$templateCache', function($templateCache) {
10093
10206
  " </div>\n" +
10094
10207
  " </div>\n" +
10095
10208
  " </div>\n" +
10096
- "\n" +
10097
- " <div class=\"nice-background\" ng-click=\"close()\" ng-if=\"open\"></div>\n" +
10098
10209
  "</div>"
10099
10210
  );
10100
10211