nice-elements 1.4.4 → 1.4.5

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,5 @@
1
1
  {
2
- "editor.formatOnSave": true,
2
+ "editor.formatOnSave": false,
3
3
  "html.format.wrapLineLength": 0,
4
4
  "prettier.printWidth": 0
5
5
  }
package/CHANGELOG.md CHANGED
@@ -1,5 +1,10 @@
1
1
  # Changelog
2
2
 
3
+ ## v1.4.5 (1.8.2022)
4
+
5
+ - added @popperjs/core v2.11.6,
6
+ - changed dropdown to popper in nice-dropdown, nice-date, nice-search2 and nice-daterange-picker-2
7
+
3
8
  ## v1.4.4 (1.8.2022)
4
9
 
5
10
  - fixed nice-calendar update on time select
package/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # Nice elements v1.4.4
1
+ # Nice elements v1.4.5
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.4",
3
+ "version": "1.4.5",
4
4
  "authors": [
5
5
  "Klemen Kastelic <klemen@olaii.com>"
6
6
  ],
package/dist/nice.js CHANGED
@@ -921,7 +921,7 @@ angular.module('niceElements')
921
921
  isInline: '=',
922
922
  onChange: '&?'
923
923
  },
924
- controller: function($scope, gettextCatalog) {
924
+ controller: function($scope, $element, gettextCatalog) {
925
925
  $scope.isOpen = false;
926
926
  $scope.hours = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23];
927
927
  $scope.minutes = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59];
@@ -981,6 +981,27 @@ angular.module('niceElements')
981
981
  if ($scope.maxDate) $scope.maxDate = moment($scope.maxDate);
982
982
  if ($scope.minDate) $scope.minDate = moment($scope.minDate);
983
983
 
984
+
985
+ // Setup popper
986
+ // https://popper.js.org/docs/v2/constructors/
987
+ $scope.setupPopper = function() {
988
+ var button = $element[0].getElementsByClassName('nice-date-button')[0];
989
+ var tooltip = $element[0].getElementsByClassName('nice-date-dropdown-wrapper')[0];
990
+ $scope.popper = Popper.createPopper(button, tooltip, {
991
+ strategy: 'fixed',
992
+ placement: 'bottom-start',
993
+ modifiers: [
994
+ {
995
+ name: 'offset',
996
+ options: {
997
+ offset: [0, 5],
998
+ },
999
+ }
1000
+ ],
1001
+ });
1002
+ };
1003
+ if (!$scope.inline) $scope.setupPopper();
1004
+
984
1005
 
985
1006
  // ------------------ Time changes ------------------
986
1007
  $scope.timeChange = function() {
@@ -1187,6 +1208,7 @@ angular.module('niceElements')
1187
1208
  $scope.toggleOpen = function() {
1188
1209
  if (!$scope.isDisabled) {
1189
1210
  $scope.isOpen = !$scope.isOpen;
1211
+ $scope.popper.update();
1190
1212
  }
1191
1213
  };
1192
1214
  }
@@ -1309,7 +1331,7 @@ angular.module('niceElements')
1309
1331
  onChange: '&?'
1310
1332
  },
1311
1333
  templateUrl: 'src/components/nice-datetimerange-picker-2/nice-datetimerange-picker-2.html',
1312
- controller: function ($rootScope, $scope) {
1334
+ controller: function ($element, $scope) {
1313
1335
  $scope.isOpen = false;
1314
1336
 
1315
1337
 
@@ -1339,6 +1361,27 @@ angular.module('niceElements')
1339
1361
  }
1340
1362
 
1341
1363
 
1364
+ // Setup popper
1365
+ // https://popper.js.org/docs/v2/constructors/
1366
+ $scope.setupPopper = function() {
1367
+ var button = $element[0].getElementsByClassName('nice-daterange-picker-button')[0];
1368
+ var tooltip = $element[0].getElementsByClassName('nice-daterange-picker-wrapper')[0];
1369
+ $scope.popper = Popper.createPopper(button, tooltip, {
1370
+ strategy: 'fixed',
1371
+ placement: 'bottom-start',
1372
+ modifiers: [
1373
+ {
1374
+ name: 'offset',
1375
+ options: {
1376
+ offset: [0, 5],
1377
+ },
1378
+ }
1379
+ ],
1380
+ });
1381
+ };
1382
+ $scope.setupPopper();
1383
+
1384
+
1342
1385
  $scope.format = function(){
1343
1386
  $scope.modelFormat = $scope.startDate.format($scope.formatString) + " - " + $scope.endDate.format($scope.formatString);
1344
1387
  };
@@ -1347,6 +1390,7 @@ angular.module('niceElements')
1347
1390
  $scope.open = function() {
1348
1391
  if (!$scope.isDisabled) {
1349
1392
  $scope.isOpen = true;
1393
+ $scope.popper.update();
1350
1394
  }
1351
1395
  };
1352
1396
 
@@ -2166,8 +2210,7 @@ angular.module('niceElements')
2166
2210
  selectedText: '@',
2167
2211
  searchFunction: '=?',
2168
2212
  isInline: '=',
2169
- clearOnSelect: '@',
2170
- positionFixed: '=' // Dropdown menu will be fixed to page
2213
+ clearOnSelect: '@'
2171
2214
  },
