nice-elements 1.9.15 → 1.10.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,16 @@
1
1
  # Changelog
2
2
 
3
+ ## v1.10.0 (22.3.2024)
4
+
5
+ - created nice-table component,
6
+ - created nice-no-data component,
7
+ - worked on nice-toggle active state
8
+
9
+ ## v1.9.16 (13.3.2024)
10
+
11
+ - worked on nice number on change function,
12
+ - updated node-sass to v9.0.0
13
+
3
14
  ## v1.9.15 (7.3.2024)
4
15
 
5
16
  - worked on nice input example
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.9.15
3
+ # Nice elements v1.10.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
 
@@ -47,6 +47,8 @@ Nice elements is an AngularJS v1.5.8 module that contains nice form elements lik
47
47
  - nice-yesno
48
48
  - nice-pill
49
49
  - nice-toggle
50
+ - nice-no-data
51
+ - nice-table
50
52
  - ~~nice-datetime-picker~~ (DEPREACATED)
51
53
  - ~~nice-datetimerange-picker~~ (DEPREACATED)
52
54
  - ~~nice-dtp~~ (DEPREACATED)
package/bower.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nice-elements",
3
- "version": "1.9.15",
3
+ "version": "1.10.0",
4
4
  "authors": ["Klemen Kastelic <klemen@olaii.com>"],
5
5
  "description": "Nice elements",
6
6
  "keywords": [],
package/dist/nice.js CHANGED
@@ -33,7 +33,7 @@ angular.module('niceElements')
33
33
  * # niceButton
34
34
  */
35
35
  angular.module('niceElements')
