nice-elements 1.4.5 → 1.4.8

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 CHANGED
@@ -1,6 +1,19 @@
1
1
  # Changelog
2
2
 
3
- ## v1.4.5 (1.8.2022)
3
+ ## v1.4.8 (29.8.2022)
4
+
5
+ - fixes
6
+
7
+ ## v1.4.7 (29.8.2022)
8
+
9
+ - fixes
10
+
11
+ ## v1.4.6 (26.8.2022)
12
+
13
+ - fixed popper in nice-date, nice-search,
14
+ - fixed with in nice-daterange-picker-2
15
+
16
+ ## v1.4.5 (26.8.2022)
4
17
 
5
18
  - added @popperjs/core v2.11.6,
6
19
  - changed dropdown to popper in nice-dropdown, nice-date, nice-search2 and nice-daterange-picker-2
package/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # Nice elements v1.4.5
1
+ # Nice elements v1.4.8
2
2
 
3
3
  Nice elements is an AngularJS v1.5.8 module that contains nice form elements like inputs, choice fields, search, toggle, dropdown, etc.
4
4
 
package/dist/nice.js CHANGED
@@ -921,7 +921,7 @@ angular.module('niceElements')
921
921
  isInline: '=',
922
922
  onChange: '&?'
923
923
  },
924
- controller: function($scope, $element, 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];
@@ -1000,7 +1000,10 @@ angular.module('niceElements')
1000
1000
  ],
1001
1001
  });
1002
1002
  };
1003
- if (!$scope.inline) $scope.setupPopper();
1003
+
1004
+ $timeout(function () {
1005
+ if (!$scope.inline) $scope.setupPopper();
1006
+ });
1004
1007
 
1005
1008
 
1006
1009
  // ------------------ Time changes ------------------
@@ -1208,7 +1211,9 @@ angular.module('niceElements')
1208
1211
  $scope.toggleOpen = function() {
1209
1212
  if (!$scope.isDisabled) {
1210
1213
  $scope.isOpen = !$scope.isOpen;
1211
- $scope.popper.update();
1214
+ $timeout(function() {
1215
+ if ($scope.popper) $scope.popper.update();
1216
+ })
1212
1217
  }
1213
1218
  };
1214
1219
  }
@@ -1331,7 +1336,7 @@ angular.module('niceElements')
1331
1336
  onChange: '&?'
1332
1337
  },
1333
1338
  templateUrl: 'src/components/nice-datetimerange-picker-2/nice-datetimerange-picker-2.html',
1334
- controller: function ($element, $scope) {
1339
+ controller: function ($element, $timeout, $scope) {
1335
1340
  $scope.isOpen = false;
1336
1341
 
1337
1342
 
@@ -1379,7 +1384,10 @@ angular.module('niceElements')
1379
1384
  ],
1380
1385
  });
1381
1386
  };
1382
- $scope.setupPopper();
1387
+
1388
+ $timeout(function () {
1389
+ $scope.setupPopper();
1390
+ });
1383
1391
 
1384
1392
 
1385
1393
  $scope.format = function(){
@@ -2258,19 +2266,22 @@ angular.module('niceElements')
2258
2266
  enabled: true,
2259
2267
  phase: "beforeWrite",
2260
2268
  requires: ["computeStyles"],
2261
- fn: ({ state }) => {
2262
- state.styles.popper.width = `${state.rects.reference.width}px`;
2269
+ fn: function(e) {
2270
+ var state = e.state;
2271
+ state.styles.popper.width = state.rects.reference.width + "px";
2263
2272
  },
2264
- effect: ({ state }) => {
2265
- state.elements.popper.style.width = `${
2266
- state.elements.reference.offsetWidth
2267
- }px`;
2273
+ effect: function(e) {
2274
+ var state = e.state;
2275
+ state.elements.popper.style.width = state.elements.reference.offsetWidth + "px";
2268
2276
  }
2269
2277
  }
2270
2278
  ],
2271
2279
  });
2272
2280
  };
2273
- $scope.setupPopper();
2281
+
2282
+ $timeout(function () {
2283
+ $scope.setupPopper();
2284
+ });
2274
2285
 
2275
2286
  // -----------------------------------Open -----------------------------------
2276
2287
  $scope.toggle = function () {
@@ -2286,9 +2297,14 @@ angular.module('niceElements')
2286
2297
  };
2287
2298
 
2288
2299
  $scope.open = function () {
2289
- $scope.isOpen = true;
2300
+ $scope.popper.update();
2301
+ $timeout(function () {
2302
+ $scope.isOpen = true;
2303
+ $timeout(function () {
2304
+ $scope.popper.update();
2305
+ });
2306
+ });
2290
2307
  $timeout(function () {
2291
- $scope.popper.update();
2292
2308
  $scope.focusInput();
2293
2309
  $scope.scrollToHover(true);
2294
2310
  }, 100);
@@ -4398,19 +4414,22 @@ angular.module('niceElements')
4398
4414
  enabled: true,
4399
4415
  phase: "beforeWrite",
4400
4416
  requires: ["computeStyles"],
4401
- fn: ({ state }) => {
4402
- state.styles.popper.width = `${state.rects.reference.width}px`;
4417
+ fn: function(e) {
4418
+ var state = e.state;
4419
+ state.styles.popper.width = state.rects.reference.width + "px";
4403
4420
  },
4404
- effect: ({ state }) => {
4405
- state.elements.popper.style.width = `${
4406
- state.elements.reference.offsetWidth
4407
- }px`;
4421
+ effect: function(e) {
4422
+ var state = e.state;
4423
+ state.elements.popper.style.width = state.elements.reference.offsetWidth + "px";
4408
4424
  }
4409
4425
  }
4410
4426
  ],
4411
4427
  });
4412
4428
  };
4413
- $scope.setupPopper();
4429
+
4430
+ $timeout(function () {
4431
+ $scope.setupPopper();
4432
+ })
4414
4433
 
4415
4434
  // ------------------- On focus -------------------
4416
4435
  $scope.onFocus = function() {
@@ -4428,6 +4447,9 @@ angular.module('niceElements')
4428
4447
  // ------------------- On focus -------------------
4429
4448
  $scope.open = function() {
4430
4449
  $scope.isOpen = true;
4450
+ $timeout(function() {
4451
+ if ($scope.popper) $scope.popper.update();
4452
+ });
4431
4453
  };
4432
4454
 
4433
4455
 
@@ -5169,7 +5191,7 @@ angular.module('niceElements').run(['$templateCache', function($templateCache) {
5169
5191
  "<i class=\"fa fa-calendar\"></i>\n" +
5170
5192
  "</span>\n" +
5171
5193
  "</div>\n" +
5172
- "<div class=\"nice-date-dropdown-wrapper\">\n" +
5194
+ "<div ng-class=\"{ 'nice-date-dropdown-wrapper': !inline }\">\n" +
5173
5195
  "<div ng-class=\"{ 'nice-date-dropdown': !inline }\" ng-if=\"inline || isOpen\">\n" +
5174
5196
  "<div class=\"nice-date-date\" ng-class=\"{ 'with-time': time }\">\n" +
5175
5197
  "<div class=\"nice-date-header\">\n" +