nice-elements 1.10.8 → 1.10.10
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 +10 -0
- package/README.md +1 -1
- package/bower.json +1 -1
- package/dist/nice.js +41 -34
- package/dist/nice.min.js +1 -1
- package/dist/style.css +38 -45
- package/dist/style.css.map +1 -1
- package/dist/style.min.css +1 -1
- package/package.json +6 -6
- package/src/components/nice-date/nice-date.html +12 -8
- package/src/components/nice-date/nice-date.js +25 -23
- package/src/components/nice-date/nice-date.scss +51 -48
- package/src/components/nice-toggle/nice-toggle.html +1 -1
- package/src/components/nice-toggle/nice-toggle.js +2 -1
- package/src/services/nice-service.js +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,15 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## v1.10.10 (16.10.2024)
|
|
4
|
+
|
|
5
|
+
- worked on nice-date component build month weeks
|
|
6
|
+
- updated decimal.js, font-awesome, moment, @eslint/js and eslint
|
|
7
|
+
- created nice date example page
|
|
8
|
+
|
|
9
|
+
## v1.10.9 (14.10.2024)
|
|
10
|
+
|
|
11
|
+
- added inverted prop to nice toggle component
|
|
12
|
+
|
|
3
13
|
## v1.10.8 (9.10.2024)
|
|
4
14
|
|
|
5
15
|
- fixed nice choice firefox drag to select - OLA-1134
|
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|

