nice-elements 1.15.0 → 1.16.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/.claude/launch.json +11 -0
- package/CHANGELOG.md +24 -0
- package/CLAUDE.md +1 -0
- package/README.md +1 -1
- package/bower.json +1 -1
- package/dist/nice.js +688 -495
- package/dist/nice.min.js +1 -1
- package/dist/style.css +140 -114
- package/dist/style.css.map +1 -1
- package/dist/style.min.css +2 -2
- package/package.json +5 -6
- package/src/components/nice-calendar/nice-calendar.html +7 -4
- package/src/components/nice-calendar/nice-calendar.scss +0 -9
- package/src/components/nice-checkbox/nice-checkbox.html +10 -4
- package/src/components/nice-checkbox/nice-checkbox.js +1 -0
- package/src/components/nice-checkbox/nice-checkbox.scss +7 -0
- package/src/components/nice-choice/nice-choice.js +11 -0
- package/src/components/nice-date/nice-date-picker.html +60 -0
- package/src/components/nice-date/nice-date.html +29 -77
- package/src/components/nice-date/nice-date.js +54 -35
- package/src/components/nice-date/nice-date.scss +7 -15
- package/src/components/nice-date-input/nice-date-input.js +1 -1
- package/src/components/nice-date-range/nice-date-range.html +1 -1
- package/src/components/nice-datetime-picker/nice-datetime-picker.html +4 -4
- package/src/components/nice-datetime-picker/nice-datetime-picker.scss +9 -12
- package/src/components/nice-datetimerange-picker/nice-datetimerange-picker.html +1 -3
- package/src/components/nice-datetimerange-picker-2/nice-datetimerange-picker-2.html +32 -30
- package/src/components/nice-datetimerange-picker-2/nice-datetimerange-picker-2.js +1 -33
- package/src/components/nice-datetimerange-picker-2/nice-datetimerange-picker-2.scss +7 -12
- package/src/components/nice-dropdown/nice-dropdown.html +42 -40
- package/src/components/nice-dropdown/nice-dropdown.js +64 -57
- package/src/components/nice-dropdown/nice-dropdown.scss +25 -15
- package/src/components/nice-dropdown-old/nice-dropdown-old.html +1 -1
- package/src/components/nice-dropdown-old/nice-dropdown-old.scss +8 -2
- package/src/components/nice-dtp/nice-dtp.html +7 -7
- package/src/components/nice-options/nice-options.scss +4 -0
- package/src/components/nice-percent/nice-percent.js +10 -3
- package/src/components/nice-popup/nice-popup.html +4 -4
- package/src/components/nice-popup/nice-popup.js +61 -75
- package/src/components/nice-popup/nice-popup.scss +10 -31
- package/src/components/nice-search/nice-search.html +0 -3
- package/src/components/nice-search/nice-search.js +8 -14
- package/src/components/nice-search2/nice-search2.html +22 -18
- package/src/components/nice-search2/nice-search2.js +2 -56
- package/src/components/nice-search2/nice-search2.scss +3 -2
- package/src/components/nice-svgs/nice-svgs.html +8 -0
- package/src/components/nice-time-picker/nice-time-picker.html +1 -3
- package/src/components/nice-time-picker/nice-time-picker.scss +0 -8
- package/src/components/nice-toggle/nice-toggle.html +3 -0
- package/src/components/nice-upload/nice-upload.html +1 -1
- package/src/components/nice-yesno/nice-yesno.html +3 -0
- package/src/directives/nice-tooltip/_nice-tooltip.scss +7 -28
- package/src/directives/nice-tooltip/nice-tooltip.js +16 -29
- package/src/services/nice-service.js +236 -1
- package/src/styles/_nice-anchored.scss +75 -0
- package/src/styles/_nice-common.scss +17 -0
- package/src/styles/_nice.scss +1 -0
package/dist/nice.js
CHANGED
|
@@ -801,6 +801,7 @@ angular.module('niceElements')
|
|
|
801
801
|
onChange: '&?',
|
|
802
802
|
help: '@',
|
|
803
803
|
isDisabled: '=',
|
|
804
|
+
required: '=', // Checkbox must be checked
|
|
804
805
|
},
|
|
805
806
|
controller: function ($scope) {
|
|
806
807
|
if ($scope.model === undefined) $scope.model = false;
|
|
@@ -845,6 +846,7 @@ angular.module('niceElements')
|
|
|
845
846
|
multiple: '=?',
|
|
846
847
|
help: '@',
|
|
847
848
|
isInline: '=?',
|
|
849
|
+
required: '=?',
|
|
848
850
|
onChange: '&?'
|
|
849
851
|
},
|
|
850
852
|
controller: function ($attrs, $scope) {
|
|
@@ -1024,6 +1026,16 @@ angular.module('niceElements')
|
|
|
1024
1026
|
}
|
|
1025
1027
|
});
|
|
1026
1028
|
|
|
1029
|
+
// Required: something has to be selected (at least one item when multiple)
|
|
1030
|
+
const checkRequired = function () {
|
|
1031
|
+
if (!$scope.formChoice) return;
|
|
1032
|
+
let hasValue = $scope.model !== null && angular.isDefined($scope.model);
|
|
1033
|
+
if ($scope.multiple) hasValue = !!($scope.model && $scope.model.length);
|
|
1034
|
+
$scope.formChoice.$setValidity('required', !$scope.required || hasValue);
|
|
1035
|
+
};
|
|
1036
|
+
$scope.$watchCollection('model', checkRequired);
|
|
1037
|
+
$scope.$watch('required', checkRequired);
|
|
1038
|
+
|
|
1027
1039
|
}
|
|
1028
1040
|
};
|
|
1029
1041
|
});
|
|
@@ -1144,7 +1156,7 @@ angular.module('niceElements')
|
|
|
1144
1156
|
if ($scope.time === undefined) $scope.time = true;
|
|
1145
1157
|
if (!$scope.placeholderDate) { $scope.placeholderDate = gettextCatalog.getString("••.••.••••", null, "Nice"); }
|
|
1146
1158
|
if (!$scope.placeholderTime) { $scope.placeholderTime = gettextCatalog.getString("••:••", null, "Nice"); }
|
|
1147
|
-
if (!$scope.model && !$scope.nullable) $scope.model = moment(
|
|
1159
|
+
if (!$scope.model && !$scope.nullable) $scope.model = moment().set({ 'second': 0, 'millisecond': 0 });
|
|
1148
1160
|
$scope.inner = {
|
|
1149
1161
|
timeModel: angular.copy($scope.model || moment()),
|
|
1150
1162
|
dateModel: angular.copy($scope.model || moment()),
|
|
@@ -1362,7 +1374,7 @@ angular.module('niceElements')
|
|
|
1362
1374
|
required: '=',
|
|
1363
1375
|
nullable: '=',
|
|
1364
1376
|
placeholder: '@',
|
|
1365
|
-
placement: '@', //
|
|
1377
|
+
placement: '@', // Preferred placement of the dropdown (nice-popup)
|
|
1366
1378
|
},
|
|
1367
1379
|
controller: function ($scope, $attrs, $element, $timeout, gettextCatalog, NiceService) {
|
|
1368
1380
|
NiceService.bindFlag($scope, $attrs, 'inline');
|
|
@@ -1425,37 +1437,6 @@ angular.module('niceElements')
|
|
|
1425
1437
|
if ($scope.minDate) $scope.minDate = moment($scope.minDate);
|
|
1426
1438
|
|
|
1427
1439
|
|
|
1428
|
-
// Setup popper
|
|
1429
|
-
// https://popper.js.org/docs/v2/constructors/
|
|
1430
|
-
$scope.setupPopper = function () {
|
|
1431
|
-
const button = $element[0].getElementsByClassName('nice-date-button')[0];
|
|
1432
|
-
const tooltip = $element[0].getElementsByClassName('nice-date-dropdown-wrapper')[0];
|
|
1433
|
-
$scope.popper = Popper.createPopper(button, tooltip, {
|
|
1434
|
-
strategy: 'fixed',
|
|
1435
|
-
placement: $scope.placement,
|
|
1436
|
-
modifiers: [
|
|
1437
|
-
{
|
|
1438
|
-
name: 'offset',
|
|
1439
|
-
options: {
|
|
1440
|
-
offset: [0, 5],
|
|
1441
|
-
},
|
|
1442
|
-
}
|
|
1443
|
-
],
|
|
1444
|
-
});
|
|
1445
|
-
};
|
|
1446
|
-
|
|
1447
|
-
const setupTimer = $timeout(function () {
|
|
1448
|
-
if (!$scope.inline) $scope.setupPopper();
|
|
1449
|
-
}, 100);
|
|
1450
|
-
|
|
1451
|
-
// Popper adds scroll/resize listeners to window; remove them with the component
|
|
1452
|
-
$scope.$on('$destroy', function () {
|
|
1453
|
-
$timeout.cancel(setupTimer);
|
|
1454
|
-
if ($scope.popper) $scope.popper.destroy();
|
|
1455
|
-
$scope.popper = null;
|
|
1456
|
-
});
|
|
1457
|
-
|
|
1458
|
-
|
|
1459
1440
|
// ------------------ Time changes ------------------
|
|
1460
1441
|
$scope.timeChange = function () {
|
|
1461
1442
|
let selectedDate = angular.copy($scope.model);
|
|
@@ -1488,6 +1469,53 @@ angular.module('niceElements')
|
|
|
1488
1469
|
};
|
|
1489
1470
|
|
|
1490
1471
|
|
|
1472
|
+
// ------------------ Typed date ------------------
|
|
1473
|
+
// Formats accepted when the date is typed in (strict parsing)
|
|
1474
|
+
const TYPED_DATE_FORMATS = ['D.M.YYYY', 'D.M.YY', 'D.M.', 'D.M'];
|
|
1475
|
+
const TYPED_TIME_FORMATS = ['D.M.YYYY H:mm', 'D.M.YY H:mm', 'D.M. H:mm', 'D.M H:mm'];
|
|
1476
|
+
|
|
1477
|
+
// Parse typed text on blur (or Enter). Invalid or out of range text reverts to the current model.
|
|
1478
|
+
$scope.parseTypedDate = function () {
|
|
1479
|
+
const text = ($scope.innerDate.value || "").replace("•", " ").replace(/\s+/g, " ").trim();
|
|
1480
|
+
|
|
1481
|
+
// Nothing changed
|
|
1482
|
+
if (text == $scope.formatDate($scope.model).replace("•", " ").replace(/\s+/g, " ")) return;
|
|
1483
|
+
|
|
1484
|
+
// Empty text clears the model, unless the field can't be empty
|
|
1485
|
+
if (!text) {
|
|
1486
|
+
if ($scope.nullable || $scope.required) $scope.setTypedDate(null);
|
|
1487
|
+
else $scope.innerDate.value = $scope.formatDate($scope.model);
|
|
1488
|
+
return;
|
|
1489
|
+
}
|
|
1490
|
+
|
|
1491
|
+
const formats = $scope.time ? TYPED_TIME_FORMATS.concat(TYPED_DATE_FORMATS) : TYPED_DATE_FORMATS;
|
|
1492
|
+
const date = moment(text, formats, true);
|
|
1493
|
+
if (!date.isValid() || _isDisabledDate(date)) {
|
|
1494
|
+
$scope.innerDate.value = $scope.formatDate($scope.model);
|
|
1495
|
+
return;
|
|
1496
|
+
}
|
|
1497
|
+
|
|
1498
|
+
if (!$scope.time) $scope._removeTime(date);
|
|
1499
|
+
$scope.setTypedDate(date);
|
|
1500
|
+
};
|
|
1501
|
+
|
|
1502
|
+
$scope.setTypedDate = function (date) {
|
|
1503
|
+
$scope.model = date;
|
|
1504
|
+
$scope.innerDate.value = $scope.formatDate($scope.model);
|
|
1505
|
+
$timeout(function () {
|
|
1506
|
+
if ($scope.onChange) $scope.onChange({ model: $scope.model });
|
|
1507
|
+
$scope.forma.$setDirty();
|
|
1508
|
+
});
|
|
1509
|
+
};
|
|
1510
|
+
|
|
1511
|
+
// Enter parses the text first, so the form is submitted with the typed date.
|
|
1512
|
+
// Enter and Tab also close the picker (it isn't closed on blur, because clicking a day blurs the input).
|
|
1513
|
+
$scope.typedDateKeydown = function (event) {
|
|
1514
|
+
if (event.keyCode == 13) $scope.parseTypedDate();
|
|
1515
|
+
if (event.keyCode == 13 || event.keyCode == 9) $scope.isOpen = false;
|
|
1516
|
+
};
|
|
1517
|
+
|
|
1518
|
+
|
|
1491
1519
|
// ------------------ Clear ------------------
|
|
1492
1520
|
$scope.clear = function () {
|
|
1493
1521
|
$scope.isOpen = false;
|
|
@@ -1707,13 +1735,16 @@ angular.module('niceElements')
|
|
|
1707
1735
|
$scope.bootstrap();
|
|
1708
1736
|
|
|
1709
1737
|
|
|
1738
|
+
// ------------------ Close (click outside) ------------------
|
|
1739
|
+
$scope.close = function () {
|
|
1740
|
+
$scope.isOpen = false;
|
|
1741
|
+
};
|
|
1742
|
+
|
|
1743
|
+
|
|
1710
1744
|
// ------------------ Toggle open ------------------
|
|
1711
1745
|
$scope.toggleOpen = function () {
|
|
1712
1746
|
if (!$scope.isDisabled) {
|
|
1713
1747
|
$scope.isOpen = !$scope.isOpen;
|
|
1714
|
-
$timeout(function () {
|
|
1715
|
-
if ($scope.popper) $scope.popper.update();
|
|
1716
|
-
});
|
|
1717
1748
|
}
|
|
1718
1749
|
};
|
|
1719
1750
|
}
|
|
@@ -1846,7 +1877,7 @@ angular.module('niceElements')
|
|
|
1846
1877
|
isInline: '=',
|
|
1847
1878
|
onChange: '&?',
|
|
1848
1879
|
required: '=',
|
|
1849
|
-
placement: '@', //
|
|
1880
|
+
placement: '@', // Preferred placement of the dropdown (nice-popup)
|
|
1850
1881
|
},
|
|
1851
1882
|
templateUrl: 'src/components/nice-datetimerange-picker-2/nice-datetimerange-picker-2.html',
|
|
1852
1883
|
controller: function ($element, $timeout, $scope) {
|
|
@@ -1882,37 +1913,6 @@ angular.module('niceElements')
|
|
|
1882
1913
|
}
|
|
1883
1914
|
|
|
1884
1915
|
|
|
1885
|
-
// Setup popper
|
|
1886
|
-
// https://popper.js.org/docs/v2/constructors/
|
|
1887
|
-
$scope.setupPopper = function () {
|
|
1888
|
-
const button = $element[0].getElementsByClassName('nice-daterange-picker-button')[0];
|
|
1889
|
-
const tooltip = $element[0].getElementsByClassName('nice-daterange-picker-wrapper')[0];
|
|
1890
|
-
$scope.popper = Popper.createPopper(button, tooltip, {
|
|
1891
|
-
strategy: 'fixed',
|
|
1892
|
-
placement: $scope.placement,
|
|
1893
|
-
modifiers: [
|
|
1894
|
-
{
|
|
1895
|
-
name: 'offset',
|
|
1896
|
-
options: {
|
|
1897
|
-
offset: [0, 5],
|
|
1898
|
-
},
|
|
1899
|
-
}
|
|
1900
|
-
],
|
|
1901
|
-
});
|
|
1902
|
-
};
|
|
1903
|
-
|
|
1904
|
-
const setupTimer = $timeout(function () {
|
|
1905
|
-
$scope.setupPopper();
|
|
1906
|
-
});
|
|
1907
|
-
|
|
1908
|
-
// Popper adds scroll/resize listeners to window; remove them with the component
|
|
1909
|
-
$scope.$on('$destroy', function () {
|
|
1910
|
-
$timeout.cancel(setupTimer);
|
|
1911
|
-
if ($scope.popper) $scope.popper.destroy();
|
|
1912
|
-
$scope.popper = null;
|
|
1913
|
-
});
|
|
1914
|
-
|
|
1915
|
-
|
|
1916
1916
|
$scope.format = function () {
|
|
1917
1917
|
$scope.modelFormat = $scope.startDate.format($scope.formatString) + " - " + $scope.endDate.format($scope.formatString);
|
|
1918
1918
|
};
|
|
@@ -1921,7 +1921,6 @@ angular.module('niceElements')
|
|
|
1921
1921
|
$scope.open = function () {
|
|
1922
1922
|
if (!$scope.isDisabled) {
|
|
1923
1923
|
$scope.isOpen = true;
|
|
1924
|
-
if ($scope.popper) $scope.popper.update();
|
|
1925
1924
|
}
|
|
1926
1925
|
};
|
|
1927
1926
|
|
|
@@ -2819,12 +2818,13 @@ angular.module('niceElements')
|
|
|
2819
2818
|
dropdownDistance: '@',
|
|
2820
2819
|
searchFunction: '=?',
|
|
2821
2820
|
filterFunction: '=?',
|
|
2821
|
+
selectedFunction: '=?', // Loads selected options missing from the list: function(keys) → promise of objects
|
|
2822
2822
|
isInline: '=',
|
|
2823
2823
|
clearOnSelect: '@',
|
|
2824
2824
|
enableLoadMore: '@', // Enable load more
|
|
2825
|
-
placement: '@', //
|
|
2825
|
+
placement: '@', // Preferred placement of the menu
|
|
2826
2826
|
},
|
|
2827
|
-
controller: function ($scope, $attrs, $http, $element, $timeout, gettextCatalog, NiceService) {
|
|
2827
|
+
controller: function ($scope, $attrs, $http, $q, $element, $timeout, gettextCatalog, NiceService) {
|
|
2828
2828
|
NiceService.bindFlag($scope, $attrs, 'selectedIsKey');
|
|
2829
2829
|
NiceService.bindFlag($scope, $attrs, 'enableLoadMore');
|
|
2830
2830
|
|
|
@@ -2849,7 +2849,6 @@ angular.module('niceElements')
|
|
|
2849
2849
|
$scope.isOpen = false;
|
|
2850
2850
|
$scope.selected = null;
|
|
2851
2851
|
// $scope.selectedIndex = 0;
|
|
2852
|
-
$scope.popper = null;
|
|
2853
2852
|
|
|
2854
2853
|
$scope.internal = {
|
|
2855
2854
|
search: ""
|
|
@@ -2859,52 +2858,9 @@ angular.module('niceElements')
|
|
|
2859
2858
|
$scope.originalList = angular.copy($scope.list);
|
|
2860
2859
|
}
|
|
2861
2860
|
|
|
2862
|
-
//
|
|
2863
|
-
|
|
2864
|
-
|
|
2865
|
-
const button = $element[0].getElementsByClassName('btn-dropdown')[0];
|
|
2866
|
-
const tooltip = $element[0].getElementsByClassName('nice-dropdown-menu-wrapper')[0];
|
|
2867
|
-
$scope.popper = Popper.createPopper(button, tooltip, {
|
|
2868
|
-
strategy: 'fixed',
|
|
2869
|
-
placement: $scope.placement,
|
|
2870
|
-
modifiers: [
|
|
2871
|
-
{
|
|
2872
|
-
name: 'offset',
|
|
2873
|
-
options: {
|
|
2874
|
-
offset: [0, $scope.dropdownDistance],
|
|
2875
|
-
},
|
|
2876
|
-
},
|
|
2877
|
-
{
|
|
2878
|
-
name: "sameWidth",
|
|
2879
|
-
enabled: true,
|
|
2880
|
-
phase: "beforeWrite",
|
|
2881
|
-
requires: ["computeStyles"],
|
|
2882
|
-
fn: function (e) {
|
|
2883
|
-
const state = e.state;
|
|
2884
|
-
let width = state.rects.reference.width;
|
|
2885
|
-
if (width < 200) width = 200;
|
|
2886
|
-
state.styles.popper.width = width + "px";
|
|
2887
|
-
},
|
|
2888
|
-
effect: function (e) {
|
|
2889
|
-
const state = e.state;
|
|
2890
|
-
let width = state.elements.reference.width;
|
|
2891
|
-
if (width < 200) width = 200;
|
|
2892
|
-
state.elements.popper.style.width = width + "px";
|
|
2893
|
-
}
|
|
2894
|
-
}
|
|
2895
|
-
],
|
|
2896
|
-
});
|
|
2897
|
-
};
|
|
2898
|
-
|
|
2899
|
-
const setupTimer = $timeout(function () {
|
|
2900
|
-
$scope.setupPopper();
|
|
2901
|
-
});
|
|
2902
|
-
|
|
2903
|
-
// Popper adds scroll/resize listeners to window; remove them with the component
|
|
2904
|
-
$scope.$on('$destroy', function () {
|
|
2905
|
-
$timeout.cancel(setupTimer);
|
|
2906
|
-
if ($scope.popper) $scope.popper.destroy();
|
|
2907
|
-
$scope.popper = null;
|
|
2861
|
+
// The menu is a nice-popup (positioning, Escape); on-close fires on every close
|
|
2862
|
+
$scope.$watch('isOpen', function (isOpen, wasOpen) {
|
|
2863
|
+
if (wasOpen && !isOpen && $scope.onClose) $scope.onClose();
|
|
2908
2864
|
});
|
|
2909
2865
|
|
|
2910
2866
|
|
|
@@ -2919,18 +2875,13 @@ angular.module('niceElements')
|
|
|
2919
2875
|
|
|
2920
2876
|
$scope.close = function () {
|
|
2921
2877
|
$scope.isOpen = false;
|
|
2922
|
-
if ($scope.onClose) $scope.onClose();
|
|
2923
2878
|
};
|
|
2924
2879
|
|
|
2925
2880
|
$scope.open = function () {
|
|
2926
|
-
if ($scope.popper) $scope.popper.update();
|
|
2927
2881
|
if ($scope.filterFunction) $scope.internalList = $scope.filterFunction($scope.originalList, $scope.model);
|
|
2928
2882
|
$timeout(function () {
|
|
2929
2883
|
$scope.isOpen = true;
|
|
2930
2884
|
if ($scope.onOpen) $scope.onOpen();
|
|
2931
|
-
$timeout(function () {
|
|
2932
|
-
if ($scope.popper) $scope.popper.update();
|
|
2933
|
-
});
|
|
2934
2885
|
});
|
|
2935
2886
|
$timeout(function () {
|
|
2936
2887
|
$scope.focusInput();
|
|
@@ -3176,10 +3127,17 @@ angular.module('niceElements')
|
|
|
3176
3127
|
$scope.handleModelChange();
|
|
3177
3128
|
});
|
|
3178
3129
|
|
|
3130
|
+
// Options seen so far by key (lists, search results, loaded with selected-function),
|
|
3131
|
+
// so selected keys keep their label when they are not in the current list
|
|
3132
|
+
const knownItems = {};
|
|
3133
|
+
// Keys already passed to selected-function (load each one only once)
|
|
3134
|
+
const requestedKeys = {};
|
|
3135
|
+
|
|
3179
3136
|
$scope.handleModelChange = function () {
|
|
3180
3137
|
$scope.selected = angular.copy($scope.model);
|
|
3181
3138
|
angular.forEach($scope.internalList, function (i, index) {
|
|
3182
3139
|
i._selected = false;
|
|
3140
|
+
knownItems[i[$scope.objKey]] = i;
|
|
3183
3141
|
|
|
3184
3142
|
if ($scope.selectedIsKey) {
|
|
3185
3143
|
// Not object
|
|
@@ -3225,12 +3183,60 @@ angular.module('niceElements')
|
|
|
3225
3183
|
}
|
|
3226
3184
|
});
|
|
3227
3185
|
|
|
3186
|
+
// Selected keys that are not in the list are still raw keys here
|
|
3187
|
+
if ($scope.selectedIsKey && $scope.selected != null) {
|
|
3188
|
+
if ($scope.multiple) $scope.selected = $scope.selected.map($scope.resolveKey);
|
|
3189
|
+
else $scope.selected = $scope.resolveKey($scope.selected);
|
|
3190
|
+
$scope.loadMissingSelected();
|
|
3191
|
+
}
|
|
3192
|
+
|
|
3228
3193
|
// Handle required
|
|
3229
|
-
$timeout(
|
|
3230
|
-
if ($scope.formDropdown) $scope.formDropdown.$setValidity('required', !(!$scope.selected && $scope.required));
|
|
3231
|
-
});
|
|
3194
|
+
$timeout($scope.checkRequired);
|
|
3232
3195
|
}
|
|
3233
3196
|
|
|
3197
|
+
// ----------------------------------- Selected keys missing from the list -----------------------------------
|
|
3198
|
+
// Turn a selected key into an option: one from the list, one seen before,
|
|
3199
|
+
// or a placeholder that shows the key (until selected-function loads it)
|
|
3200
|
+
$scope.resolveKey = function (key) {
|
|
3201
|
+
if (angular.isObject(key)) return key; // already an option from the list
|
|
3202
|
+
if (knownItems[key]) return knownItems[key];
|
|
3203
|
+
const placeholder = { _missing: true };
|
|
3204
|
+
placeholder[$scope.objKey] = key;
|
|
3205
|
+
placeholder[$scope.objValue] = String(key);
|
|
3206
|
+
return placeholder;
|
|
3207
|
+
};
|
|
3208
|
+
|
|
3209
|
+
// Ask selected-function for the options of placeholder keys, then show them
|
|
3210
|
+
$scope.loadMissingSelected = function () {
|
|
3211
|
+
if (!$scope.selectedFunction) return;
|
|
3212
|
+
const selected = $scope.multiple ? $scope.selected : [$scope.selected];
|
|
3213
|
+
const keys = selected.filter(function (s) {
|
|
3214
|
+
return s._missing && !requestedKeys[s[$scope.objKey]];
|
|
3215
|
+
}).map(function (s) {
|
|
3216
|
+
return s[$scope.objKey];
|
|
3217
|
+
});
|
|
3218
|
+
if (keys.length == 0) return;
|
|
3219
|
+
|
|
3220
|
+
keys.forEach(function (key) { requestedKeys[key] = true; });
|
|
3221
|
+
$q.when($scope.selectedFunction(keys)).then(function (items) {
|
|
3222
|
+
angular.forEach(items, function (item) {
|
|
3223
|
+
knownItems[item[$scope.objKey]] = item;
|
|
3224
|
+
});
|
|
3225
|
+
$scope.handleModelChange();
|
|
3226
|
+
});
|
|
3227
|
+
};
|
|
3228
|
+
|
|
3229
|
+
// ----------------------------------- Required -----------------------------------
|
|
3230
|
+
// Form is invalid when required and nothing is selected
|
|
3231
|
+
$scope.checkRequired = function () {
|
|
3232
|
+
if ($scope.formDropdown) $scope.formDropdown.$setValidity('required', !(!$scope.selected && $scope.required));
|
|
3233
|
+
};
|
|
3234
|
+
|
|
3235
|
+
// Re-check when required is turned on/off
|
|
3236
|
+
$scope.$watch('required', function () {
|
|
3237
|
+
$scope.checkRequired();
|
|
3238
|
+
});
|
|
3239
|
+
|
|
3234
3240
|
// ----------------------------------- Watch for keydown and keypress -----------------------------------
|
|
3235
3241
|
// $element.bind("keydown keypress", function (event) {
|
|
3236
3242
|
// // Arrow Up
|
|
@@ -5125,7 +5131,10 @@ angular.module('niceElements')
|
|
|
5125
5131
|
return Number(new Decimal(String(number)).toFixed(decimals, 4));
|
|
5126
5132
|
};
|
|
5127
5133
|
|
|
5128
|
-
if (
|
|
5134
|
+
if ($scope.model === null && $scope.required) {
|
|
5135
|
+
// Required and empty: keep the field empty so ng-required marks it invalid
|
|
5136
|
+
$scope.internalModel = "";
|
|
5137
|
+
} else if (angular.isDefined($scope.model)) {
|
|
5129
5138
|
$scope.internalModel = roundN((angular.copy($scope.model) * 100), 6);
|
|
5130
5139
|
} else {
|
|
5131
5140
|
$scope.internalModel = "0";
|
|
@@ -5138,7 +5147,8 @@ angular.module('niceElements')
|
|
|
5138
5147
|
if (parseFloat($scope.internalModel) > 100) $scope.internalModel = 100;
|
|
5139
5148
|
$scope.model = roundN(parseFloat($scope.internalModel) / 100, 6);
|
|
5140
5149
|
} else {
|
|
5141
|
-
|
|
5150
|
+
// Cleared field: null when required (so the form is invalid), otherwise 0
|
|
5151
|
+
$scope.model = $scope.required ? null : 0;
|
|
5142
5152
|
}
|
|
5143
5153
|
if ($scope.onChange) $scope.onChange({ model: $scope.model });
|
|
5144
5154
|
};
|
|
@@ -5160,11 +5170,14 @@ angular.module('niceElements')
|
|
|
5160
5170
|
$scope.$watch('model', function (value_new, value_old) {
|
|
5161
5171
|
if (value_new) {
|
|
5162
5172
|
$scope.internalModel = roundN(angular.copy($scope.model) * 100, 6);
|
|
5173
|
+
} else if (value_new === null && $scope.required) {
|
|
5174
|
+
$scope.internalModel = "";
|
|
5163
5175
|
}
|
|
5164
5176
|
});
|
|
5165
5177
|
|
|
5166
5178
|
$scope.$watch('internalModel', function (value_new, value_old) {
|
|
5167
|
-
|
|
5179
|
+
// Empty field falls back to 0, unless required (then it stays empty and invalid)
|
|
5180
|
+
if (!$scope.internalModel && !$scope.required) {
|
|
5168
5181
|
$scope.internalModel = "0";
|
|
5169
5182
|
}
|
|
5170
5183
|
});
|
|
@@ -5209,6 +5222,12 @@ angular.module('niceElements')
|
|
|
5209
5222
|
* @name niceElements.directive:nicePopup
|
|
5210
5223
|
* @description
|
|
5211
5224
|
* # nicePopup
|
|
5225
|
+
* Shows content next to a target. Positioned with NiceService.anchor()
|
|
5226
|
+
* (native popover + CSS anchor positioning, Popper fallback).
|
|
5227
|
+
*
|
|
5228
|
+
* trigger="click" (default): clicking the target toggles it, clicking outside closes it.
|
|
5229
|
+
* trigger="manual": the parent opens and closes it through is-open.
|
|
5230
|
+
* Escape always closes it (also in "manual", is-open is set to false).
|
|
5212
5231
|
*/
|
|
5213
5232
|
angular.module('niceElements')
|
|
5214
5233
|
.directive('nicePopup', function () {
|
|
@@ -5220,92 +5239,69 @@ angular.module('niceElements')
|
|
|
5220
5239
|
'content': '?nicePopupContent'
|
|
5221
5240
|
},
|
|
5222
5241
|
scope: {
|
|
5223
|
-
|
|
5224
|
-
|
|
5225
|
-
|
|
5226
|
-
|
|
5242
|
+
isOpen: '=?', // two-way open state
|
|
5243
|
+
trigger: '@', // "click" (default) or "manual"
|
|
5244
|
+
offsetDistance: '@', // gap in px between the target and the content
|
|
5245
|
+
offsetSkidding: '@', // shift in px along the target
|
|
5246
|
+
placement: '@', // preferred placement, e.g. "bottom-start"
|
|
5247
|
+
strategy: '@', // Popper strategy (fallback only)
|
|
5227
5248
|
showArrow: '@',
|
|
5249
|
+
sameWidth: '@', // content as wide as the target
|
|
5228
5250
|
onChange: '&?',
|
|
5229
5251
|
},
|
|
5230
|
-
controller: function ($scope, $element, $timeout) {
|
|
5231
|
-
$scope
|
|
5232
|
-
|
|
5233
|
-
if (!$scope.
|
|
5234
|
-
if (!$scope.
|
|
5235
|
-
if (!$scope.offsetSkidding) { $scope.offsetSkidding = 0; }
|
|
5252
|
+
controller: function ($scope, $element, $attrs, $timeout, NiceService) {
|
|
5253
|
+
NiceService.bindFlag($scope, $attrs, 'showArrow');
|
|
5254
|
+
NiceService.bindFlag($scope, $attrs, 'sameWidth');
|
|
5255
|
+
if (!$scope.isOpen) { $scope.isOpen = false; }
|
|
5256
|
+
if (!$scope.trigger) { $scope.trigger = "click"; }
|
|
5236
5257
|
if (!$scope.placement) { $scope.placement = "auto"; }
|
|
5237
|
-
if (!$scope.
|
|
5238
|
-
|
|
5239
|
-
|
|
5240
|
-
//
|
|
5241
|
-
//
|
|
5242
|
-
|
|
5243
|
-
|
|
5244
|
-
|
|
5245
|
-
//
|
|
5246
|
-
|
|
5247
|
-
// 'bottom',
|
|
5248
|
-
// 'bottom-start',
|
|
5249
|
-
// 'bottom-end',
|
|
5250
|
-
// 'right',
|
|
5251
|
-
// 'right-start',
|
|
5252
|
-
// 'right-end',
|
|
5253
|
-
// 'left',
|
|
5254
|
-
// 'left-start',
|
|
5255
|
-
// 'left-end'
|
|
5256
|
-
// ]
|
|
5257
|
-
|
|
5258
|
-
// Setup popper
|
|
5259
|
-
// https://popper.js.org/docs/v2/constructors/
|
|
5260
|
-
$scope.setupPopper = function () {
|
|
5258
|
+
if (!$scope.offsetDistance) { $scope.offsetDistance = $scope.showArrow ? 8 : 5; }
|
|
5259
|
+
if (!$scope.offsetSkidding) { $scope.offsetSkidding = 0; }
|
|
5260
|
+
|
|
5261
|
+
// Placements: auto, auto-start, auto-end, top, top-start, top-end, bottom, bottom-start,
|
|
5262
|
+
// bottom-end, right, right-start, right-end, left, left-start, left-end
|
|
5263
|
+
|
|
5264
|
+
let anchored = null;
|
|
5265
|
+
|
|
5266
|
+
// Template is in the DOM after the first digest
|
|
5267
|
+
const setupTimer = $timeout(function () {
|
|
5261
5268
|
const target = $element[0].getElementsByClassName('nice-popup-target')[0];
|
|
5262
5269
|
const content = $element[0].getElementsByClassName('nice-popup-content')[0];
|
|
5263
|
-
|
|
5270
|
+
const arrow = $element[0].getElementsByClassName('nice-popup-arrow')[0];
|
|
5271
|
+
anchored = NiceService.anchor(target, content, {
|
|
5264
5272
|
placement: $scope.placement,
|
|
5273
|
+
offset: parseInt($scope.offsetDistance),
|
|
5274
|
+
skidding: parseInt($scope.offsetSkidding),
|
|
5275
|
+
sameWidth: $scope.sameWidth,
|
|
5265
5276
|
strategy: $scope.strategy,
|
|
5266
|
-
|
|
5267
|
-
|
|
5268
|
-
|
|
5269
|
-
|
|
5270
|
-
offset: [$scope.offsetSkidding, $scope.offsetDistance],
|
|
5271
|
-
},
|
|
5272
|
-
},
|
|
5273
|
-
{
|
|
5274
|
-
name: 'arrow',
|
|
5275
|
-
options: {
|
|
5276
|
-
padding: 5, // 5px from the edges of the popper
|
|
5277
|
-
},
|
|
5278
|
-
},
|
|
5279
|
-
// {
|
|
5280
|
-
// name: "sameWidth",
|
|
5281
|
-
// enabled: true,
|
|
5282
|
-
// phase: "beforeWrite",
|
|
5283
|
-
// requires: ["computeStyles"],
|
|
5284
|
-
// fn: function (e) {
|
|
5285
|
-
// var state = e.state;
|
|
5286
|
-
// state.styles.popper.width = state.rects.reference.width + "px";
|
|
5287
|
-
// },
|
|
5288
|
-
// effect: function (e) {
|
|
5289
|
-
// var state = e.state;
|
|
5290
|
-
// state.elements.popper.style.width = state.elements.reference.offsetWidth + "px";
|
|
5291
|
-
// }
|
|
5292
|
-
// }
|
|
5293
|
-
],
|
|
5277
|
+
arrow: arrow,
|
|
5278
|
+
onEscape: function () {
|
|
5279
|
+
$timeout(function () { $scope.close(); });
|
|
5280
|
+
}
|
|
5294
5281
|
});
|
|
5295
|
-
|
|
5282
|
+
if ($scope.isOpen) anchored.open();
|
|
5283
|
+
});
|
|
5296
5284
|
|
|
5297
|
-
|
|
5298
|
-
|
|
5285
|
+
// Show or hide the content when the state changes
|
|
5286
|
+
$scope.$watch('isOpen', function (isOpen, wasOpen) {
|
|
5287
|
+
if (!anchored) return;
|
|
5288
|
+
if (isOpen) {
|
|
5289
|
+
anchored.open();
|
|
5290
|
+
// Content is rendered with ng-if, update once it's there
|
|
5291
|
+
$timeout(function () { if (anchored) anchored.update(); });
|
|
5292
|
+
} else {
|
|
5293
|
+
anchored.close();
|
|
5294
|
+
}
|
|
5295
|
+
if (isOpen !== wasOpen && $scope.onChange) $scope.onChange({ isOpen: isOpen });
|
|
5299
5296
|
});
|
|
5300
5297
|
|
|
5301
|
-
// Popper adds scroll/resize listeners to window; remove them with the component
|
|
5302
5298
|
$scope.$on('$destroy', function () {
|
|
5303
5299
|
$timeout.cancel(setupTimer);
|
|
5304
|
-
if (
|
|
5305
|
-
|
|
5300
|
+
if (anchored) anchored.destroy();
|
|
5301
|
+
anchored = null;
|
|
5306
5302
|
});
|
|
5307
5303
|
|
|
5308
|
-
// -----------------------------------Open -----------------------------------
|
|
5304
|
+
// ----------------------------------- Open -----------------------------------
|
|
5309
5305
|
$scope.toggle = function () {
|
|
5310
5306
|
if ($scope.isOpen) {
|
|
5311
5307
|
$scope.close();
|
|
@@ -5316,20 +5312,24 @@ angular.module('niceElements')
|
|
|
5316
5312
|
|
|
5317
5313
|
$scope.close = function () {
|
|
5318
5314
|
$scope.isOpen = false;
|
|
5319
|
-
if ($scope.onChange) $scope.onChange({ isOpen: $scope.isOpen });
|
|
5320
5315
|
};
|
|
5321
5316
|
|
|
5322
5317
|
$scope.open = function () {
|
|
5323
|
-
if ($scope.popper) $scope.popper.update();
|
|
5324
5318
|
$scope.isOpen = true;
|
|
5325
|
-
|
|
5326
|
-
|
|
5327
|
-
|
|
5328
|
-
|
|
5319
|
+
};
|
|
5320
|
+
|
|
5321
|
+
// Click on target / outside only does something in "click" mode
|
|
5322
|
+
$scope.targetClicked = function () {
|
|
5323
|
+
if ($scope.trigger != 'manual') $scope.toggle();
|
|
5324
|
+
};
|
|
5325
|
+
|
|
5326
|
+
$scope.clickedOutside = function () {
|
|
5327
|
+
if ($scope.trigger != 'manual') $scope.close();
|
|
5329
5328
|
};
|
|
5330
5329
|
}
|
|
5331
5330
|
};
|
|
5332
5331
|
});
|
|
5332
|
+
|
|
5333
5333
|
'use strict';
|
|
5334
5334
|
|
|
5335
5335
|
/**
|
|
@@ -5491,7 +5491,6 @@ angular.module('niceElements')
|
|
|
5491
5491
|
if (!attrs.placeholder) { attrs.placeholder = ''; }
|
|
5492
5492
|
if (!attrs.fieldWidth) { attrs.fieldWidth = 'col-sm-8'; }
|
|
5493
5493
|
if (!attrs.labelWidth) { attrs.labelWidth = 'col-sm-4'; }
|
|
5494
|
-
if (!attrs.setText) { attrs.setText = ''; }
|
|
5495
5494
|
|
|
5496
5495
|
attrs.required = attrs.required === 'true' || attrs.required === true;
|
|
5497
5496
|
attrs.hideValid = attrs.hideValid === 'true' || attrs.hideValid === true;
|
|
@@ -5517,8 +5516,9 @@ angular.module('niceElements')
|
|
|
5517
5516
|
});
|
|
5518
5517
|
|
|
5519
5518
|
// Set default text
|
|
5519
|
+
// (skip when set-text is not used, so the label of a preset model below is kept)
|
|
5520
5520
|
scope.$watch("setText", function () {
|
|
5521
|
-
scope.modelString = scope.setText;
|
|
5521
|
+
if (angular.isDefined(scope.setText)) scope.modelString = scope.setText;
|
|
5522
5522
|
});
|
|
5523
5523
|
|
|
5524
5524
|
// Check if object is defined
|
|
@@ -5529,18 +5529,12 @@ angular.module('niceElements')
|
|
|
5529
5529
|
scope.modelString = scope.model;
|
|
5530
5530
|
}
|
|
5531
5531
|
|
|
5532
|
-
|
|
5533
|
-
|
|
5534
|
-
|
|
5535
|
-
|
|
5536
|
-
|
|
5537
|
-
|
|
5538
|
-
scope.$watch('model', function (newValue) {
|
|
5539
|
-
if (scope.model && scope.model.id) {
|
|
5540
|
-
setValid(true);
|
|
5541
|
-
} else {
|
|
5542
|
-
setValid(false);
|
|
5543
|
-
}
|
|
5532
|
+
// When required, an object (with id) has to be selected. Also re-check when
|
|
5533
|
+
// `required` changes, so turning it off clears the error.
|
|
5534
|
+
scope.$watchGroup(['model', 'required'], function () {
|
|
5535
|
+
if (!scope.form) return;
|
|
5536
|
+
const hasObject = !!(scope.model && scope.model.id);
|
|
5537
|
+
scope.form.$setValidity('objectSelected', !scope.required || hasObject);
|
|
5544
5538
|
});
|
|
5545
5539
|
|
|
5546
5540
|
scope.selectRow = function (obj) {
|
|
@@ -5751,7 +5745,8 @@ angular.module('niceElements')
|
|
|
5751
5745
|
debounceTime: '@',
|
|
5752
5746
|
isInline: '=',
|
|
5753
5747
|
help: '@',
|
|
5754
|
-
|
|
5748
|
+
required: '=',
|
|
5749
|
+
placement: '@', // Preferred placement of the dropdown (nice-popup)
|
|
5755
5750
|
},
|
|
5756
5751
|
controller: function ($scope, $timeout, $element) {
|
|
5757
5752
|
$scope.loading = false;
|
|
@@ -5766,51 +5761,6 @@ angular.module('niceElements')
|
|
|
5766
5761
|
if (!$scope.model) $scope.model = "";
|
|
5767
5762
|
if (!$scope.placement) { $scope.placement = "bottom-start"; }
|
|
5768
5763
|
|
|
5769
|
-
// Setup popper
|
|
5770
|
-
// https://popper.js.org/docs/v2/constructors/
|
|
5771
|
-
$scope.setupPopper = function () {
|
|
5772
|
-
const button = $element[0].getElementsByClassName('nice-search-button')[0];
|
|
5773
|
-
const tooltip = $element[0].getElementsByClassName('nice-search-dropdown-wrapper')[0];
|
|
5774
|
-
$scope.popper = Popper.createPopper(button, tooltip, {
|
|
5775
|
-
strategy: 'fixed',
|
|
5776
|
-
placement: $scope.placement,
|
|
5777
|
-
modifiers: [
|
|
5778
|
-
{
|
|
5779
|
-
name: 'offset',
|
|
5780
|
-
options: {
|
|
5781
|
-
offset: [0, 5],
|
|
5782
|
-
},
|
|
5783
|
-
},
|
|
5784
|
-
{
|
|
5785
|
-
name: "sameWidth",
|
|
5786
|
-
enabled: true,
|
|
5787
|
-
phase: "beforeWrite",
|
|
5788
|
-
requires: ["computeStyles"],
|
|
5789
|
-
fn: function (e) {
|
|
5790
|
-
const state = e.state;
|
|
5791
|
-
state.styles.popper.width = state.rects.reference.width + "px";
|
|
5792
|
-
},
|
|
5793
|
-
effect: function (e) {
|
|
5794
|
-
const state = e.state;
|
|
5795
|
-
state.elements.popper.style.width = state.elements.reference.offsetWidth + "px";
|
|
5796
|
-
}
|
|
5797
|
-
}
|
|
5798
|
-
],
|
|
5799
|
-
});
|
|
5800
|
-
};
|
|
5801
|
-
|
|
5802
|
-
const setupTimer = $timeout(function () {
|
|
5803
|
-
$scope.setupPopper();
|
|
5804
|
-
});
|
|
5805
|
-
|
|
5806
|
-
// Popper adds scroll/resize listeners to window; remove them with the component
|
|
5807
|
-
$scope.$on('$destroy', function () {
|
|
5808
|
-
$timeout.cancel(setupTimer);
|
|
5809
|
-
if ($scope.popper) $scope.popper.destroy();
|
|
5810
|
-
$scope.popper = null;
|
|
5811
|
-
});
|
|
5812
|
-
|
|
5813
|
-
|
|
5814
5764
|
// ------------------- On focus -------------------
|
|
5815
5765
|
$scope.onFocus = function () {
|
|
5816
5766
|
if ($scope.showDropdown && $scope.results.length == 0) {
|
|
@@ -5833,22 +5783,12 @@ angular.module('niceElements')
|
|
|
5833
5783
|
// ------------------- On focus -------------------
|
|
5834
5784
|
$scope.open = function () {
|
|
5835
5785
|
$scope.isOpen = true;
|
|
5836
|
-
$timeout(function () {
|
|
5837
|
-
if ($scope.popper) $scope.popper.update();
|
|
5838
|
-
});
|
|
5839
5786
|
};
|
|
5840
5787
|
|
|
5841
5788
|
|
|
5842
5789
|
// ------------------- On blur -------------------
|
|
5843
5790
|
$scope.close = function () {
|
|
5844
5791
|
$scope.isOpen = false;
|
|
5845
|
-
|
|
5846
|
-
// const input = $element[0].getElementsByTagName('input')[0];
|
|
5847
|
-
// if (input) input.blur();
|
|
5848
|
-
|
|
5849
|
-
$timeout(function () {
|
|
5850
|
-
if ($scope.popper) $scope.popper.update();
|
|
5851
|
-
});
|
|
5852
5792
|
};
|
|
5853
5793
|
|
|
5854
5794
|
|
|
@@ -7034,24 +6974,27 @@ angular.module('niceElements')
|
|
|
7034
6974
|
* @name niceElements.directive:niceTooltip
|
|
7035
6975
|
* @description
|
|
7036
6976
|
* # niceTooltip
|
|
6977
|
+
* Positioned with NiceService.anchor() (native popover + CSS anchor positioning, Popper fallback).
|
|
7037
6978
|
*/
|
|
7038
6979
|
angular.module('niceElements')
|
|
7039
6980
|
.directive('niceTooltip', function () {
|
|
7040
6981
|
return {
|
|
7041
6982
|
restrict: 'A',
|
|
7042
|
-
controller: function ($scope, $element, $attrs, $injector) {
|
|
6983
|
+
controller: function ($scope, $element, $attrs, $injector, NiceService) {
|
|
7043
6984
|
const id = Math.random().toString(36).substring(7);
|
|
7044
6985
|
const showEvents = ['mouseenter', 'focus'];
|
|
7045
6986
|
const hideEvents = ['mouseleave', 'blur'];
|
|
7046
|
-
|
|
6987
|
+
// "auto" variants → top variants (flips when there is no space)
|
|
6988
|
+
const placement = ($attrs.niceTooltipPlacement || 'top').replace(/^auto/, 'top');
|
|
7047
6989
|
|
|
7048
|
-
// Create
|
|
7049
|
-
$element.addClass(
|
|
6990
|
+
// Create tooltip window
|
|
6991
|
+
$element.addClass('nice-tooltip');
|
|
7050
6992
|
const tooltipWindow = document.createElement('div');
|
|
7051
6993
|
tooltipWindow.className = 'nice-tooltip-window';
|
|
7052
6994
|
tooltipWindow.id = 'nice-tooltip-window-' + id;
|
|
6995
|
+
tooltipWindow.setAttribute('role', 'tooltip');
|
|
7053
6996
|
|
|
7054
|
-
//
|
|
6997
|
+
// Tooltip body. The attribute's {{ }} is interpolated by Angular, but the
|
|
7055
6998
|
// resulting text is never compiled, so user data can't run as a template.
|
|
7056
6999
|
// Safe HTML is kept when the app loads ngSanitize; otherwise it's plain text.
|
|
7057
7000
|
const content = document.createElement('div');
|
|
@@ -7065,44 +7008,28 @@ angular.module('niceElements')
|
|
|
7065
7008
|
else content.textContent = value;
|
|
7066
7009
|
});
|
|
7067
7010
|
|
|
7068
|
-
//
|
|
7011
|
+
// Arrow
|
|
7069
7012
|
const tooltipWindowArrow = document.createElement('div');
|
|
7070
7013
|
tooltipWindowArrow.className = 'nice-tooltip-window-arrow';
|
|
7071
|
-
tooltipWindowArrow.setAttribute("data-popper-arrow", "");
|
|
7072
7014
|
tooltipWindow.append(tooltipWindowArrow);
|
|
7073
7015
|
|
|
7074
7016
|
// Add to body
|
|
7075
7017
|
document.body.append(tooltipWindow);
|
|
7076
7018
|
|
|
7077
|
-
|
|
7078
|
-
const popper = Popper.createPopper($element[0], tooltipWindow, {
|
|
7019
|
+
const anchored = NiceService.anchor($element[0], tooltipWindow, {
|
|
7079
7020
|
placement: placement,
|
|
7080
|
-
|
|
7081
|
-
|
|
7082
|
-
|
|
7083
|
-
name: 'offset',
|
|
7084
|
-
options: {
|
|
7085
|
-
offset: [0, 8],
|
|
7086
|
-
},
|
|
7087
|
-
},
|
|
7088
|
-
{
|
|
7089
|
-
name: 'arrow',
|
|
7090
|
-
options: {
|
|
7091
|
-
element: tooltipWindowArrow,
|
|
7092
|
-
padding: 3
|
|
7093
|
-
},
|
|
7094
|
-
},
|
|
7095
|
-
],
|
|
7021
|
+
offset: 8,
|
|
7022
|
+
arrow: tooltipWindowArrow,
|
|
7023
|
+
onEscape: hide
|
|
7096
7024
|
});
|
|
7097
7025
|
|
|
7098
7026
|
function show() {
|
|
7099
7027
|
if ($attrs.niceTooltipDisabled == true || $attrs.niceTooltipDisabled == "true") return;
|
|
7100
|
-
|
|
7101
|
-
popper.update();
|
|
7028
|
+
anchored.open();
|
|
7102
7029
|
}
|
|
7103
7030
|
|
|
7104
7031
|
function hide() {
|
|
7105
|
-
|
|
7032
|
+
anchored.close();
|
|
7106
7033
|
}
|
|
7107
7034
|
|
|
7108
7035
|
showEvents.forEach((event) => {
|
|
@@ -7115,8 +7042,8 @@ angular.module('niceElements')
|
|
|
7115
7042
|
|
|
7116
7043
|
// On destroy
|
|
7117
7044
|
$scope.$on('$destroy', function () {
|
|
7045
|
+
anchored.destroy();
|
|
7118
7046
|
tooltipWindow.remove();
|
|
7119
|
-
if (popper) popper.destroy();
|
|
7120
7047
|
});
|
|
7121
7048
|
}
|
|
7122
7049
|
};
|
|
@@ -7132,9 +7059,147 @@ angular.module('niceElements')
|
|
|
7132
7059
|
*/
|
|
7133
7060
|
angular.module('niceElements')
|
|
7134
7061
|
.service('NiceService', function ($rootScope) {
|
|
7062
|
+
// Can `el` scroll further in the wheel's direction?
|
|
7063
|
+
function canScroll(el, deltaY) {
|
|
7064
|
+
if (!/(auto|scroll)/.test(getComputedStyle(el).overflowY)) return false;
|
|
7065
|
+
if (deltaY > 0) return el.scrollTop + el.clientHeight < el.scrollHeight;
|
|
7066
|
+
return el.scrollTop > 0;
|
|
7067
|
+
}
|
|
7068
|
+
|
|
7069
|
+
// Nearest scrollable ancestor of `el` (null when only the page itself scrolls)
|
|
7070
|
+
function scrollParent(el) {
|
|
7071
|
+
for (el = el.parentElement; el && el !== document.body; el = el.parentElement) {
|
|
7072
|
+
if (/(auto|scroll)/.test(getComputedStyle(el).overflowY) && el.scrollHeight > el.clientHeight) return el;
|
|
7073
|
+
}
|
|
7074
|
+
return null;
|
|
7075
|
+
}
|
|
7076
|
+
|
|
7077
|
+
// Turns show/hide of NiceService.anchor() into open/close that, while open:
|
|
7078
|
+
// - listen for Escape (options.onEscape decides what happens)
|
|
7079
|
+
// - let the mouse wheel over the content scroll the page behind it
|
|
7080
|
+
// - clip the content where the target scrolled out of its scroll container
|
|
7081
|
+
function withEvents(target, content, options, mode) {
|
|
7082
|
+
function onKeydown(event) {
|
|
7083
|
+
if (event.key === 'Escape' && options.onEscape) options.onEscape(event);
|
|
7084
|
+
}
|
|
7085
|
+
|
|
7086
|
+
// The content is position: fixed, so the browser only passes the wheel on to the
|
|
7087
|
+
// window, never to the scroll container the target is in. Do that ourselves.
|
|
7088
|
+
function onWheel(event) {
|
|
7089
|
+
// Scrollable parts of the content (e.g. a long list) scroll themselves first
|
|
7090
|
+
for (let el = event.target; el && el !== content.parentElement; el = el.parentElement) {
|
|
7091
|
+
if (canScroll(el, event.deltaY)) return;
|
|
7092
|
+
}
|
|
7093
|
+
const scroller = scrollParent(target);
|
|
7094
|
+
if (!scroller) return; // the window scrolls by itself
|
|
7095
|
+
const lineHeight = event.deltaMode === 1 ? 16 : 1; // Firefox can report lines
|
|
7096
|
+
scroller.scrollBy(event.deltaX * lineHeight, event.deltaY * lineHeight);
|
|
7097
|
+
}
|
|
7098
|
+
|
|
7099
|
+
// The content is in the top layer, so the target's scroll container doesn't clip it.
|
|
7100
|
+
// When the target scrolls out of that container (e.g. under the nice-view header),
|
|
7101
|
+
// cut the content off at the container's edge on that side, so it slides under the
|
|
7102
|
+
// header like normal content. Other sides stay open, so it can still stick out of
|
|
7103
|
+
// a small scroll box or modal.
|
|
7104
|
+
//
|
|
7105
|
+
// The browser moves anchored content one frame after a scroll, so its position
|
|
7106
|
+
// can't be read while scrolling. It moves together with the target though, so we
|
|
7107
|
+
// measure its offset from the target once it has settled and add that to the
|
|
7108
|
+
// target's (always current) position.
|
|
7109
|
+
let offset = null;
|
|
7110
|
+
function measure() {
|
|
7111
|
+
const t = target.getBoundingClientRect();
|
|
7112
|
+
const c = content.getBoundingClientRect();
|
|
7113
|
+
offset = { top: c.top - t.top, left: c.left - t.left };
|
|
7114
|
+
}
|
|
7115
|
+
|
|
7116
|
+
function clip() {
|
|
7117
|
+
const scroller = scrollParent(target);
|
|
7118
|
+
if (!scroller || !offset) {
|
|
7119
|
+
content.style.clipPath = '';
|
|
7120
|
+
return;
|
|
7121
|
+
}
|
|
7122
|
+
|
|
7123
|
+
const box = scroller.getBoundingClientRect();
|
|
7124
|
+
const t = target.getBoundingClientRect();
|
|
7125
|
+
// Where the content is now: target position + measured offset
|
|
7126
|
+
const c = {
|
|
7127
|
+
top: t.top + offset.top,
|
|
7128
|
+
left: t.left + offset.left,
|
|
7129
|
+
bottom: t.top + offset.top + content.offsetHeight,
|
|
7130
|
+
right: t.left + offset.left + content.offsetWidth
|
|
7131
|
+
};
|
|
7132
|
+
const open = -9999; // negative inset = no clipping (keeps arrow and shadow)
|
|
7133
|
+
const top = t.top < box.top ? box.top - c.top : open;
|
|
7134
|
+
const right = t.right > box.right ? c.right - box.right : open;
|
|
7135
|
+
const bottom = t.bottom > box.bottom ? c.bottom - box.bottom : open;
|
|
7136
|
+
const left = t.left < box.left ? box.left - c.left : open;
|
|
7137
|
+
|
|
7138
|
+
if (top == open && right == open && bottom == open && left == open) content.style.clipPath = '';
|
|
7139
|
+
else content.style.clipPath = 'inset(' + top + 'px ' + right + 'px ' + bottom + 'px ' + left + 'px)';
|
|
7140
|
+
}
|
|
7141
|
+
|
|
7142
|
+
// Measure again once things settled (two frames: the browser is one frame behind),
|
|
7143
|
+
// e.g. after opening, a resize, or when scrolling stopped (it may have flipped)
|
|
7144
|
+
let settleTimer = null;
|
|
7145
|
+
function measureLater(delay) {
|
|
7146
|
+
clearTimeout(settleTimer);
|
|
7147
|
+
settleTimer = setTimeout(function () {
|
|
7148
|
+
requestAnimationFrame(function () {
|
|
7149
|
+
requestAnimationFrame(function () {
|
|
7150
|
+
measure();
|
|
7151
|
+
clip();
|
|
7152
|
+
});
|
|
7153
|
+
});
|
|
7154
|
+
}, delay);
|
|
7155
|
+
}
|
|
7156
|
+
|
|
7157
|
+
function onScroll() {
|
|
7158
|
+
clip();
|
|
7159
|
+
measureLater(100);
|
|
7160
|
+
}
|
|
7161
|
+
|
|
7162
|
+
function removeListeners() {
|
|
7163
|
+
document.removeEventListener('keydown', onKeydown);
|
|
7164
|
+
content.removeEventListener('wheel', onWheel);
|
|
7165
|
+
document.removeEventListener('scroll', onScroll, true); // true: scroll of any element
|
|
7166
|
+
window.removeEventListener('resize', onScroll);
|
|
7167
|
+
clearTimeout(settleTimer);
|
|
7168
|
+
}
|
|
7169
|
+
|
|
7170
|
+
function close() {
|
|
7171
|
+
mode.hide();
|
|
7172
|
+
removeListeners();
|
|
7173
|
+
content.style.clipPath = '';
|
|
7174
|
+
}
|
|
7175
|
+
|
|
7176
|
+
return {
|
|
7177
|
+
open: function () {
|
|
7178
|
+
mode.show();
|
|
7179
|
+
// remove first, so opening twice doesn't add them twice
|
|
7180
|
+
removeListeners();
|
|
7181
|
+
document.addEventListener('keydown', onKeydown);
|
|
7182
|
+
content.addEventListener('wheel', onWheel, { passive: true });
|
|
7183
|
+
document.addEventListener('scroll', onScroll, { capture: true, passive: true });
|
|
7184
|
+
window.addEventListener('resize', onScroll);
|
|
7185
|
+
offset = null;
|
|
7186
|
+
measureLater(0);
|
|
7187
|
+
},
|
|
7188
|
+
close: close,
|
|
7189
|
+
update: function () {
|
|
7190
|
+
mode.update();
|
|
7191
|
+
measureLater(0);
|
|
7192
|
+
},
|
|
7193
|
+
destroy: function () {
|
|
7194
|
+
close();
|
|
7195
|
+
mode.destroy();
|
|
7196
|
+
}
|
|
7197
|
+
};
|
|
7198
|
+
}
|
|
7199
|
+
|
|
7135
7200
|
const service = {
|
|
7136
7201
|
name: "Nice elements",
|
|
7137
|
-
version: "1.
|
|
7202
|
+
version: "1.16.0",
|
|
7138
7203
|
getHeader: function () {
|
|
7139
7204
|
return {};
|
|
7140
7205
|
},
|
|
@@ -7156,6 +7221,103 @@ angular.module('niceElements')
|
|
|
7156
7221
|
$scope[name] = service.isOn(value);
|
|
7157
7222
|
});
|
|
7158
7223
|
},
|
|
7224
|
+
// Can the browser position popovers natively (popover API + CSS anchor positioning)?
|
|
7225
|
+
supportsAnchor: function () {
|
|
7226
|
+
return !!(window.CSS && CSS.supports('anchor-name', '--a') && ('popover' in HTMLElement.prototype));
|
|
7227
|
+
},
|
|
7228
|
+
// Position `content` next to `target` (used by nice-popup and nice-tooltip).
|
|
7229
|
+
// Native: content becomes a manual popover (top layer) positioned with CSS anchor
|
|
7230
|
+
// positioning, see src/styles/_nice-anchored.scss. Fallback: Popper.js.
|
|
7231
|
+
// options: placement ("bottom-start", "auto", ...), offset (px gap), skidding (px shift
|
|
7232
|
+
// along the target), sameWidth (content as wide as target), arrow (element inside content),
|
|
7233
|
+
// onEscape (called when Escape is pressed while open; the owner closes it).
|
|
7234
|
+
// While open, the mouse wheel over the content scrolls the page behind it.
|
|
7235
|
+
// Returns { open(), close(), update(), destroy() }
|
|
7236
|
+
anchor: function (target, content, options) {
|
|
7237
|
+
options = options || {};
|
|
7238
|
+
const placement = options.placement || 'bottom';
|
|
7239
|
+
const offset = options.offset || 0;
|
|
7240
|
+
const skidding = options.skidding || 0;
|
|
7241
|
+
|
|
7242
|
+
if (service.supportsAnchor()) {
|
|
7243
|
+
// "auto" → bottom, CSS flips it when there is no space
|
|
7244
|
+
const native = placement.replace(/^auto/, 'bottom');
|
|
7245
|
+
const side = native.split('-')[0];
|
|
7246
|
+
const align = native.split('-')[1];
|
|
7247
|
+
const vertical = side == 'top' || side == 'bottom';
|
|
7248
|
+
|
|
7249
|
+
// position-area: side + alignment (start/end = align with the target's start/end edge)
|
|
7250
|
+
let area = side;
|
|
7251
|
+
if (align == 'start') area += vertical ? ' span-right' : ' span-bottom';
|
|
7252
|
+
if (align == 'end') area += vertical ? ' span-left' : ' span-top';
|
|
7253
|
+
|
|
7254
|
+
// Unique anchor names: one for the target, one for the content (the arrow uses both)
|
|
7255
|
+
const name = '--nice-anchor-' + Math.random().toString(36).substring(7);
|
|
7256
|
+
target.style.anchorName = name;
|
|
7257
|
+
content.setAttribute('popover', 'manual');
|
|
7258
|
+
content.classList.add('nice-anchored', 'nice-anchored--' + side);
|
|
7259
|
+
if (options.sameWidth) content.classList.add('nice-anchored--same-width');
|
|
7260
|
+
content.style.positionAnchor = name;
|
|
7261
|
+
content.style.positionArea = area;
|
|
7262
|
+
content.style.anchorName = name + '-content';
|
|
7263
|
+
content.style.setProperty('--nice-anchored', name + '-content');
|
|
7264
|
+
content.style.setProperty('--nice-anchored-offset', offset + 'px');
|
|
7265
|
+
// Skidding is a translate. Only set when used: translate makes the content the
|
|
7266
|
+
// containing block of the fixed arrow, so the arrow can't use anchor() any more.
|
|
7267
|
+
if (skidding) content.style.translate = vertical ? skidding + 'px 0' : '0 ' + skidding + 'px';
|
|
7268
|
+
if (options.arrow) options.arrow.classList.add('nice-anchored-arrow');
|
|
7269
|
+
|
|
7270
|
+
const isOpen = function () { return content.matches(':popover-open'); };
|
|
7271
|
+
return withEvents(target, content, options, {
|
|
7272
|
+
show: function () { if (!isOpen() && content.isConnected) content.showPopover(); },
|
|
7273
|
+
hide: function () { if (isOpen()) content.hidePopover(); },
|
|
7274
|
+
update: function () { }, // the browser keeps it positioned
|
|
7275
|
+
destroy: function () { }
|
|
7276
|
+
});
|
|
7277
|
+
}
|
|
7278
|
+
|
|
7279
|
+
// Fallback: Popper.js (content is shown with the [data-show] attribute)
|
|
7280
|
+
// https://popper.js.org/docs/v2/constructors/
|
|
7281
|
+
content.classList.add('nice-anchored-fallback');
|
|
7282
|
+
if (options.arrow) {
|
|
7283
|
+
options.arrow.classList.add('nice-anchored-arrow');
|
|
7284
|
+
options.arrow.setAttribute('data-popper-arrow', '');
|
|
7285
|
+
}
|
|
7286
|
+
|
|
7287
|
+
const modifiers = [
|
|
7288
|
+
{ name: 'offset', options: { offset: [skidding, offset] } },
|
|
7289
|
+
{ name: 'arrow', options: { padding: 5 } }
|
|
7290
|
+
];
|
|
7291
|
+
if (options.sameWidth) {
|
|
7292
|
+
modifiers.push({
|
|
7293
|
+
name: 'sameWidth',
|
|
7294
|
+
enabled: true,
|
|
7295
|
+
phase: 'beforeWrite',
|
|
7296
|
+
requires: ['computeStyles'],
|
|
7297
|
+
fn: function (e) {
|
|
7298
|
+
e.state.styles.popper.width = e.state.rects.reference.width + 'px';
|
|
7299
|
+
}
|
|
7300
|
+
});
|
|
7301
|
+
}
|
|
7302
|
+
|
|
7303
|
+
const popper = Popper.createPopper(target, content, {
|
|
7304
|
+
placement: placement,
|
|
7305
|
+
strategy: options.strategy || 'fixed',
|
|
7306
|
+
modifiers: modifiers
|
|
7307
|
+
});
|
|
7308
|
+
|
|
7309
|
+
return withEvents(target, content, options, {
|
|
7310
|
+
show: function () {
|
|
7311
|
+
content.setAttribute('data-show', '');
|
|
7312
|
+
popper.update();
|
|
7313
|
+
},
|
|
7314
|
+
hide: function () {
|
|
7315
|
+
content.removeAttribute('data-show');
|
|
7316
|
+
},
|
|
7317
|
+
update: function () { popper.update(); },
|
|
7318
|
+
destroy: function () { popper.destroy(); }
|
|
7319
|
+
});
|
|
7320
|
+
},
|
|
7159
7321
|
// Check if value is a Decimal.js object (also Decimal.clone() instances)
|
|
7160
7322
|
isDecimal: function (value) {
|
|
7161
7323
|
return typeof Decimal !== 'undefined' && Decimal.isDecimal(value);
|
|
@@ -7309,6 +7471,10 @@ angular.module('niceElements').run(['$templateCache', function($templateCache) {
|
|
|
7309
7471
|
" <div class=\"nice-field col-xs-12\" ng-class=\"[fieldWidth ? fieldWidth : 'col-sm-8', { 'nice-disabled': isDisabled }]\">\n" +
|
|
7310
7472
|
" <div class=\"disabled-shield\" ng-if=\"isDisabled\"></div>\n" +
|
|
7311
7473
|
"\n" +
|
|
7474
|
+
" \n" +
|
|
7475
|
+
" <input class=\"hidden-input\" ng-model=\"startDate\" ng-required=\"required\" tabindex=\"-1\">\n" +
|
|
7476
|
+
" <input class=\"hidden-input\" ng-model=\"endDate\" ng-required=\"required\" tabindex=\"-1\">\n" +
|
|
7477
|
+
"\n" +
|
|
7312
7478
|
" <div class=\"nice-calendar-wrapper\">\n" +
|
|
7313
7479
|
" <div class=\"nice-calendar-weeks\">\n" +
|
|
7314
7480
|
" <div class=\"nice-calendar-header\">\n" +
|
|
@@ -7323,17 +7489,17 @@ angular.module('niceElements').run(['$templateCache', function($templateCache) {
|
|
|
7323
7489
|
"\n" +
|
|
7324
7490
|
" \n" +
|
|
7325
7491
|
" <button title=\"{{ 'Previous month' | translate:'Nice' }}\" type=\"button\" class=\"btn\" ng-click=\"previous()\" ng-disabled=\"isDisabled\">\n" +
|
|
7326
|
-
" <
|
|
7492
|
+
" <nice-icon icon=\"icon-chevron-left\"></nice-icon>\n" +
|
|
7327
7493
|
" </button>\n" +
|
|
7328
7494
|
"\n" +
|
|
7329
7495
|
" \n" +
|
|
7330
7496
|
" <button title=\"{{ 'Today' | translate:'Nice' }}\" type=\"button\" class=\"btn\" ng-click=\"today()\" ng-disabled=\"isDisabled\">\n" +
|
|
7331
|
-
" <nice-icon icon=\"icon-
|
|
7497
|
+
" <nice-icon icon=\"icon-dot\"></nice-icon>\n" +
|
|
7332
7498
|
" </button>\n" +
|
|
7333
7499
|
"\n" +
|
|
7334
7500
|
" \n" +
|
|
7335
7501
|
" <button title=\"{{ 'Next month' | translate:'Nice' }}\" type=\"button\" class=\"btn\" ng-click=\"next()\" ng-disabled=\"isDisabled\">\n" +
|
|
7336
|
-
" <
|
|
7502
|
+
" <nice-icon icon=\"icon-chevron-right\"></nice-icon>\n" +
|
|
7337
7503
|
" </button>\n" +
|
|
7338
7504
|
" </div>\n" +
|
|
7339
7505
|
"\n" +
|
|
@@ -7382,7 +7548,6 @@ angular.module('niceElements').run(['$templateCache', function($templateCache) {
|
|
|
7382
7548
|
" </div>\n" +
|
|
7383
7549
|
"\n" +
|
|
7384
7550
|
" <div class=\"time-picker-icon\">\n" +
|
|
7385
|
-
" \n" +
|
|
7386
7551
|
" <nice-icon icon=\"icon-clock\"></nice-icon>\n" +
|
|
7387
7552
|
" </div>\n" +
|
|
7388
7553
|
"\n" +
|
|
@@ -7423,10 +7588,15 @@ angular.module('niceElements').run(['$templateCache', function($templateCache) {
|
|
|
7423
7588
|
" 'nice-checkbox-disabled': isDisabled, \n" +
|
|
7424
7589
|
" 'nice-checkbox-left': titleOnLeft\n" +
|
|
7425
7590
|
" }\" ng-click=\"toggle()\">\n" +
|
|
7426
|
-
" <
|
|
7427
|
-
" <
|
|
7428
|
-
"
|
|
7429
|
-
"
|
|
7591
|
+
" <span class=\"nice-checkbox-box\">\n" +
|
|
7592
|
+
" <button type=\"button\" class=\"btn nice-checkbox-checkbox\" ng-disabled=\"isDisabled\">\n" +
|
|
7593
|
+
" <nice-icon ng-if=\"model\" class=\"nice-checkbox-check\" icon=\"icon-check\"></nice-icon>\n" +
|
|
7594
|
+
" <nice-icon ng-if=\"!model && indeterminate\" class=\"nice-checkbox-check\" icon=\"icon-minus\"></nice-icon>\n" +
|
|
7595
|
+
" </button>\n" +
|
|
7596
|
+
"\n" +
|
|
7597
|
+
" \n" +
|
|
7598
|
+
" <input type=\"checkbox\" class=\"hidden-input\" ng-model=\"model\" ng-required=\"required\" tabindex=\"-1\">\n" +
|
|
7599
|
+
" </span>\n" +
|
|
7430
7600
|
" <div class=\"nice-checkbox-info\" ng-transclude>\n" +
|
|
7431
7601
|
" <nice-title text=\"title || niceTitle\" help=\"help\" required=\"required\" description=\"niceDescription\" label-width=\"col-xs-12\"></nice-title>\n" +
|
|
7432
7602
|
" \n" +
|
|
@@ -7544,7 +7714,7 @@ angular.module('niceElements').run(['$templateCache', function($templateCache) {
|
|
|
7544
7714
|
" \n" +
|
|
7545
7715
|
" <div class=\"nice-field col-xs-12\" ng-class=\"fieldWidth ? fieldWidth : 'col-sm-8'\">\n" +
|
|
7546
7716
|
" <div class=\"input-group\">\n" +
|
|
7547
|
-
" <input date-range-picker class=\"form-control date-picker\" type=\"text\" options=\"opts\" ng-model=\"model\">\n" +
|
|
7717
|
+
" <input date-range-picker class=\"form-control date-picker\" type=\"text\" options=\"opts\" ng-model=\"model\" ng-required=\"required\">\n" +
|
|
7548
7718
|
" <span date-range-picker options=\"opts\" ng-model=\"model\" class=\"input-group-addon\">\n" +
|
|
7549
7719
|
" <nice-icon icon=\"icon-calendar\"></nice-icon>\n" +
|
|
7550
7720
|
" </span>\n" +
|
|
@@ -7555,103 +7725,108 @@ angular.module('niceElements').run(['$templateCache', function($templateCache) {
|
|
|
7555
7725
|
);
|
|
7556
7726
|
|
|
7557
7727
|
|
|
7728
|
+
$templateCache.put('src/components/nice-date/nice-date-picker.html',
|
|
7729
|
+
"\n" +
|
|
7730
|
+
"<div class=\"nice-date-date\" ng-if=\"date\" role=\"grid\">\n" +
|
|
7731
|
+
" <div class=\"nice-date-header\">\n" +
|
|
7732
|
+
" <span>\n" +
|
|
7733
|
+
" <select class=\"year-picker\" ng-model=\"innerDate.year\" ng-change=\"handleDateChange()\" ng-options=\"year for year in years\" ng-disabled=\"isDisabled\"></select>\n" +
|
|
7734
|
+
" <span class=\"nice-date-header-comma\">,</span>\n" +
|
|
7735
|
+
" <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" +
|
|
7736
|
+
" </span>\n" +
|
|
7737
|
+
" <button type=\"button\" class=\"btn btn-default-naked\" ng-disabled=\"isDisabled\" ng-click=\"previous()\" title=\"{{ 'Previous month' | translate:'Nice' }}\">\n" +
|
|
7738
|
+
" <nice-icon icon=\"icon-chevron-left\"></nice-icon>\n" +
|
|
7739
|
+
" </button>\n" +
|
|
7740
|
+
" <button type=\"button\" class=\"btn btn-default-naked\" ng-disabled=\"isDisabled\" ng-click=\"today()\" title=\"{{ 'Today' | translate:'Nice' }}\">\n" +
|
|
7741
|
+
" <nice-icon icon=\"icon-dot\"></nice-icon>\n" +
|
|
7742
|
+
" </button>\n" +
|
|
7743
|
+
" <button type=\"button\" class=\"btn btn-default-naked\" ng-disabled=\"isDisabled\" ng-click=\"next()\" title=\"{{ 'Next month' | translate:'Nice' }}\">\n" +
|
|
7744
|
+
" <nice-icon icon=\"icon-chevron-right\"></nice-icon>\n" +
|
|
7745
|
+
" </button>\n" +
|
|
7746
|
+
" </div>\n" +
|
|
7747
|
+
"\n" +
|
|
7748
|
+
" <div class=\"nice-date-grid nice-date-grid-names\">\n" +
|
|
7749
|
+
" <span class=\"nice-date-day\" ng-class=\"{ 'weekend': $index == 6 || $index == 5 }\" ng-repeat=\"day in weekdays\">{{ day }}</span>\n" +
|
|
7750
|
+
" </div>\n" +
|
|
7751
|
+
"\n" +
|
|
7752
|
+
" <div class=\"nice-date-grid\">\n" +
|
|
7753
|
+
" <button type=\"button\" class=\"nice-date-day\" role=\"gridcell\" title=\"{{ day.text }}\" ng-class=\"{\n" +
|
|
7754
|
+
" 'today': day.isToday,\n" +
|
|
7755
|
+
" 'different-month': !day.isCurrentMonth,\n" +
|
|
7756
|
+
" 'selected': isSameDay(model, day.date),\n" +
|
|
7757
|
+
" 'weekend': day.isWeekday,\n" +
|
|
7758
|
+
" 'disabled': day.isDisabled,\n" +
|
|
7759
|
+
" 'between': isBetween(day.date, model, nextDate)\n" +
|
|
7760
|
+
" }\" ng-click=\"select(day)\" ng-repeat=\"day in days\" ng-disabled=\"isDisabled\">\n" +
|
|
7761
|
+
" <span>{{ day.name }}</span>\n" +
|
|
7762
|
+
" </button>\n" +
|
|
7763
|
+
" </div>\n" +
|
|
7764
|
+
"</div>\n" +
|
|
7765
|
+
"\n" +
|
|
7766
|
+
"\n" +
|
|
7767
|
+
"<div class=\"nice-date-time\" ng-if=\"time\">\n" +
|
|
7768
|
+
" <nice-icon icon=\"icon-clock\"></nice-icon>\n" +
|
|
7769
|
+
"\n" +
|
|
7770
|
+
" <div class=\"time-picker time-picker-hour\">\n" +
|
|
7771
|
+
" <select ng-disabled=\"isDisabled\" ng-model=\"innerDate.hour\" ng-change=\"timeChange()\" ng-options=\"hour as hour for hour in hours track by hour\" ng-disabled=\"isDisabled\"></select>\n" +
|
|
7772
|
+
" </div>\n" +
|
|
7773
|
+
"\n" +
|
|
7774
|
+
" <div class=\"divider\">:</div>\n" +
|
|
7775
|
+
"\n" +
|
|
7776
|
+
" <div class=\"time-picker time-picker-minute\">\n" +
|
|
7777
|
+
" <select ng-disabled=\"isDisabled\" ng-model=\"innerDate.minute\" ng-change=\"timeChange()\" ng-options=\"minute as minute for minute in minutes track by minute\" ng-disabled=\"isDisabled\"></select>\n" +
|
|
7778
|
+
" </div>\n" +
|
|
7779
|
+
"</div>\n"
|
|
7780
|
+
);
|
|
7781
|
+
|
|
7782
|
+
|
|
7558
7783
|
$templateCache.put('src/components/nice-date/nice-date.html',
|
|
7559
7784
|
"<div class=\"nice-component nice-date\" ng-form=\"forma\" ng-class=\"{ 'margin-bottom-0': noMargin, 'nice-component-inline': isInline }\">\n" +
|
|
7560
|
-
" <div class=\"nice-date-background\" ng-click=\"toggleOpen()\" ng-if=\"isOpen && !inline\"></div>\n" +
|
|
7561
|
-
"\n" +
|
|
7562
7785
|
" <div class=\"row\">\n" +
|
|
7563
7786
|
" \n" +
|
|
7564
7787
|
" <nice-title text=\"title || niceTitle\" help=\"help\" required=\"required\" description=\"description\" label-width=\"labelWidth\"></nice-title>\n" +
|
|
7565
7788
|
"\n" +
|
|
7566
7789
|
" \n" +
|
|
7567
|
-
" <div class=\"nice-field col-xs-12\" ng-class=\"[fieldWidth ? fieldWidth : 'col-sm-8', { 'nice-disabled': isDisabled }]\">\n" +
|
|
7790
|
+
" <div class=\"nice-field col-xs-12\" ng-class=\"[fieldWidth ? fieldWidth : 'col-sm-8', { 'nice-disabled': isDisabled }]\" click-outside=\"close()\">\n" +
|
|
7568
7791
|
" <div class=\"disabled-shield\" ng-if=\"isDisabled\"></div>\n" +
|
|
7569
7792
|
"\n" +
|
|
7570
7793
|
" \n" +
|
|
7571
|
-
" <
|
|
7572
|
-
" <
|
|
7573
|
-
"
|
|
7574
|
-
"
|
|
7575
|
-
" <
|
|
7576
|
-
"
|
|
7577
|
-
"
|
|
7578
|
-
" <nice-icon icon=\"icon-x\"></nice-icon>\n" +
|
|
7579
|
-
" </button>\n" +
|
|
7580
|
-
" </span>\n" +
|
|
7581
|
-
" </div>\n" +
|
|
7582
|
-
"\n" +
|
|
7583
|
-
" \n" +
|
|
7584
|
-
" <div ng-class=\"{ 'nice-date-dropdown-wrapper': !inline }\">\n" +
|
|
7585
|
-
" <div ng-class=\"{ 'nice-date-dropdown': !inline, 'with-time': time, 'no-date': !date }\" ng-if=\"inline || isOpen\">\n" +
|
|
7586
|
-
" \n" +
|
|
7587
|
-
" <div class=\"nice-date-date\" ng-if=\"date\" role=\"grid\">\n" +
|
|
7588
|
-
" <div class=\"nice-date-header\">\n" +
|
|
7589
|
-
" <span>\n" +
|
|
7590
|
-
" <select class=\"year-picker\" ng-model=\"innerDate.year\" ng-change=\"handleDateChange()\" ng-options=\"year for year in years\" ng-disabled=\"isDisabled\"></select>\n" +
|
|
7591
|
-
" <span class=\"nice-date-header-comma\">,</span>\n" +
|
|
7592
|
-
" <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" +
|
|
7593
|
-
" </span>\n" +
|
|
7594
|
-
" <button type=\"button\" class=\"btn btn-default-naked\" ng-disabled=\"isDisabled\" ng-click=\"previous()\" title=\"{{ 'Previous month' | translate:'Nice' }}\">\n" +
|
|
7595
|
-
" <nice-icon icon=\"icon-chevron-left\"></nice-icon>\n" +
|
|
7596
|
-
" </button>\n" +
|
|
7597
|
-
" <button type=\"button\" class=\"btn btn-default-naked\" ng-disabled=\"isDisabled\" ng-click=\"today()\" title=\"{{ 'Today' | translate:'Nice' }}\">\n" +
|
|
7598
|
-
" <nice-icon icon=\"icon-circle\"></nice-icon>\n" +
|
|
7599
|
-
" </button>\n" +
|
|
7600
|
-
" <button type=\"button\" class=\"btn btn-default-naked\" ng-disabled=\"isDisabled\" ng-click=\"next()\" title=\"{{ 'Next month' | translate:'Nice' }}\">\n" +
|
|
7601
|
-
" <nice-icon icon=\"icon-chevron-right\"></nice-icon>\n" +
|
|
7794
|
+
" <nice-popup ng-show=\"!inline\" trigger=\"manual\" is-open=\"isOpen\" placement=\"{{ placement }}\">\n" +
|
|
7795
|
+
" <nice-popup-target>\n" +
|
|
7796
|
+
" <div class=\"nice-date-button input-group\" ng-class=\"{ 'open': isOpen }\" ng-click=\"toggleOpen()\">\n" +
|
|
7797
|
+
" <input type=\"text\" class=\"form-control\" ng-model=\"innerDate.value\" placeholder=\"{{ placeholder }}\" ng-required=\"required\" ng-disabled=\"isDisabled\" ng-blur=\"parseTypedDate()\" ng-keydown=\"typedDateKeydown($event)\">\n" +
|
|
7798
|
+
" <span class=\"input-group-btn\">\n" +
|
|
7799
|
+
" <button type=\"button\" class=\"btn btn-default btn-right\" ng-disabled=\"isDisabled\" ng-if=\"!(model && nullable)\">\n" +
|
|
7800
|
+
" <nice-icon icon=\"icon-calendar\"></nice-icon>\n" +
|
|
7602
7801
|
" </button>\n" +
|
|
7603
|
-
"
|
|
7604
|
-
"\n" +
|
|
7605
|
-
" <div class=\"nice-date-grid nice-date-grid-names\">\n" +
|
|
7606
|
-
" <span class=\"nice-date-day\" ng-class=\"{ 'weekend': $index == 6 || $index == 5 }\" ng-repeat=\"day in weekdays\">{{ day }}</span>\n" +
|
|
7607
|
-
" </div>\n" +
|
|
7608
|
-
"\n" +
|
|
7609
|
-
" <div class=\"nice-date-grid\">\n" +
|
|
7610
|
-
" <button type=\"button\" class=\"nice-date-day\" role=\"gridcell\" title=\"{{ day.text }}\" ng-class=\"{\n" +
|
|
7611
|
-
" 'today': day.isToday,\n" +
|
|
7612
|
-
" 'different-month': !day.isCurrentMonth,\n" +
|
|
7613
|
-
" 'selected': isSameDay(model, day.date),\n" +
|
|
7614
|
-
" 'weekend': day.isWeekday,\n" +
|
|
7615
|
-
" 'disabled': day.isDisabled,\n" +
|
|
7616
|
-
" 'between': isBetween(day.date, model, nextDate)\n" +
|
|
7617
|
-
" }\" ng-click=\"select(day)\" ng-repeat=\"day in days\" ng-disabled=\"isDisabled\">\n" +
|
|
7618
|
-
" <span>{{ day.name }}</span>\n" +
|
|
7802
|
+
" <button type=\"button\" class=\"btn btn-default btn-right\" ng-disabled=\"isDisabled\" ng-if=\"model && nullable\" ng-click=\"clear()\">\n" +
|
|
7803
|
+
" <nice-icon icon=\"icon-x\"></nice-icon>\n" +
|
|
7619
7804
|
" </button>\n" +
|
|
7620
|
-
" </
|
|
7805
|
+
" </span>\n" +
|
|
7621
7806
|
" </div>\n" +
|
|
7807
|
+
" </nice-popup-target>\n" +
|
|
7622
7808
|
"\n" +
|
|
7623
|
-
"
|
|
7624
|
-
" <div class=\"nice-date-
|
|
7625
|
-
"
|
|
7626
|
-
"
|
|
7627
|
-
" <div class=\"time-picker time-picker-hour\">\n" +
|
|
7628
|
-
" <select ng-disabled=\"isDisabled\" ng-model=\"innerDate.hour\" ng-change=\"timeChange()\" ng-options=\"hour as hour for hour in hours track by hour\" ng-disabled=\"isDisabled\"></select>\n" +
|
|
7629
|
-
" </div>\n" +
|
|
7630
|
-
"\n" +
|
|
7631
|
-
" <div class=\"divider\">:</div>\n" +
|
|
7809
|
+
" <nice-popup-content>\n" +
|
|
7810
|
+
" <div class=\"nice-date-dropdown\" ng-class=\"{ 'with-time': time, 'no-date': !date }\" ng-include=\"'src/components/nice-date/nice-date-picker.html'\"></div>\n" +
|
|
7811
|
+
" </nice-popup-content>\n" +
|
|
7812
|
+
" </nice-popup>\n" +
|
|
7632
7813
|
"\n" +
|
|
7633
|
-
"
|
|
7634
|
-
"
|
|
7635
|
-
" </div>\n" +
|
|
7636
|
-
" </div>\n" +
|
|
7637
|
-
" </div>\n" +
|
|
7638
|
-
" </div>\n" +
|
|
7814
|
+
" \n" +
|
|
7815
|
+
" <div ng-if=\"inline\" ng-class=\"{ 'with-time': time, 'no-date': !date }\" ng-include=\"'src/components/nice-date/nice-date-picker.html'\"></div>\n" +
|
|
7639
7816
|
" </div>\n" +
|
|
7640
7817
|
" </div>\n" +
|
|
7641
|
-
"</div
|
|
7818
|
+
"</div>\n"
|
|
7642
7819
|
);
|
|
7643
7820
|
|
|
7644
7821
|
|
|
7645
7822
|
$templateCache.put('src/components/nice-datetime-picker/nice-datetime-picker.html',
|
|
7646
7823
|
"<div class=\"nice-component nice-datetime-picker\" name=\"form\" ng-class=\"{ 'margin-bottom-0': noMargin, 'nice-component-inline': isInline }\">\n" +
|
|
7647
|
-
" <div class=\"nice-dtp-background\" ng-click=\"closeDtp(true)\" ng-if=\"isOpen\"></div>\n" +
|
|
7648
|
-
"\n" +
|
|
7649
7824
|
" <div class=\"row\">\n" +
|
|
7650
7825
|
" \n" +
|
|
7651
7826
|
" <nice-title text=\"title || niceTitle\" help=\"help\" required=\"required\" description=\"description\" label-width=\"labelWidth\"></nice-title>\n" +
|
|
7652
7827
|
"\n" +
|
|
7653
7828
|
" \n" +
|
|
7654
|
-
" <div class=\"nice-field col-xs-12\" ng-class=\"[fieldWidth ? fieldWidth : 'col-sm-8', { 'nice-disabled': isDisabled }]\">\n" +
|
|
7829
|
+
" <div class=\"nice-field col-xs-12\" ng-class=\"[fieldWidth ? fieldWidth : 'col-sm-8', { 'nice-disabled': isDisabled }]\" click-outside=\"closeDtp(true)\" is-open=\"{{ isOpen }}\">\n" +
|
|
7655
7830
|
" \n" +
|
|
7656
7831
|
" <div ng-form=\"formDatetimePicker\"></div>\n" +
|
|
7657
7832
|
"\n" +
|
|
@@ -7659,7 +7834,6 @@ angular.module('niceElements').run(['$templateCache', function($templateCache) {
|
|
|
7659
7834
|
" <input type=\"text\" class=\"form-control\" value=\"{{ value }}\" ng-click=\"openDtp()\" ng-disabled=\"isDisabled\">\n" +
|
|
7660
7835
|
" <span class=\"input-group-btn\">\n" +
|
|
7661
7836
|
" <button type=\"button\" class=\"btn btn-default\" ng-click=\"openDtp()\">\n" +
|
|
7662
|
-
" \n" +
|
|
7663
7837
|
" <nice-icon ng-if=\"isTrue(date)\" icon=\"icon-calendar\"></nice-icon>\n" +
|
|
7664
7838
|
" <nice-icon ng-if=\"!isTrue(date)\" icon=\"icon-clock\"></nice-icon>\n" +
|
|
7665
7839
|
" </button>\n" +
|
|
@@ -7667,6 +7841,9 @@ angular.module('niceElements').run(['$templateCache', function($templateCache) {
|
|
|
7667
7841
|
" </div>\n" +
|
|
7668
7842
|
"\n" +
|
|
7669
7843
|
" \n" +
|
|
7844
|
+
" <input class=\"hidden-input\" ng-model=\"model\" ng-required=\"required\" tabindex=\"-1\">\n" +
|
|
7845
|
+
"\n" +
|
|
7846
|
+
" \n" +
|
|
7670
7847
|
" <div ng-show=\"isOpen\">\n" +
|
|
7671
7848
|
" <nice-dtp model=\"internalDate\" format=\"{{ format }}\" model-format=\"{{ modelFormat }}\" date=\"{{ isTrue(date) }}\" time=\"{{ isTrue(time) }}\" width=\"{{ width }}\" enable-ok-buttons=\"{{ enableOkButtons }}\" lang=\"{{ lang }}\" min-date=\"{{ minDate }}\" max-date=\"{{ maxDate }}\" week-start=\"{{ weekStart }}\" ok-text=\"{{ okText }}\" cancel-text=\"{{ cancelText }}\" closed=\"closeDtp\"></nice-dtp>\n" +
|
|
7672
7849
|
" </div>\n" +
|
|
@@ -7678,47 +7855,49 @@ angular.module('niceElements').run(['$templateCache', function($templateCache) {
|
|
|
7678
7855
|
|
|
7679
7856
|
$templateCache.put('src/components/nice-datetimerange-picker-2/nice-datetimerange-picker-2.html',
|
|
7680
7857
|
"<div class=\"nice-component nice-datetimerange-picker-2\" ng-form=\"formDateRangePicker\" ng-class=\"{ 'margin-bottom-0': noMargin, 'nice-component-inline': isInline }\">\n" +
|
|
7681
|
-
" <div class=\"nice-dtp-background\" ng-click=\"close()\" ng-if=\"isOpen\"></div>\n" +
|
|
7682
|
-
"\n" +
|
|
7683
7858
|
" <div class=\"row\">\n" +
|
|
7684
7859
|
" \n" +
|
|
7685
7860
|
" <nice-title text=\"title || niceTitle\" help=\"help\" required=\"required\" description=\"description\" label-width=\"labelWidth\"></nice-title>\n" +
|
|
7686
7861
|
"\n" +
|
|
7687
7862
|
" \n" +
|
|
7688
|
-
" <div class=\"nice-field col-xs-12\" ng-class=\"[fieldWidth ? fieldWidth : 'col-sm-8', { 'nice-disabled': isDisabled }]\">\n" +
|
|
7689
|
-
" <
|
|
7690
|
-
" <
|
|
7691
|
-
"
|
|
7692
|
-
"
|
|
7693
|
-
"
|
|
7694
|
-
"
|
|
7695
|
-
"
|
|
7863
|
+
" <div class=\"nice-field col-xs-12\" ng-class=\"[fieldWidth ? fieldWidth : 'col-sm-8', { 'nice-disabled': isDisabled }]\" click-outside=\"isOpen && close()\">\n" +
|
|
7864
|
+
" <nice-popup trigger=\"manual\" is-open=\"isOpen\" placement=\"{{ placement }}\" on-change=\"isOpen || close()\">\n" +
|
|
7865
|
+
" <nice-popup-target>\n" +
|
|
7866
|
+
" <div class=\"nice-daterange-picker-button input-group\" ng-class=\"{ 'open': isOpen }\" ng-click=\"open()\">\n" +
|
|
7867
|
+
" <input type=\"text\" class=\"form-control\" value=\"{{ modelFormat }}\" readonly=\"readonly\" ng-disabled=\"isDisabled\">\n" +
|
|
7868
|
+
" \n" +
|
|
7869
|
+
" <button type=\"button\" class=\"btn input-group-addon\" ng-disabled=\"isDisabled\">\n" +
|
|
7870
|
+
" <nice-icon icon=\"icon-calendar\"></nice-icon>\n" +
|
|
7871
|
+
" </button>\n" +
|
|
7872
|
+
" </div>\n" +
|
|
7873
|
+
" </nice-popup-target>\n" +
|
|
7874
|
+
"\n" +
|
|
7875
|
+
" <nice-popup-content>\n" +
|
|
7876
|
+
" <div class=\"dtp-wrapper\">\n" +
|
|
7877
|
+
" <div class=\"dtp-buttons-left\">\n" +
|
|
7878
|
+
" <div class=\"dtp-buttons-top\">\n" +
|
|
7879
|
+
" <a class=\"btn btn-primary btn-block\" ng-click=\"selectToday()\" translate translate-context=\"Nice\">Last 24 hours</a>\n" +
|
|
7880
|
+
" <a class=\"btn btn-primary btn-block\" ng-click=\"selectLastNDays(7)\" translate translate-context=\"Nice\">Last 7 days</a>\n" +
|
|
7881
|
+
" <a class=\"btn btn-primary btn-block\" ng-click=\"selectLastMonth()\" translate translate-context=\"Nice\">Last month</a>\n" +
|
|
7882
|
+
" <a class=\"btn btn-primary btn-block\" ng-click=\"selectThisMonth()\" translate translate-context=\"Nice\">This month</a>\n" +
|
|
7883
|
+
" </div>\n" +
|
|
7696
7884
|
"\n" +
|
|
7697
|
-
"
|
|
7698
|
-
"
|
|
7699
|
-
"
|
|
7700
|
-
"
|
|
7701
|
-
" <a class=\"btn btn-primary btn-block\" ng-click=\"selectToday()\" translate translate-context=\"Nice\">Last 24 hours</a>\n" +
|
|
7702
|
-
" <a class=\"btn btn-primary btn-block\" ng-click=\"selectLastNDays(7)\" translate translate-context=\"Nice\">Last 7 days</a>\n" +
|
|
7703
|
-
" <a class=\"btn btn-primary btn-block\" ng-click=\"selectLastMonth()\" translate translate-context=\"Nice\">Last month</a>\n" +
|
|
7704
|
-
" <a class=\"btn btn-primary btn-block\" ng-click=\"selectThisMonth()\" translate translate-context=\"Nice\">This month</a>\n" +
|
|
7885
|
+
" <div class=\"dtp-buttons-bottom\">\n" +
|
|
7886
|
+
" <a class=\"btn btn-danger btn-block\" ng-click=\"close()\" translate translate-context=\"Nice\">Cancel</a>\n" +
|
|
7887
|
+
" <a class=\"btn btn-success btn-block\" ng-click=\"confirm()\" translate translate-context=\"Nice\">OK</a>\n" +
|
|
7888
|
+
" </div>\n" +
|
|
7705
7889
|
" </div>\n" +
|
|
7706
7890
|
"\n" +
|
|
7707
|
-
" <div class=\"dtp-
|
|
7708
|
-
" <
|
|
7709
|
-
" <a class=\"btn btn-success btn-block\" ng-click=\"confirm()\" translate translate-context=\"Nice\">OK</a>\n" +
|
|
7891
|
+
" <div class=\"dtp-left\">\n" +
|
|
7892
|
+
" <nice-date model=\"model.innerStartDate\" next-date=\"model.innerEndDate\" is-inline=\"true\" no-margin=\"true\" inline=\"true\" time=\"time\" min-date=\"minDate\" max-date=\"maxDate\" on-change=\"dateChanged(model)\"></nice-date>\n" +
|
|
7710
7893
|
" </div>\n" +
|
|
7711
|
-
" </div>\n" +
|
|
7712
|
-
"\n" +
|
|
7713
|
-
" <div class=\"dtp-left\">\n" +
|
|
7714
|
-
" <nice-date model=\"model.innerStartDate\" next-date=\"model.innerEndDate\" is-inline=\"true\" no-margin=\"true\" inline=\"true\" time=\"time\" min-date=\"minDate\" max-date=\"maxDate\" on-change=\"dateChanged(model)\"></nice-date>\n" +
|
|
7715
|
-
" </div>\n" +
|
|
7716
7894
|
"\n" +
|
|
7717
|
-
"
|
|
7718
|
-
"
|
|
7895
|
+
" <div class=\"dtp-right\">\n" +
|
|
7896
|
+
" <nice-date model=\"model.innerEndDate\" next-date=\"model.innerStartDate\" is-inline=\"true\" no-margin=\"true\" inline=\"true\" time=\"time\" min-date=\"minDate\" max-date=\"maxDate\" on-change=\"dateChanged(model)\"></nice-date>\n" +
|
|
7897
|
+
" </div>\n" +
|
|
7719
7898
|
" </div>\n" +
|
|
7720
|
-
" </
|
|
7721
|
-
" </
|
|
7899
|
+
" </nice-popup-content>\n" +
|
|
7900
|
+
" </nice-popup>\n" +
|
|
7722
7901
|
" </div>\n" +
|
|
7723
7902
|
" </div>\n" +
|
|
7724
7903
|
"</div>"
|
|
@@ -7727,14 +7906,12 @@ angular.module('niceElements').run(['$templateCache', function($templateCache) {
|
|
|
7727
7906
|
|
|
7728
7907
|
$templateCache.put('src/components/nice-datetimerange-picker/nice-datetimerange-picker.html',
|
|
7729
7908
|
"<div class=\"nice-component nice-datetime-picker nice-datetimerange-picker\" name=\"form\" ng-class=\"{ 'margin-bottom-0': noMargin, 'nice-component-inline': isInline }\">\n" +
|
|
7730
|
-
" <div class=\"nice-dtp-background\" ng-click=\"cancelClick()\" ng-if=\"showDtpRange\"></div>\n" +
|
|
7731
|
-
"\n" +
|
|
7732
7909
|
" <div class=\"row\">\n" +
|
|
7733
7910
|
" \n" +
|
|
7734
7911
|
" <nice-title text=\"title || niceTitle\" help=\"help\" required=\"required\" description=\"description\" label-width=\"labelWidth\"></nice-title>\n" +
|
|
7735
7912
|
"\n" +
|
|
7736
7913
|
" \n" +
|
|
7737
|
-
" <div class=\"nice-field col-xs-12\" ng-class=\"[fieldWidth ? fieldWidth : 'col-sm-8', { 'nice-disabled': isDisabled }]\">\n" +
|
|
7914
|
+
" <div class=\"nice-field col-xs-12\" ng-class=\"[fieldWidth ? fieldWidth : 'col-sm-8', { 'nice-disabled': isDisabled }]\" click-outside=\"cancelClick()\" is-open=\"{{ showDtpRange }}\">\n" +
|
|
7738
7915
|
" \n" +
|
|
7739
7916
|
" <div ng-form=\"formDatetimeRangePicker\"></div>\n" +
|
|
7740
7917
|
"\n" +
|
|
@@ -7866,7 +8043,7 @@ angular.module('niceElements').run(['$templateCache', function($templateCache) {
|
|
|
7866
8043
|
" <ul id=\"{{id}}\" class=\"dropdown-menu\" role=\"menu\">\n" +
|
|
7867
8044
|
" <li id=\"{{id}}-{{$index}}\" ng-repeat=\"item in internalList\" ng-click=\"clicked(item)\">\n" +
|
|
7868
8045
|
" <a href>\n" +
|
|
7869
|
-
" <span class=\"choice-checkbox\" ng-if=\"multiple\" ng-class=\"{ 'selected' : isItemSelected(item) }\"><
|
|
8046
|
+
" <span class=\"choice-checkbox\" ng-if=\"multiple\" ng-class=\"{ 'selected' : isItemSelected(item) }\"><nice-icon icon=\"icon-check\"></nice-icon></span>\n" +
|
|
7870
8047
|
" <span ng-if=\"item.color_hex_code\" class=\"dropdown-color\" ng-style=\"{'background': item.color_hex_code}\"></span>\n" +
|
|
7871
8048
|
" <span ng-class=\"{'multiple-item': multiple}\">{{ getLabel(item) }}</span>\n" +
|
|
7872
8049
|
" \n" +
|
|
@@ -7897,49 +8074,51 @@ angular.module('niceElements').run(['$templateCache', function($templateCache) {
|
|
|
7897
8074
|
" <div class=\"nice-field col-xs-12\" ng-class=\"[ fieldWidth ? fieldWidth : 'col-sm-8', { 'open': isOpen, 'nice-disabled': isDisabled || emptyList } ]\" click-outside=\"close()\" is-open=\"{{ isOpen }}\">\n" +
|
|
7898
8075
|
" <div class=\"nice-field-wrapper\">\n" +
|
|
7899
8076
|
" \n" +
|
|
7900
|
-
" <
|
|
7901
|
-
" <
|
|
7902
|
-
"
|
|
7903
|
-
"
|
|
7904
|
-
"
|
|
7905
|
-
"
|
|
7906
|
-
"
|
|
7907
|
-
"
|
|
7908
|
-
"
|
|
7909
|
-
"
|
|
7910
|
-
"
|
|
7911
|
-
"
|
|
7912
|
-
"\n" +
|
|
7913
|
-
" <span class=\"caret\" ng-show=\"!loading\"></span>\n" +
|
|
7914
|
-
" <nice-loader ng-if=\"loading\"></nice-loader>\n" +
|
|
7915
|
-
" </button>\n" +
|
|
8077
|
+
" <nice-popup trigger=\"manual\" is-open=\"isOpen\" placement=\"{{ placement }}\" offset-distance=\"{{ dropdownDistance }}\" same-width=\"true\">\n" +
|
|
8078
|
+
" <nice-popup-target>\n" +
|
|
8079
|
+
" <button type=\"button\" class=\"btn btn-dropdown\" type=\"button\" ng-ref=\"dropdown-button\" ng-click=\"toggle()\" ng-disabled=\"isDisabled || emptyList\" aria-expanded=\"{{ isOpen }}\" aria-haspopup=\"true\" aria-controls=\"menu\" id=\"nice-dropdown-{{ id }}\">\n" +
|
|
8080
|
+
" <input class=\"hidden-input\" ng-model=\"model\" ng-required=\"required\" ng-disabled=\"disabled\" tabindex=\"-1\">\n" +
|
|
8081
|
+
" <div class=\"btn-dropdown-inside\" ng-transclude=\"button\" ng-if=\"selected != null\">\n" +
|
|
8082
|
+
" <span ng-if=\"!multiple\">{{ selected[objValue] }}</span>\n" +
|
|
8083
|
+
" <span ng-if=\"multiple\" class=\"multiple-selected\" ng-class=\"{ 'has-more': selected.length > maxSelectedShown }\">\n" +
|
|
8084
|
+
" <span ng-if=\"selected.length > 0\" class=\"multiple-selected-values\"><span ng-repeat=\"item in selected | limitTo: maxSelectedShown\">{{ item[objValue] }}{{ $last ? '' : ', ' }}</span></span>\n" +
|
|
8085
|
+
" <span ng-if=\"selected.length > maxSelectedShown\" class=\"multiple-selected-more\">+{{ selected.length - maxSelectedShown }} {{ moreText }}</span>\n" +
|
|
8086
|
+
" <span ng-if=\"selected.length == 0\" class=\"not-selected\">{{ nullableText }}</span>\n" +
|
|
8087
|
+
" </span>\n" +
|
|
8088
|
+
" </div>\n" +
|
|
7916
8089
|
"\n" +
|
|
8090
|
+
" <div class=\"not-selected\" ng-if=\"selected == null\">{{ selectText }}</div>\n" +
|
|
7917
8091
|
"\n" +
|
|
7918
|
-
"
|
|
7919
|
-
"
|
|
7920
|
-
"
|
|
7921
|
-
"
|
|
7922
|
-
"
|
|
7923
|
-
"
|
|
7924
|
-
"
|
|
7925
|
-
" <
|
|
7926
|
-
"
|
|
7927
|
-
"
|
|
7928
|
-
"
|
|
7929
|
-
"
|
|
7930
|
-
"
|
|
7931
|
-
"
|
|
7932
|
-
"
|
|
7933
|
-
"
|
|
7934
|
-
"
|
|
7935
|
-
"
|
|
7936
|
-
"
|
|
7937
|
-
" <
|
|
7938
|
-
"
|
|
7939
|
-
"
|
|
8092
|
+
" <span class=\"caret\" ng-show=\"!loading\"></span>\n" +
|
|
8093
|
+
" <nice-loader ng-if=\"loading\"></nice-loader>\n" +
|
|
8094
|
+
" </button>\n" +
|
|
8095
|
+
" </nice-popup-target>\n" +
|
|
8096
|
+
"\n" +
|
|
8097
|
+
" <nice-popup-content>\n" +
|
|
8098
|
+
" <div class=\"nice-dropdown-menu\" ng-if=\"isOpen\">\n" +
|
|
8099
|
+
" <div class=\"search-bar\" ng-if=\"!noSearch && searchFunction\">\n" +
|
|
8100
|
+
" <input class=\"search-bar-input\" ng-model=\"internal.search\" ng-model-options=\"{ debounce: 500 }\" ng-change=\"handleSearch()\" placeholder=\"{{ searchText }}\">\n" +
|
|
8101
|
+
" <div class=\"count\" ng-if=\"internalList && internalList._metadata && enableLoadMore\">{{ internalList.length }}/{{ internalList._metadata.count }}</div>\n" +
|
|
8102
|
+
" <nice-icon ng-if=\"!internal.search\" class=\"icon\" icon=\"icon-search\"></nice-icon>\n" +
|
|
8103
|
+
" <nice-icon ng-if=\"internal.search\" class=\"icon\" icon=\"icon-x\" ng-click=\"clearSearch()\"></nice-icon>\n" +
|
|
8104
|
+
" </div>\n" +
|
|
8105
|
+
" <div class=\"nice-dropdown-actions\" ng-if=\"multiple\">\n" +
|
|
8106
|
+
" <button type=\"button\" class=\"btn btn-default btn-sm\" ng-click=\"selectAll()\" translate translate-context=\"Nice\">All</button>\n" +
|
|
8107
|
+
" <button type=\"button\" class=\"btn btn-default btn-sm\" ng-click=\"selectNone()\">{{ nullableText }}</button>\n" +
|
|
8108
|
+
" </div>\n" +
|
|
8109
|
+
" <div class=\"nice-dropdown-items\" aria-labelledby=\"nice-dropdown-{{ id }}\" role=\"listbox\">\n" +
|
|
8110
|
+
" <div role=\"none\" type=\"button\" class=\"nice-no-data\" ng-if=\"internalList && internalList.length == 0\">{{ noDataText }}</div>\n" +
|
|
8111
|
+
" <button type=\"button\" role=\"option\" class=\"nice-dropdown-item null-item\" ng-if=\"!multiple && nullable && internalList.length != 0\" ng-click=\"handleSelected(null, -1)\" ng-disabled=\"isDisabled\">\n" +
|
|
8112
|
+
" {{ nullableText }}\n" +
|
|
8113
|
+
" </button>\n" +
|
|
8114
|
+
" <button type=\"button\" role=\"option\" class=\"nice-dropdown-item\" ng-repeat=\"item in internalList\" ng-click=\"handleSelected(item, $index)\" ng-class=\"{ 'selected': item._selected }\" ng-disabled=\"isDisabled\">\n" +
|
|
8115
|
+
" <div class=\"choice-checkbox\" ng-if=\"multiple\" role=\"menuitemcheckbox\"><nice-icon icon=\"icon-check\"></nice-icon></div>\n" +
|
|
8116
|
+
" <div class=\"choice-option\" ng-transclude=\"option\" ng-class=\"{ 'multiple-item': multiple }\">{{ item[objValue] }}</div>\n" +
|
|
8117
|
+
" </button>\n" +
|
|
8118
|
+
" </div>\n" +
|
|
7940
8119
|
" </div>\n" +
|
|
7941
|
-
" </
|
|
7942
|
-
" </
|
|
8120
|
+
" </nice-popup-content>\n" +
|
|
8121
|
+
" </nice-popup>\n" +
|
|
7943
8122
|
"\n" +
|
|
7944
8123
|
"\n" +
|
|
7945
8124
|
" \n" +
|
|
@@ -7960,27 +8139,27 @@ angular.module('niceElements').run(['$templateCache', function($templateCache) {
|
|
|
7960
8139
|
" <div class=\"dtp-date-view\">\n" +
|
|
7961
8140
|
" <div class=\"dtp-header\" ng-if=\"!inline\">\n" +
|
|
7962
8141
|
" <div class=\"dtp-actual-day\">{{actualDay}}</div>\n" +
|
|
7963
|
-
" <div class=\"dtp-close\" ng-if=\"!inline\"><a href=\"javascript:void(0);\" ng-click=\"onCloseClick()\"><
|
|
8142
|
+
" <div class=\"dtp-close\" ng-if=\"!inline\"><a href=\"javascript:void(0);\" ng-click=\"onCloseClick()\"><nice-icon icon=\"icon-x\"></nice-icon></a></div>\n" +
|
|
7964
8143
|
" </div>\n" +
|
|
7965
8144
|
" <div class=\"dtp-date\" ng-if=\"!inline\" ng-class=\"{'hidden': !showDateHeader}\">\n" +
|
|
7966
8145
|
" <div>\n" +
|
|
7967
8146
|
" <div class=\"left center p10\">\n" +
|
|
7968
|
-
" <a href=\"javascript:void(0);\" class=\"dtp-select-month-before\" ng-click=\"onMonthBeforeClick()\" ng-class=\"{'disabled': !btnMonthBeforeEnabled}\"><
|
|
8147
|
+
" <a href=\"javascript:void(0);\" class=\"dtp-select-month-before\" ng-click=\"onMonthBeforeClick()\" ng-class=\"{'disabled': !btnMonthBeforeEnabled}\"><nice-icon icon=\"icon-chevron-left\"></nice-icon></a>\n" +
|
|
7969
8148
|
" </div>\n" +
|
|
7970
8149
|
" <div class=\"dtp-actual-month p80\" ng-click=\"initDate()\">{{actualMonth}}</div>\n" +
|
|
7971
8150
|
" <div class=\"right center p10\">\n" +
|
|
7972
|
-
" <a href=\"javascript:void(0);\" class=\"dtp-select-month-after\" ng-click=\"onMonthAfterClick()\" ng-class=\"{'disabled': !btnMonthAfterEnabled}\"><
|
|
8151
|
+
" <a href=\"javascript:void(0);\" class=\"dtp-select-month-after\" ng-click=\"onMonthAfterClick()\" ng-class=\"{'disabled': !btnMonthAfterEnabled}\"><nice-icon icon=\"icon-chevron-right\"></nice-icon></a>\n" +
|
|
7973
8152
|
" </div>\n" +
|
|
7974
8153
|
" <div class=\"clearfix\"></div>\n" +
|
|
7975
8154
|
" </div>\n" +
|
|
7976
8155
|
" <div class=\"dtp-actual-num\" ng-click=\"initDate()\">{{actualNum}}</div>\n" +
|
|
7977
8156
|
" <div>\n" +
|
|
7978
8157
|
" <div class=\"left center p10\">\n" +
|
|
7979
|
-
" <a href=\"javascript:void(0);\" class=\"dtp-select-year-before\" ng-click=\"onYearBeforeClick()\" ng-class=\"{'disabled': !btnYearBeforeEnabled}\"><
|
|
8158
|
+
" <a href=\"javascript:void(0);\" class=\"dtp-select-year-before\" ng-click=\"onYearBeforeClick()\" ng-class=\"{'disabled': !btnYearBeforeEnabled}\"><nice-icon icon=\"icon-chevron-left\"></nice-icon></a>\n" +
|
|
7980
8159
|
" </div>\n" +
|
|
7981
8160
|
" <div class=\"dtp-actual-year p80\" ng-click=\"initDate()\">{{actualYear}}</div>\n" +
|
|
7982
8161
|
" <div class=\"right center p10\">\n" +
|
|
7983
|
-
" <a href=\"javascript:void(0);\" class=\"dtp-select-year-after\" ng-click=\"onYearAfterClick()\" ng-class=\"{'disabled': !btnYearAfterEnabled}\"><
|
|
8162
|
+
" <a href=\"javascript:void(0);\" class=\"dtp-select-year-after\" ng-click=\"onYearAfterClick()\" ng-class=\"{'disabled': !btnYearAfterEnabled}\"><nice-icon icon=\"icon-chevron-right\"></nice-icon></a>\n" +
|
|
7984
8163
|
" </div>\n" +
|
|
7985
8164
|
" <div class=\"clearfix\"></div>\n" +
|
|
7986
8165
|
" </div>\n" +
|
|
@@ -7994,11 +8173,11 @@ angular.module('niceElements').run(['$templateCache', function($templateCache) {
|
|
|
7994
8173
|
" <div class=\"dtp-picker-calendar\" ng-class=\"{'hidden': !showCalendar}\">\n" +
|
|
7995
8174
|
" <div>\n" +
|
|
7996
8175
|
" <div ng-if=\"inline\" class=\"left center p10\">\n" +
|
|
7997
|
-
" <a href=\"javascript:void(0);\" class=\"dtp-select-month-before\" ng-click=\"onMonthBeforeClick()\" ng-class=\"{'disabled': !btnMonthBeforeEnabled}\"><
|
|
8176
|
+
" <a href=\"javascript:void(0);\" class=\"dtp-select-month-before\" ng-click=\"onMonthBeforeClick()\" ng-class=\"{'disabled': !btnMonthBeforeEnabled}\"><nice-icon icon=\"icon-chevron-left\"></nice-icon></a>\n" +
|
|
7998
8177
|
" </div>\n" +
|
|
7999
8178
|
" <div class=\"dtp-picker-month\" ng-class=\"{'p80': inline}\">{{monthAndYear}}</div>\n" +
|
|
8000
8179
|
" <div class=\"right center p10\" ng-if=\"inline\">\n" +
|
|
8001
|
-
" <a href=\"javascript:void(0);\" class=\"dtp-select-month-after\" ng-click=\"onMonthAfterClick()\" ng-class=\"{'disabled': !btnMonthAfterEnabled}\"><
|
|
8180
|
+
" <a href=\"javascript:void(0);\" class=\"dtp-select-month-after\" ng-click=\"onMonthAfterClick()\" ng-class=\"{'disabled': !btnMonthAfterEnabled}\"><nice-icon icon=\"icon-chevron-right\"></nice-icon></a>\n" +
|
|
8002
8181
|
" </div>\n" +
|
|
8003
8182
|
" </div>\n" +
|
|
8004
8183
|
"\n" +
|
|
@@ -8287,13 +8466,13 @@ angular.module('niceElements').run(['$templateCache', function($templateCache) {
|
|
|
8287
8466
|
|
|
8288
8467
|
|
|
8289
8468
|
$templateCache.put('src/components/nice-popup/nice-popup.html',
|
|
8290
|
-
"<div class=\"nice-popup\" click-outside=\"
|
|
8291
|
-
" <div class=\"nice-popup-target\" ng-transclude=\"target\" ng-click=\"
|
|
8469
|
+
"<div class=\"nice-popup\" click-outside=\"clickedOutside()\">\n" +
|
|
8470
|
+
" <div class=\"nice-popup-target\" ng-transclude=\"target\" ng-click=\"targetClicked()\"></div>\n" +
|
|
8292
8471
|
" <div class=\"nice-popup-content\">\n" +
|
|
8293
|
-
" <div class=\"nice-popup-arrow\"
|
|
8472
|
+
" <div class=\"nice-popup-arrow\" ng-show=\"isOpen && showArrow\"></div>\n" +
|
|
8294
8473
|
" <div ng-transclude=\"content\" ng-if=\"isOpen\"></div>\n" +
|
|
8295
8474
|
" </div>\n" +
|
|
8296
|
-
"</div
|
|
8475
|
+
"</div>\n"
|
|
8297
8476
|
);
|
|
8298
8477
|
|
|
8299
8478
|
|
|
@@ -8357,13 +8536,11 @@ angular.module('niceElements').run(['$templateCache', function($templateCache) {
|
|
|
8357
8536
|
"\n" +
|
|
8358
8537
|
" <button type=\"button\" class=\"btn input-group-addon\" ng-click=\"search()\" ng-if=\"!model\" ng-disabled=\"isDisabled\">\n" +
|
|
8359
8538
|
" \n" +
|
|
8360
|
-
" \n" +
|
|
8361
8539
|
" <nice-icon ng-show=\"!loading\" icon=\"icon-search\"></nice-icon>\n" +
|
|
8362
8540
|
" <nice-loader ng-if=\"loading\"></nice-loader>\n" +
|
|
8363
8541
|
" </button>\n" +
|
|
8364
8542
|
"\n" +
|
|
8365
8543
|
" <button type=\"button\" class=\"btn input-group-addon\" ng-click=\"remove()\" ng-if=\"model\" ng-disabled=\"isDisabled\">\n" +
|
|
8366
|
-
" \n" +
|
|
8367
8544
|
" <nice-icon ng-show=\"!loading\" icon=\"icon-x\"></nice-icon>\n" +
|
|
8368
8545
|
" </button>\n" +
|
|
8369
8546
|
" </div>\n" +
|
|
@@ -8398,29 +8575,33 @@ angular.module('niceElements').run(['$templateCache', function($templateCache) {
|
|
|
8398
8575
|
"\n" +
|
|
8399
8576
|
" \n" +
|
|
8400
8577
|
" <div class=\"nice-field col-xs-12\" ng-class=\"[fieldWidth ? fieldWidth : 'col-sm-8', { 'nice-disabled': isDisabled }]\" click-outside=\"close()\">\n" +
|
|
8401
|
-
" <
|
|
8402
|
-
" <
|
|
8403
|
-
"\n" +
|
|
8404
|
-
"
|
|
8405
|
-
"
|
|
8406
|
-
"
|
|
8407
|
-
"
|
|
8408
|
-
"
|
|
8409
|
-
"
|
|
8410
|
-
"
|
|
8411
|
-
" <div class=\"nice-search-dropdown-wrapper\">\n" +
|
|
8412
|
-
" <div class=\"nice-search-dropdown\" ng-if=\"showDropdown && isOpen\">\n" +
|
|
8413
|
-
" <div class=\"nice-search-row nice-search-row-loading\" ng-if=\"loading && results.length == 0\">\n" +
|
|
8414
|
-
" <nice-loader ng-if=\"loading\"></nice-loader>\n" +
|
|
8578
|
+
" <nice-popup trigger=\"manual\" is-open=\"isOpen\" placement=\"{{ placement }}\" same-width=\"true\">\n" +
|
|
8579
|
+
" <nice-popup-target>\n" +
|
|
8580
|
+
" <div class=\"nice-search-button input-group\" ng-class=\"{ 'disabled': isDisabled }\">\n" +
|
|
8581
|
+
" <input class=\"form-control\" type=\"text\" id=\"{{ id }}\" ng-model=\"model\" placeholder=\"{{ placeholder }}\" ng-disabled=\"isDisabled\" ng-change=\"updateSearch()\" ng-focus=\"onFocus()\" ng-required=\"required\" tabindex=\"{{ tabIndex }}\">\n" +
|
|
8582
|
+
"\n" +
|
|
8583
|
+
" <button type=\"button\" class=\"btn input-group-addon\" ng-disabled=\"isDisabled\" ng-click=\"buttonClicked()\">\n" +
|
|
8584
|
+
" <nice-icon ng-show=\"!loading && model != ''\" icon=\"icon-x\"></nice-icon>\n" +
|
|
8585
|
+
" <nice-icon ng-show=\"!loading && model == ''\" icon=\"icon-search\"></nice-icon>\n" +
|
|
8586
|
+
" <nice-loader ng-if=\"loading\"></nice-loader>\n" +
|
|
8587
|
+
" </button>\n" +
|
|
8415
8588
|
" </div>\n" +
|
|
8589
|
+
" </nice-popup-target>\n" +
|
|
8416
8590
|
"\n" +
|
|
8417
|
-
"
|
|
8591
|
+
" <nice-popup-content>\n" +
|
|
8592
|
+
" <div class=\"nice-search-dropdown\" ng-if=\"showDropdown && isOpen\">\n" +
|
|
8593
|
+
" <div class=\"nice-search-row nice-search-row-loading\" ng-if=\"loading && results.length == 0\">\n" +
|
|
8594
|
+
" <nice-loader ng-if=\"loading\"></nice-loader>\n" +
|
|
8595
|
+
" </div>\n" +
|
|
8596
|
+
"\n" +
|
|
8597
|
+
" <div class=\"nice-search-row nice-search-row-empty\" ng-if=\"!loading && results.length == 0\" translate translate-context=\"Nice\">No results found.</div>\n" +
|
|
8418
8598
|
"\n" +
|
|
8419
|
-
"
|
|
8420
|
-
"
|
|
8599
|
+
" <div ng-repeat=\"result in results\" class=\"nice-search-row\" ng-class=\"{'active': selectedIndex == $index}\" ng-click=\"selectItem(result)\">\n" +
|
|
8600
|
+
" <ng-transclude>{{ result[keyForInputLabel] }}</ng-transclude>\n" +
|
|
8601
|
+
" </div>\n" +
|
|
8421
8602
|
" </div>\n" +
|
|
8422
|
-
" </
|
|
8423
|
-
" </
|
|
8603
|
+
" </nice-popup-content>\n" +
|
|
8604
|
+
" </nice-popup>\n" +
|
|
8424
8605
|
" </div>\n" +
|
|
8425
8606
|
" </div>\n" +
|
|
8426
8607
|
"</ng-form>"
|
|
@@ -8690,6 +8871,10 @@ angular.module('niceElements').run(['$templateCache', function($templateCache) {
|
|
|
8690
8871
|
" <path d=\"M23 12c0-3.037-1.232-5.789-3.222-7.778s-4.741-3.222-7.778-3.222-5.789 1.232-7.778 3.222-3.222 4.741-3.222 7.778 1.232 5.789 3.222 7.778 4.741 3.222 7.778 3.222 5.789-1.232 7.778-3.222 3.222-4.741 3.222-7.778zM21 12c0 2.486-1.006 4.734-2.636 6.364s-3.878 2.636-6.364 2.636-4.734-1.006-6.364-2.636-2.636-3.878-2.636-6.364 1.006-4.734 2.636-6.364 3.878-2.636 6.364-2.636 4.734 1.006 6.364 2.636 2.636 3.878 2.636 6.364z\"></path>\n" +
|
|
8691
8872
|
" </symbol>\n" +
|
|
8692
8873
|
"\n" +
|
|
8874
|
+
" <symbol id=\"icon-dot\" viewBox=\"0 0 24 24\">\n" +
|
|
8875
|
+
" <path d=\"M12 6a6 6 0 1 1 0 12a6 6 0 1 1 0-12z\"></path>\n" +
|
|
8876
|
+
" </symbol>\n" +
|
|
8877
|
+
"\n" +
|
|
8693
8878
|
" <symbol id=\"icon-clipboard\" viewBox=\"0 0 24 24\">\n" +
|
|
8694
8879
|
" <path d=\"M7 5c0 0.552 0.225 1.053 0.586 1.414s0.862 0.586 1.414 0.586h6c0.552 0 1.053-0.225 1.414-0.586s0.586-0.862 0.586-1.414h1c0.276 0 0.525 0.111 0.707 0.293s0.293 0.431 0.293 0.707v14c0 0.276-0.111 0.525-0.293 0.707s-0.431 0.293-0.707 0.293h-12c-0.276 0-0.525-0.111-0.707-0.293s-0.293-0.431-0.293-0.707v-14c0-0.276 0.111-0.525 0.293-0.707s0.431-0.293 0.707-0.293zM9 1c-0.552 0-1.053 0.225-1.414 0.586s-0.586 0.862-0.586 1.414h-1c-0.828 0-1.58 0.337-2.121 0.879s-0.879 1.293-0.879 2.121v14c0 0.828 0.337 1.58 0.879 2.121s1.293 0.879 2.121 0.879h12c0.828 0 1.58-0.337 2.121-0.879s0.879-1.293 0.879-2.121v-14c0-0.828-0.337-1.58-0.879-2.121s-1.293-0.879-2.121-0.879h-1c0-0.552-0.225-1.053-0.586-1.414s-0.862-0.586-1.414-0.586zM9 3h6v2h-6z\"></path>\n" +
|
|
8695
8880
|
" </symbol>\n" +
|
|
@@ -9223,6 +9408,10 @@ angular.module('niceElements').run(['$templateCache', function($templateCache) {
|
|
|
9223
9408
|
" </symbol>\n" +
|
|
9224
9409
|
"\n" +
|
|
9225
9410
|
" <symbol id=\"icon-plus\" viewBox=\"0 0 24 24\">\n" +
|
|
9411
|
+
" <path d=\"M10.5 5.5a1.5 1.5 0 0 1 3 0v5h5a1.5 1.5 0 0 1 0 3h-5v5a1.5 1.5 0 0 1-3 0v-5h-5a1.5 1.5 0 0 1 0-3h5z\"></path>\n" +
|
|
9412
|
+
" </symbol>\n" +
|
|
9413
|
+
"\n" +
|
|
9414
|
+
" <symbol id=\"icon-plus-2\" viewBox=\"0 0 24 24\">\n" +
|
|
9226
9415
|
" <path d=\"M5 13h6v6c0 0.552 0.448 1 1 1s1-0.448 1-1v-6h6c0.552 0 1-0.448 1-1s-0.448-1-1-1h-6v-6c0-0.552-0.448-1-1-1s-1 0.448-1 1v6h-6c-0.552 0-1 0.448-1 1s0.448 1 1 1z\"></path>\n" +
|
|
9227
9416
|
" </symbol>\n" +
|
|
9228
9417
|
"\n" +
|
|
@@ -9976,7 +10165,7 @@ angular.module('niceElements').run(['$templateCache', function($templateCache) {
|
|
|
9976
10165
|
" <nice-title text=\"title || niceTitle\" help=\"help\" required=\"required\" description=\"description\" label-width=\"labelWidth\"></nice-title>\n" +
|
|
9977
10166
|
"\n" +
|
|
9978
10167
|
" \n" +
|
|
9979
|
-
" <div class=\"nice-field col-xs-12\" ng-class=\"fieldWidth ? fieldWidth : 'col-sm-8'\">\n" +
|
|
10168
|
+
" <div class=\"nice-field col-xs-12\" ng-class=\"fieldWidth ? fieldWidth : 'col-sm-8'\" click-outside=\"close()\" is-open=\"{{ open }}\">\n" +
|
|
9980
10169
|
" <div class=\"input-group\" ng-class=\"{\n" +
|
|
9981
10170
|
" 'has-warning': !isDisabled && forma.$invalid && forma.$dirty,\n" +
|
|
9982
10171
|
" 'disabled': isDisabled\n" +
|
|
@@ -10011,8 +10200,6 @@ angular.module('niceElements').run(['$templateCache', function($templateCache) {
|
|
|
10011
10200
|
" </div>\n" +
|
|
10012
10201
|
" </div>\n" +
|
|
10013
10202
|
" </div>\n" +
|
|
10014
|
-
"\n" +
|
|
10015
|
-
" <div class=\"nice-background\" ng-click=\"close()\" ng-if=\"open\"></div>\n" +
|
|
10016
10203
|
"</div>"
|
|
10017
10204
|
);
|
|
10018
10205
|
|
|
@@ -10052,6 +10239,9 @@ angular.module('niceElements').run(['$templateCache', function($templateCache) {
|
|
|
10052
10239
|
"\n" +
|
|
10053
10240
|
" \n" +
|
|
10054
10241
|
" <div class=\"nice-field col-xs-12\" ng-class=\"[fieldWidth ? fieldWidth : 'col-sm-8', { 'nice-disabled': isDisabled }]\">\n" +
|
|
10242
|
+
" \n" +
|
|
10243
|
+
" <input type=\"checkbox\" class=\"hidden-input\" ng-model=\"model\" ng-required=\"required\" tabindex=\"-1\">\n" +
|
|
10244
|
+
"\n" +
|
|
10055
10245
|
" <button type=\"button\" class=\"nice-toggle-field\" ng-click=\"toggle()\" ng-disabled=\"isDisabled\">\n" +
|
|
10056
10246
|
" <div class=\"nice-toggle-field-handle\">\n" +
|
|
10057
10247
|
" <nice-icon ng-if=\"showIcons && model\" icon=\"icon-check\"></nice-icon>\n" +
|
|
@@ -10092,7 +10282,7 @@ angular.module('niceElements').run(['$templateCache', function($templateCache) {
|
|
|
10092
10282
|
" </button>\n" +
|
|
10093
10283
|
"\n" +
|
|
10094
10284
|
" \n" +
|
|
10095
|
-
" <input class=\"input-file\" type=\"file\" accept=\"{{ accept }}\" ng-model=\"file\" ng-required=\"required\" ng-disabled=\"isDisabled || loading\">\n" +
|
|
10285
|
+
" <input class=\"input-file\" type=\"file\" accept=\"{{ accept }}\" ng-model=\"file\" ng-required=\"required && !model\" ng-disabled=\"isDisabled || loading\">\n" +
|
|
10096
10286
|
"\n" +
|
|
10097
10287
|
" \n" +
|
|
10098
10288
|
" <div class=\"nice-upload-loading\" ng-if=\"loading\">\n" +
|
|
@@ -10172,6 +10362,9 @@ angular.module('niceElements').run(['$templateCache', function($templateCache) {
|
|
|
10172
10362
|
"\n" +
|
|
10173
10363
|
" \n" +
|
|
10174
10364
|
" <div class=\"nice-field col-xs-12\" ng-class=\"[fieldWidth ? fieldWidth : 'col-sm-8', { 'nice-disabled': isDisabled }]\">\n" +
|
|
10365
|
+
" \n" +
|
|
10366
|
+
" <input class=\"hidden-input\" ng-model=\"model\" ng-required=\"required\" tabindex=\"-1\">\n" +
|
|
10367
|
+
"\n" +
|
|
10175
10368
|
" <div class=\"yesno-wrapper noselect\">\n" +
|
|
10176
10369
|
" <button type=\"button\" class=\"yesno-yes-bg\" ng-click=\"switch()\" tabindex=\"-1\" ng-disabled=\"isDisabled\">{{ yes }}</button>\n" +
|
|
10177
10370
|
" <button type=\"button\" class=\"yesno-no-bg\" ng-click=\"switch()\" tabindex=\"-1\" ng-disabled=\"isDisabled\">{{ no }}</button>\n" +
|