2172
2215
  controller: function ($scope, $element, $timeout, gettextCatalog) {
2173
2216
  if (!$scope.objValue) { $scope.objValue = 'value'; }
@@ -2188,11 +2231,47 @@ angular.module('niceElements')
2188
2231
  $scope.isOpen = false;
2189
2232
  $scope.selected = null;
2190
2233
  $scope.selectedIndex = 0;
2234
+ $scope.popper = null;
2191
2235
 
2192
2236
  $scope.internal = {
2193
2237
  search: ""
2194
2238
  };
2195
2239
 
2240
+ // Setup popper
2241
+ // https://popper.js.org/docs/v2/constructors/
2242
+ $scope.setupPopper = function() {
2243
+ var button = $element[0].getElementsByClassName('btn-dropdown')[0];
2244
+ var tooltip = $element[0].getElementsByClassName('nice-dropdown-menu-wrapper')[0];
2245
+ $scope.popper = Popper.createPopper(button, tooltip, {
2246
+ strategy: 'fixed',
2247
+ scroll: true,
2248
+ resize: true,
2249
+ modifiers: [
2250
+ {
2251
+ name: 'offset',
2252
+ options: {
2253
+ offset: [0, 5],
2254
+ },
2255
+ },
2256
+ {
2257
+ name: "sameWidth",
2258
+ enabled: true,
2259
+ phase: "beforeWrite",
2260
+ requires: ["computeStyles"],
2261
+ fn: ({ state }) => {
2262
+ state.styles.popper.width = `${state.rects.reference.width}px`;
2263
+ },
2264
+ effect: ({ state }) => {
2265
+ state.elements.popper.style.width = `${
2266
+ state.elements.reference.offsetWidth
2267
+ }px`;
2268
+ }
2269
+ }
2270
+ ],
2271
+ });
2272
+ };
2273
+ $scope.setupPopper();
2274
+
2196
2275
  // -----------------------------------Open -----------------------------------
2197
2276
  $scope.toggle = function () {
2198
2277
  if ($scope.isOpen) {
@@ -2207,10 +2286,10 @@ angular.module('niceElements')
2207
2286
  };
2208
2287
 
2209
2288
  $scope.open = function () {
2210
- $scope.focusInput();
2211
2289
  $scope.isOpen = true;
2212
- if($scope.positionFixed) $scope.updateStyle();
2213
- $timeout(function() {
2290
+ $timeout(function () {
2291
+ $scope.popper.update();
2292
+ $scope.focusInput();
2214
2293
  $scope.scrollToHover(true);
2215
2294
  }, 100);
2216
2295
  };
@@ -2228,18 +2307,18 @@ angular.module('niceElements')
2228
2307
 
2229
2308
 
2230
2309
  // ----------------------------------- Scroll to hover -----------------------------------
2231
- $scope.scrollToHover = function(notSmooth) {
2232
- var dropdownMenu = $element[0].getElementsByClassName("dropdown-menu")[0];
2233
- var dorpdownList = dropdownMenu.getElementsByTagName("ul")[0];
2310
+ $scope.scrollToHover = function (notSmooth) {
2311
+ var dropdownMenu = $element[0].getElementsByClassName("nice-dropdown-menu")[0];
2312
+ if (!dropdownMenu) return;
2313
+ var dorpdownList = dropdownMenu.getElementsByClassName("nice-dropdown-items")[0];
2234
2314
  var hoverItem = dorpdownList.getElementsByClassName("hover")[0];
2235
- if (hoverItem) {
2236
- var topPos = hoverItem.offsetTop;
2237
- dorpdownList.scroll({
2238
- top: topPos - 120,
2239
- left: 0,
2240
- behavior: notSmooth ? 'auto' : 'smooth'
2241
- });
2242
- }
2315
+ if (!hoverItem) return
2316
+ var topPos = hoverItem.offsetTop;
2317
+ dorpdownList.scroll({
2318
+ top: topPos - 120,
2319
+ left: 0,
2320
+ behavior: notSmooth ? 'auto' : 'smooth'
2321
+ });
2243
2322
  };
2244
2323
 
2245
2324
 
@@ -2274,11 +2353,11 @@ angular.module('niceElements')
2274
2353
 
2275
2354
 
2276
2355
  // ----------------------------------- Handle multiple select -----------------------------------
2277
- $scope.handleMultipleSelect = function(item, index) {
2356
+ $scope.handleMultipleSelect = function (item, index) {
2278
2357
  if (!$scope.selected) $scope.selected = [];
2279
2358
 
2280
- if(item._selected) {
2281
- $scope.selected = $scope.selected.filter(function(s) {
2359
+ if (item._selected) {
2360
+ $scope.selected = $scope.selected.filter(function (s) {
2282
2361
  return s[$scope.objKey] != item[$scope.objKey];
2283
2362
  });
2284
2363
  } else {
@@ -2290,7 +2369,7 @@ angular.module('niceElements')
2290
2369
 
2291
2370
 
2292
2371
  // ----------------------------------- Handle single slect -----------------------------------
2293
- $scope.handleSingleSelect = function(item, index) {
2372
+ $scope.handleSingleSelect = function (item, index) {
2294
2373
  $scope.selected = item;
2295
2374
  $scope.close();
2296
2375
  $scope.handleSetModel();
@@ -2298,13 +2377,13 @@ angular.module('niceElements')
2298
2377
 
2299
2378
 
2300
2379
  // ----------------------------------- Handle set model -----------------------------------
2301
- $scope.handleSetModel = function() {
2380
+ $scope.handleSetModel = function () {
2302
2381
  var obj = angular.copy($scope.selected);
2303
2382
 
2304
2383
  if ($scope.selected != null) {
2305
2384
  // Remove selected flag
2306
2385
  if ($scope.multiple) {
2307
- angular.forEach(obj, function(o) {
2386
+ angular.forEach(obj, function (o) {
2308
2387
  o._selected = undefined;
2309
2388
  });
2310
2389
  } else {
@@ -2314,7 +2393,7 @@ angular.module('niceElements')
2314
2393
  // Selected is object
2315
2394
  if ($scope.selectedIsKey) {
2316
2395
  if ($scope.multiple) {
2317
- angular.forEach(obj, function(o) {
2396
+ angular.forEach(obj, function (o) {
2318
2397
  o = o[$scope.objKey];
2319
2398
  });
2320
2399
  } else {
@@ -2322,7 +2401,7 @@ angular.module('niceElements')
2322
2401
  }
2323
2402
  }
2324
2403
  }
2325
-
2404
+
2326
2405
  if ($scope.clearOnSelect) {
2327
2406
  // Clear on select
2328
2407
  $scope.model = null;
@@ -2339,7 +2418,7 @@ angular.module('niceElements')
2339
2418
 
2340
2419
 
2341
2420
  // ----------------------------------- Handle default -----------------------------------
2342
- $scope.handleDefault = function() {
2421
+ $scope.handleDefault = function () {
2343
2422
  if ($scope.model) $scope.handleModelChange();
2344
2423
  if (!$scope.nullable && !$scope.model && !$scope.clearOnSelect && $scope.internalList && $scope.internalList.length > 0) {
2345
2424
  $scope.handleSelected($scope.internalList[0], 0);
@@ -2358,16 +2437,16 @@ angular.module('niceElements')
2358
2437
  $scope.handleModelChange();
2359
2438
  });
2360
2439
 
2361
- $scope.handleModelChange = function() {
2440
+ $scope.handleModelChange = function () {
2362
2441
  $scope.selected = angular.copy($scope.model);
2363
- angular.forEach($scope.internalList, function(i, index) {
2442
+ angular.forEach($scope.internalList, function (i, index) {
2364
2443
  i._selected = false;
2365
2444
 
2366
2445
  if ($scope.selectedIsKey) {
2367
2446
  // Not object
2368
2447
  if ($scope.multiple) {
2369
2448
  // Multiple
2370
- angular.forEach($scope.selected, function(s) {
2449
+ angular.forEach($scope.selected, function (s) {
2371
2450
  if (i[$scope.objKey] == s) {
2372
2451
  i._selected = true;
2373
2452
  // $scope.selected.push(i);
@@ -2382,12 +2461,12 @@ angular.module('niceElements')
2382
2461
  $scope.selectedIndex = index;
2383
2462
  $scope.scrollToHover();
2384
2463
  }
2385
- }
2464
+ }
2386
2465
  } else {
2387
2466
  // Is object
2388
2467
  if ($scope.multiple) {
2389
2468
  // Multiple
2390
- angular.forEach($scope.selected, function(s) {
2469
+ angular.forEach($scope.selected, function (s) {
2391
2470
  if (i[$scope.objKey] == s[$scope.objKey]) {
2392
2471
  i._selected = true;
2393
2472
  // $scope.selected.push(i);
@@ -2406,41 +2485,16 @@ angular.module('niceElements')
2406
2485
  }
2407
2486
  });
2408
2487
  }
2409
-
2410
- // ----------------------------------- Handle fixed position -----------------------------------
2411
- if ($scope.positionFixed) {
2412
- $scope.dropdownButton = $element[0].getElementsByClassName('btn-dropdown')[0]
2413
- $scope.dropdownMenu = $element[0].getElementsByClassName('dropdown-menu')[0]
2414
- $scope.updateStyle = function () {
2415
- if (this.isOpen) {
2416
- var buttonPos = $scope.dropdownButton.getBoundingClientRect();
2417
- $scope.dropdownMenu.style.top = (buttonPos.top + buttonPos.height) + "px";
2418
- $scope.dropdownMenu.style.left = buttonPos.left + "px";
2419
- $scope.dropdownMenu.style.width = buttonPos.width + "px";
2420
- }
2421
- }
2422
-
2423
- $scope.updateStyle();
2424
-
2425
- angular.element($window).on("resize", function () {
2426
- $scope.updateStyle();
2427
- })
2428
-
2429
- angular.element($window).on("scroll", function () {
2430
- $scope.updateStyle();
2431
- })
2432
- }
2433
-
2434
2488
 
2435
2489
  // ----------------------------------- Watch for keydown and keypress -----------------------------------
2436
2490
  $element.bind("keydown keypress", function (event) {
2437
2491
  // Arrow Up
2438
2492
  if (event.keyCode == 38) {
2439
2493
  event.preventDefault();
2440
- $timeout(function() {
2441
- if ( $scope.selectedIndex > 0) {
2494
+ $timeout(function () {
2495
+ if ($scope.selectedIndex > 0) {
2442
2496
  $scope.selectedIndex -= 1;
2443
- $timeout(function() {
2497
+ $timeout(function () {
2444
2498
  $scope.scrollToHover();
2445
2499
  });
2446
2500
  }
@@ -2450,10 +2504,10 @@ angular.module('niceElements')
2450
2504
  // Arrow Down
2451
2505
  if (event.keyCode == 40) {
2452
2506
  event.preventDefault();
2453
- $timeout(function() {
2507
+ $timeout(function () {
2454
2508
  if ($scope.internalList && $scope.selectedIndex < $scope.internalList.length - 1) {
2455
2509
  $scope.selectedIndex += 1;
2456
- $timeout(function() {
2510
+ $timeout(function () {
2457
2511
  $scope.scrollToHover();
2458
2512
  });
2459
2513
  }
@@ -2463,14 +2517,14 @@ angular.module('niceElements')
2463
2517
  // Enter
2464
2518
  if (event.keyCode == 13) {
2465
2519
  event.preventDefault();
2466
- $timeout(function() {
2520
+ $timeout(function () {
2467
2521
  $scope.handleSelected($scope.internalList[$scope.selectedIndex], $scope.selectedIndex);
2468
2522
  });
2469
2523
  }
2470
2524
 
2471
2525
  // Escape
2472
2526
  if (event.keyCode == 27) {
2473
- $timeout(function() {
2527
+ $timeout(function () {
2474
2528
  $scope.close();
2475
2529
  });
2476
2530
  }
@@ -4323,6 +4377,40 @@ angular.module('niceElements')
4323
4377
 
4324
4378
  if (!$scope.debounceTime) $scope.debounceTime = 500;
4325
4379
  if (!$scope.model) $scope.model = "";
4380
+
4381
+ // Setup popper
4382
+ // https://popper.js.org/docs/v2/constructors/
4383
+ $scope.setupPopper = function() {
4384
+ var button = $element[0].getElementsByClassName('nice-search-button')[0];
4385
+ var tooltip = $element[0].getElementsByClassName('nice-search-dropdown-wrapper')[0];
4386
+ $scope.popper = Popper.createPopper(button, tooltip, {
4387
+ strategy: 'fixed',
4388
+ placement: 'bottom-start',
4389
+ modifiers: [
4390
+ {
4391
+ name: 'offset',
4392
+ options: {
4393
+ offset: [0, 5],
4394
+ },
4395
+ },
4396
+ {
4397
+ name: "sameWidth",
4398
+ enabled: true,
4399
+ phase: "beforeWrite",
4400
+ requires: ["computeStyles"],
4401
+ fn: ({ state }) => {
4402
+ state.styles.popper.width = `${state.rects.reference.width}px`;
4403
+ },
4404
+ effect: ({ state }) => {
4405
+ state.elements.popper.style.width = `${
4406
+ state.elements.reference.offsetWidth
4407
+ }px`;
4408
+ }
4409
+ }
4410
+ ],
4411
+ });
4412
+ };
4413
+ $scope.setupPopper();
4326
4414
 
4327
4415
  // ------------------- On focus -------------------
4328
4416
  $scope.onFocus = function() {
@@ -4349,6 +4437,10 @@ angular.module('niceElements')
4349
4437
 
4350
4438
  var input = $element[0].getElementsByTagName('input')[0];
4351
4439
  if (input) input.blur();
4440
+
4441
+ $timeout(function() {
4442
+ $scope.popper.update();
4443
+ })
4352
4444
  };
4353
4445
 
4354
4446
 
@@ -5071,12 +5163,13 @@ angular.module('niceElements').run(['$templateCache', function($templateCache) {
5071
5163
  "</div>\n" +
5072
5164
  "<div class=\"nice-field col-xs-12\" ng-class=\"[fieldWidth ? fieldWidth : 'col-sm-8', { 'nice-disabled': isDisabled }]\">\n" +
5073
5165
  "<div class=\"disabled-shield\" ng-if=\"isDisabled\"></div>\n" +
5074
- "<div class=\"input-group\" ng-class=\"{ 'open': isOpen }\" ng-if=\"!inline\" ng-click=\"toggleOpen()\">\n" +
5166
+ "<div class=\"nice-date-button input-group\" ng-class=\"{ 'open': isOpen }\" ng-show=\"!inline\" ng-click=\"toggleOpen()\">\n" +
5075
5167
  "<input type=\"text\" class=\"form-control\" value=\"{{ model | niceDate:time }}\" readonly=\"readonly\">\n" +
5076
5168
  "<span class=\"input-group-addon clickable\">\n" +
5077
5169
  "<i class=\"fa fa-calendar\"></i>\n" +
5078
5170
  "</span>\n" +
5079
5171
  "</div>\n" +
5172
+ "<div class=\"nice-date-dropdown-wrapper\">\n" +
5080
5173
  "<div ng-class=\"{ 'nice-date-dropdown': !inline }\" ng-if=\"inline || isOpen\">\n" +
5081
5174
  "<div class=\"nice-date-date\" ng-class=\"{ 'with-time': time }\">\n" +
5082
5175
  "<div class=\"nice-date-header\">\n" +
@@ -5095,13 +5188,13 @@ angular.module('niceElements').run(['$templateCache', function($templateCache) {
5095
5188
  "</div>\n" +
5096
5189
  "<div class=\"nice-date-week\" ng-repeat=\"week in weeks\">\n" +
5097
5190
  "<span class=\"nice-date-day\" title=\"{{ day.value }}\" ng-class=\"{\n" +
5098
- " 'today': day.isToday,\n" +
5099
- " 'different-month': !day.isCurrentMonth,\n" +
5100
- " 'selected': isSameDay(model, day.date),\n" +
5101
- " 'weekend': day.isWeekday,\n" +
5102
- " 'disabled': day.isDisabled,\n" +
5103
- " 'between': isBetween(day.date, model, nextDate)\n" +
5104
- " }\" ng-click=\"select(day)\" ng-repeat=\"day in week.days\">{{ day.number }}</span>\n" +
5191
+ " 'today': day.isToday,\n" +
5192
+ " 'different-month': !day.isCurrentMonth,\n" +
5193
+ " 'selected': isSameDay(model, day.date),\n" +
5194
+ " 'weekend': day.isWeekday,\n" +
5195
+ " 'disabled': day.isDisabled,\n" +
5196
+ " 'between': isBetween(day.date, model, nextDate)\n" +
5197
+ " }\" ng-click=\"select(day)\" ng-repeat=\"day in week.days\">{{ day.number }}</span>\n" +
5105
5198
  "</div>\n" +
5106
5199
  "</div>\n" +
5107
5200
  "<div class=\"nice-date-time\" ng-if=\"time\">\n" +
@@ -5119,6 +5212,7 @@ angular.module('niceElements').run(['$templateCache', function($templateCache) {
5119
5212
  "</div>\n" +
5120
5213
  "</div>\n" +
5121
5214
  "</div>\n" +
5215
+ "</div>\n" +
5122
5216
  "</div>"
5123
5217
  );
5124
5218
 
@@ -5157,11 +5251,12 @@ angular.module('niceElements').run(['$templateCache', function($templateCache) {
5157
5251
  "<nice-help class=\"nice-title-help\" ng-if=\"help\" text=\"{{ help }}\"></nice-help>\n" +
5158
5252
  "</div>\n" +
5159
5253
  "<div class=\"nice-field col-xs-12\" ng-class=\"[fieldWidth ? fieldWidth : 'col-sm-8', { 'nice-disabled': isDisabled }]\">\n" +
5160
- "<div class=\"input-group\" ng-class=\"{ 'open': isOpen }\" ng-click=\"open()\">\n" +
5254
+ "<div class=\"nice-daterange-picker-button input-group\" ng-class=\"{ 'open': isOpen }\" ng-click=\"open()\">\n" +
5161
5255
  "<input type=\"text\" class=\"form-control\" value=\"{{ modelFormat }}\" readonly=\"readonly\">\n" +
5162
5256
  "<span class=\"input-group-addon clickable\"><i class=\"fa fa-calendar\"></i></span>\n" +
5163
5257
  "</div>\n" +
5164
- "<div class=\"dtp-wrapper\" ng-show=\"isOpen\">\n" +
5258
+ "<div class=\"nice-daterange-picker-wrapper\">\n" +
5259
+ "<div class=\"dtp-wrapper\" ng-if=\"isOpen\">\n" +
5165
5260
  "<div class=\"dtp-buttons-left\">\n" +
5166
5261
  "<div class=\"dtp-buttons-top\">\n" +
5167
5262
  "<a class=\"btn btn-primary btn-block\" ng-click=\"selectToday()\" translate translate-context=\"Nice\">Last 24 hours</a>\n" +
@@ -5183,6 +5278,7 @@ angular.module('niceElements').run(['$templateCache', function($templateCache) {
5183
5278
  "</div>\n" +
5184
5279
  "</div>\n" +
5185
5280
  "</div>\n" +
5281
+ "</div>\n" +
5186
5282
  "</div>"
5187
5283
  );
5188
5284
 
@@ -5325,23 +5421,25 @@ angular.module('niceElements').run(['$templateCache', function($templateCache) {
5325
5421
  "<span class=\"caret\" ng-show=\"!loading\"></span>\n" +
5326
5422
  "<nice-loader visible-when=\"!loading\"></nice-loader>\n" +
5327
5423
  "</button>\n" +
5328
- "<div class=\"dropdown-menu\" ng-class=\"{ 'dropdown-menu-fixed': positionFixed }\">\n" +
5424
+ "<div class=\"nice-dropdown-menu-wrapper\">\n" +
5425
+ "<div class=\"nice-dropdown-menu\" ng-if=\"isOpen\">\n" +
5329
5426
  "<div class=\"search-bar\" ng-if=\"searchFunction\">\n" +
5330
5427
  "<input ng-model=\"internal.search\" ng-model-options=\"{ debounce: 500 }\" ng-change=\"handleSearch()\" placeholder=\"{{ searchText }}\">\n" +
5331
5428
  "<span class=\"icon\"><i class=\"fa fa-search\"></i></span>\n" +
5332
5429
  "</div>\n" +
5430
+ "<div class=\"nice-dropdown-items\">\n" +
5333
5431
  "<div class=\"nice-no-data\" ng-if=\"internalList && internalList.length == 0\">{{ noDataText }}</div>\n" +
5334
- "<ul>\n" +
5335
- "<li class=\"null-item\" ng-if=\"nullable && internalList.length != 0\" ng-click=\"handleSelected(null, -1)\">\n" +
5432
+ "<div class=\"nice-dropdown-item null-item\" ng-if=\"nullable && internalList.length != 0\" ng-click=\"handleSelected(null, -1)\">\n" +
5336
5433
  "{{ nullableText }}\n" +
5337
- "</li>\n" +
5338
- "<li ng-repeat=\"item in internalList\" ng-click=\"handleSelected(item, $index)\" ng-class=\"{ 'selected': item._selected, 'hover': $index == selectedIndex }\">\n" +
5434
+ "</div>\n" +
5435
+ "<div class=\"nice-dropdown-item\" ng-repeat=\"item in internalList\" ng-click=\"handleSelected(item, $index)\" ng-class=\"{ 'selected': item._selected, 'hover': $index == selectedIndex }\">\n" +
5339
5436
  "<span class=\"choice-checkbox\" ng-if=\"multiple\"><i class=\"fa fa-check\"></i></span>\n" +
5340
5437
  "<span ng-transclude=\"option\">\n" +
5341
5438
  "<span ng-class=\"{ 'multiple-item': multiple }\">{{ item[objValue] }}</span>\n" +
5342
5439
  "</span>\n" +
5343
- "</li>\n" +
5344
- "</ul>\n" +
5440
+ "</div>\n" +
5441
+ "</div>\n" +
5442
+ "</div>\n" +
5345
5443
  "</div>\n" +
5346
5444
  "<button class=\"btn btn-primary add-btn\" type=\"button\" ng-if=\"addButtonFunction && !isDisabled\" ng-click=\"addButtonFunction()\">+</button>\n" +
5347
5445
  "</div>\n" +
@@ -5672,13 +5770,15 @@ angular.module('niceElements').run(['$templateCache', function($templateCache) {
5672
5770
  "<nice-help class=\"nice-title-help\" ng-if=\"help\" text=\"{{ help }}\"></nice-help>\n" +
5673
5771
  "</div>\n" +
5674
5772
  "<div class=\"nice-field col-xs-12\" ng-class=\"[fieldWidth ? fieldWidth : 'col-sm-8', { 'nice-disabled': isDisabled }]\" click-outside=\"close()\">\n" +
5675
- "<div class=\"input-group\" ng-class=\"{ 'disabled': isDisabled, 'has-warning': !isDisabled && form.$invalid && form.$dirty, 'has-success': !isDisabled && form.$valid && form.$dirty}\">\n" +
5773
+ "<div class=\"nice-search-button input-group\" ng-class=\"{ 'disabled': isDisabled, 'has-warning': !isDisabled && form.$invalid && form.$dirty, 'has-success': !isDisabled && form.$valid && form.$dirty}\">\n" +
5676
5774
  "<input class=\"form-control\" type=\"text\" id=\"{{ id }}\" ng-model=\"model\" placeholder=\"{{ placeholder }}\" ng-disabled=\"isDisabled\" ng-change=\"updateSearch()\" ng-focus=\"onFocus()\" tabindex=\"{{ tabIndex }}\">\n" +
5677
5775
  "<span class=\"input-group-addon clickable\" ng-click=\"onFocus()\">\n" +
5678
5776
  "<i ng-show=\"!loading\" class=\"fa fa-search\"></i>\n" +
5679
5777
  "<i ng-show=\"loading\" class=\"fa fa-refresh fa-spin\"></i>\n" +
5680
5778
  "</span>\n" +
5681
- "<div class=\"nice-dropdown\" ng-if=\"showDropdown && isOpen\">\n" +
5779
+ "</div>\n" +
5780
+ "<div class=\"nice-search-dropdown-wrapper\">\n" +
5781
+ "<div class=\"nice-search-dropdown\" ng-if=\"showDropdown && isOpen\">\n" +
5682
5782
  "<div class=\"nice-search-row nice-search-row-loading\" ng-if=\"loading && results.length == 0\">\n" +
5683
5783
  "<nice-loader visible-when=\"!loading\"></nice-loader>\n" +
5684
5784
  "</div>\n" +