nice-elements 1.15.1 → 1.16.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +14 -0
- package/CLAUDE.md +1 -0
- package/README.md +1 -1
- package/bower.json +1 -1
- package/dist/nice.js +573 -468
- package/dist/nice.min.js +1 -1
- package/dist/style.css +122 -104
- package/dist/style.css.map +1 -1
- package/dist/style.min.css +2 -2
- package/package.json +5 -6
- package/src/components/nice-calendar/nice-calendar.html +3 -4
- package/src/components/nice-calendar/nice-calendar.scss +0 -9
- package/src/components/nice-date/nice-date-picker.html +60 -0
- package/src/components/nice-date/nice-date.html +29 -86
- package/src/components/nice-date/nice-date.js +7 -35
- package/src/components/nice-date/nice-date.scss +6 -15
- package/src/components/nice-datetime-picker/nice-datetime-picker.html +1 -4
- package/src/components/nice-datetime-picker/nice-datetime-picker.scss +9 -12
- package/src/components/nice-datetimerange-picker/nice-datetimerange-picker.html +1 -3
- package/src/components/nice-datetimerange-picker-2/nice-datetimerange-picker-2.html +32 -30
- package/src/components/nice-datetimerange-picker-2/nice-datetimerange-picker-2.js +1 -33
- package/src/components/nice-datetimerange-picker-2/nice-datetimerange-picker-2.scss +7 -12
- package/src/components/nice-dropdown/nice-dropdown.html +42 -40
- package/src/components/nice-dropdown/nice-dropdown.js +52 -54
- package/src/components/nice-dropdown/nice-dropdown.scss +25 -4
- package/src/components/nice-dropdown-old/nice-dropdown-old.html +1 -1
- package/src/components/nice-dropdown-old/nice-dropdown-old.scss +8 -2
- package/src/components/nice-dtp/nice-dtp.html +7 -7
- package/src/components/nice-options/nice-options.scss +4 -0
- package/src/components/nice-popup/nice-popup.html +4 -4
- package/src/components/nice-popup/nice-popup.js +61 -75
- package/src/components/nice-popup/nice-popup.scss +10 -31
- package/src/components/nice-search/nice-search.html +0 -3
- package/src/components/nice-search2/nice-search2.html +22 -18
- package/src/components/nice-search2/nice-search2.js +1 -56
- package/src/components/nice-search2/nice-search2.scss +3 -2
- package/src/components/nice-svgs/nice-svgs.html +8 -0
- package/src/components/nice-time-picker/nice-time-picker.html +1 -3
- package/src/components/nice-time-picker/nice-time-picker.scss +0 -8
- package/src/directives/nice-tooltip/_nice-tooltip.scss +7 -28
- package/src/directives/nice-tooltip/nice-tooltip.js +16 -29
- package/src/services/nice-service.js +236 -1
- package/src/styles/_nice-anchored.scss +75 -0
- 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: '@', //
|
|
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: '@', //
|
|
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: '@', //
|
|
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
|
-
//
|
|
2922
|
-
|
|
2923
|
-
|
|
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
|
-
|
|
5299
|
-
|
|
5300
|
-
|
|
5301
|
-
|
|
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
|
|
5307
|
-
|
|
5308
|
-
if (!$scope.
|
|
5309
|
-
if (!$scope.
|
|
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.
|
|
5313
|
-
|
|
5314
|
-
|
|
5315
|
-
//
|
|
5316
|
-
//
|
|
5317
|
-
|
|
5318
|
-
|
|
5319
|
-
|
|
5320
|
-
//
|
|
5321
|
-
|
|
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
|
-
|
|
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
|
-
|
|
5342
|
-
|
|
5343
|
-
|
|
5344
|
-
|
|
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
|
-
|
|
5373
|
-
|
|
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 (
|
|
5380
|
-
|
|
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
|
-
|
|
5401
|
-
|
|
5402
|
-
|
|
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
|
/**
|
|
@@ -5821,7 +5746,7 @@ angular.module('niceElements')
|
|
|
5821
5746
|
isInline: '=',
|
|
5822
5747
|
help: '@',
|
|
5823
5748
|
required: '=',
|
|
5824
|
-
placement: '@', //
|
|
5749
|
+
placement: '@', // Preferred placement of the dropdown (nice-popup)
|
|
5825
5750
|
},
|
|
5826
5751
|
controller: function ($scope, $timeout, $element) {
|
|
5827
5752
|
$scope.loading = false;
|
|
@@ -5836,51 +5761,6 @@ angular.module('niceElements')
|
|
|
5836
5761
|
if (!$scope.model) $scope.model = "";
|
|
5837
5762
|
if (!$scope.placement) { $scope.placement = "bottom-start"; }
|
|
5838
5763
|
|
|
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
|
-
});
|
|
5870
|
-
};
|
|
5871
|
-
|
|
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
5764
|
// ------------------- On focus -------------------
|
|
5885
5765
|
$scope.onFocus = function () {
|
|
5886
5766
|
if ($scope.showDropdown && $scope.results.length == 0) {
|
|
@@ -5903,22 +5783,12 @@ angular.module('niceElements')
|
|
|
5903
5783
|
// ------------------- On focus -------------------
|
|
5904
5784
|
$scope.open = function () {
|
|
5905
5785
|
$scope.isOpen = true;
|
|
5906
|
-
$timeout(function () {
|
|
5907
|
-
if ($scope.popper) $scope.popper.update();
|
|
5908
|
-
});
|
|
5909
5786
|
};
|
|
5910
5787
|
|
|
5911
5788
|
|
|
5912
5789
|
// ------------------- On blur -------------------
|
|
5913
5790
|
$scope.close = function () {
|
|
5914
5791
|
$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
5792
|
};
|
|
5923
5793
|
|
|
5924
5794
|
|
|
@@ -7104,24 +6974,27 @@ angular.module('niceElements')
|
|
|
7104
6974
|
* @name niceElements.directive:niceTooltip
|
|
7105
6975
|
* @description
|
|
7106
6976
|
* # niceTooltip
|
|
6977
|
+
* Positioned with NiceService.anchor() (native popover + CSS anchor positioning, Popper fallback).
|
|
7107
6978
|
*/
|
|
7108
6979
|
angular.module('niceElements')
|
|
7109
6980
|
.directive('niceTooltip', function () {
|
|
7110
6981
|
return {
|
|
7111
6982
|
restrict: 'A',
|
|
7112
|
-
controller: function ($scope, $element, $attrs, $injector) {
|
|
6983
|
+
controller: function ($scope, $element, $attrs, $injector, NiceService) {
|
|
7113
6984
|
const id = Math.random().toString(36).substring(7);
|
|
7114
6985
|
const showEvents = ['mouseenter', 'focus'];
|
|
7115
6986
|
const hideEvents = ['mouseleave', 'blur'];
|
|
7116
|
-
|
|
6987
|
+
// "auto" variants → top variants (flips when there is no space)
|
|
6988
|
+
const placement = ($attrs.niceTooltipPlacement || 'top').replace(/^auto/, 'top');
|
|
7117
6989
|
|
|
7118
|
-
// Create
|
|
7119
|
-
$element.addClass(
|
|
6990
|
+
// Create tooltip window
|
|
6991
|
+
$element.addClass('nice-tooltip');
|
|
7120
6992
|
const tooltipWindow = document.createElement('div');
|
|
7121
6993
|
tooltipWindow.className = 'nice-tooltip-window';
|
|
7122
6994
|
tooltipWindow.id = 'nice-tooltip-window-' + id;
|
|
6995
|
+
tooltipWindow.setAttribute('role', 'tooltip');
|
|
7123
6996
|
|
|
7124
|
-
//
|
|
6997
|
+
// Tooltip body. The attribute's {{ }} is interpolated by Angular, but the
|
|
7125
6998
|
// resulting text is never compiled, so user data can't run as a template.
|
|
7126
6999
|
// Safe HTML is kept when the app loads ngSanitize; otherwise it's plain text.
|
|
7127
7000
|
const content = document.createElement('div');
|
|
@@ -7135,44 +7008,28 @@ angular.module('niceElements')
|
|
|
7135
7008
|
else content.textContent = value;
|
|
7136
7009
|
});
|
|
7137
7010
|
|
|
7138
|
-
//
|
|
7011
|
+
// Arrow
|
|
7139
7012
|
const tooltipWindowArrow = document.createElement('div');
|
|
7140
7013
|
tooltipWindowArrow.className = 'nice-tooltip-window-arrow';
|
|
7141
|
-
tooltipWindowArrow.setAttribute("data-popper-arrow", "");
|
|
7142
7014
|
tooltipWindow.append(tooltipWindowArrow);
|
|
7143
7015
|
|
|
7144
7016
|
// Add to body
|
|
7145
7017
|
document.body.append(tooltipWindow);
|
|
7146
7018
|
|
|
7147
|
-
|
|
7148
|
-
const popper = Popper.createPopper($element[0], tooltipWindow, {
|
|
7019
|
+
const anchored = NiceService.anchor($element[0], tooltipWindow, {
|
|
7149
7020
|
placement: placement,
|
|
7150
|
-
|
|
7151
|
-
|
|
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
|
-
],
|
|
7021
|
+
offset: 8,
|
|
7022
|
+
arrow: tooltipWindowArrow,
|
|
7023
|
+
onEscape: hide
|
|
7166
7024
|
});
|
|
7167
7025
|
|
|
7168
7026
|
function show() {
|
|
7169
7027
|
if ($attrs.niceTooltipDisabled == true || $attrs.niceTooltipDisabled == "true") return;
|
|
7170
|
-
|
|
7171
|
-
popper.update();
|
|
7028
|
+
anchored.open();
|
|
7172
7029
|
}
|
|
7173
7030
|
|
|
7174
7031
|
function hide() {
|
|
7175
|
-
|
|
7032
|
+
anchored.close();
|
|
7176
7033
|
}
|
|
7177
7034
|
|
|
7178
7035
|
showEvents.forEach((event) => {
|
|
@@ -7185,8 +7042,8 @@ angular.module('niceElements')
|
|
|
7185
7042
|
|
|
7186
7043
|
// On destroy
|
|
7187
7044
|
$scope.$on('$destroy', function () {
|
|
7045
|
+
anchored.destroy();
|
|
7188
7046
|
tooltipWindow.remove();
|
|
7189
|
-
if (popper) popper.destroy();
|
|
7190
7047
|
});
|
|
7191
7048
|
}
|
|
7192
7049
|
};
|
|
@@ -7202,9 +7059,147 @@ angular.module('niceElements')
|
|
|
7202
7059
|
*/
|
|
7203
7060
|
angular.module('niceElements')
|
|
7204
7061
|
.service('NiceService', function ($rootScope) {
|
|
7062
|
+
// Can `el` scroll further in the wheel's direction?
|
|
7063
|
+
function canScroll(el, deltaY) {
|
|
7064
|
+
if (!/(auto|scroll)/.test(getComputedStyle(el).overflowY)) return false;
|
|
7065
|
+
if (deltaY > 0) return el.scrollTop + el.clientHeight < el.scrollHeight;
|
|
7066
|
+
return el.scrollTop > 0;
|
|
7067
|
+
}
|
|
7068
|
+
|
|
7069
|
+
// Nearest scrollable ancestor of `el` (null when only the page itself scrolls)
|
|
7070
|
+
function scrollParent(el) {
|
|
7071
|
+
for (el = el.parentElement; el && el !== document.body; el = el.parentElement) {
|
|
7072
|
+
if (/(auto|scroll)/.test(getComputedStyle(el).overflowY) && el.scrollHeight > el.clientHeight) return el;
|
|
7073
|
+
}
|
|
7074
|
+
return null;
|
|
7075
|
+
}
|
|
7076
|
+
|
|
7077
|
+
// Turns show/hide of NiceService.anchor() into open/close that, while open:
|
|
7078
|
+
// - listen for Escape (options.onEscape decides what happens)
|
|
7079
|
+
// - let the mouse wheel over the content scroll the page behind it
|
|
7080
|
+
// - clip the content where the target scrolled out of its scroll container
|
|
7081
|
+
function withEvents(target, content, options, mode) {
|
|
7082
|
+
function onKeydown(event) {
|
|
7083
|
+
if (event.key === 'Escape' && options.onEscape) options.onEscape(event);
|
|
7084
|
+
}
|
|
7085
|
+
|
|
7086
|
+
// The content is position: fixed, so the browser only passes the wheel on to the
|
|
7087
|
+
// window, never to the scroll container the target is in. Do that ourselves.
|
|
7088
|
+
function onWheel(event) {
|
|
7089
|
+
// Scrollable parts of the content (e.g. a long list) scroll themselves first
|
|
7090
|
+
for (let el = event.target; el && el !== content.parentElement; el = el.parentElement) {
|
|
7091
|
+
if (canScroll(el, event.deltaY)) return;
|
|
7092
|
+
}
|
|
7093
|
+
const scroller = scrollParent(target);
|
|
7094
|
+
if (!scroller) return; // the window scrolls by itself
|
|
7095
|
+
const lineHeight = event.deltaMode === 1 ? 16 : 1; // Firefox can report lines
|
|
7096
|
+
scroller.scrollBy(event.deltaX * lineHeight, event.deltaY * lineHeight);
|
|
7097
|
+
}
|
|
7098
|
+
|
|
7099
|
+
// The content is in the top layer, so the target's scroll container doesn't clip it.
|
|
7100
|
+
// When the target scrolls out of that container (e.g. under the nice-view header),
|
|
7101
|
+
// cut the content off at the container's edge on that side, so it slides under the
|
|
7102
|
+
// header like normal content. Other sides stay open, so it can still stick out of
|
|
7103
|
+
// a small scroll box or modal.
|
|
7104
|
+
//
|
|
7105
|
+
// The browser moves anchored content one frame after a scroll, so its position
|
|
7106
|
+
// can't be read while scrolling. It moves together with the target though, so we
|
|
7107
|
+
// measure its offset from the target once it has settled and add that to the
|
|
7108
|
+
// target's (always current) position.
|
|
7109
|
+
let offset = null;
|
|
7110
|
+
function measure() {
|
|
7111
|
+
const t = target.getBoundingClientRect();
|
|
7112
|
+
const c = content.getBoundingClientRect();
|
|
7113
|
+
offset = { top: c.top - t.top, left: c.left - t.left };
|
|
7114
|
+
}
|
|
7115
|
+
|
|
7116
|
+
function clip() {
|
|
7117
|
+
const scroller = scrollParent(target);
|
|
7118
|
+
if (!scroller || !offset) {
|
|
7119
|
+
content.style.clipPath = '';
|
|
7120
|
+
return;
|
|
7121
|
+
}
|
|
7122
|
+
|
|
7123
|
+
const box = scroller.getBoundingClientRect();
|
|
7124
|
+
const t = target.getBoundingClientRect();
|
|
7125
|
+
// Where the content is now: target position + measured offset
|
|
7126
|
+
const c = {
|
|
7127
|
+
top: t.top + offset.top,
|
|
7128
|
+
left: t.left + offset.left,
|
|
7129
|
+
bottom: t.top + offset.top + content.offsetHeight,
|
|
7130
|
+
right: t.left + offset.left + content.offsetWidth
|
|
7131
|
+
};
|
|
7132
|
+
const open = -9999; // negative inset = no clipping (keeps arrow and shadow)
|
|
7133
|
+
const top = t.top < box.top ? box.top - c.top : open;
|
|
7134
|
+
const right = t.right > box.right ? c.right - box.right : open;
|
|
7135
|
+
const bottom = t.bottom > box.bottom ? c.bottom - box.bottom : open;
|
|
7136
|
+
const left = t.left < box.left ? box.left - c.left : open;
|
|
7137
|
+
|
|
7138
|
+
if (top == open && right == open && bottom == open && left == open) content.style.clipPath = '';
|
|
7139
|
+
else content.style.clipPath = 'inset(' + top + 'px ' + right + 'px ' + bottom + 'px ' + left + 'px)';
|
|
7140
|
+
}
|
|
7141
|
+
|
|
7142
|
+
// Measure again once things settled (two frames: the browser is one frame behind),
|
|
7143
|
+
// e.g. after opening, a resize, or when scrolling stopped (it may have flipped)
|
|
7144
|
+
let settleTimer = null;
|
|
7145
|
+
function measureLater(delay) {
|
|
7146
|
+
clearTimeout(settleTimer);
|
|
7147
|
+
settleTimer = setTimeout(function () {
|
|
7148
|
+
requestAnimationFrame(function () {
|
|
7149
|
+
requestAnimationFrame(function () {
|
|
7150
|
+
measure();
|
|
7151
|
+
clip();
|
|
7152
|
+
});
|
|
7153
|
+
});
|
|
7154
|
+
}, delay);
|
|
7155
|
+
}
|
|
7156
|
+
|
|
7157
|
+
function onScroll() {
|
|
7158
|
+
clip();
|
|
7159
|
+
measureLater(100);
|
|
7160
|
+
}
|
|
7161
|
+
|
|
7162
|
+
function removeListeners() {
|
|
7163
|
+
document.removeEventListener('keydown', onKeydown);
|
|
7164
|
+
content.removeEventListener('wheel', onWheel);
|
|
7165
|
+
document.removeEventListener('scroll', onScroll, true); // true: scroll of any element
|
|
7166
|
+
window.removeEventListener('resize', onScroll);
|
|
7167
|
+
clearTimeout(settleTimer);
|
|
7168
|
+
}
|
|
7169
|
+
|
|
7170
|
+
function close() {
|
|
7171
|
+
mode.hide();
|
|
7172
|
+
removeListeners();
|
|
7173
|
+
content.style.clipPath = '';
|
|
7174
|
+
}
|
|
7175
|
+
|
|
7176
|
+
return {
|
|
7177
|
+
open: function () {
|
|
7178
|
+
mode.show();
|
|
7179
|
+
// remove first, so opening twice doesn't add them twice
|
|
7180
|
+
removeListeners();
|
|
7181
|
+
document.addEventListener('keydown', onKeydown);
|
|
7182
|
+
content.addEventListener('wheel', onWheel, { passive: true });
|
|
7183
|
+
document.addEventListener('scroll', onScroll, { capture: true, passive: true });
|
|
7184
|
+
window.addEventListener('resize', onScroll);
|
|
7185
|
+
offset = null;
|
|
7186
|
+
measureLater(0);
|
|
7187
|
+
},
|
|
7188
|
+
close: close,
|
|
7189
|
+
update: function () {
|
|
7190
|
+
mode.update();
|
|
7191
|
+
measureLater(0);
|
|
7192
|
+
},
|
|
7193
|
+
destroy: function () {
|
|
7194
|
+
close();
|
|
7195
|
+
mode.destroy();
|
|
7196
|
+
}
|
|
7197
|
+
};
|
|
7198
|
+
}
|
|
7199
|
+
|
|
7205
7200
|
const service = {
|
|
7206
7201
|
name: "Nice elements",
|
|
7207
|
-
version: "1.
|
|
7202
|
+
version: "1.16.0",
|
|
7208
7203
|
getHeader: function () {
|
|
7209
7204
|
return {};
|
|
7210
7205
|
},
|
|
@@ -7226,6 +7221,103 @@ angular.module('niceElements')
|
|
|
7226
7221
|
$scope[name] = service.isOn(value);
|
|
7227
7222
|
});
|
|
7228
7223
|
},
|
|
7224
|
+
// Can the browser position popovers natively (popover API + CSS anchor positioning)?
|
|
7225
|
+
supportsAnchor: function () {
|
|
7226
|
+
return !!(window.CSS && CSS.supports('anchor-name', '--a') && ('popover' in HTMLElement.prototype));
|
|
7227
|
+
},
|
|
7228
|
+
// Position `content` next to `target` (used by nice-popup and nice-tooltip).
|
|
7229
|
+
// Native: content becomes a manual popover (top layer) positioned with CSS anchor
|
|
7230
|
+
// positioning, see src/styles/_nice-anchored.scss. Fallback: Popper.js.
|
|
7231
|
+
// options: placement ("bottom-start", "auto", ...), offset (px gap), skidding (px shift
|
|
7232
|
+
// along the target), sameWidth (content as wide as target), arrow (element inside content),
|
|
7233
|
+
// onEscape (called when Escape is pressed while open; the owner closes it).
|
|
7234
|
+
// While open, the mouse wheel over the content scrolls the page behind it.
|
|
7235
|
+
// Returns { open(), close(), update(), destroy() }
|
|
7236
|
+
anchor: function (target, content, options) {
|
|
7237
|
+
options = options || {};
|
|
7238
|
+
const placement = options.placement || 'bottom';
|
|
7239
|
+
const offset = options.offset || 0;
|
|
7240
|
+
const skidding = options.skidding || 0;
|
|
7241
|
+
|
|
7242
|
+
if (service.supportsAnchor()) {
|
|
7243
|
+
// "auto" → bottom, CSS flips it when there is no space
|
|
7244
|
+
const native = placement.replace(/^auto/, 'bottom');
|
|
7245
|
+
const side = native.split('-')[0];
|
|
7246
|
+
const align = native.split('-')[1];
|
|
7247
|
+
const vertical = side == 'top' || side == 'bottom';
|
|
7248
|
+
|
|
7249
|
+
// position-area: side + alignment (start/end = align with the target's start/end edge)
|
|
7250
|
+
let area = side;
|
|
7251
|
+
if (align == 'start') area += vertical ? ' span-right' : ' span-bottom';
|
|
7252
|
+
if (align == 'end') area += vertical ? ' span-left' : ' span-top';
|
|
7253
|
+
|
|
7254
|
+
// Unique anchor names: one for the target, one for the content (the arrow uses both)
|
|
7255
|
+
const name = '--nice-anchor-' + Math.random().toString(36).substring(7);
|
|
7256
|
+
target.style.anchorName = name;
|
|
7257
|
+
content.setAttribute('popover', 'manual');
|
|
7258
|
+
content.classList.add('nice-anchored', 'nice-anchored--' + side);
|
|
7259
|
+
if (options.sameWidth) content.classList.add('nice-anchored--same-width');
|
|
7260
|
+
content.style.positionAnchor = name;
|
|
7261
|
+
content.style.positionArea = area;
|
|
7262
|
+
content.style.anchorName = name + '-content';
|
|
7263
|
+
content.style.setProperty('--nice-anchored', name + '-content');
|
|
7264
|
+
content.style.setProperty('--nice-anchored-offset', offset + 'px');
|
|
7265
|
+
// Skidding is a translate. Only set when used: translate makes the content the
|
|
7266
|
+
// containing block of the fixed arrow, so the arrow can't use anchor() any more.
|
|
7267
|
+
if (skidding) content.style.translate = vertical ? skidding + 'px 0' : '0 ' + skidding + 'px';
|
|
7268
|
+
if (options.arrow) options.arrow.classList.add('nice-anchored-arrow');
|
|
7269
|
+
|
|
7270
|
+
const isOpen = function () { return content.matches(':popover-open'); };
|
|
7271
|
+
return withEvents(target, content, options, {
|
|
7272
|
+
show: function () { if (!isOpen() && content.isConnected) content.showPopover(); },
|
|
7273
|
+
hide: function () { if (isOpen()) content.hidePopover(); },
|
|
7274
|
+
update: function () { }, // the browser keeps it positioned
|
|
7275
|
+
destroy: function () { }
|
|
7276
|
+
});
|
|
7277
|
+
}
|
|
7278
|
+
|
|
7279
|
+
// Fallback: Popper.js (content is shown with the [data-show] attribute)
|
|
7280
|
+
// https://popper.js.org/docs/v2/constructors/
|
|
7281
|
+
content.classList.add('nice-anchored-fallback');
|
|
7282
|
+
if (options.arrow) {
|
|
7283
|
+
options.arrow.classList.add('nice-anchored-arrow');
|
|
7284
|
+
options.arrow.setAttribute('data-popper-arrow', '');
|
|
7285
|
+
}
|
|
7286
|
+
|
|
7287
|
+
const modifiers = [
|
|
7288
|
+
{ name: 'offset', options: { offset: [skidding, offset] } },
|
|
7289
|
+
{ name: 'arrow', options: { padding: 5 } }
|
|
7290
|
+
];
|
|
7291
|
+
if (options.sameWidth) {
|
|
7292
|
+
modifiers.push({
|
|
7293
|
+
name: 'sameWidth',
|
|
7294
|
+
enabled: true,
|
|
7295
|
+
phase: 'beforeWrite',
|
|
7296
|
+
requires: ['computeStyles'],
|
|
7297
|
+
fn: function (e) {
|
|
7298
|
+
e.state.styles.popper.width = e.state.rects.reference.width + 'px';
|
|
7299
|
+
}
|
|
7300
|
+
});
|
|
7301
|
+
}
|
|
7302
|
+
|
|
7303
|
+
const popper = Popper.createPopper(target, content, {
|
|
7304
|
+
placement: placement,
|
|
7305
|
+
strategy: options.strategy || 'fixed',
|
|
7306
|
+
modifiers: modifiers
|
|
7307
|
+
});
|
|
7308
|
+
|
|
7309
|
+
return withEvents(target, content, options, {
|
|
7310
|
+
show: function () {
|
|
7311
|
+
content.setAttribute('data-show', '');
|
|
7312
|
+
popper.update();
|
|
7313
|
+
},
|
|
7314
|
+
hide: function () {
|
|
7315
|
+
content.removeAttribute('data-show');
|
|
7316
|
+
},
|
|
7317
|
+
update: function () { popper.update(); },
|
|
7318
|
+
destroy: function () { popper.destroy(); }
|
|
7319
|
+
});
|
|
7320
|
+
},
|
|
7229
7321
|
// Check if value is a Decimal.js object (also Decimal.clone() instances)
|
|
7230
7322
|
isDecimal: function (value) {
|
|
7231
7323
|
return typeof Decimal !== 'undefined' && Decimal.isDecimal(value);
|
|
@@ -7397,17 +7489,17 @@ angular.module('niceElements').run(['$templateCache', function($templateCache) {
|
|
|
7397
7489
|
"\n" +
|
|
7398
7490
|
" \n" +
|
|
7399
7491
|
" <button title=\"{{ 'Previous month' | translate:'Nice' }}\" type=\"button\" class=\"btn\" ng-click=\"previous()\" ng-disabled=\"isDisabled\">\n" +
|
|
7400
|
-
" <
|
|
7492
|
+
" <nice-icon icon=\"icon-chevron-left\"></nice-icon>\n" +
|
|
7401
7493
|
" </button>\n" +
|
|
7402
7494
|
"\n" +
|
|
7403
7495
|
" \n" +
|
|
7404
7496
|
" <button title=\"{{ 'Today' | translate:'Nice' }}\" type=\"button\" class=\"btn\" ng-click=\"today()\" ng-disabled=\"isDisabled\">\n" +
|
|
7405
|
-
" <nice-icon icon=\"icon-
|
|
7497
|
+
" <nice-icon icon=\"icon-dot\"></nice-icon>\n" +
|
|
7406
7498
|
" </button>\n" +
|
|
7407
7499
|
"\n" +
|
|
7408
7500
|
" \n" +
|
|
7409
7501
|
" <button title=\"{{ 'Next month' | translate:'Nice' }}\" type=\"button\" class=\"btn\" ng-click=\"next()\" ng-disabled=\"isDisabled\">\n" +
|
|
7410
|
-
" <
|
|
7502
|
+
" <nice-icon icon=\"icon-chevron-right\"></nice-icon>\n" +
|
|
7411
7503
|
" </button>\n" +
|
|
7412
7504
|
" </div>\n" +
|
|
7413
7505
|
"\n" +
|
|
@@ -7456,7 +7548,6 @@ angular.module('niceElements').run(['$templateCache', function($templateCache) {
|
|
|
7456
7548
|
" </div>\n" +
|
|
7457
7549
|
"\n" +
|
|
7458
7550
|
" <div class=\"time-picker-icon\">\n" +
|
|
7459
|
-
" \n" +
|
|
7460
7551
|
" <nice-icon icon=\"icon-clock\"></nice-icon>\n" +
|
|
7461
7552
|
" </div>\n" +
|
|
7462
7553
|
"\n" +
|
|
@@ -7634,103 +7725,108 @@ angular.module('niceElements').run(['$templateCache', function($templateCache) {
|
|
|
7634
7725
|
);
|
|
7635
7726
|
|
|
7636
7727
|
|
|
7728
|
+
$templateCache.put('src/components/nice-date/nice-date-picker.html',
|
|
7729
|
+
"\n" +
|
|
7730
|
+
"<div class=\"nice-date-date\" ng-if=\"date\" role=\"grid\">\n" +
|
|
7731
|
+
" <div class=\"nice-date-header\">\n" +
|
|
7732
|
+
" <span>\n" +
|
|
7733
|
+
" <select class=\"year-picker\" ng-model=\"innerDate.year\" ng-change=\"handleDateChange()\" ng-options=\"year for year in years\" ng-disabled=\"isDisabled\"></select>\n" +
|
|
7734
|
+
" <span class=\"nice-date-header-comma\">,</span>\n" +
|
|
7735
|
+
" <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" +
|
|
7736
|
+
" </span>\n" +
|
|
7737
|
+
" <button type=\"button\" class=\"btn btn-default-naked\" ng-disabled=\"isDisabled\" ng-click=\"previous()\" title=\"{{ 'Previous month' | translate:'Nice' }}\">\n" +
|
|
7738
|
+
" <nice-icon icon=\"icon-chevron-left\"></nice-icon>\n" +
|
|
7739
|
+
" </button>\n" +
|
|
7740
|
+
" <button type=\"button\" class=\"btn btn-default-naked\" ng-disabled=\"isDisabled\" ng-click=\"today()\" title=\"{{ 'Today' | translate:'Nice' }}\">\n" +
|
|
7741
|
+
" <nice-icon icon=\"icon-dot\"></nice-icon>\n" +
|
|
7742
|
+
" </button>\n" +
|
|
7743
|
+
" <button type=\"button\" class=\"btn btn-default-naked\" ng-disabled=\"isDisabled\" ng-click=\"next()\" title=\"{{ 'Next month' | translate:'Nice' }}\">\n" +
|
|
7744
|
+
" <nice-icon icon=\"icon-chevron-right\"></nice-icon>\n" +
|
|
7745
|
+
" </button>\n" +
|
|
7746
|
+
" </div>\n" +
|
|
7747
|
+
"\n" +
|
|
7748
|
+
" <div class=\"nice-date-grid nice-date-grid-names\">\n" +
|
|
7749
|
+
" <span class=\"nice-date-day\" ng-class=\"{ 'weekend': $index == 6 || $index == 5 }\" ng-repeat=\"day in weekdays\">{{ day }}</span>\n" +
|
|
7750
|
+
" </div>\n" +
|
|
7751
|
+
"\n" +
|
|
7752
|
+
" <div class=\"nice-date-grid\">\n" +
|
|
7753
|
+
" <button type=\"button\" class=\"nice-date-day\" role=\"gridcell\" title=\"{{ day.text }}\" ng-class=\"{\n" +
|
|
7754
|
+
" 'today': day.isToday,\n" +
|
|
7755
|
+
" 'different-month': !day.isCurrentMonth,\n" +
|
|
7756
|
+
" 'selected': isSameDay(model, day.date),\n" +
|
|
7757
|
+
" 'weekend': day.isWeekday,\n" +
|
|
7758
|
+
" 'disabled': day.isDisabled,\n" +
|
|
7759
|
+
" 'between': isBetween(day.date, model, nextDate)\n" +
|
|
7760
|
+
" }\" ng-click=\"select(day)\" ng-repeat=\"day in days\" ng-disabled=\"isDisabled\">\n" +
|
|
7761
|
+
" <span>{{ day.name }}</span>\n" +
|
|
7762
|
+
" </button>\n" +
|
|
7763
|
+
" </div>\n" +
|
|
7764
|
+
"</div>\n" +
|
|
7765
|
+
"\n" +
|
|
7766
|
+
"\n" +
|
|
7767
|
+
"<div class=\"nice-date-time\" ng-if=\"time\">\n" +
|
|
7768
|
+
" <nice-icon icon=\"icon-clock\"></nice-icon>\n" +
|
|
7769
|
+
"\n" +
|
|
7770
|
+
" <div class=\"time-picker time-picker-hour\">\n" +
|
|
7771
|
+
" <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" +
|
|
7772
|
+
" </div>\n" +
|
|
7773
|
+
"\n" +
|
|
7774
|
+
" <div class=\"divider\">:</div>\n" +
|
|
7775
|
+
"\n" +
|
|
7776
|
+
" <div class=\"time-picker time-picker-minute\">\n" +
|
|
7777
|
+
" <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" +
|
|
7778
|
+
" </div>\n" +
|
|
7779
|
+
"</div>\n"
|
|
7780
|
+
);
|
|
7781
|
+
|
|
7782
|
+
|
|
7637
7783
|
$templateCache.put('src/components/nice-date/nice-date.html',
|
|
7638
7784
|
"<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
7785
|
" <div class=\"row\">\n" +
|
|
7642
7786
|
" \n" +
|
|
7643
7787
|
" <nice-title text=\"title || niceTitle\" help=\"help\" required=\"required\" description=\"description\" label-width=\"labelWidth\"></nice-title>\n" +
|
|
7644
7788
|
"\n" +
|
|
7645
7789
|
" \n" +
|
|
7646
|
-
" <div class=\"nice-field col-xs-12\" ng-class=\"[fieldWidth ? fieldWidth : 'col-sm-8', { 'nice-disabled': isDisabled }]\">\n" +
|
|
7790
|
+
" <div class=\"nice-field col-xs-12\" ng-class=\"[fieldWidth ? fieldWidth : 'col-sm-8', { 'nice-disabled': isDisabled }]\" click-outside=\"close()\">\n" +
|
|
7647
7791
|
" <div class=\"disabled-shield\" ng-if=\"isDisabled\"></div>\n" +
|
|
7648
7792
|
"\n" +
|
|
7649
7793
|
" \n" +
|
|
7650
|
-
" <
|
|
7651
|
-
" <
|
|
7652
|
-
"
|
|
7653
|
-
"
|
|
7654
|
-
" <
|
|
7655
|
-
"
|
|
7656
|
-
"
|
|
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" +
|
|
7794
|
+
" <nice-popup ng-show=\"!inline\" trigger=\"manual\" is-open=\"isOpen\" placement=\"{{ placement }}\">\n" +
|
|
7795
|
+
" <nice-popup-target>\n" +
|
|
7796
|
+
" <div class=\"nice-date-button input-group\" ng-class=\"{ 'open': isOpen }\" ng-click=\"toggleOpen()\">\n" +
|
|
7797
|
+
" <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" +
|
|
7798
|
+
" <span class=\"input-group-btn\">\n" +
|
|
7799
|
+
" <button type=\"button\" class=\"btn btn-default btn-right\" ng-disabled=\"isDisabled\" ng-if=\"!(model && nullable)\">\n" +
|
|
7800
|
+
" <nice-icon icon=\"icon-calendar\"></nice-icon>\n" +
|
|
7678
7801
|
" </button>\n" +
|
|
7679
|
-
" <button type=\"button\" class=\"btn btn-default-
|
|
7680
|
-
" <nice-icon icon=\"icon-
|
|
7802
|
+
" <button type=\"button\" class=\"btn btn-default btn-right\" ng-disabled=\"isDisabled\" ng-if=\"model && nullable\" ng-click=\"clear()\">\n" +
|
|
7803
|
+
" <nice-icon icon=\"icon-x\"></nice-icon>\n" +
|
|
7681
7804
|
" </button>\n" +
|
|
7682
|
-
" </
|
|
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" +
|
|
7698
|
-
" </button>\n" +
|
|
7699
|
-
" </div>\n" +
|
|
7805
|
+
" </span>\n" +
|
|
7700
7806
|
" </div>\n" +
|
|
7807
|
+
" </nice-popup-target>\n" +
|
|
7701
7808
|
"\n" +
|
|
7702
|
-
"
|
|
7703
|
-
" <div class=\"nice-date-
|
|
7704
|
-
"
|
|
7705
|
-
"
|
|
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" +
|
|
7809
|
+
" <nice-popup-content>\n" +
|
|
7810
|
+
" <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" +
|
|
7811
|
+
" </nice-popup-content>\n" +
|
|
7812
|
+
" </nice-popup>\n" +
|
|
7709
7813
|
"\n" +
|
|
7710
|
-
"
|
|
7711
|
-
"\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" +
|
|
7814
|
+
" \n" +
|
|
7815
|
+
" <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
7816
|
" </div>\n" +
|
|
7719
7817
|
" </div>\n" +
|
|
7720
|
-
"</div
|
|
7818
|
+
"</div>\n"
|
|
7721
7819
|
);
|
|
7722
7820
|
|
|
7723
7821
|
|
|
7724
7822
|
$templateCache.put('src/components/nice-datetime-picker/nice-datetime-picker.html',
|
|
7725
7823
|
"<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
7824
|
" <div class=\"row\">\n" +
|
|
7729
7825
|
" \n" +
|
|
7730
7826
|
" <nice-title text=\"title || niceTitle\" help=\"help\" required=\"required\" description=\"description\" label-width=\"labelWidth\"></nice-title>\n" +
|
|
7731
7827
|
"\n" +
|
|
7732
7828
|
" \n" +
|
|
7733
|
-
" <div class=\"nice-field col-xs-12\" ng-class=\"[fieldWidth ? fieldWidth : 'col-sm-8', { 'nice-disabled': isDisabled }]\">\n" +
|
|
7829
|
+
" <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
7830
|
" \n" +
|
|
7735
7831
|
" <div ng-form=\"formDatetimePicker\"></div>\n" +
|
|
7736
7832
|
"\n" +
|
|
@@ -7738,7 +7834,6 @@ angular.module('niceElements').run(['$templateCache', function($templateCache) {
|
|
|
7738
7834
|
" <input type=\"text\" class=\"form-control\" value=\"{{ value }}\" ng-click=\"openDtp()\" ng-disabled=\"isDisabled\">\n" +
|
|
7739
7835
|
" <span class=\"input-group-btn\">\n" +
|
|
7740
7836
|
" <button type=\"button\" class=\"btn btn-default\" ng-click=\"openDtp()\">\n" +
|
|
7741
|
-
" \n" +
|
|
7742
7837
|
" <nice-icon ng-if=\"isTrue(date)\" icon=\"icon-calendar\"></nice-icon>\n" +
|
|
7743
7838
|
" <nice-icon ng-if=\"!isTrue(date)\" icon=\"icon-clock\"></nice-icon>\n" +
|
|
7744
7839
|
" </button>\n" +
|
|
@@ -7760,47 +7855,49 @@ angular.module('niceElements').run(['$templateCache', function($templateCache) {
|
|
|
7760
7855
|
|
|
7761
7856
|
$templateCache.put('src/components/nice-datetimerange-picker-2/nice-datetimerange-picker-2.html',
|
|
7762
7857
|
"<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
7858
|
" <div class=\"row\">\n" +
|
|
7766
7859
|
" \n" +
|
|
7767
7860
|
" <nice-title text=\"title || niceTitle\" help=\"help\" required=\"required\" description=\"description\" label-width=\"labelWidth\"></nice-title>\n" +
|
|
7768
7861
|
"\n" +
|
|
7769
7862
|
" \n" +
|
|
7770
|
-
" <div class=\"nice-field col-xs-12\" ng-class=\"[fieldWidth ? fieldWidth : 'col-sm-8', { 'nice-disabled': isDisabled }]\">\n" +
|
|
7771
|
-
" <
|
|
7772
|
-
" <
|
|
7773
|
-
"
|
|
7774
|
-
"
|
|
7775
|
-
"
|
|
7776
|
-
"
|
|
7777
|
-
"
|
|
7863
|
+
" <div class=\"nice-field col-xs-12\" ng-class=\"[fieldWidth ? fieldWidth : 'col-sm-8', { 'nice-disabled': isDisabled }]\" click-outside=\"isOpen && close()\">\n" +
|
|
7864
|
+
" <nice-popup trigger=\"manual\" is-open=\"isOpen\" placement=\"{{ placement }}\" on-change=\"isOpen || close()\">\n" +
|
|
7865
|
+
" <nice-popup-target>\n" +
|
|
7866
|
+
" <div class=\"nice-daterange-picker-button input-group\" ng-class=\"{ 'open': isOpen }\" ng-click=\"open()\">\n" +
|
|
7867
|
+
" <input type=\"text\" class=\"form-control\" value=\"{{ modelFormat }}\" readonly=\"readonly\" ng-disabled=\"isDisabled\">\n" +
|
|
7868
|
+
" \n" +
|
|
7869
|
+
" <button type=\"button\" class=\"btn input-group-addon\" ng-disabled=\"isDisabled\">\n" +
|
|
7870
|
+
" <nice-icon icon=\"icon-calendar\"></nice-icon>\n" +
|
|
7871
|
+
" </button>\n" +
|
|
7872
|
+
" </div>\n" +
|
|
7873
|
+
" </nice-popup-target>\n" +
|
|
7874
|
+
"\n" +
|
|
7875
|
+
" <nice-popup-content>\n" +
|
|
7876
|
+
" <div class=\"dtp-wrapper\">\n" +
|
|
7877
|
+
" <div class=\"dtp-buttons-left\">\n" +
|
|
7878
|
+
" <div class=\"dtp-buttons-top\">\n" +
|
|
7879
|
+
" <a class=\"btn btn-primary btn-block\" ng-click=\"selectToday()\" translate translate-context=\"Nice\">Last 24 hours</a>\n" +
|
|
7880
|
+
" <a class=\"btn btn-primary btn-block\" ng-click=\"selectLastNDays(7)\" translate translate-context=\"Nice\">Last 7 days</a>\n" +
|
|
7881
|
+
" <a class=\"btn btn-primary btn-block\" ng-click=\"selectLastMonth()\" translate translate-context=\"Nice\">Last month</a>\n" +
|
|
7882
|
+
" <a class=\"btn btn-primary btn-block\" ng-click=\"selectThisMonth()\" translate translate-context=\"Nice\">This month</a>\n" +
|
|
7883
|
+
" </div>\n" +
|
|
7778
7884
|
"\n" +
|
|
7779
|
-
"
|
|
7780
|
-
"
|
|
7781
|
-
"
|
|
7782
|
-
"
|
|
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" +
|
|
7885
|
+
" <div class=\"dtp-buttons-bottom\">\n" +
|
|
7886
|
+
" <a class=\"btn btn-danger btn-block\" ng-click=\"close()\" translate translate-context=\"Nice\">Cancel</a>\n" +
|
|
7887
|
+
" <a class=\"btn btn-success btn-block\" ng-click=\"confirm()\" translate translate-context=\"Nice\">OK</a>\n" +
|
|
7888
|
+
" </div>\n" +
|
|
7787
7889
|
" </div>\n" +
|
|
7788
7890
|
"\n" +
|
|
7789
|
-
" <div class=\"dtp-
|
|
7790
|
-
" <
|
|
7791
|
-
" <a class=\"btn btn-success btn-block\" ng-click=\"confirm()\" translate translate-context=\"Nice\">OK</a>\n" +
|
|
7891
|
+
" <div class=\"dtp-left\">\n" +
|
|
7892
|
+
" <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
7893
|
" </div>\n" +
|
|
7793
|
-
" </div>\n" +
|
|
7794
|
-
"\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
7894
|
"\n" +
|
|
7799
|
-
"
|
|
7800
|
-
"
|
|
7895
|
+
" <div class=\"dtp-right\">\n" +
|
|
7896
|
+
" <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" +
|
|
7897
|
+
" </div>\n" +
|
|
7801
7898
|
" </div>\n" +
|
|
7802
|
-
" </
|
|
7803
|
-
" </
|
|
7899
|
+
" </nice-popup-content>\n" +
|
|
7900
|
+
" </nice-popup>\n" +
|
|
7804
7901
|
" </div>\n" +
|
|
7805
7902
|
" </div>\n" +
|
|
7806
7903
|
"</div>"
|
|
@@ -7809,14 +7906,12 @@ angular.module('niceElements').run(['$templateCache', function($templateCache) {
|
|
|
7809
7906
|
|
|
7810
7907
|
$templateCache.put('src/components/nice-datetimerange-picker/nice-datetimerange-picker.html',
|
|
7811
7908
|
"<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
7909
|
" <div class=\"row\">\n" +
|
|
7815
7910
|
" \n" +
|
|
7816
7911
|
" <nice-title text=\"title || niceTitle\" help=\"help\" required=\"required\" description=\"description\" label-width=\"labelWidth\"></nice-title>\n" +
|
|
7817
7912
|
"\n" +
|
|
7818
7913
|
" \n" +
|
|
7819
|
-
" <div class=\"nice-field col-xs-12\" ng-class=\"[fieldWidth ? fieldWidth : 'col-sm-8', { 'nice-disabled': isDisabled }]\">\n" +
|
|
7914
|
+
" <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
7915
|
" \n" +
|
|
7821
7916
|
" <div ng-form=\"formDatetimeRangePicker\"></div>\n" +
|
|
7822
7917
|
"\n" +
|
|
@@ -7948,7 +8043,7 @@ angular.module('niceElements').run(['$templateCache', function($templateCache) {
|
|
|
7948
8043
|
" <ul id=\"{{id}}\" class=\"dropdown-menu\" role=\"menu\">\n" +
|
|
7949
8044
|
" <li id=\"{{id}}-{{$index}}\" ng-repeat=\"item in internalList\" ng-click=\"clicked(item)\">\n" +
|
|
7950
8045
|
" <a href>\n" +
|
|
7951
|
-
" <span class=\"choice-checkbox\" ng-if=\"multiple\" ng-class=\"{ 'selected' : isItemSelected(item) }\"><
|
|
8046
|
+
" <span class=\"choice-checkbox\" ng-if=\"multiple\" ng-class=\"{ 'selected' : isItemSelected(item) }\"><nice-icon icon=\"icon-check\"></nice-icon></span>\n" +
|
|
7952
8047
|
" <span ng-if=\"item.color_hex_code\" class=\"dropdown-color\" ng-style=\"{'background': item.color_hex_code}\"></span>\n" +
|
|
7953
8048
|
" <span ng-class=\"{'multiple-item': multiple}\">{{ getLabel(item) }}</span>\n" +
|
|
7954
8049
|
" \n" +
|
|
@@ -7979,49 +8074,51 @@ angular.module('niceElements').run(['$templateCache', function($templateCache) {
|
|
|
7979
8074
|
" <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
8075
|
" <div class=\"nice-field-wrapper\">\n" +
|
|
7981
8076
|
" \n" +
|
|
7982
|
-
" <
|
|
7983
|
-
" <
|
|
7984
|
-
"
|
|
7985
|
-
"
|
|
7986
|
-
"
|
|
7987
|
-
"
|
|
7988
|
-
"
|
|
7989
|
-
"
|
|
7990
|
-
"
|
|
7991
|
-
"
|
|
7992
|
-
"
|
|
7993
|
-
"
|
|
7994
|
-
"\n" +
|
|
7995
|
-
" <span class=\"caret\" ng-show=\"!loading\"></span>\n" +
|
|
7996
|
-
" <nice-loader ng-if=\"loading\"></nice-loader>\n" +
|
|
7997
|
-
" </button>\n" +
|
|
8077
|
+
" <nice-popup trigger=\"manual\" is-open=\"isOpen\" placement=\"{{ placement }}\" offset-distance=\"{{ dropdownDistance }}\" same-width=\"true\">\n" +
|
|
8078
|
+
" <nice-popup-target>\n" +
|
|
8079
|
+
" <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" +
|
|
8080
|
+
" <input class=\"hidden-input\" ng-model=\"model\" ng-required=\"required\" ng-disabled=\"disabled\" tabindex=\"-1\">\n" +
|
|
8081
|
+
" <div class=\"btn-dropdown-inside\" ng-transclude=\"button\" ng-if=\"selected != null\">\n" +
|
|
8082
|
+
" <span ng-if=\"!multiple\">{{ selected[objValue] }}</span>\n" +
|
|
8083
|
+
" <span ng-if=\"multiple\" class=\"multiple-selected\" ng-class=\"{ 'has-more': selected.length > maxSelectedShown }\">\n" +
|
|
8084
|
+
" <span ng-if=\"selected.length > 0\" class=\"multiple-selected-values\"><span ng-repeat=\"item in selected | limitTo: maxSelectedShown\">{{ item[objValue] }}{{ $last ? '' : ', ' }}</span></span>\n" +
|
|
8085
|
+
" <span ng-if=\"selected.length > maxSelectedShown\" class=\"multiple-selected-more\">+{{ selected.length - maxSelectedShown }} {{ moreText }}</span>\n" +
|
|
8086
|
+
" <span ng-if=\"selected.length == 0\" class=\"not-selected\">{{ nullableText }}</span>\n" +
|
|
8087
|
+
" </span>\n" +
|
|
8088
|
+
" </div>\n" +
|
|
7998
8089
|
"\n" +
|
|
8090
|
+
" <div class=\"not-selected\" ng-if=\"selected == null\">{{ selectText }}</div>\n" +
|
|
7999
8091
|
"\n" +
|
|
8000
|
-
"
|
|
8001
|
-
"
|
|
8002
|
-
"
|
|
8003
|
-
"
|
|
8004
|
-
"
|
|
8005
|
-
"
|
|
8006
|
-
"
|
|
8007
|
-
" <
|
|
8008
|
-
"
|
|
8009
|
-
"
|
|
8010
|
-
"
|
|
8011
|
-
"
|
|
8012
|
-
"
|
|
8013
|
-
"
|
|
8014
|
-
"
|
|
8015
|
-
"
|
|
8016
|
-
"
|
|
8017
|
-
"
|
|
8018
|
-
"
|
|
8019
|
-
" <
|
|
8020
|
-
"
|
|
8021
|
-
"
|
|
8092
|
+
" <span class=\"caret\" ng-show=\"!loading\"></span>\n" +
|
|
8093
|
+
" <nice-loader ng-if=\"loading\"></nice-loader>\n" +
|
|
8094
|
+
" </button>\n" +
|
|
8095
|
+
" </nice-popup-target>\n" +
|
|
8096
|
+
"\n" +
|
|
8097
|
+
" <nice-popup-content>\n" +
|
|
8098
|
+
" <div class=\"nice-dropdown-menu\" ng-if=\"isOpen\">\n" +
|
|
8099
|
+
" <div class=\"search-bar\" ng-if=\"!noSearch && searchFunction\">\n" +
|
|
8100
|
+
" <input class=\"search-bar-input\" ng-model=\"internal.search\" ng-model-options=\"{ debounce: 500 }\" ng-change=\"handleSearch()\" placeholder=\"{{ searchText }}\">\n" +
|
|
8101
|
+
" <div class=\"count\" ng-if=\"internalList && internalList._metadata && enableLoadMore\">{{ internalList.length }}/{{ internalList._metadata.count }}</div>\n" +
|
|
8102
|
+
" <nice-icon ng-if=\"!internal.search\" class=\"icon\" icon=\"icon-search\"></nice-icon>\n" +
|
|
8103
|
+
" <nice-icon ng-if=\"internal.search\" class=\"icon\" icon=\"icon-x\" ng-click=\"clearSearch()\"></nice-icon>\n" +
|
|
8104
|
+
" </div>\n" +
|
|
8105
|
+
" <div class=\"nice-dropdown-actions\" ng-if=\"multiple\">\n" +
|
|
8106
|
+
" <button type=\"button\" class=\"btn btn-default btn-sm\" ng-click=\"selectAll()\" translate translate-context=\"Nice\">All</button>\n" +
|
|
8107
|
+
" <button type=\"button\" class=\"btn btn-default btn-sm\" ng-click=\"selectNone()\">{{ nullableText }}</button>\n" +
|
|
8108
|
+
" </div>\n" +
|
|
8109
|
+
" <div class=\"nice-dropdown-items\" aria-labelledby=\"nice-dropdown-{{ id }}\" role=\"listbox\">\n" +
|
|
8110
|
+
" <div role=\"none\" type=\"button\" class=\"nice-no-data\" ng-if=\"internalList && internalList.length == 0\">{{ noDataText }}</div>\n" +
|
|
8111
|
+
" <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" +
|
|
8112
|
+
" {{ nullableText }}\n" +
|
|
8113
|
+
" </button>\n" +
|
|
8114
|
+
" <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" +
|
|
8115
|
+
" <div class=\"choice-checkbox\" ng-if=\"multiple\" role=\"menuitemcheckbox\"><nice-icon icon=\"icon-check\"></nice-icon></div>\n" +
|
|
8116
|
+
" <div class=\"choice-option\" ng-transclude=\"option\" ng-class=\"{ 'multiple-item': multiple }\">{{ item[objValue] }}</div>\n" +
|
|
8117
|
+
" </button>\n" +
|
|
8118
|
+
" </div>\n" +
|
|
8022
8119
|
" </div>\n" +
|
|
8023
|
-
" </
|
|
8024
|
-
" </
|
|
8120
|
+
" </nice-popup-content>\n" +
|
|
8121
|
+
" </nice-popup>\n" +
|
|
8025
8122
|
"\n" +
|
|
8026
8123
|
"\n" +
|
|
8027
8124
|
" \n" +
|
|
@@ -8042,27 +8139,27 @@ angular.module('niceElements').run(['$templateCache', function($templateCache) {
|
|
|
8042
8139
|
" <div class=\"dtp-date-view\">\n" +
|
|
8043
8140
|
" <div class=\"dtp-header\" ng-if=\"!inline\">\n" +
|
|
8044
8141
|
" <div class=\"dtp-actual-day\">{{actualDay}}</div>\n" +
|
|
8045
|
-
" <div class=\"dtp-close\" ng-if=\"!inline\"><a href=\"javascript:void(0);\" ng-click=\"onCloseClick()\"><
|
|
8142
|
+
" <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
8143
|
" </div>\n" +
|
|
8047
8144
|
" <div class=\"dtp-date\" ng-if=\"!inline\" ng-class=\"{'hidden': !showDateHeader}\">\n" +
|
|
8048
8145
|
" <div>\n" +
|
|
8049
8146
|
" <div class=\"left center p10\">\n" +
|
|
8050
|
-
" <a href=\"javascript:void(0);\" class=\"dtp-select-month-before\" ng-click=\"onMonthBeforeClick()\" ng-class=\"{'disabled': !btnMonthBeforeEnabled}\"><
|
|
8147
|
+
" <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
8148
|
" </div>\n" +
|
|
8052
8149
|
" <div class=\"dtp-actual-month p80\" ng-click=\"initDate()\">{{actualMonth}}</div>\n" +
|
|
8053
8150
|
" <div class=\"right center p10\">\n" +
|
|
8054
|
-
" <a href=\"javascript:void(0);\" class=\"dtp-select-month-after\" ng-click=\"onMonthAfterClick()\" ng-class=\"{'disabled': !btnMonthAfterEnabled}\"><
|
|
8151
|
+
" <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
8152
|
" </div>\n" +
|
|
8056
8153
|
" <div class=\"clearfix\"></div>\n" +
|
|
8057
8154
|
" </div>\n" +
|
|
8058
8155
|
" <div class=\"dtp-actual-num\" ng-click=\"initDate()\">{{actualNum}}</div>\n" +
|
|
8059
8156
|
" <div>\n" +
|
|
8060
8157
|
" <div class=\"left center p10\">\n" +
|
|
8061
|
-
" <a href=\"javascript:void(0);\" class=\"dtp-select-year-before\" ng-click=\"onYearBeforeClick()\" ng-class=\"{'disabled': !btnYearBeforeEnabled}\"><
|
|
8158
|
+
" <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
8159
|
" </div>\n" +
|
|
8063
8160
|
" <div class=\"dtp-actual-year p80\" ng-click=\"initDate()\">{{actualYear}}</div>\n" +
|
|
8064
8161
|
" <div class=\"right center p10\">\n" +
|
|
8065
|
-
" <a href=\"javascript:void(0);\" class=\"dtp-select-year-after\" ng-click=\"onYearAfterClick()\" ng-class=\"{'disabled': !btnYearAfterEnabled}\"><
|
|
8162
|
+
" <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
8163
|
" </div>\n" +
|
|
8067
8164
|
" <div class=\"clearfix\"></div>\n" +
|
|
8068
8165
|
" </div>\n" +
|
|
@@ -8076,11 +8173,11 @@ angular.module('niceElements').run(['$templateCache', function($templateCache) {
|
|
|
8076
8173
|
" <div class=\"dtp-picker-calendar\" ng-class=\"{'hidden': !showCalendar}\">\n" +
|
|
8077
8174
|
" <div>\n" +
|
|
8078
8175
|
" <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}\"><
|
|
8176
|
+
" <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
8177
|
" </div>\n" +
|
|
8081
8178
|
" <div class=\"dtp-picker-month\" ng-class=\"{'p80': inline}\">{{monthAndYear}}</div>\n" +
|
|
8082
8179
|
" <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}\"><
|
|
8180
|
+
" <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
8181
|
" </div>\n" +
|
|
8085
8182
|
" </div>\n" +
|
|
8086
8183
|
"\n" +
|
|
@@ -8369,13 +8466,13 @@ angular.module('niceElements').run(['$templateCache', function($templateCache) {
|
|
|
8369
8466
|
|
|
8370
8467
|
|
|
8371
8468
|
$templateCache.put('src/components/nice-popup/nice-popup.html',
|
|
8372
|
-
"<div class=\"nice-popup\" click-outside=\"
|
|
8373
|
-
" <div class=\"nice-popup-target\" ng-transclude=\"target\" ng-click=\"
|
|
8469
|
+
"<div class=\"nice-popup\" click-outside=\"clickedOutside()\">\n" +
|
|
8470
|
+
" <div class=\"nice-popup-target\" ng-transclude=\"target\" ng-click=\"targetClicked()\"></div>\n" +
|
|
8374
8471
|
" <div class=\"nice-popup-content\">\n" +
|
|
8375
|
-
" <div class=\"nice-popup-arrow\"
|
|
8472
|
+
" <div class=\"nice-popup-arrow\" ng-show=\"isOpen && showArrow\"></div>\n" +
|
|
8376
8473
|
" <div ng-transclude=\"content\" ng-if=\"isOpen\"></div>\n" +
|
|
8377
8474
|
" </div>\n" +
|
|
8378
|
-
"</div
|
|
8475
|
+
"</div>\n"
|
|
8379
8476
|
);
|
|
8380
8477
|
|
|
8381
8478
|
|
|
@@ -8439,13 +8536,11 @@ angular.module('niceElements').run(['$templateCache', function($templateCache) {
|
|
|
8439
8536
|
"\n" +
|
|
8440
8537
|
" <button type=\"button\" class=\"btn input-group-addon\" ng-click=\"search()\" ng-if=\"!model\" ng-disabled=\"isDisabled\">\n" +
|
|
8441
8538
|
" \n" +
|
|
8442
|
-
" \n" +
|
|
8443
8539
|
" <nice-icon ng-show=\"!loading\" icon=\"icon-search\"></nice-icon>\n" +
|
|
8444
8540
|
" <nice-loader ng-if=\"loading\"></nice-loader>\n" +
|
|
8445
8541
|
" </button>\n" +
|
|
8446
8542
|
"\n" +
|
|
8447
8543
|
" <button type=\"button\" class=\"btn input-group-addon\" ng-click=\"remove()\" ng-if=\"model\" ng-disabled=\"isDisabled\">\n" +
|
|
8448
|
-
" \n" +
|
|
8449
8544
|
" <nice-icon ng-show=\"!loading\" icon=\"icon-x\"></nice-icon>\n" +
|
|
8450
8545
|
" </button>\n" +
|
|
8451
8546
|
" </div>\n" +
|
|
@@ -8480,29 +8575,33 @@ angular.module('niceElements').run(['$templateCache', function($templateCache) {
|
|
|
8480
8575
|
"\n" +
|
|
8481
8576
|
" \n" +
|
|
8482
8577
|
" <div class=\"nice-field col-xs-12\" ng-class=\"[fieldWidth ? fieldWidth : 'col-sm-8', { 'nice-disabled': isDisabled }]\" click-outside=\"close()\">\n" +
|
|
8483
|
-
" <
|
|
8484
|
-
" <
|
|
8485
|
-
"\n" +
|
|
8486
|
-
"
|
|
8487
|
-
"
|
|
8488
|
-
"
|
|
8489
|
-
"
|
|
8490
|
-
"
|
|
8491
|
-
"
|
|
8492
|
-
"
|
|
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" +
|
|
8578
|
+
" <nice-popup trigger=\"manual\" is-open=\"isOpen\" placement=\"{{ placement }}\" same-width=\"true\">\n" +
|
|
8579
|
+
" <nice-popup-target>\n" +
|
|
8580
|
+
" <div class=\"nice-search-button input-group\" ng-class=\"{ 'disabled': isDisabled }\">\n" +
|
|
8581
|
+
" <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" +
|
|
8582
|
+
"\n" +
|
|
8583
|
+
" <button type=\"button\" class=\"btn input-group-addon\" ng-disabled=\"isDisabled\" ng-click=\"buttonClicked()\">\n" +
|
|
8584
|
+
" <nice-icon ng-show=\"!loading && model != ''\" icon=\"icon-x\"></nice-icon>\n" +
|
|
8585
|
+
" <nice-icon ng-show=\"!loading && model == ''\" icon=\"icon-search\"></nice-icon>\n" +
|
|
8586
|
+
" <nice-loader ng-if=\"loading\"></nice-loader>\n" +
|
|
8587
|
+
" </button>\n" +
|
|
8497
8588
|
" </div>\n" +
|
|
8589
|
+
" </nice-popup-target>\n" +
|
|
8590
|
+
"\n" +
|
|
8591
|
+
" <nice-popup-content>\n" +
|
|
8592
|
+
" <div class=\"nice-search-dropdown\" ng-if=\"showDropdown && isOpen\">\n" +
|
|
8593
|
+
" <div class=\"nice-search-row nice-search-row-loading\" ng-if=\"loading && results.length == 0\">\n" +
|
|
8594
|
+
" <nice-loader ng-if=\"loading\"></nice-loader>\n" +
|
|
8595
|
+
" </div>\n" +
|
|
8498
8596
|
"\n" +
|
|
8499
|
-
"
|
|
8597
|
+
" <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
8598
|
"\n" +
|
|
8501
|
-
"
|
|
8502
|
-
"
|
|
8599
|
+
" <div ng-repeat=\"result in results\" class=\"nice-search-row\" ng-class=\"{'active': selectedIndex == $index}\" ng-click=\"selectItem(result)\">\n" +
|
|
8600
|
+
" <ng-transclude>{{ result[keyForInputLabel] }}</ng-transclude>\n" +
|
|
8601
|
+
" </div>\n" +
|
|
8503
8602
|
" </div>\n" +
|
|
8504
|
-
" </
|
|
8505
|
-
" </
|
|
8603
|
+
" </nice-popup-content>\n" +
|
|
8604
|
+
" </nice-popup>\n" +
|
|
8506
8605
|
" </div>\n" +
|
|
8507
8606
|
" </div>\n" +
|
|
8508
8607
|
"</ng-form>"
|
|
@@ -8772,6 +8871,10 @@ angular.module('niceElements').run(['$templateCache', function($templateCache) {
|
|
|
8772
8871
|
" <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
8872
|
" </symbol>\n" +
|
|
8774
8873
|
"\n" +
|
|
8874
|
+
" <symbol id=\"icon-dot\" viewBox=\"0 0 24 24\">\n" +
|
|
8875
|
+
" <path d=\"M12 6a6 6 0 1 1 0 12a6 6 0 1 1 0-12z\"></path>\n" +
|
|
8876
|
+
" </symbol>\n" +
|
|
8877
|
+
"\n" +
|
|
8775
8878
|
" <symbol id=\"icon-clipboard\" viewBox=\"0 0 24 24\">\n" +
|
|
8776
8879
|
" <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
8880
|
" </symbol>\n" +
|
|
@@ -9305,6 +9408,10 @@ angular.module('niceElements').run(['$templateCache', function($templateCache) {
|
|
|
9305
9408
|
" </symbol>\n" +
|
|
9306
9409
|
"\n" +
|
|
9307
9410
|
" <symbol id=\"icon-plus\" viewBox=\"0 0 24 24\">\n" +
|
|
9411
|
+
" <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" +
|
|
9412
|
+
" </symbol>\n" +
|
|
9413
|
+
"\n" +
|
|
9414
|
+
" <symbol id=\"icon-plus-2\" viewBox=\"0 0 24 24\">\n" +
|
|
9308
9415
|
" <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
9416
|
" </symbol>\n" +
|
|
9310
9417
|
"\n" +
|
|
@@ -10058,7 +10165,7 @@ angular.module('niceElements').run(['$templateCache', function($templateCache) {
|
|
|
10058
10165
|
" <nice-title text=\"title || niceTitle\" help=\"help\" required=\"required\" description=\"description\" label-width=\"labelWidth\"></nice-title>\n" +
|
|
10059
10166
|
"\n" +
|
|
10060
10167
|
" \n" +
|
|
10061
|
-
" <div class=\"nice-field col-xs-12\" ng-class=\"fieldWidth ? fieldWidth : 'col-sm-8'\">\n" +
|
|
10168
|
+
" <div class=\"nice-field col-xs-12\" ng-class=\"fieldWidth ? fieldWidth : 'col-sm-8'\" click-outside=\"close()\" is-open=\"{{ open }}\">\n" +
|
|
10062
10169
|
" <div class=\"input-group\" ng-class=\"{\n" +
|
|
10063
10170
|
" 'has-warning': !isDisabled && forma.$invalid && forma.$dirty,\n" +
|
|
10064
10171
|
" 'disabled': isDisabled\n" +
|
|
@@ -10093,8 +10200,6 @@ angular.module('niceElements').run(['$templateCache', function($templateCache) {
|
|
|
10093
10200
|
" </div>\n" +
|
|
10094
10201
|
" </div>\n" +
|
|
10095
10202
|
" </div>\n" +
|
|
10096
|
-
"\n" +
|
|
10097
|
-
" <div class=\"nice-background\" ng-click=\"close()\" ng-if=\"open\"></div>\n" +
|
|
10098
10203
|
"</div>"
|
|
10099
10204
|
);
|
|
10100
10205
|
|