|
|
2
2
|
|
|
3
|
-
# Nice elements v1.10.
|
|
3
|
+
# Nice elements v1.10.10
|
|
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
|
|
package/bower.json
CHANGED
package/dist/nice.js
CHANGED
|
@@ -1088,8 +1088,8 @@ angular.module('niceElements')
|
|
|
1088
1088
|
];
|
|
1089
1089
|
|
|
1090
1090
|
$scope.years = [];
|
|
1091
|
-
|
|
1092
|
-
for (
|
|
1091
|
+
const year = moment().year() - 100;
|
|
1092
|
+
for (let i = 0; i < 200; i++) {
|
|
1093
1093
|
$scope.years.push(year + i);
|
|
1094
1094
|
}
|
|
1095
1095
|
|
|
@@ -1115,8 +1115,8 @@ angular.module('niceElements')
|
|
|
1115
1115
|
// Setup popper
|
|
1116
1116
|
// https://popper.js.org/docs/v2/constructors/
|
|
1117
1117
|
$scope.setupPopper = function () {
|
|
1118
|
-
|
|
1119
|
-
|
|
1118
|
+
const button = $element[0].getElementsByClassName('nice-date-button')[0];
|
|
1119
|
+
const tooltip = $element[0].getElementsByClassName('nice-date-dropdown-wrapper')[0];
|
|
1120
1120
|
$scope.popper = Popper.createPopper(button, tooltip, {
|
|
1121
1121
|
strategy: 'fixed',
|
|
1122
1122
|
placement: 'bottom-start',
|
|
@@ -1133,33 +1133,37 @@ angular.module('niceElements')
|
|
|
1133
1133
|
|
|
1134
1134
|
$timeout(function () {
|
|
1135
1135
|
if (!$scope.inline) $scope.setupPopper();
|
|
1136
|
-
});
|
|
1136
|
+
}, 100);
|
|
1137
1137
|
|
|
1138
1138
|
|
|
1139
1139
|
// ------------------ Time changes ------------------
|
|
1140
1140
|
$scope.timeChange = function () {
|
|
1141
|
-
|
|
1141
|
+
const selectedDate = angular.copy($scope.model);
|
|
1142
1142
|
selectedDate = $scope._removeTime(selectedDate);
|
|
1143
1143
|
selectedDate.hours($scope.innerDate.hour);
|
|
1144
1144
|
selectedDate.minutes($scope.innerDate.minute);
|
|
1145
1145
|
$scope.innerDate.value = $scope.formatDate(selectedDate);
|
|
1146
1146
|
|
|
1147
1147
|
$scope.model = angular.copy(selectedDate);
|
|
1148
|
-
|
|
1149
|
-
|
|
1148
|
+
$timeout(function () {
|
|
1149
|
+
if ($scope.onChange) $scope.onChange({ model: $scope.model });
|
|
1150
|
+
$scope.forma.$setDirty();
|
|
1151
|
+
})
|
|
1150
1152
|
};
|
|
1151
1153
|
|
|
1152
1154
|
|
|
1153
1155
|
// ------------------ Day was selected ------------------
|
|
1154
1156
|
$scope.select = function (day) {
|
|
1155
1157
|
if (!day.isDisabled) {
|
|
1156
|
-
|
|
1158
|
+
const selectedDate = angular.copy(day.date);
|
|
1157
1159
|
selectedDate.hours($scope.innerDate.hour);
|
|
1158
1160
|
selectedDate.minutes($scope.innerDate.minute);
|
|
1159
1161
|
|
|
1160
1162
|
$scope.model = angular.copy(selectedDate);
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
+
$timeout(function () {
|
|
1164
|
+
if ($scope.onChange) $scope.onChange({ model: $scope.model });
|
|
1165
|
+
$scope.forma.$setDirty();
|
|
1166
|
+
});
|
|
1163
1167
|
}
|
|
1164
1168
|
};
|
|
1165
1169
|
|
|
@@ -1258,12 +1262,10 @@ angular.module('niceElements')
|
|
|
1258
1262
|
|
|
1259
1263
|
// ------------------ Build month ------------------
|
|
1260
1264
|
$scope._buildMonth = function () {
|
|
1261
|
-
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
|
|
1265
|
-
|
|
1266
|
-
date.add(1, "w");
|
|
1265
|
+
let done = false;
|
|
1266
|
+
const date = angular.copy($scope.innerDate.date).startOf("month").startOf('week');
|
|
1267
|
+
let monthIndex = date.month();
|
|
1268
|
+
let count = 0;
|
|
1267
1269
|
|
|
1268
1270
|
$scope.weeks = [];
|
|
1269
1271
|
while (!done) {
|
|
@@ -1277,9 +1279,9 @@ angular.module('niceElements')
|
|
|
1277
1279
|
|
|
1278
1280
|
// ------------------ Build week ------------------
|
|
1279
1281
|
$scope._buildWeek = function (date) {
|
|
1280
|
-
|
|
1281
|
-
for (
|
|
1282
|
-
|
|
1282
|
+
const days = [];
|
|
1283
|
+
for (let i = 0; i < 7; i++) {
|
|
1284
|
+
const day = {
|
|
1283
1285
|
name: date.format("dd"),
|
|
1284
1286
|
number: date.date(),
|
|
1285
1287
|
isCurrentMonth: $scope.isSameMonth(date, $scope.innerDate.date),
|
|
@@ -1304,7 +1306,7 @@ angular.module('niceElements')
|
|
|
1304
1306
|
|
|
1305
1307
|
// ------------------ Watch for model change ------------------
|
|
1306
1308
|
$scope.$watchGroup(["model", 'minDate', 'maxDate', 'nextDate'], function (value) {
|
|
1307
|
-
$scope.
|
|
1309
|
+
$scope.bootstrap();
|
|
1308
1310
|
});
|
|
1309
1311
|
|
|
1310
1312
|
|
|
@@ -1323,7 +1325,7 @@ angular.module('niceElements')
|
|
|
1323
1325
|
|
|
1324
1326
|
|
|
1325
1327
|
// ------------------ Bootstrap ------------------
|
|
1326
|
-
$scope.
|
|
1328
|
+
$scope.bootstrap = function () {
|
|
1327
1329
|
$scope.setInnerDate(moment($scope.model));
|
|
1328
1330
|
$scope.getTime();
|
|
1329
1331
|
|
|
@@ -1335,7 +1337,7 @@ angular.module('niceElements')
|
|
|
1335
1337
|
$scope._buildMonth();
|
|
1336
1338
|
};
|
|
1337
1339
|
|
|
1338
|
-
$scope.
|
|
1340
|
+
$scope.bootstrap();
|
|
1339
1341
|
|
|
1340
1342
|
|
|
1341
1343
|
// ------------------ Toggle open ------------------
|
|
@@ -5552,7 +5554,8 @@ angular.module('niceElements')
|
|
|
5552
5554
|
isBlock: '=',
|
|
5553
5555
|
titleRight: '=',
|
|
5554
5556
|
help: '@',
|
|
5555
|
-
required: '='
|
|
5557
|
+
required: '=',
|
|
5558
|
+
inverted: '='
|
|
5556
5559
|
},
|
|
5557
5560
|
controller: function ($scope, $timeout) {
|
|
5558
5561
|
if (!$scope.title) { $scope.title = ''; }
|
|
@@ -5969,7 +5972,7 @@ angular.module('niceElements')
|
|
|
5969
5972
|
.service('NiceService', function ($rootScope) {
|
|
5970
5973
|
var service = {
|
|
5971
5974
|
name: "Nice elements",
|
|
5972
|
-
version: "1.10.
|
|
5975
|
+
version: "1.10.10",
|
|
5973
5976
|
getHeader: function () {
|
|
5974
5977
|
return {};
|
|
5975
5978
|
},
|
|
@@ -6274,15 +6277,19 @@ angular.module('niceElements').run(['$templateCache', function($templateCache) {
|
|
|
6274
6277
|
"<div class=\"nice-date-date\" ng-if=\"date\" role=\"grid\">\n" +
|
|
6275
6278
|
"<div class=\"nice-date-header\">\n" +
|
|
6276
6279
|
"<span>\n" +
|
|
6277
|
-
"<select class=\"year-picker\" ng-model=\"innerDate.year\" ng-change=\"handleDateChange()\" ng-options=\"year for year in years\" ng-disabled=\"isDisabled\">\n" +
|
|
6278
|
-
"
|
|
6279
|
-
"<
|
|
6280
|
-
"<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\">\n" +
|
|
6281
|
-
"</select>\n" +
|
|
6280
|
+
"<select class=\"year-picker\" ng-model=\"innerDate.year\" ng-change=\"handleDateChange()\" ng-options=\"year for year in years\" ng-disabled=\"isDisabled\"></select>\n" +
|
|
6281
|
+
"<span class=\"nice-date-header-comma\">,</span>\n" +
|
|
6282
|
+
"<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" +
|
|
6282
6283
|
"</span>\n" +
|
|
6283
|
-
"<button type=\"button\" class=\"btn btn-default-naked\" ng-disabled=\"isDisabled\" ng-click=\"previous()\"
|
|
6284
|
-
"<
|
|
6285
|
-
"
|
|
6284
|
+
"<button type=\"button\" class=\"btn btn-default-naked\" ng-disabled=\"isDisabled\" ng-click=\"previous()\">\n" +
|
|
6285
|
+
"<nice-icon icon=\"icon-chevron-left\"></nice-icon>\n" +
|
|
6286
|
+
"</button>\n" +
|
|
6287
|
+
"<button type=\"button\" class=\"btn btn-default-naked\" ng-disabled=\"isDisabled\" ng-click=\"today()\">\n" +
|
|
6288
|
+
"<nice-icon icon=\"icon-circle\"></nice-icon>\n" +
|
|
6289
|
+
"</button>\n" +
|
|
6290
|
+
"<button type=\"button\" class=\"btn btn-default-naked\" ng-disabled=\"isDisabled\" ng-click=\"next()\">\n" +
|
|
6291
|
+
"<nice-icon icon=\"icon-chevron-right\"></nice-icon>\n" +
|
|
6292
|
+
"</button>\n" +
|
|
6286
6293
|
"</div>\n" +
|
|
6287
6294
|
"<div class=\"nice-date-week names\">\n" +
|
|
6288
6295
|
"<span class=\"nice-date-day\" ng-class=\"{ 'weekend': $index == 6 || $index == 5 }\" ng-repeat=\"day in weekdays\">{{ day }}</span>\n" +
|
|
@@ -8017,7 +8024,7 @@ angular.module('niceElements').run(['$templateCache', function($templateCache) {
|
|
|
8017
8024
|
|
|
8018
8025
|
|
|
8019
8026
|
$templateCache.put('src/components/nice-toggle/nice-toggle.html',
|
|
8020
|
-
"<div class=\"nice-component nice-toggle\" ng-class=\"{ 'margin-bottom-0': noMargin, 'title-right': titleRight, 'nice-component-inline': isInline, 'nice-component-block': isBlock, 'active': model }\" ng-form=\"formToggle\">\n" +
|
|
8027
|
+
"<div class=\"nice-component nice-toggle\" ng-class=\"{ 'margin-bottom-0': noMargin, 'title-right': titleRight, 'nice-component-inline': isInline, 'nice-component-block': isBlock, 'active': inverted ? !model : model }\" ng-form=\"formToggle\">\n" +
|
|
8021
8028
|
"<div class=\"row\">\n" +
|
|
8022
8029
|
"<nice-title text=\"title || niceTitle\" help=\"help\" required=\"required\" label-width=\"labelWidth\"></nice-title>\n" +
|
|
8023
8030
|
"<div class=\"nice-field col-xs-12\" ng-class=\"[fieldWidth ? fieldWidth : 'col-sm-8', { 'nice-disabled': isDisabled }]\">\n" +
|