nice-elements 1.4.9 → 1.4.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.vscode/settings.json +4 -1
- package/CHANGELOG.md +8 -0
- package/README.md +1 -1
- package/bower.json +1 -1
- package/dist/nice.js +50 -9
- package/dist/nice.min.js +1 -1
- package/dist/style.css +37 -19
- package/dist/style.css.map +1 -1
- package/dist/style.min.css +1 -1
- package/package.json +1 -1
- package/src/components/nice-dropdown/nice-dropdown.js +7 -5
- package/src/components/nice-help/nice-help.html +7 -4
- package/src/components/nice-help/nice-help.js +36 -0
- package/src/components/nice-help/nice-help.scss +37 -21
package/.vscode/settings.json
CHANGED
package/CHANGELOG.md
CHANGED
package/README.md
CHANGED
package/bower.json
CHANGED
package/dist/nice.js
CHANGED
|
@@ -2222,11 +2222,13 @@ angular.module('niceElements')
|
|
|
2222
2222
|
searchText: '@',
|
|
2223
2223
|
nullableText: '@',
|
|
2224
2224
|
selectedText: '@',
|
|
2225
|
+
dropdownDistance: '@',
|
|
2225
2226
|
searchFunction: '=?',
|
|
2226
2227
|
isInline: '=',
|
|
2227
2228
|
clearOnSelect: '@'
|
|
2228
2229
|
},
|
|
2229
2230
|
controller: function ($scope, $element, $timeout, gettextCatalog) {
|
|
2231
|
+
if (!$scope.dropdownDistance) { $scope.dropdownDistance = 5; }
|
|
2230
2232
|
if (!$scope.objValue) { $scope.objValue = 'value'; }
|
|
2231
2233
|
if (!$scope.objKey) { $scope.objKey = 'id'; }
|
|
2232
2234
|
if (!$scope.noOptionsText) { $scope.noOptionsText = gettextCatalog.getString("No options", null, "Nice"); }
|
|
@@ -2253,7 +2255,7 @@ angular.module('niceElements')
|
|
|
2253
2255
|
|
|
2254
2256
|
// Setup popper
|
|
2255
2257
|
// https://popper.js.org/docs/v2/constructors/
|
|
2256
|
-
$scope.setupPopper = function() {
|
|
2258
|
+
$scope.setupPopper = function () {
|
|
2257
2259
|
var button = $element[0].getElementsByClassName('btn-dropdown')[0];
|
|
2258
2260
|
var tooltip = $element[0].getElementsByClassName('nice-dropdown-menu-wrapper')[0];
|
|
2259
2261
|
$scope.popper = Popper.createPopper(button, tooltip, {
|
|
@@ -2264,7 +2266,7 @@ angular.module('niceElements')
|
|
|
2264
2266
|
{
|
|
2265
2267
|
name: 'offset',
|
|
2266
2268
|
options: {
|
|
2267
|
-
offset: [0,
|
|
2269
|
+
offset: [0, $scope.dropdownDistance],
|
|
2268
2270
|
},
|
|
2269
2271
|
},
|
|
2270
2272
|
{
|
|
@@ -2272,13 +2274,13 @@ angular.module('niceElements')
|
|
|
2272
2274
|
enabled: true,
|
|
2273
2275
|
phase: "beforeWrite",
|
|
2274
2276
|
requires: ["computeStyles"],
|
|
2275
|
-
fn: function(e) {
|
|
2277
|
+
fn: function (e) {
|
|
2276
2278
|
var state = e.state;
|
|
2277
2279
|
state.styles.popper.width = state.rects.reference.width + "px";
|
|
2278
2280
|
},
|
|
2279
|
-
effect: function(e) {
|
|
2281
|
+
effect: function (e) {
|
|
2280
2282
|
var state = e.state;
|
|
2281
|
-
state.elements.popper.style.width = state.elements.reference.offsetWidth
|
|
2283
|
+
state.elements.popper.style.width = state.elements.reference.offsetWidth + "px";
|
|
2282
2284
|
}
|
|
2283
2285
|
}
|
|
2284
2286
|
],
|
|
@@ -3409,6 +3411,42 @@ angular.module('niceElements')
|
|
|
3409
3411
|
restrict: 'E',
|
|
3410
3412
|
scope: {
|
|
3411
3413
|
text: '@'
|
|
3414
|
+
},
|
|
3415
|
+
controller: function ($scope, $element, $timeout) {
|
|
3416
|
+
// Setup popper
|
|
3417
|
+
// https://popper.js.org/docs/v2/constructors/
|
|
3418
|
+
$scope.setupPopper = function () {
|
|
3419
|
+
var button = $element[0].getElementsByClassName('nice-help-button')[0];
|
|
3420
|
+
var tooltip = $element[0].getElementsByClassName('nice-help-popup')[0];
|
|
3421
|
+
$scope.popper = Popper.createPopper(button, tooltip, {
|
|
3422
|
+
strategy: 'fixed',
|
|
3423
|
+
placement: 'top',
|
|
3424
|
+
scroll: true,
|
|
3425
|
+
resize: true,
|
|
3426
|
+
modifiers: [
|
|
3427
|
+
{
|
|
3428
|
+
name: 'offset',
|
|
3429
|
+
options: {
|
|
3430
|
+
offset: [0, 5],
|
|
3431
|
+
},
|
|
3432
|
+
},
|
|
3433
|
+
{
|
|
3434
|
+
name: 'arrow',
|
|
3435
|
+
options: {
|
|
3436
|
+
padding: 2,
|
|
3437
|
+
},
|
|
3438
|
+
}
|
|
3439
|
+
],
|
|
3440
|
+
});
|
|
3441
|
+
};
|
|
3442
|
+
|
|
3443
|
+
// $timeout(function () {
|
|
3444
|
+
// $scope.setupPopper();
|
|
3445
|
+
// });
|
|
3446
|
+
|
|
3447
|
+
$scope.onHover = function () {
|
|
3448
|
+
$scope.setupPopper();
|
|
3449
|
+
}
|
|
3412
3450
|
}
|
|
3413
3451
|
};
|
|
3414
3452
|
});
|
|
@@ -5568,10 +5606,13 @@ angular.module('niceElements').run(['$templateCache', function($templateCache) {
|
|
|
5568
5606
|
|
|
5569
5607
|
|
|
5570
5608
|
$templateCache.put('src/components/nice-help/nice-help.html',
|
|
5571
|
-
"<div class=\"nice-help\">\n" +
|
|
5572
|
-
"<i class=\"fa fa-question-circle\"></i>\n" +
|
|
5573
|
-
"<div class=\"help-
|
|
5574
|
-
"</
|
|
5609
|
+
"<div class=\"nice-help\" ng-mouseover=\"onHover()\">\n" +
|
|
5610
|
+
"<i class=\"fa fa-question-circle nice-help-button\" aria-label=\"\"></i>\n" +
|
|
5611
|
+
"<div class=\"nice-help-popup\">\n" +
|
|
5612
|
+
"<span ng-bind-html=\"text\">{{ text }}</span>\n" +
|
|
5613
|
+
"<div data-popper-arrow class=\"nice-help-arrow\"></div>\n" +
|
|
5614
|
+
"</div>\n" +
|
|
5615
|
+
"</div>"
|
|
5575
5616
|
);
|
|
5576
5617
|
|
|
5577
5618
|
|