nice-elements 1.7.11 → 1.8.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 CHANGED
@@ -1,5 +1,20 @@
1
1
  # Changelog
2
2
 
3
+ ## v1.8.0 (16.3.2023)
4
+
5
+ - created nice-wrapper component,
6
+ - created nice loader example page,
7
+ - worked on nice-loader,
8
+ - worked on nice-search and nice-dropdown loading,
9
+ - worked on nice-button,
10
+ - worked on example pages,
11
+ - fixed nice-search and nice-search2 border color,
12
+ - deprecated addClass from nice button and nice loader
13
+
14
+ ## v1.7.12 (13.3.2023)
15
+
16
+ - fixed build for services
17
+
3
18
  ## v1.7.11 (13.3.2023)
4
19
 
5
20
  - fixed button types,
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  ![Nice elements](https://github.com/Klemen1337/angularjs-nice-elements/raw/master/demo/assets/logo.png)
2
2
 
3
- # Nice elements v1.7.11
3
+ # Nice elements v1.8.0
4
4
 
5
5
  Nice elements is an AngularJS v1.5.8 module that contains nice form elements like inputs, choice fields, search, toggle, dropdown, etc.
6
6
 
@@ -8,6 +8,7 @@ Nice elements is an AngularJS v1.5.8 module that contains nice form elements lik
8
8
 
9
9
  ## Components
10
10
 
11
+ - nice-wrapper
11
12
  - nice-button
12
13
  - nice-button-toggle
13
14
  - nice-calendar
package/bower.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nice-elements",
3
- "version": "1.7.11",
3
+ "version": "1.8.0",
4
4
  "authors": [
5
5
  "Klemen Kastelic <klemen@olaii.com>"
6
6
  ],
package/dist/nice.js CHANGED
@@ -38,27 +38,28 @@ angular.module('niceElements')
38
38
  templateUrl: 'src/components/nice-button/nice-button.html',
39
39
  restrict: 'E',
40
40
  transclude: true,
41
+ replace: true,
41
42
  scope: {
42
- niceDisabled: '=',
43
43
  title: '@',
44
+ icon: '@?',
44
45
  noMargin: '=',
45
- fieldWidth: '@',
46
- labelWidth: '@',
47
46
  niceClick: '&',
47
+ niceDisabled: '=',
48
48
  addClass: '@',
49
- isInline: '=',
50
- type: '@'
49
+ type: '@?'
51
50
  },
52
- link: function postLink(scope, element, attrs) {
53
- scope.loading = false;
54
- if (!scope.type) scope.type = "button";
51
+ controller: function ($q, $scope, $transclude) {
52
+ if ($scope.addClass != undefined) console.warn("[NICE ELEMENTS] Nice button: add-class attribute is deprecated")
53
+ if (!$scope.type) $scope.type = "button";
54
+ $scope.showSlot = $transclude().length > 0;
55
+ $scope.loading = false;
55
56
 
56
- scope.click = function(){
57
- if (scope.loading===false && scope.niceDisabled!==true){
58
- scope.loading = true;
57
+ $scope.click = function () {
58
+ if ($scope.loading === false && $scope.niceDisabled !== true) {
59
+ $scope.loading = true;
59
60
 
60
- $q.when(scope.niceClick()).finally(function(){
61
- scope.loading = false;
61
+ $q.when($scope.niceClick()).finally(function () {
62
+ $scope.loading = false;
62
63
  });
63
64
  }
64
65
  };
@@ -1010,7 +1011,6 @@ angular.module('niceElements')
1010
1011
  * # niceDate
1011
1012
  */
1012
1013
  angular.module('niceElements')
1013
-
1014
1014
  .directive('niceDate', function () {
1015
1015
  return {
1016
1016
  restrict: 'E',
@@ -1136,7 +1136,7 @@ angular.module('niceElements')
1136
1136
  selectedDate.hours($scope.innerDate.hour);
1137
1137
  selectedDate.minutes($scope.innerDate.minute);
1138
1138
 
1139
- $scope.model = selectedDate;
1139
+ $scope.model = angular.copy(selectedDate);
1140
1140
  if ($scope.onChange) $scope.onChange({ model: $scope.model });
1141
1141
  $scope.forma.$setDirty();
1142
1142
  }
@@ -3847,12 +3847,18 @@ angular.module('niceElements')
3847
3847
  templateUrl: 'src/components/nice-loader/nice-loader.html',
3848
3848
  restrict: 'E',
3849
3849
  transclude: true,
3850
+ replace: true,
3850
3851
  scope: {
3851
3852
  visibleWhen: '=',
3852
3853
  message: '@',
3853
3854
  fullscreen: '@',
3854
3855
  fulldiv: '@',
3855
3856
  addClass: '@'
3857
+ },
3858
+ controller: function ($scope, $transclude) {
3859
+ $scope.showSlot = $transclude().length > 0;
3860
+ if ($scope.visibleWhen != undefined) console.warn("[NICE ELEMENTS] Nice loader: visible-when attribute is deprecated")
3861
+ if ($scope.addClass != undefined) console.warn("[NICE ELEMENTS] Nice loader: add-class attribute is deprecated")
3856
3862
  }
3857
3863
  };
3858
3864
  });
@@ -5362,6 +5368,48 @@ angular.module('niceElements')
5362
5368
 
5363
5369
  'use strict';
5364
5370
 
5371
+ /**
5372
+ * @ngdoc directive
5373
+ * @name niceElements.directive:niceWrapper
5374
+ * @description
5375
+ * # niceWrapper
5376
+ */
5377
+ angular.module('niceElements')
5378
+ .directive('niceWrapper', function () {
5379
+ return {
5380
+ templateUrl: 'src/components/nice-wrapper/nice-wrapper.html',
5381
+ restrict: 'E',
5382
+ replace: true,
5383
+ transclude: {
5384
+ 'title': '?niceWrapperTitle',
5385
+ 'subtitle': '?niceWrapperSubtitle',
5386
+ 'footer': '?niceWrapperFooter'
5387
+ },
5388
+ scope: {
5389
+ title: '@',
5390
+ subtitle: '@',
5391
+ collapsable: '=',
5392
+ collapsed: '@',
5393
+ },
5394
+ controller: function ($scope, $transclude) {
5395
+ $scope.isOpen = true;
5396
+ if ($scope.collapsed) $scope.isOpen = false;
5397
+
5398
+ $scope.hasTitle = $transclude.isSlotFilled('title');
5399
+ $scope.hasSubtitle = $transclude.isSlotFilled('subtitle');
5400
+ $scope.hasFooter = $transclude.isSlotFilled('footer');
5401
+ $scope.hasHeader = $scope.hasTitle || $scope.hasSubtitle || $scope.title || $scope.subtitle || $scope.collapsable;
5402
+
5403
+ $scope.toggle = function () {
5404
+ if (!$scope.collapsable) return;
5405
+ $scope.isOpen = !$scope.isOpen;
5406
+ }
5407
+ }
5408
+ };
5409
+ });
5410
+
5411
+ 'use strict';
5412
+
5365
5413
  /**
5366
5414
  * @ngdoc directive
5367
5415
  * @name niceElements.directive:niceYesno
@@ -5505,6 +5553,26 @@ angular.module('niceElements').filter('niceHighlight', function () {
5505
5553
  };
5506
5554
  });
5507
5555
 
5556
+ /**
5557
+ * @ngdoc date
5558
+ * @name niceElements.service:NiceService
5559
+ * @function
5560
+ * @description
5561
+ * # NiceService
5562
+ * Service in the niceElements.
5563
+ */
5564
+ angular.module('niceElements')
5565
+ .service('NiceService', function () {
5566
+ var service = {
5567
+ name: "Nice elements",
5568
+ version: "1.7.12",
5569
+ getHeader: function () {
5570
+ return {};
5571
+ }
5572
+ };
5573
+
5574
+ return service;
5575
+ })
5508
5576
  angular.module('niceElements').run(['$templateCache', function($templateCache) {
5509
5577
  'use strict';
5510
5578
 
@@ -5522,12 +5590,11 @@ angular.module('niceElements').run(['$templateCache', function($templateCache) {
5522
5590
 
5523
5591
 
5524
5592
  $templateCache.put('src/components/nice-button/nice-button.html',
5525
- "<div class=\"nice-component nice-button\" ng-class=\"{ 'margin-bottom-0' : noMargin, 'nice-component-inline': isInline }\">\n" +
5526
- "<button type=\"{{ type }}\" class=\"btn btn-primary\" ng-class=\"addClass\" ng-click=\"click()\" ng-disabled=\"niceDisabled===true\">\n" +
5527
- "<div ng-class=\"{opacity0: loading==true, opacity1: loading==false}\"><ng-transclude></ng-transclude></div>\n" +
5528
- "<div ng-class=\"{display0: loading==false, opacity1: loading==true}\" class=\"nice-button-loader-wrapper\"><nice-loader add-class=\"nice-button-loader\"></nice-loader></div>\n" +
5529
- "</button>\n" +
5530
- "</div>\n"
5593
+ "<button type=\"{{ type }}\" class=\"nice-component nice-button btn btn-primary\" ng-class=\"{ 'margin-bottom-0' : noMargin }\" ng-click=\"click()\" ng-disabled=\"niceDisabled == true\">\n" +
5594
+ "<nice-icon icon=\"{{ icon }}\" ng-if=\"icon\" ng-class=\"{ 'opacity-0': loading }\"></nice-icon>\n" +
5595
+ "<span ng-if=\"showSlot\" ng-transclude ng-class=\"{ 'opacity-0': loading }\"></span>\n" +
5596
+ "<nice-loader ng-if=\"loading\" fulldiv=\"true\" class=\"nice-button-loader\"></nice-loader>\n" +
5597
+ "</button>"
5531
5598
  );
5532
5599
 
5533
5600
 
@@ -5959,7 +6026,7 @@ angular.module('niceElements').run(['$templateCache', function($templateCache) {
5959
6026
  "</div>\n" +
5960
6027
  "<div class=\"not-selected\" ng-if=\"selected == null\">{{ selectText }}</div>\n" +
5961
6028
  "<span class=\"caret\" ng-show=\"!loading\"></span>\n" +
5962
- "<nice-loader visible-when=\"!loading\"></nice-loader>\n" +
6029
+ "<nice-loader ng-if=\"loading\"></nice-loader>\n" +
5963
6030
  "</button>\n" +
5964
6031
  "<div class=\"nice-dropdown-menu-wrapper\">\n" +
5965
6032
  "<div class=\"nice-dropdown-menu\" ng-if=\"isOpen\">\n" +
@@ -6145,12 +6212,12 @@ angular.module('niceElements').run(['$templateCache', function($templateCache) {
6145
6212
 
6146
6213
 
6147
6214
  $templateCache.put('src/components/nice-loader/nice-loader.html',
6148
- "<div class=\"nice-loader\" ng-if=\"!visibleWhen\" ng-class=\"[addClass, { 'nice-loader-fullscreen': fullscreen, 'nice-loader-fulldiv': fulldiv }]\">\n" +
6149
- "<svg version=\"1.1\" id=\"loader\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" x=\"0px\" y=\"0px\" width=\"40px\" height=\"40px\" viewBox=\"0 0 50 50\" style=\"enable-background:new 0 0 50 50;\" xml:space=\"preserve\">\n" +
6150
- "<path fill=\"#000\" d=\"M43.935,25.145c0-10.318-8.364-18.683-18.683-18.683c-10.318,0-18.683,8.365-18.683,18.683h4.068c0-8.071,6.543-14.615,14.615-14.615c8.072,0,14.615,6.543,14.615,14.615H43.935z\"></path>\n" +
6215
+ "<div class=\"nice-loader\" ng-class=\"{ 'nice-loader-fullscreen': fullscreen, 'nice-loader-fulldiv': fulldiv }\">\n" +
6216
+ "<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" x=\"0px\" y=\"0px\" width=\"40px\" height=\"40px\" viewBox=\"0 0 50 50\" style=\"enable-background:new 0 0 50 50;\" xml:space=\"preserve\">\n" +
6217
+ "<path d=\"M43.935,25.145c0-10.318-8.364-18.683-18.683-18.683c-10.318,0-18.683,8.365-18.683,18.683h4.068c0-8.071,6.543-14.615,14.615-14.615c8.072,0,14.615,6.543,14.615,14.615H43.935z\"></path>\n" +
6151
6218
  "</svg>\n" +
6152
6219
  "<div class=\"nice-loader-message\" ng-if=\"message\">{{ message }}</div>\n" +
6153
- "<ng-transclude></ng-transclude>\n" +
6220
+ "<ng-transclude ng-if=\"showSlot\"></ng-transclude>\n" +
6154
6221
  "</div>"
6155
6222
  );
6156
6223
 
@@ -6278,15 +6345,11 @@ angular.module('niceElements').run(['$templateCache', function($templateCache) {
6278
6345
  "<div class=\"row\">\n" +
6279
6346
  "<nice-title title=\"title\" help=\"help\" required=\"required\" label-width=\"labelWidth\"></nice-title>\n" +
6280
6347
  "<div class=\"nice-field col-xs-12\" ng-class=\"[fieldWidth ? fieldWidth : 'col-sm-8', { 'nice-disabled': isDisabled }]\">\n" +
6281
- "<div class=\"input-group\" ng-class=\"{\n" +
6282
- " 'disabled': isDisabled,\n" +
6283
- " 'has-warning': !isDisabled && form.$invalid && form.$dirty,\n" +
6284
- " 'has-success': !isDisabled && form.$valid && form.$dirty}\n" +
6285
- " \">\n" +
6348
+ "<div class=\"input-group\" ng-class=\"{ 'disabled': isDisabled }\">\n" +
6286
6349
  "<input class=\"form-control\" type=\"text\" id=\"{{ id }}\" ng-model=\"modelString\" ng-keypress=\"keypress($event)\" placeholder=\"{{ placeholder }}\" ng-disabled=\"isDisabled\" ng-change=\"updateSearch()\" ng-required=\"required\" tabindex=\"{{ tabIndex }}\">\n" +
6287
6350
  "<span class=\"input-group-addon clickable\" ng-click=\"search()\" ng-if=\"!model\">\n" +
6288
6351
  "<nice-icon ng-show=\"!loading\" icon=\"icon-search\"></nice-icon>\n" +
6289
- "<nice-icon ng-show=\"loading\" icon=\"icon-loader\" class=\"d-block nice-animation-spin\"></nice-icon>\n" +
6352
+ "<nice-loader ng-if=\"loading\"></nice-loader>\n" +
6290
6353
  "</span>\n" +
6291
6354
  "<span class=\"input-group-addon clickable\" ng-click=\"remove()\" ng-if=\"model\">\n" +
6292
6355
  "<nice-icon ng-show=\"!loading\" icon=\"icon-x\"></nice-icon>\n" +
@@ -6316,17 +6379,17 @@ angular.module('niceElements').run(['$templateCache', function($templateCache) {
6316
6379
  "<div class=\"row\">\n" +
6317
6380
  "<nice-title title=\"title\" help=\"help\" required=\"required\" label-width=\"labelWidth\"></nice-title>\n" +
6318
6381
  "<div class=\"nice-field col-xs-12\" ng-class=\"[fieldWidth ? fieldWidth : 'col-sm-8', { 'nice-disabled': isDisabled }]\" click-outside=\"close()\">\n" +
6319
- "<div class=\"nice-search-button input-group\" ng-class=\"{ 'disabled': isDisabled, 'has-warning': !isDisabled && form.$invalid && form.$dirty, 'has-success': !isDisabled && form.$valid && form.$dirty}\">\n" +
6382
+ "<div class=\"nice-search-button input-group\" ng-class=\"{ 'disabled': isDisabled }\">\n" +
6320
6383
  "<input class=\"form-control\" type=\"text\" id=\"{{ id }}\" ng-model=\"model\" placeholder=\"{{ placeholder }}\" ng-disabled=\"isDisabled\" ng-change=\"updateSearch()\" ng-focus=\"onFocus()\" tabindex=\"{{ tabIndex }}\">\n" +
6321
6384
  "<span class=\"input-group-addon clickable\" ng-click=\"onFocus()\">\n" +
6322
6385
  "<nice-icon ng-show=\"!loading\" icon=\"icon-search\"></nice-icon>\n" +
6323
- "<nice-icon ng-show=\"loading\" icon=\"icon-loader\" class=\"d-block nice-animation-spin\"></nice-icon>\n" +
6386
+ "<nice-loader ng-if=\"loading\"></nice-loader>\n" +
6324
6387
  "</span>\n" +
6325
6388
  "</div>\n" +
6326
6389
  "<div class=\"nice-search-dropdown-wrapper\">\n" +
6327
6390
  "<div class=\"nice-search-dropdown\" ng-if=\"showDropdown && isOpen\">\n" +
6328
6391
  "<div class=\"nice-search-row nice-search-row-loading\" ng-if=\"loading && results.length == 0\">\n" +
6329
- "<nice-loader visible-when=\"!loading\"></nice-loader>\n" +
6392
+ "<nice-loader ng-if=\"loading\"></nice-loader>\n" +
6330
6393
  "</div>\n" +
6331
6394
  "<div class=\"nice-search-row nice-search-row-empty\" ng-if=\"!loading && results.length == 0\" translate translate-context=\"Nice\">No results found.</div>\n" +
6332
6395
  "<div ng-repeat=\"result in results\" class=\"nice-search-row\" ng-class=\"{'active': selectedIndex == $index}\" ng-click=\"selectItem(result)\">\n" +
@@ -7304,6 +7367,23 @@ angular.module('niceElements').run(['$templateCache', function($templateCache) {
7304
7367
  );
7305
7368
 
7306
7369
 
7370
+ $templateCache.put('src/components/nice-wrapper/nice-wrapper.html',
7371
+ "<div class=\"nice-wrapper\" ng-class=\"{ 'collapsable': collapsable, 'has-header': hasHeader, 'has-footer': hasFooter }\">\n" +
7372
+ "<div class=\"nice-wrapper-header\" ng-if=\"hasHeader\" ng-click=\"toggle()\">\n" +
7373
+ "<div class=\"nice-wrapper-info\">\n" +
7374
+ "<div class=\"nice-wrapper-title\" ng-transclude=\"title\">{{ title }}</div>\n" +
7375
+ "<div class=\"nice-wrapper-subtitle\" ng-transclude=\"subtitle\">{{ subtitle }}</div>\n" +
7376
+ "</div>\n" +
7377
+ "<button class=\"nice-wrapper-toggle btn btn-icon btn-default-naked\" ng-if=\"collapsable\" ng-class=\"{ 'is-open': isOpen }\">\n" +
7378
+ "<nice-icon icon=\"icon-chevron-down\"></nice-icon>\n" +
7379
+ "</button>\n" +
7380
+ "</div>\n" +
7381
+ "<div class=\"nice-wrapper-body\" ng-transclude ng-if=\"isOpen\"></div>\n" +
7382
+ "<div class=\"nice-wrapper-footer\" ng-if=\"isOpen && hasFooter\" ng-transclude=\"footer\"></div>\n" +
7383
+ "</div>"
7384
+ );
7385
+
7386
+
7307
7387
  $templateCache.put('src/components/nice-yesno/nice-yesno.html',
7308
7388
  "<div class=\"nice-component nice-yesno\" ng-class=\"{ 'margin-bottom-0' : noMargin, 'nice-component-inline': isInline }\" ng-form=\"formYesno\">\n" +
7309
7389
  "<div class=\"row\">\n" +