nice-elements 1.4.4 → 1.4.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.vscode/settings.json +1 -1
- package/CHANGELOG.md +14 -0
- package/README.md +1 -1
- package/bower.json +1 -1
- package/dist/nice.js +195 -83
- package/dist/nice.min.js +1 -1
- package/dist/style.css +46 -50
- package/dist/style.css.map +1 -1
- package/dist/style.min.css +2 -2
- package/package.json +2 -1
- package/src/components/nice-date/nice-date.html +63 -61
- package/src/components/nice-date/nice-date.js +28 -1
- package/src/components/nice-date/nice-date.scss +5 -5
- package/src/components/nice-datetimerange-picker-2/nice-datetimerange-picker-2.html +20 -18
- package/src/components/nice-datetimerange-picker-2/nice-datetimerange-picker-2.js +23 -1
- package/src/components/nice-datetimerange-picker-2/nice-datetimerange-picker-2.scss +6 -6
- package/src/components/nice-dropdown/nice-dropdown.html +18 -16
- package/src/components/nice-dropdown/nice-dropdown.js +74 -62
- package/src/components/nice-dropdown/nice-dropdown.scss +10 -12
- package/src/components/nice-search2/nice-search2.html +4 -2
- package/src/components/nice-search2/nice-search2.js +43 -0
- package/src/components/nice-search2/nice-search2.scss +4 -8
package/.vscode/settings.json
CHANGED
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## v1.4.7 (29.8.2022)
|
|
4
|
+
|
|
5
|
+
- fixes
|
|
6
|
+
|
|
7
|
+
## v1.4.6 (26.8.2022)
|
|
8
|
+
|
|
9
|
+
- fixed popper in nice-date, nice-search,
|
|
10
|
+
- fixed with in nice-daterange-picker-2
|
|
11
|
+
|
|
12
|
+
## v1.4.5 (26.8.2022)
|
|
13
|
+
|
|
14
|
+
- added @popperjs/core v2.11.6,
|
|
15
|
+
- changed dropdown to popper in nice-dropdown, nice-date, nice-search2 and nice-daterange-picker-2
|
|
16
|
+
|
|
3
17
|
## v1.4.4 (1.8.2022)
|
|
4
18
|
|
|
5
19
|
- fixed nice-calendar update on time select
|
package/README.md
CHANGED
package/bower.json
CHANGED
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, $timeout, 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,30 @@ 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
|
+
|
|
1004
|
+
$timeout(function() {
|
|
1005
|
+
if (!$scope.inline) $scope.setupPopper();
|
|
1006
|
+
});
|
|
1007
|
+
|
|
984
1008
|
|
|
985
1009
|
// ------------------ Time changes ------------------
|
|
986
1010
|
$scope.timeChange = function() {
|
|
@@ -1187,6 +1211,9 @@ angular.module('niceElements')
|
|
|
1187
1211
|
$scope.toggleOpen = function() {
|
|
1188
1212
|
if (!$scope.isDisabled) {
|
|
1189
1213
|
$scope.isOpen = !$scope.isOpen;
|
|
1214
|
+
$timeout(function() {
|
|
1215
|
+
if ($scope.popper) $scope.popper.update();
|
|
1216
|
+
})
|
|
1190
1217
|
}
|
|
1191
1218
|
};
|
|
1192
1219
|
}
|
|
@@ -1309,7 +1336,7 @@ angular.module('niceElements')
|
|
|
1309
1336
|
onChange: '&?'
|
|
1310
1337
|
},
|
|
1311
1338
|
templateUrl: 'src/components/nice-datetimerange-picker-2/nice-datetimerange-picker-2.html',
|
|
1312
|
-
controller: function ($
|
|
1339
|
+
controller: function ($element, $scope) {
|
|
1313
1340
|
$scope.isOpen = false;
|
|
1314
1341
|
|
|
1315
1342
|
|
|
@@ -1339,6 +1366,27 @@ angular.module('niceElements')
|
|
|
1339
1366
|
}
|
|
1340
1367
|
|
|
1341
1368
|
|
|
1369
|
+
// Setup popper
|
|
1370
|
+
// https://popper.js.org/docs/v2/constructors/
|
|
1371
|
+
$scope.setupPopper = function() {
|
|
1372
|
+
var button = $element[0].getElementsByClassName('nice-daterange-picker-button')[0];
|
|
1373
|
+
var tooltip = $element[0].getElementsByClassName('nice-daterange-picker-wrapper')[0];
|
|
1374
|
+
$scope.popper = Popper.createPopper(button, tooltip, {
|
|
1375
|
+
strategy: 'fixed',
|
|
1376
|
+
placement: 'bottom-start',
|
|
1377
|
+
modifiers: [
|
|
1378
|
+
{
|
|
1379
|
+
name: 'offset',
|
|
1380
|
+
options: {
|
|
1381
|
+
offset: [0, 5],
|
|
1382
|
+
},
|
|
1383
|
+
}
|
|
1384
|
+
],
|
|
1385
|
+
});
|
|
1386
|
+
};
|
|
1387
|
+
$scope.setupPopper();
|
|
1388
|
+
|
|
1389
|
+
|
|
1342
1390
|
$scope.format = function(){
|
|
1343
1391
|
$scope.modelFormat = $scope.startDate.format($scope.formatString) + " - " + $scope.endDate.format($scope.formatString);
|
|
1344
1392
|
};
|
|
@@ -1347,6 +1395,7 @@ angular.module('niceElements')
|
|
|
1347
1395
|
$scope.open = function() {
|
|
1348
1396
|
if (!$scope.isDisabled) {
|
|
1349
1397
|
$scope.isOpen = true;
|
|
1398
|
+
$scope.popper.update();
|
|
1350
1399
|
}
|
|
1351
1400
|
};
|
|
1352
1401
|
|
|
@@ -2166,8 +2215,7 @@ angular.module('niceElements')
|
|
|
2166
2215
|
selectedText: '@',
|
|
2167
2216
|
searchFunction: '=?',
|
|
2168
2217
|
isInline: '=',
|
|
2169
|
-
clearOnSelect: '@'
|
|
2170
|
-
positionFixed: '=' // Dropdown menu will be fixed to page
|
|
2218
|
+
clearOnSelect: '@'
|
|
2171
2219
|
},
|
|
2172
2220
|
controller: function ($scope, $element, $timeout, gettextCatalog) {
|
|
2173
2221
|
if (!$scope.objValue) { $scope.objValue = 'value'; }
|
|
@@ -2188,11 +2236,49 @@ angular.module('niceElements')
|
|
|
2188
2236
|
$scope.isOpen = false;
|
|
2189
2237
|
$scope.selected = null;
|
|
2190
2238
|
$scope.selectedIndex = 0;
|
|
2239
|
+
$scope.popper = null;
|
|
2191
2240
|
|
|
2192
2241
|
$scope.internal = {
|
|
2193
2242
|
search: ""
|
|
2194
2243
|
};
|
|
2195
2244
|
|
|
2245
|
+
// Setup popper
|
|
2246
|
+
// https://popper.js.org/docs/v2/constructors/
|
|
2247
|
+
$scope.setupPopper = function() {
|
|
2248
|
+
var button = $element[0].getElementsByClassName('btn-dropdown')[0];
|
|
2249
|
+
var tooltip = $element[0].getElementsByClassName('nice-dropdown-menu-wrapper')[0];
|
|
2250
|
+
$scope.popper = Popper.createPopper(button, tooltip, {
|
|
2251
|
+
strategy: 'fixed',
|
|
2252
|
+
scroll: true,
|
|
2253
|
+
resize: true,
|
|
2254
|
+
modifiers: [
|
|
2255
|
+
{
|
|
2256
|
+
name: 'offset',
|
|
2257
|
+
options: {
|
|
2258
|
+
offset: [0, 5],
|
|
2259
|
+
},
|
|
2260
|
+
},
|
|
2261
|
+
{
|
|
2262
|
+
name: "sameWidth",
|
|
2263
|
+
enabled: true,
|
|
2264
|
+
phase: "beforeWrite",
|
|
2265
|
+
requires: ["computeStyles"],
|
|
2266
|
+
fn: function(e) {
|
|
2267
|
+
var state = e.state;
|
|
2268
|
+
state.styles.popper.width = `${state.rects.reference.width}px`;
|
|
2269
|
+
},
|
|
2270
|
+
effect: function(e) {
|
|
2271
|
+
var state = e.state;
|
|
2272
|
+
state.elements.popper.style.width = `${
|
|
2273
|
+
state.elements.reference.offsetWidth
|
|
2274
|
+
}px`;
|
|
2275
|
+
}
|
|
2276
|
+
}
|
|
2277
|
+
],
|
|
2278
|
+
});
|
|
2279
|
+
};
|
|
2280
|
+
$scope.setupPopper();
|
|
2281
|
+
|
|
2196
2282
|
// -----------------------------------Open -----------------------------------
|
|
2197
2283
|
$scope.toggle = function () {
|
|
2198
2284
|
if ($scope.isOpen) {
|
|
@@ -2207,10 +2293,10 @@ angular.module('niceElements')
|
|
|
2207
2293
|
};
|
|
2208
2294
|
|
|
2209
2295
|
$scope.open = function () {
|
|
2210
|
-
$scope.focusInput();
|
|
2211
2296
|
$scope.isOpen = true;
|
|
2212
|
-
|
|
2213
|
-
|
|
2297
|
+
$timeout(function () {
|
|
2298
|
+
$scope.popper.update();
|
|
2299
|
+
$scope.focusInput();
|
|
2214
2300
|
$scope.scrollToHover(true);
|
|
2215
2301
|
}, 100);
|
|
2216
2302
|
};
|
|
@@ -2228,18 +2314,18 @@ angular.module('niceElements')
|
|
|
2228
2314
|
|
|
2229
2315
|
|
|
2230
2316
|
// ----------------------------------- Scroll to hover -----------------------------------
|
|
2231
|
-
$scope.scrollToHover = function(notSmooth) {
|
|
2232
|
-
var dropdownMenu = $element[0].getElementsByClassName("dropdown-menu")[0];
|
|
2233
|
-
|
|
2317
|
+
$scope.scrollToHover = function (notSmooth) {
|
|
2318
|
+
var dropdownMenu = $element[0].getElementsByClassName("nice-dropdown-menu")[0];
|
|
2319
|
+
if (!dropdownMenu) return;
|
|
2320
|
+
var dorpdownList = dropdownMenu.getElementsByClassName("nice-dropdown-items")[0];
|
|
2234
2321
|
var hoverItem = dorpdownList.getElementsByClassName("hover")[0];
|
|
2235
|
-
if (hoverItem)
|
|
2236
|
-
|
|
2237
|
-
|
|
2238
|
-
|
|
2239
|
-
|
|
2240
|
-
|
|
2241
|
-
|
|
2242
|
-
}
|
|
2322
|
+
if (!hoverItem) return
|
|
2323
|
+
var topPos = hoverItem.offsetTop;
|
|
2324
|
+
dorpdownList.scroll({
|
|
2325
|
+
top: topPos - 120,
|
|
2326
|
+
left: 0,
|
|
2327
|
+
behavior: notSmooth ? 'auto' : 'smooth'
|
|
2328
|
+
});
|
|
2243
2329
|
};
|
|
2244
2330
|
|
|
2245
2331
|
|
|
@@ -2274,11 +2360,11 @@ angular.module('niceElements')
|
|
|
2274
2360
|
|
|
2275
2361
|
|
|
2276
2362
|
// ----------------------------------- Handle multiple select -----------------------------------
|
|
2277
|
-
$scope.handleMultipleSelect = function(item, index) {
|
|
2363
|
+
$scope.handleMultipleSelect = function (item, index) {
|
|
2278
2364
|
if (!$scope.selected) $scope.selected = [];
|
|
2279
2365
|
|
|
2280
|
-
if(item._selected) {
|
|
2281
|
-
$scope.selected = $scope.selected.filter(function(s) {
|
|
2366
|
+
if (item._selected) {
|
|
2367
|
+
$scope.selected = $scope.selected.filter(function (s) {
|
|
2282
2368
|
return s[$scope.objKey] != item[$scope.objKey];
|
|
2283
2369
|
});
|
|
2284
2370
|
} else {
|
|
@@ -2290,7 +2376,7 @@ angular.module('niceElements')
|
|
|
2290
2376
|
|
|
2291
2377
|
|
|
2292
2378
|
// ----------------------------------- Handle single slect -----------------------------------
|
|
2293
|
-
$scope.handleSingleSelect = function(item, index) {
|
|
2379
|
+
$scope.handleSingleSelect = function (item, index) {
|
|
2294
2380
|
$scope.selected = item;
|
|
2295
2381
|
$scope.close();
|
|
2296
2382
|
$scope.handleSetModel();
|
|
@@ -2298,13 +2384,13 @@ angular.module('niceElements')
|
|
|
2298
2384
|
|
|
2299
2385
|
|
|
2300
2386
|
// ----------------------------------- Handle set model -----------------------------------
|
|
2301
|
-
$scope.handleSetModel = function() {
|
|
2387
|
+
$scope.handleSetModel = function () {
|
|
2302
2388
|
var obj = angular.copy($scope.selected);
|
|
2303
2389
|
|
|
2304
2390
|
if ($scope.selected != null) {
|
|
2305
2391
|
// Remove selected flag
|
|
2306
2392
|
if ($scope.multiple) {
|
|
2307
|
-
angular.forEach(obj, function(o) {
|
|
2393
|
+
angular.forEach(obj, function (o) {
|
|
2308
2394
|
o._selected = undefined;
|
|
2309
2395
|
});
|
|
2310
2396
|
} else {
|
|
@@ -2314,7 +2400,7 @@ angular.module('niceElements')
|
|
|
2314
2400
|
// Selected is object
|
|
2315
2401
|
if ($scope.selectedIsKey) {
|
|
2316
2402
|
if ($scope.multiple) {
|
|
2317
|
-
angular.forEach(obj, function(o) {
|
|
2403
|
+
angular.forEach(obj, function (o) {
|
|
2318
2404
|
o = o[$scope.objKey];
|
|
2319
2405
|
});
|
|
2320
2406
|
} else {
|
|
@@ -2322,7 +2408,7 @@ angular.module('niceElements')
|
|
|
2322
2408
|
}
|
|
2323
2409
|
}
|
|
2324
2410
|
}
|
|
2325
|
-
|
|
2411
|
+
|
|
2326
2412
|
if ($scope.clearOnSelect) {
|
|
2327
2413
|
// Clear on select
|
|
2328
2414
|
$scope.model = null;
|
|
@@ -2339,7 +2425,7 @@ angular.module('niceElements')
|
|
|
2339
2425
|
|
|
2340
2426
|
|
|
2341
2427
|
// ----------------------------------- Handle default -----------------------------------
|
|
2342
|
-
$scope.handleDefault = function() {
|
|
2428
|
+
$scope.handleDefault = function () {
|
|
2343
2429
|
if ($scope.model) $scope.handleModelChange();
|
|
2344
2430
|
if (!$scope.nullable && !$scope.model && !$scope.clearOnSelect && $scope.internalList && $scope.internalList.length > 0) {
|
|
2345
2431
|
$scope.handleSelected($scope.internalList[0], 0);
|
|
@@ -2358,16 +2444,16 @@ angular.module('niceElements')
|
|
|
2358
2444
|
$scope.handleModelChange();
|
|
2359
2445
|
});
|
|
2360
2446
|
|
|
2361
|
-
$scope.handleModelChange = function() {
|
|
2447
|
+
$scope.handleModelChange = function () {
|
|
2362
2448
|
$scope.selected = angular.copy($scope.model);
|
|
2363
|
-
angular.forEach($scope.internalList, function(i, index) {
|
|
2449
|
+
angular.forEach($scope.internalList, function (i, index) {
|
|
2364
2450
|
i._selected = false;
|
|
2365
2451
|
|
|
2366
2452
|
if ($scope.selectedIsKey) {
|
|
2367
2453
|
// Not object
|
|
2368
2454
|
if ($scope.multiple) {
|
|
2369
2455
|
// Multiple
|
|
2370
|
-
angular.forEach($scope.selected, function(s) {
|
|
2456
|
+
angular.forEach($scope.selected, function (s) {
|
|
2371
2457
|
if (i[$scope.objKey] == s) {
|
|
2372
2458
|
i._selected = true;
|
|
2373
2459
|
// $scope.selected.push(i);
|
|
@@ -2382,12 +2468,12 @@ angular.module('niceElements')
|
|
|
2382
2468
|
$scope.selectedIndex = index;
|
|
2383
2469
|
$scope.scrollToHover();
|
|
2384
2470
|
}
|
|
2385
|
-
}
|
|
2471
|
+
}
|
|
2386
2472
|
} else {
|
|
2387
2473
|
// Is object
|
|
2388
2474
|
if ($scope.multiple) {
|
|
2389
2475
|
// Multiple
|
|
2390
|
-
angular.forEach($scope.selected, function(s) {
|
|
2476
|
+
angular.forEach($scope.selected, function (s) {
|
|
2391
2477
|
if (i[$scope.objKey] == s[$scope.objKey]) {
|
|
2392
2478
|
i._selected = true;
|
|
2393
2479
|
// $scope.selected.push(i);
|
|
@@ -2406,41 +2492,16 @@ angular.module('niceElements')
|
|
|
2406
2492
|
}
|
|
2407
2493
|
});
|
|
2408
2494
|
}
|
|
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
2495
|
|
|
2435
2496
|
// ----------------------------------- Watch for keydown and keypress -----------------------------------
|
|
2436
2497
|
$element.bind("keydown keypress", function (event) {
|
|
2437
2498
|
// Arrow Up
|
|
2438
2499
|
if (event.keyCode == 38) {
|
|
2439
2500
|
event.preventDefault();
|
|
2440
|
-
$timeout(function() {
|
|
2441
|
-
if (
|
|
2501
|
+
$timeout(function () {
|
|
2502
|
+
if ($scope.selectedIndex > 0) {
|
|
2442
2503
|
$scope.selectedIndex -= 1;
|
|
2443
|
-
$timeout(function() {
|
|
2504
|
+
$timeout(function () {
|
|
2444
2505
|
$scope.scrollToHover();
|
|
2445
2506
|
});
|
|
2446
2507
|
}
|
|
@@ -2450,10 +2511,10 @@ angular.module('niceElements')
|
|
|
2450
2511
|
// Arrow Down
|
|
2451
2512
|
if (event.keyCode == 40) {
|
|
2452
2513
|
event.preventDefault();
|
|
2453
|
-
$timeout(function() {
|
|
2514
|
+
$timeout(function () {
|
|
2454
2515
|
if ($scope.internalList && $scope.selectedIndex < $scope.internalList.length - 1) {
|
|
2455
2516
|
$scope.selectedIndex += 1;
|
|
2456
|
-
$timeout(function() {
|
|
2517
|
+
$timeout(function () {
|
|
2457
2518
|
$scope.scrollToHover();
|
|
2458
2519
|
});
|
|
2459
2520
|
}
|
|
@@ -2463,14 +2524,14 @@ angular.module('niceElements')
|
|
|
2463
2524
|
// Enter
|
|
2464
2525
|
if (event.keyCode == 13) {
|
|
2465
2526
|
event.preventDefault();
|
|
2466
|
-
$timeout(function() {
|
|
2527
|
+
$timeout(function () {
|
|
2467
2528
|
$scope.handleSelected($scope.internalList[$scope.selectedIndex], $scope.selectedIndex);
|
|
2468
2529
|
});
|
|
2469
2530
|
}
|
|
2470
2531
|
|
|
2471
2532
|
// Escape
|
|
2472
2533
|
if (event.keyCode == 27) {
|
|
2473
|
-
$timeout(function() {
|
|
2534
|
+
$timeout(function () {
|
|
2474
2535
|
$scope.close();
|
|
2475
2536
|
});
|
|
2476
2537
|
}
|
|
@@ -4323,6 +4384,42 @@ angular.module('niceElements')
|
|
|
4323
4384
|
|
|
4324
4385
|
if (!$scope.debounceTime) $scope.debounceTime = 500;
|
|
4325
4386
|
if (!$scope.model) $scope.model = "";
|
|
4387
|
+
|
|
4388
|
+
// Setup popper
|
|
4389
|
+
// https://popper.js.org/docs/v2/constructors/
|
|
4390
|
+
$scope.setupPopper = function() {
|
|
4391
|
+
var button = $element[0].getElementsByClassName('nice-search-button')[0];
|
|
4392
|
+
var tooltip = $element[0].getElementsByClassName('nice-search-dropdown-wrapper')[0];
|
|
4393
|
+
$scope.popper = Popper.createPopper(button, tooltip, {
|
|
4394
|
+
strategy: 'fixed',
|
|
4395
|
+
placement: 'bottom-start',
|
|
4396
|
+
modifiers: [
|
|
4397
|
+
{
|
|
4398
|
+
name: 'offset',
|
|
4399
|
+
options: {
|
|
4400
|
+
offset: [0, 5],
|
|
4401
|
+
},
|
|
4402
|
+
},
|
|
4403
|
+
{
|
|
4404
|
+
name: "sameWidth",
|
|
4405
|
+
enabled: true,
|
|
4406
|
+
phase: "beforeWrite",
|
|
4407
|
+
requires: ["computeStyles"],
|
|
4408
|
+
fn: function(e) {
|
|
4409
|
+
var state = e.state;
|
|
4410
|
+
state.styles.popper.width = `${state.rects.reference.width}px`;
|
|
4411
|
+
},
|
|
4412
|
+
effect: function(e) {
|
|
4413
|
+
var state = e.state;
|
|
4414
|
+
state.elements.popper.style.width = `${
|
|
4415
|
+
state.elements.reference.offsetWidth
|
|
4416
|
+
}px`;
|
|
4417
|
+
}
|
|
4418
|
+
}
|
|
4419
|
+
],
|
|
4420
|
+
});
|
|
4421
|
+
};
|
|
4422
|
+
$scope.setupPopper();
|
|
4326
4423
|
|
|
4327
4424
|
// ------------------- On focus -------------------
|
|
4328
4425
|
$scope.onFocus = function() {
|
|
@@ -4340,6 +4437,9 @@ angular.module('niceElements')
|
|
|
4340
4437
|
// ------------------- On focus -------------------
|
|
4341
4438
|
$scope.open = function() {
|
|
4342
4439
|
$scope.isOpen = true;
|
|
4440
|
+
$timeout(function() {
|
|
4441
|
+
if ($scope.popper) $scope.popper.update();
|
|
4442
|
+
});
|
|
4343
4443
|
};
|
|
4344
4444
|
|
|
4345
4445
|
|
|
@@ -4349,6 +4449,10 @@ angular.module('niceElements')
|
|
|
4349
4449
|
|
|
4350
4450
|
var input = $element[0].getElementsByTagName('input')[0];
|
|
4351
4451
|
if (input) input.blur();
|
|
4452
|
+
|
|
4453
|
+
$timeout(function() {
|
|
4454
|
+
$scope.popper.update();
|
|
4455
|
+
})
|
|
4352
4456
|
};
|
|
4353
4457
|
|
|
4354
4458
|
|
|
@@ -5071,12 +5175,13 @@ angular.module('niceElements').run(['$templateCache', function($templateCache) {
|
|
|
5071
5175
|
"</div>\n" +
|
|
5072
5176
|
"<div class=\"nice-field col-xs-12\" ng-class=\"[fieldWidth ? fieldWidth : 'col-sm-8', { 'nice-disabled': isDisabled }]\">\n" +
|
|
5073
5177
|
"<div class=\"disabled-shield\" ng-if=\"isDisabled\"></div>\n" +
|
|
5074
|
-
"<div class=\"input-group\" ng-class=\"{ 'open': isOpen }\" ng-
|
|
5178
|
+
"<div class=\"nice-date-button input-group\" ng-class=\"{ 'open': isOpen }\" ng-show=\"!inline\" ng-click=\"toggleOpen()\">\n" +
|
|
5075
5179
|
"<input type=\"text\" class=\"form-control\" value=\"{{ model | niceDate:time }}\" readonly=\"readonly\">\n" +
|
|
5076
5180
|
"<span class=\"input-group-addon clickable\">\n" +
|
|
5077
5181
|
"<i class=\"fa fa-calendar\"></i>\n" +
|
|
5078
5182
|
"</span>\n" +
|
|
5079
5183
|
"</div>\n" +
|
|
5184
|
+
"<div ng-class=\"{ 'nice-date-dropdown-wrapper': !inline }\">\n" +
|
|
5080
5185
|
"<div ng-class=\"{ 'nice-date-dropdown': !inline }\" ng-if=\"inline || isOpen\">\n" +
|
|
5081
5186
|
"<div class=\"nice-date-date\" ng-class=\"{ 'with-time': time }\">\n" +
|
|
5082
5187
|
"<div class=\"nice-date-header\">\n" +
|
|
@@ -5095,13 +5200,13 @@ angular.module('niceElements').run(['$templateCache', function($templateCache) {
|
|
|
5095
5200
|
"</div>\n" +
|
|
5096
5201
|
"<div class=\"nice-date-week\" ng-repeat=\"week in weeks\">\n" +
|
|
5097
5202
|
"<span class=\"nice-date-day\" title=\"{{ day.value }}\" ng-class=\"{\n" +
|
|
5098
|
-
"
|
|
5099
|
-
"
|
|
5100
|
-
"
|
|
5101
|
-
"
|
|
5102
|
-
"
|
|
5103
|
-
"
|
|
5104
|
-
"
|
|
5203
|
+
" 'today': day.isToday,\n" +
|
|
5204
|
+
" 'different-month': !day.isCurrentMonth,\n" +
|
|
5205
|
+
" 'selected': isSameDay(model, day.date),\n" +
|
|
5206
|
+
" 'weekend': day.isWeekday,\n" +
|
|
5207
|
+
" 'disabled': day.isDisabled,\n" +
|
|
5208
|
+
" 'between': isBetween(day.date, model, nextDate)\n" +
|
|
5209
|
+
" }\" ng-click=\"select(day)\" ng-repeat=\"day in week.days\">{{ day.number }}</span>\n" +
|
|
5105
5210
|
"</div>\n" +
|
|
5106
5211
|
"</div>\n" +
|
|
5107
5212
|
"<div class=\"nice-date-time\" ng-if=\"time\">\n" +
|
|
@@ -5119,6 +5224,7 @@ angular.module('niceElements').run(['$templateCache', function($templateCache) {
|
|
|
5119
5224
|
"</div>\n" +
|
|
5120
5225
|
"</div>\n" +
|
|
5121
5226
|
"</div>\n" +
|
|
5227
|
+
"</div>\n" +
|
|
5122
5228
|
"</div>"
|
|
5123
5229
|
);
|
|
5124
5230
|
|
|
@@ -5157,11 +5263,12 @@ angular.module('niceElements').run(['$templateCache', function($templateCache) {
|
|
|
5157
5263
|
"<nice-help class=\"nice-title-help\" ng-if=\"help\" text=\"{{ help }}\"></nice-help>\n" +
|
|
5158
5264
|
"</div>\n" +
|
|
5159
5265
|
"<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" +
|
|
5266
|
+
"<div class=\"nice-daterange-picker-button input-group\" ng-class=\"{ 'open': isOpen }\" ng-click=\"open()\">\n" +
|
|
5161
5267
|
"<input type=\"text\" class=\"form-control\" value=\"{{ modelFormat }}\" readonly=\"readonly\">\n" +
|
|
5162
5268
|
"<span class=\"input-group-addon clickable\"><i class=\"fa fa-calendar\"></i></span>\n" +
|
|
5163
5269
|
"</div>\n" +
|
|
5164
|
-
"<div class=\"
|
|
5270
|
+
"<div class=\"nice-daterange-picker-wrapper\">\n" +
|
|
5271
|
+
"<div class=\"dtp-wrapper\" ng-if=\"isOpen\">\n" +
|
|
5165
5272
|
"<div class=\"dtp-buttons-left\">\n" +
|
|
5166
5273
|
"<div class=\"dtp-buttons-top\">\n" +
|
|
5167
5274
|
"<a class=\"btn btn-primary btn-block\" ng-click=\"selectToday()\" translate translate-context=\"Nice\">Last 24 hours</a>\n" +
|
|
@@ -5183,6 +5290,7 @@ angular.module('niceElements').run(['$templateCache', function($templateCache) {
|
|
|
5183
5290
|
"</div>\n" +
|
|
5184
5291
|
"</div>\n" +
|
|
5185
5292
|
"</div>\n" +
|
|
5293
|
+
"</div>\n" +
|
|
5186
5294
|
"</div>"
|
|
5187
5295
|
);
|
|
5188
5296
|
|
|
@@ -5325,23 +5433,25 @@ angular.module('niceElements').run(['$templateCache', function($templateCache) {
|
|
|
5325
5433
|
"<span class=\"caret\" ng-show=\"!loading\"></span>\n" +
|
|
5326
5434
|
"<nice-loader visible-when=\"!loading\"></nice-loader>\n" +
|
|
5327
5435
|
"</button>\n" +
|
|
5328
|
-
"<div class=\"
|
|
5436
|
+
"<div class=\"nice-dropdown-menu-wrapper\">\n" +
|
|
5437
|
+
"<div class=\"nice-dropdown-menu\" ng-if=\"isOpen\">\n" +
|
|
5329
5438
|
"<div class=\"search-bar\" ng-if=\"searchFunction\">\n" +
|
|
5330
5439
|
"<input ng-model=\"internal.search\" ng-model-options=\"{ debounce: 500 }\" ng-change=\"handleSearch()\" placeholder=\"{{ searchText }}\">\n" +
|
|
5331
5440
|
"<span class=\"icon\"><i class=\"fa fa-search\"></i></span>\n" +
|
|
5332
5441
|
"</div>\n" +
|
|
5442
|
+
"<div class=\"nice-dropdown-items\">\n" +
|
|
5333
5443
|
"<div class=\"nice-no-data\" ng-if=\"internalList && internalList.length == 0\">{{ noDataText }}</div>\n" +
|
|
5334
|
-
"<
|
|
5335
|
-
"<li class=\"null-item\" ng-if=\"nullable && internalList.length != 0\" ng-click=\"handleSelected(null, -1)\">\n" +
|
|
5444
|
+
"<div class=\"nice-dropdown-item null-item\" ng-if=\"nullable && internalList.length != 0\" ng-click=\"handleSelected(null, -1)\">\n" +
|
|
5336
5445
|
"{{ nullableText }}\n" +
|
|
5337
|
-
"</
|
|
5338
|
-
"<
|
|
5446
|
+
"</div>\n" +
|
|
5447
|
+
"<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
5448
|
"<span class=\"choice-checkbox\" ng-if=\"multiple\"><i class=\"fa fa-check\"></i></span>\n" +
|
|
5340
5449
|
"<span ng-transclude=\"option\">\n" +
|
|
5341
5450
|
"<span ng-class=\"{ 'multiple-item': multiple }\">{{ item[objValue] }}</span>\n" +
|
|
5342
5451
|
"</span>\n" +
|
|
5343
|
-
"</
|
|
5344
|
-
"</
|
|
5452
|
+
"</div>\n" +
|
|
5453
|
+
"</div>\n" +
|
|
5454
|
+
"</div>\n" +
|
|
5345
5455
|
"</div>\n" +
|
|
5346
5456
|
"<button class=\"btn btn-primary add-btn\" type=\"button\" ng-if=\"addButtonFunction && !isDisabled\" ng-click=\"addButtonFunction()\">+</button>\n" +
|
|
5347
5457
|
"</div>\n" +
|
|
@@ -5672,13 +5782,15 @@ angular.module('niceElements').run(['$templateCache', function($templateCache) {
|
|
|
5672
5782
|
"<nice-help class=\"nice-title-help\" ng-if=\"help\" text=\"{{ help }}\"></nice-help>\n" +
|
|
5673
5783
|
"</div>\n" +
|
|
5674
5784
|
"<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" +
|
|
5785
|
+
"<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
5786
|
"<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
5787
|
"<span class=\"input-group-addon clickable\" ng-click=\"onFocus()\">\n" +
|
|
5678
5788
|
"<i ng-show=\"!loading\" class=\"fa fa-search\"></i>\n" +
|
|
5679
5789
|
"<i ng-show=\"loading\" class=\"fa fa-refresh fa-spin\"></i>\n" +
|
|
5680
5790
|
"</span>\n" +
|
|
5681
|
-
"
|
|
5791
|
+
"</div>\n" +
|
|
5792
|
+
"<div class=\"nice-search-dropdown-wrapper\">\n" +
|
|
5793
|
+
"<div class=\"nice-search-dropdown\" ng-if=\"showDropdown && isOpen\">\n" +
|
|
5682
5794
|
"<div class=\"nice-search-row nice-search-row-loading\" ng-if=\"loading && results.length == 0\">\n" +
|
|
5683
5795
|
"<nice-loader visible-when=\"!loading\"></nice-loader>\n" +
|
|
5684
5796
|
"</div>\n" +
|