36
- .directive('niceButton', function ($q) {
36
+ .directive('niceButton', function () {
37
37
  return {
38
38
  templateUrl: 'src/components/nice-button/nice-button.html',
39
39
  restrict: 'E',
@@ -4009,6 +4009,32 @@ angular.module('niceElements')
4009
4009
  }
4010
4010
  };
4011
4011
  });
4012
+ 'use strict';
4013
+
4014
+ /**
4015
+ * @ngdoc directive
4016
+ * @name niceElements.directive:niceNoData
4017
+ * @description
4018
+ * # niceNoData
4019
+ */
4020
+ angular.module('niceElements')
4021
+ .directive('niceNoData', function () {
4022
+ return {
4023
+ templateUrl: 'src/components/nice-no-data/nice-no-data.html',
4024
+ restrict: 'E',
4025
+ transclude: true,
4026
+ replace: true,
4027
+ scope: {
4028
+ icon: '@?',
4029
+ message: '@',
4030
+ fulldiv: '@'
4031
+ },
4032
+ controller: function ($scope, gettextCatalog) {
4033
+ // if (!$scope.icon) $scope.icon = "icon-square";
4034
+ if (!$scope.message) $scope.message = gettextCatalog.getString("No data");
4035
+ }
4036
+ };
4037
+ });
4012
4038
 
4013
4039
  /**
4014
4040
  * @ngdoc directive
@@ -4249,8 +4275,6 @@ angular.module('niceElements')
4249
4275
  $scope.niceNumberForm.$setValidity("zero", null);
4250
4276
  }
4251
4277
  }
4252
-
4253
- if ($scope.onChange) $scope.onChange({ model: $scope.model });
4254
4278
  };
4255
4279
 
4256
4280
 
@@ -4267,8 +4291,13 @@ angular.module('niceElements')
4267
4291
 
4268
4292
 
4269
4293
  // Watch for model change
4270
- $scope.$watch("model", function () {
4294
+ $scope.$watch("model", function (oldModel, newModel) {
4271
4295
  $scope.check();
4296
+ if ($scope.onChange && oldModel != newModel) {
4297
+ $timeout(function() {
4298
+ $scope.onChange({ model: $scope.model });
4299
+ })
4300
+ }
4272
4301
  });
4273
4302
 
4274
4303
 
@@ -5214,6 +5243,46 @@ angular.module('niceElements')
5214
5243
 
5215
5244
  'use strict';
5216
5245
 
5246
+ /**
5247
+ * @ngdoc directive
5248
+ * @name niceElements.directive:niceTable
5249
+ * @description
5250
+ * # niceTable
5251
+ */
5252
+ angular.module('niceElements')
5253
+ .directive('niceTable', function () {
5254
+ return {
5255
+ templateUrl: 'src/components/nice-table/nice-table.html',
5256
+ restrict: 'E',
5257
+ transclude: true,
5258
+ replace: true,
5259
+ scope: {
5260
+ data: '=',
5261
+ columns: '=',
5262
+ freezeFirst: '@',
5263
+ freezeLast: '@',
5264
+ },
5265
+ controller: function ($scope, $transclude) {
5266
+ $scope.hasActions = $transclude().length > 0;
5267
+
5268
+ $scope.rowStyle = function(column, row) {
5269
+ if (!column.valueStyle) return;
5270
+ return column.valueStyle(row[column.key], row);
5271
+ }
5272
+
5273
+ $scope.rowClass = function(column, row) {
5274
+ if (!column.valueClass) return;
5275
+ return column.valueClass(row[column.key], row);
5276
+ }
5277
+
5278
+ $scope.handleFreeze = function(isFirst, isLast) {
5279
+ return { 'nice-table-freeze-first': $scope.freezeFirst && isFirst, 'nice-table-freeze-last': $scope.freezeLast && isLast }
5280
+ }
5281
+ }
5282
+ };
5283
+ });
5284
+ 'use strict';
5285
+
5217
5286
  /**
5218
5287
  * @ngdoc directive
5219
5288
  * @name niceElements.directive:niceTimePicker
@@ -5854,7 +5923,7 @@ angular.module('niceElements')
5854
5923
  .service('NiceService', function () {
5855
5924
  var service = {
5856
5925
  name: "Nice elements",
5857
- version: "1.9.15",
5926
+ version: "1.10.0",
5858
5927
  getHeader: function () {
5859
5928
  return {};
5860
5929
  }
@@ -6635,6 +6704,14 @@ angular.module('niceElements').run(['$templateCache', function($templateCache) {
6635
6704
  );
6636
6705
 
6637
6706
 
6707
+ $templateCache.put('src/components/nice-no-data/nice-no-data.html',
6708
+ "<div class=\"nice-no-data\" ng-class=\"{ 'nice-no-data-fulldiv': fulldiv }\">\n" +
6709
+ "<nice-icon class=\"nice-no-data-icon\" icon=\"{{ icon }}\" ng-if=\"icon\"></nice-icon>\n" +
6710
+ "<div class=\"nice-no-data-message\" ng-transclude>{{ message }}</div>\n" +
6711
+ "</div>"
6712
+ );
6713
+
6714
+
6638
6715
  $templateCache.put('src/components/nice-notification/nice-notification.html',
6639
6716
  "<div class=\"notification\">\n" +
6640
6717
  "<h3 ng-show=\"title\" ng-bind-html=\"title\"></h3>\n" +
@@ -7819,6 +7896,35 @@ angular.module('niceElements').run(['$templateCache', function($templateCache) {
7819
7896
  );
7820
7897
 
7821
7898
 
7899
+ $templateCache.put('src/components/nice-table/nice-table.html',
7900
+ "<div class=\"nice-table-wrapper\">\n" +
7901
+ "<table class=\"nice-table\">\n" +
7902
+ "<thead>\n" +
7903
+ "<tr>\n" +
7904
+ "<th ng-repeat=\"column in columns\" ng-class=\"[column.class, handleFreeze($first, $last)]\">{{ column.title }}</th>\n" +
7905
+ "<th class=\"w-0 text-right\" ng-if=\"hasActions\">\n" +
7906
+ "<span>{{ data.length }}</span>\n" +
7907
+ "<span ng-if=\"data._resultmeta\">/ {{ data._resultmeta.count }}</span>\n" +
7908
+ "</th>\n" +
7909
+ "</tr>\n" +
7910
+ "</thead>\n" +
7911
+ "<tbody>\n" +
7912
+ "<tr ng-repeat=\"row in data\">\n" +
7913
+ "<td ng-repeat=\"column in columns\" ng-class=\"[column.class, handleFreeze($first, $last)]\">\n" +
7914
+ "<span ng-style=\"rowStyle(column, row)\" ng-class=\"rowClass(column, row)\" ng-if=\"column.formatter\">{{ column.formatter(row[column.key], row) }}</span>\n" +
7915
+ "<span ng-style=\"rowStyle(column, row)\" ng-class=\"rowClass(column, row)\" ng-if=\"!column.formatter\">{{ row[column.key] }}</span>\n" +
7916
+ "</td>\n" +
7917
+ "<td class=\"w-0\" ng-if=\"hasActions\">\n" +
7918
+ "<div class=\"nice-table-actions\" ng-transclude></div>\n" +
7919
+ "</td>\n" +
7920
+ "</tr>\n" +
7921
+ "</tbody>\n" +
7922
+ "</table>\n" +
7923
+ "<nice-no-data ng-if=\"!data || data.length == 0\"></nice-no-data>\n" +
7924
+ "</div>\n"
7925
+ );
7926
+
7927
+
7822
7928
  $templateCache.put('src/components/nice-time-picker/nice-time-picker.html',
7823
7929
  "<div class=\"nice-component nice-time-picker\" ng-form=\"forma\" ng-class=\"{ 'margin-bottom-0': noMargin, 'nice-component-inline': isInline }\">\n" +
7824
7930
  "<div class=\"row\">\n" +
@@ -7881,12 +7987,12 @@ angular.module('niceElements').run(['$templateCache', function($templateCache) {
7881
7987
 
7882
7988
 
7883
7989
  $templateCache.put('src/components/nice-toggle/nice-toggle.html',
7884
- "<div class=\"nice-component nice-toggle\" ng-class=\"{ 'margin-bottom-0' : noMargin, 'nice-component-inline': isInline }\" ng-form=\"formToggle\">\n" +
7990
+ "<div class=\"nice-component nice-toggle\" ng-class=\"{ 'margin-bottom-0' : noMargin, 'nice-component-inline': isInline, 'active': model }\" ng-form=\"formToggle\">\n" +
7885
7991
  "<div class=\"row\">\n" +
7886
7992
  "<nice-title text=\"title\" help=\"help\" required=\"required\" label-width=\"labelWidth\"></nice-title>\n" +
7887
7993
  "<div class=\"nice-field col-xs-12\" ng-class=\"[fieldWidth ? fieldWidth : 'col-sm-8', { 'nice-disabled': isDisabled }]\">\n" +
7888
7994
  "<button type=\"button\" class=\"nice-toggle-field\" ng-click=\"switch()\" ng-disabled=\"isDisabled\">\n" +
7889
- "<div class=\"nice-toggle-field-handle\" ng-class=\"{ 'active': model }\">{{ state }}</div>\n" +
7995
+ "<div class=\"nice-toggle-field-handle\">{{ state }}</div>\n" +
7890
7996
  "</button>\n" +
7891
7997
  "</div>\n" +
7892
7998
  "</div>\n" +