nice-elements 1.9.16 → 1.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.vscode/settings.json +17 -17
- package/CHANGELOG.md +407 -401
- package/LICENSE.md +21 -21
- package/README.md +95 -93
- package/bower.json +10 -10
- package/dist/nice.js +8073 -7930
- package/dist/nice.min.js +1 -1
- package/dist/style.css +105 -9
- package/dist/style.css.map +3 -1
- package/dist/style.min.css +8 -8
- package/package.json +40 -40
- package/src/components/nice-button/nice-button.html +4 -4
- package/src/components/nice-button/nice-button.js +41 -41
- package/src/components/nice-button/nice-button.scss +16 -16
- package/src/components/nice-button-toggle/nice-button-toggle.html +9 -9
- package/src/components/nice-button-toggle/nice-button-toggle.js +23 -23
- package/src/components/nice-button-toggle/nice-button-toggle.scss +2 -2
- package/src/components/nice-calendar/nice-calendar.html +91 -91
- package/src/components/nice-calendar/nice-calendar.js +334 -334
- package/src/components/nice-calendar/nice-calendar.scss +285 -285
- package/src/components/nice-checkbox/nice-checkbox.html +5 -5
- package/src/components/nice-checkbox/nice-checkbox.js +33 -33
- package/src/components/nice-checkbox/nice-checkbox.scss +91 -91
- package/src/components/nice-choice/nice-choice.html +18 -18
- package/src/components/nice-choice/nice-choice.js +210 -210
- package/src/components/nice-choice/nice-choice.scss +110 -110
- package/src/components/nice-click-outside/nice-click-outside.js +105 -105
- package/src/components/nice-comment/nice-comment.html +10 -10
- package/src/components/nice-comment/nice-comment.js +69 -69
- package/src/components/nice-comment/nice-comment.scss +39 -39
- package/src/components/nice-date/nice-date.html +74 -74
- package/src/components/nice-date/nice-date.js +327 -327
- package/src/components/nice-date/nice-date.scss +302 -302
- package/src/components/nice-date-input/nice-date-input.html +41 -41
- package/src/components/nice-date-input/nice-date-input.js +109 -109
- package/src/components/nice-date-input/nice-date-input.scss +45 -45
- package/src/components/nice-date-range/nice-date-range.html +15 -15
- package/src/components/nice-date-range/nice-date-range.js +76 -76
- package/src/components/nice-date-range/nice-date-range.scss +390 -390
- package/src/components/nice-datetime-picker/nice-datetime-picker.html +29 -29
- package/src/components/nice-datetime-picker/nice-datetime-picker.js +87 -87
- package/src/components/nice-datetime-picker/nice-datetime-picker.scss +428 -428
- package/src/components/nice-datetimerange-picker/nice-datetimerange-picker.html +55 -55
- package/src/components/nice-datetimerange-picker/nice-datetimerange-picker.js +246 -246
- package/src/components/nice-datetimerange-picker/nice-datetimerange-picker.scss +73 -73
- package/src/components/nice-datetimerange-picker-2/nice-datetimerange-picker-2.html +44 -44
- package/src/components/nice-datetimerange-picker-2/nice-datetimerange-picker-2.js +172 -172
- package/src/components/nice-datetimerange-picker-2/nice-datetimerange-picker-2.scss +127 -127
- package/src/components/nice-dropdown/nice-dropdown.html +60 -60
- package/src/components/nice-dropdown/nice-dropdown.js +489 -489
- package/src/components/nice-dropdown/nice-dropdown.scss +249 -249
- package/src/components/nice-dropdown-date/nice-dropdown-date.html +28 -28
- package/src/components/nice-dropdown-date/nice-dropdown-date.js +126 -126
- package/src/components/nice-dropdown-date/nice-dropdown-date.scss +82 -82
- package/src/components/nice-dropdown-old/nice-dropdown-old.html +44 -44
- package/src/components/nice-dropdown-old/nice-dropdown-old.js +330 -330
- package/src/components/nice-dropdown-old/nice-dropdown-old.scss +129 -129
- package/src/components/nice-dtp/nice-dtp.html +91 -91
- package/src/components/nice-dtp/nice-dtp.js +833 -833
- package/src/components/nice-help/nice-help.html +6 -6
- package/src/components/nice-help/nice-help.js +55 -55
- package/src/components/nice-help/nice-help.scss +78 -78
- package/src/components/nice-input/nice-input.html +48 -48
- package/src/components/nice-input/nice-input.js +244 -244
- package/src/components/nice-input/nice-input.scss +130 -130
- package/src/components/nice-label/nice-label.html +10 -10
- package/src/components/nice-label/nice-label.js +30 -30
- package/src/components/nice-loader/nice-loader.html +6 -6
- package/src/components/nice-loader/nice-loader.js +28 -28
- package/src/components/nice-loader/nice-loader.scss +47 -47
- package/src/components/nice-no-data/nice-no-data.html +4 -0
- package/src/components/nice-no-data/nice-no-data.js +26 -0
- package/src/components/nice-no-data/nice-no-data.scss +27 -0
- package/src/components/nice-notification/nice-notification.html +3 -3
- package/src/components/nice-notification/nice-notification.js +124 -124
- package/src/components/nice-notification/nice-notification.scss +66 -66
- package/src/components/nice-number/nice-number.html +40 -40
- package/src/components/nice-number/nice-number.js +169 -169
- package/src/components/nice-number/nice-number.scss +18 -18
- package/src/components/nice-percent/nice-percent.html +24 -24
- package/src/components/nice-percent/nice-percent.js +94 -94
- package/src/components/nice-pill/nice-pill.html +3 -3
- package/src/components/nice-pill/nice-pill.js +29 -29
- package/src/components/nice-pill/nice-pill.scss +25 -25
- package/src/components/nice-popup/nice-popup.html +6 -6
- package/src/components/nice-popup/nice-popup.js +122 -122
- package/src/components/nice-popup/nice-popup.scss +43 -43
- package/src/components/nice-progress-bar/nice-progress-bar.html +15 -15
- package/src/components/nice-progress-bar/nice-progress-bar.js +54 -54
- package/src/components/nice-progress-bar/nice-progress-bar.scss +47 -47
- package/src/components/nice-quantity/nice-quantity.html +22 -22
- package/src/components/nice-quantity/nice-quantity.js +55 -55
- package/src/components/nice-quantity/nice-quantity.scss +51 -51
- package/src/components/nice-search/nice-search.html +44 -44
- package/src/components/nice-search/nice-search.js +239 -239
- package/src/components/nice-search/nice-search.scss +90 -90
- package/src/components/nice-search2/nice-search2.html +32 -32
- package/src/components/nice-search2/nice-search2.js +264 -264
- package/src/components/nice-search2/nice-search2.scss +80 -80
- package/src/components/nice-slot/nice-slot.html +10 -10
- package/src/components/nice-slot/nice-slot.js +29 -29
- package/src/components/nice-steps/nice-steps.scss +81 -81
- package/src/components/nice-svgs/nice-svgs.html +1262 -1262
- package/src/components/nice-svgs/nice-svgs.js +16 -16
- package/src/components/nice-table/nice-table.html +28 -0
- package/src/components/nice-table/nice-table.js +40 -0
- package/src/components/nice-table/nice-table.scss +62 -0
- package/src/components/nice-time-picker/nice-time-picker.html +43 -43
- package/src/components/nice-time-picker/nice-time-picker.js +83 -83
- package/src/components/nice-time-picker/nice-time-picker.scss +37 -37
- package/src/components/nice-title/nice-title.html +3 -3
- package/src/components/nice-title/nice-title.js +21 -21
- package/src/components/nice-toast/nice-toast.html +2 -2
- package/src/components/nice-toast/nice-toast.js +56 -56
- package/src/components/nice-toast/nice-toast.scss +74 -74
- package/src/components/nice-toggle/nice-toggle.html +12 -12
- package/src/components/nice-toggle/nice-toggle.js +95 -95
- package/src/components/nice-toggle/nice-toggle.scss +74 -67
- package/src/components/nice-tooltip/_nice-tooltip.scss +71 -71
- package/src/components/nice-tooltip/nice-tooltip.js +23 -23
- package/src/components/nice-upload/nice-upload.html +22 -22
- package/src/components/nice-upload/nice-upload.js +157 -157
- package/src/components/nice-upload/nice-upload.scss +85 -85
- package/src/components/nice-wrapper/_nice-wrapper.scss +87 -87
- package/src/components/nice-wrapper/nice-wrapper.html +12 -12
- package/src/components/nice-wrapper/nice-wrapper.js +43 -43
- package/src/components/nice-yesno/nice-yesno.html +14 -14
- package/src/components/nice-yesno/nice-yesno.js +109 -109
- package/src/components/nice-yesno/nice-yesno.scss +95 -95
- package/src/filters/nice-date.js +17 -17
- package/src/filters/nice-highlight.js +16 -16
- package/src/modals/nice-multilangual-modal/nice-multilangual-modal.html +30 -30
- package/src/modals/nice-multilangual-modal/nice-multilangual-modal.js +67 -67
- package/src/modals/nice-multilangual-modal/nice-multilangual-modal.scss +19 -19
- package/src/nice.js +2 -2
- package/src/services/nice-service.js +19 -19
- package/src/styles/_bootstrap-variables.scss +178 -178
- package/src/styles/_nice-buttons.scss +403 -403
- package/src/styles/_nice-common.scss +471 -471
- package/src/styles/_nice-ngdialog.scss +85 -85
- package/src/styles/_nice-spacing.scss +283 -283
- package/src/styles/_nice.scss +67 -65
- package/src/styles/_variables.scss +197 -195
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* @ngdoc directive
|
|
5
|
-
* @name niceElements.directive:niceSvgs
|
|
6
|
-
* @description
|
|
7
|
-
* # niceSvgs
|
|
8
|
-
*/
|
|
9
|
-
angular.module('niceElements')
|
|
10
|
-
.directive('niceSvgs', function () {
|
|
11
|
-
return {
|
|
12
|
-
templateUrl: 'src/components/nice-svgs/nice-svgs.html',
|
|
13
|
-
restrict: 'E',
|
|
14
|
-
transclude: true
|
|
15
|
-
};
|
|
16
|
-
});
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* @ngdoc directive
|
|
5
|
+
* @name niceElements.directive:niceSvgs
|
|
6
|
+
* @description
|
|
7
|
+
* # niceSvgs
|
|
8
|
+
*/
|
|
9
|
+
angular.module('niceElements')
|
|
10
|
+
.directive('niceSvgs', function () {
|
|
11
|
+
return {
|
|
12
|
+
templateUrl: 'src/components/nice-svgs/nice-svgs.html',
|
|
13
|
+
restrict: 'E',
|
|
14
|
+
transclude: true
|
|
15
|
+
};
|
|
16
|
+
});
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
<div class="nice-table-wrapper">
|
|
2
|
+
<table class="nice-table">
|
|
3
|
+
<thead>
|
|
4
|
+
<tr>
|
|
5
|
+
<th ng-repeat="column in columns" ng-class="[column.class, handleFreeze($first, $last)]">{{ column.title }}</th>
|
|
6
|
+
<th class="w-0 text-right" ng-if="hasActions">
|
|
7
|
+
<span>{{ data.length }}</span>
|
|
8
|
+
<span ng-if="data._resultmeta"> / {{ data._resultmeta.count }}</span>
|
|
9
|
+
</th>
|
|
10
|
+
</tr>
|
|
11
|
+
</thead>
|
|
12
|
+
|
|
13
|
+
<tbody>
|
|
14
|
+
<tr ng-repeat="row in data">
|
|
15
|
+
<td ng-repeat="column in columns" ng-class="[column.class, handleFreeze($first, $last)]">
|
|
16
|
+
<span ng-style="rowStyle(column, row)" ng-class="rowClass(column, row)" ng-if="column.formatter">{{ column.formatter(row[column.key], row) }}</span>
|
|
17
|
+
<span ng-style="rowStyle(column, row)" ng-class="rowClass(column, row)" ng-if="!column.formatter">{{ row[column.key] }}</span>
|
|
18
|
+
</td>
|
|
19
|
+
|
|
20
|
+
<td class="w-0" ng-if="hasActions">
|
|
21
|
+
<div class="nice-table-actions" ng-transclude></div>
|
|
22
|
+
</td>
|
|
23
|
+
</tr>
|
|
24
|
+
</tbody>
|
|
25
|
+
</table>
|
|
26
|
+
|
|
27
|
+
<nice-no-data ng-if="!data || data.length == 0"></nice-no-data>
|
|
28
|
+
</div>
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* @ngdoc directive
|
|
5
|
+
* @name niceElements.directive:niceTable
|
|
6
|
+
* @description
|
|
7
|
+
* # niceTable
|
|
8
|
+
*/
|
|
9
|
+
angular.module('niceElements')
|
|
10
|
+
.directive('niceTable', function () {
|
|
11
|
+
return {
|
|
12
|
+
templateUrl: 'src/components/nice-table/nice-table.html',
|
|
13
|
+
restrict: 'E',
|
|
14
|
+
transclude: true,
|
|
15
|
+
replace: true,
|
|
16
|
+
scope: {
|
|
17
|
+
data: '=',
|
|
18
|
+
columns: '=',
|
|
19
|
+
freezeFirst: '@',
|
|
20
|
+
freezeLast: '@',
|
|
21
|
+
},
|
|
22
|
+
controller: function ($scope, $transclude) {
|
|
23
|
+
$scope.hasActions = $transclude().length > 0;
|
|
24
|
+
|
|
25
|
+
$scope.rowStyle = function(column, row) {
|
|
26
|
+
if (!column.valueStyle) return;
|
|
27
|
+
return column.valueStyle(row[column.key], row);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
$scope.rowClass = function(column, row) {
|
|
31
|
+
if (!column.valueClass) return;
|
|
32
|
+
return column.valueClass(row[column.key], row);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
$scope.handleFreeze = function(isFirst, isLast) {
|
|
36
|
+
return { 'nice-table-freeze-first': $scope.freezeFirst && isFirst, 'nice-table-freeze-last': $scope.freezeLast && isLast }
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
};
|
|
40
|
+
});
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
.nice-table-wrapper {
|
|
2
|
+
min-height: .01%;
|
|
3
|
+
overflow-x: auto;
|
|
4
|
+
|
|
5
|
+
.nice-table {
|
|
6
|
+
width: 100%;
|
|
7
|
+
max-width: 100%;
|
|
8
|
+
border-collapse: collapse;
|
|
9
|
+
border-spacing: 0;
|
|
10
|
+
background: var(--nice-card-bg);
|
|
11
|
+
|
|
12
|
+
.nice-table-freeze-first {
|
|
13
|
+
position: sticky;
|
|
14
|
+
left: 0;
|
|
15
|
+
background: var(--nice-card-bg);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.nice-table-freeze-last {
|
|
19
|
+
position: sticky;
|
|
20
|
+
right: 0;
|
|
21
|
+
background: var(--nice-card-bg);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.nice-table-actions {
|
|
25
|
+
display: flex;
|
|
26
|
+
gap: 0.5rem;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
thead {
|
|
30
|
+
border-bottom: 1px solid var(--nice-border-color);
|
|
31
|
+
|
|
32
|
+
tr {
|
|
33
|
+
th {
|
|
34
|
+
padding: 8px;
|
|
35
|
+
vertical-align: bottom;
|
|
36
|
+
text-transform: uppercase;
|
|
37
|
+
font-size: 12px;
|
|
38
|
+
color: var(--nice-primary-color);
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
tbody {
|
|
44
|
+
tr {
|
|
45
|
+
&:hover {
|
|
46
|
+
background-color: var(--nice-hover-color);
|
|
47
|
+
|
|
48
|
+
.nice-table-freeze-first,
|
|
49
|
+
.nice-table-freeze-last {
|
|
50
|
+
background-color: var(--nice-hover-color);
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
td {
|
|
55
|
+
padding: 8px;
|
|
56
|
+
vertical-align: middle;
|
|
57
|
+
border-top: 1px solid var(--nice-border-color);
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
}
|
|
@@ -1,44 +1,44 @@
|
|
|
1
|
-
<div class="nice-component nice-time-picker" ng-form="forma" ng-class="{ 'margin-bottom-0': noMargin, 'nice-component-inline': isInline }">
|
|
2
|
-
<div class="row">
|
|
3
|
-
<!------------------------- Title ------------------------->
|
|
4
|
-
<nice-title text="title" help="help" required="required" label-width="labelWidth"></nice-title>
|
|
5
|
-
|
|
6
|
-
<!------------------------- Field ------------------------->
|
|
7
|
-
<div class="nice-field col-xs-12" ng-class="fieldWidth ? fieldWidth : 'col-sm-8'">
|
|
8
|
-
<div class="input-group" ng-class="{
|
|
9
|
-
'has-warning': !isDisabled && forma.$invalid && forma.$dirty,
|
|
10
|
-
'disabled': isDisabled
|
|
11
|
-
}">
|
|
12
|
-
<input type="text" class="form-control" ng-model="modelString" ng-keyup="$event.keyCode == 13 && validateDate()" ng-blur="validateDate()">
|
|
13
|
-
<span class="input-group-btn">
|
|
14
|
-
<button type="button" class="btn btn-default btn-right" ng-click="open = !open">
|
|
15
|
-
<nice-icon icon="icon-clock"></nice-icon>
|
|
16
|
-
</button>
|
|
17
|
-
</span>
|
|
18
|
-
</div>
|
|
19
|
-
|
|
20
|
-
<div class="nice-time-picker-dropdown" ng-if="open">
|
|
21
|
-
<div>
|
|
22
|
-
<button type="button" class="btn btn-sm btn-block btn-default" ng-click="changeHour(true)">
|
|
23
|
-
<nice-icon icon="icon-chevron-up"></nice-icon>
|
|
24
|
-
</button>
|
|
25
|
-
<div class="numbers">{{ hours }}</div>
|
|
26
|
-
<button type="button" class="btn btn-sm btn-block btn-default" ng-click="changeHour(false)">
|
|
27
|
-
<nice-icon icon="icon-chevron-down"></nice-icon>
|
|
28
|
-
</button>
|
|
29
|
-
</div>
|
|
30
|
-
<div>
|
|
31
|
-
<button type="button" class="btn btn-sm btn-block btn-default" ng-click="changeMinutes(true)">
|
|
32
|
-
<nice-icon icon="icon-chevron-up"></nice-icon>
|
|
33
|
-
</button>
|
|
34
|
-
<div class="numbers">{{ minutes }}</div>
|
|
35
|
-
<button type="button" class="btn btn-sm btn-block btn-default" ng-click="changeMinutes(false)">
|
|
36
|
-
<nice-icon icon="icon-chevron-down"></nice-icon>
|
|
37
|
-
</button>
|
|
38
|
-
</div>
|
|
39
|
-
</div>
|
|
40
|
-
</div>
|
|
41
|
-
</div>
|
|
42
|
-
|
|
43
|
-
<div class="nice-background" ng-click="close()" ng-if="open"></div>
|
|
1
|
+
<div class="nice-component nice-time-picker" ng-form="forma" ng-class="{ 'margin-bottom-0': noMargin, 'nice-component-inline': isInline }">
|
|
2
|
+
<div class="row">
|
|
3
|
+
<!------------------------- Title ------------------------->
|
|
4
|
+
<nice-title text="title" help="help" required="required" label-width="labelWidth"></nice-title>
|
|
5
|
+
|
|
6
|
+
<!------------------------- Field ------------------------->
|
|
7
|
+
<div class="nice-field col-xs-12" ng-class="fieldWidth ? fieldWidth : 'col-sm-8'">
|
|
8
|
+
<div class="input-group" ng-class="{
|
|
9
|
+
'has-warning': !isDisabled && forma.$invalid && forma.$dirty,
|
|
10
|
+
'disabled': isDisabled
|
|
11
|
+
}">
|
|
12
|
+
<input type="text" class="form-control" ng-model="modelString" ng-keyup="$event.keyCode == 13 && validateDate()" ng-blur="validateDate()">
|
|
13
|
+
<span class="input-group-btn">
|
|
14
|
+
<button type="button" class="btn btn-default btn-right" ng-click="open = !open">
|
|
15
|
+
<nice-icon icon="icon-clock"></nice-icon>
|
|
16
|
+
</button>
|
|
17
|
+
</span>
|
|
18
|
+
</div>
|
|
19
|
+
|
|
20
|
+
<div class="nice-time-picker-dropdown" ng-if="open">
|
|
21
|
+
<div>
|
|
22
|
+
<button type="button" class="btn btn-sm btn-block btn-default" ng-click="changeHour(true)">
|
|
23
|
+
<nice-icon icon="icon-chevron-up"></nice-icon>
|
|
24
|
+
</button>
|
|
25
|
+
<div class="numbers">{{ hours }}</div>
|
|
26
|
+
<button type="button" class="btn btn-sm btn-block btn-default" ng-click="changeHour(false)">
|
|
27
|
+
<nice-icon icon="icon-chevron-down"></nice-icon>
|
|
28
|
+
</button>
|
|
29
|
+
</div>
|
|
30
|
+
<div>
|
|
31
|
+
<button type="button" class="btn btn-sm btn-block btn-default" ng-click="changeMinutes(true)">
|
|
32
|
+
<nice-icon icon="icon-chevron-up"></nice-icon>
|
|
33
|
+
</button>
|
|
34
|
+
<div class="numbers">{{ minutes }}</div>
|
|
35
|
+
<button type="button" class="btn btn-sm btn-block btn-default" ng-click="changeMinutes(false)">
|
|
36
|
+
<nice-icon icon="icon-chevron-down"></nice-icon>
|
|
37
|
+
</button>
|
|
38
|
+
</div>
|
|
39
|
+
</div>
|
|
40
|
+
</div>
|
|
41
|
+
</div>
|
|
42
|
+
|
|
43
|
+
<div class="nice-background" ng-click="close()" ng-if="open"></div>
|
|
44
44
|
</div>
|
|
@@ -1,84 +1,84 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* @ngdoc directive
|
|
5
|
-
* @name niceElements.directive:niceTimePicker
|
|
6
|
-
* @description
|
|
7
|
-
* # niceTimePicker
|
|
8
|
-
*/
|
|
9
|
-
angular.module('niceElements')
|
|
10
|
-
.directive('niceTimePicker', function () {
|
|
11
|
-
return {
|
|
12
|
-
scope: {
|
|
13
|
-
model: '=',
|
|
14
|
-
title: '@',
|
|
15
|
-
isDisabled: '=',
|
|
16
|
-
noMargin: '@',
|
|
17
|
-
fieldWidth: '@',
|
|
18
|
-
labelWidth: '@',
|
|
19
|
-
onChange: '&?',
|
|
20
|
-
isInline: '=',
|
|
21
|
-
help: '@'
|
|
22
|
-
},
|
|
23
|
-
restrict: 'E',
|
|
24
|
-
templateUrl: 'src/components/nice-time-picker/nice-time-picker.html',
|
|
25
|
-
link: function ($scope, $element, $attrs) {
|
|
26
|
-
if (!$scope.model) $scope.model = moment();
|
|
27
|
-
$scope.open = false;
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
$scope.close = function () {
|
|
31
|
-
$scope.open = false;
|
|
32
|
-
};
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
$scope.validateDate = function () {
|
|
36
|
-
$scope.checkDate($scope.modelString);
|
|
37
|
-
};
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
$scope.checkDate = function (date) {
|
|
41
|
-
var parsedDate = moment(date, "HH:mm");
|
|
42
|
-
if (parsedDate.isValid()) {
|
|
43
|
-
if ($scope.forma) $scope.forma.$setValidity("valid-time", true);
|
|
44
|
-
$scope.model = parsedDate;
|
|
45
|
-
$scope.refreshTime();
|
|
46
|
-
if ($scope.onChange) $scope.onChange({ model: $scope.model });
|
|
47
|
-
} else {
|
|
48
|
-
if ($scope.forma) $scope.forma.$setValidity("valid-time", false);
|
|
49
|
-
$scope.modelString = "";
|
|
50
|
-
}
|
|
51
|
-
};
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
$scope.refreshTime = function () {
|
|
55
|
-
$scope.hours = $scope.model.format("HH");
|
|
56
|
-
$scope.minutes = $scope.model.format("mm");
|
|
57
|
-
$scope.modelString = $scope.model.format("HH:mm");
|
|
58
|
-
};
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
$scope.changeHour = function (add) {
|
|
62
|
-
if (add) $scope.model.add(1, 'hour');
|
|
63
|
-
else $scope.model.subtract(1, 'hour');
|
|
64
|
-
$scope.refreshTime();
|
|
65
|
-
$scope.forma.$setDirty();
|
|
66
|
-
};
|
|
67
|
-
|
|
68
|
-
$scope.changeMinutes = function (add) {
|
|
69
|
-
if (add) $scope.model.add(1, 'minutes');
|
|
70
|
-
else $scope.model.subtract(1, 'minutes');
|
|
71
|
-
$scope.refreshTime();
|
|
72
|
-
$scope.forma.$setDirty();
|
|
73
|
-
};
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
$scope.$watch("model", function (value, oldValue) {
|
|
77
|
-
$scope.refreshTime();
|
|
78
|
-
if (!value.isSame(oldValue)) {
|
|
79
|
-
$scope.checkDate(value);
|
|
80
|
-
}
|
|
81
|
-
})
|
|
82
|
-
}
|
|
83
|
-
};
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* @ngdoc directive
|
|
5
|
+
* @name niceElements.directive:niceTimePicker
|
|
6
|
+
* @description
|
|
7
|
+
* # niceTimePicker
|
|
8
|
+
*/
|
|
9
|
+
angular.module('niceElements')
|
|
10
|
+
.directive('niceTimePicker', function () {
|
|
11
|
+
return {
|
|
12
|
+
scope: {
|
|
13
|
+
model: '=',
|
|
14
|
+
title: '@',
|
|
15
|
+
isDisabled: '=',
|
|
16
|
+
noMargin: '@',
|
|
17
|
+
fieldWidth: '@',
|
|
18
|
+
labelWidth: '@',
|
|
19
|
+
onChange: '&?',
|
|
20
|
+
isInline: '=',
|
|
21
|
+
help: '@'
|
|
22
|
+
},
|
|
23
|
+
restrict: 'E',
|
|
24
|
+
templateUrl: 'src/components/nice-time-picker/nice-time-picker.html',
|
|
25
|
+
link: function ($scope, $element, $attrs) {
|
|
26
|
+
if (!$scope.model) $scope.model = moment();
|
|
27
|
+
$scope.open = false;
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
$scope.close = function () {
|
|
31
|
+
$scope.open = false;
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
$scope.validateDate = function () {
|
|
36
|
+
$scope.checkDate($scope.modelString);
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
$scope.checkDate = function (date) {
|
|
41
|
+
var parsedDate = moment(date, "HH:mm");
|
|
42
|
+
if (parsedDate.isValid()) {
|
|
43
|
+
if ($scope.forma) $scope.forma.$setValidity("valid-time", true);
|
|
44
|
+
$scope.model = parsedDate;
|
|
45
|
+
$scope.refreshTime();
|
|
46
|
+
if ($scope.onChange) $scope.onChange({ model: $scope.model });
|
|
47
|
+
} else {
|
|
48
|
+
if ($scope.forma) $scope.forma.$setValidity("valid-time", false);
|
|
49
|
+
$scope.modelString = "";
|
|
50
|
+
}
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
$scope.refreshTime = function () {
|
|
55
|
+
$scope.hours = $scope.model.format("HH");
|
|
56
|
+
$scope.minutes = $scope.model.format("mm");
|
|
57
|
+
$scope.modelString = $scope.model.format("HH:mm");
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
$scope.changeHour = function (add) {
|
|
62
|
+
if (add) $scope.model.add(1, 'hour');
|
|
63
|
+
else $scope.model.subtract(1, 'hour');
|
|
64
|
+
$scope.refreshTime();
|
|
65
|
+
$scope.forma.$setDirty();
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
$scope.changeMinutes = function (add) {
|
|
69
|
+
if (add) $scope.model.add(1, 'minutes');
|
|
70
|
+
else $scope.model.subtract(1, 'minutes');
|
|
71
|
+
$scope.refreshTime();
|
|
72
|
+
$scope.forma.$setDirty();
|
|
73
|
+
};
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
$scope.$watch("model", function (value, oldValue) {
|
|
77
|
+
$scope.refreshTime();
|
|
78
|
+
if (!value.isSame(oldValue)) {
|
|
79
|
+
$scope.checkDate(value);
|
|
80
|
+
}
|
|
81
|
+
})
|
|
82
|
+
}
|
|
83
|
+
};
|
|
84
84
|
});
|
|
@@ -1,38 +1,38 @@
|
|
|
1
|
-
.nice-time-picker {
|
|
2
|
-
position: relative;
|
|
3
|
-
|
|
4
|
-
.nice-time-picker-dropdown {
|
|
5
|
-
z-index: 900;
|
|
6
|
-
border-radius: $nice-border-radius;
|
|
7
|
-
position: absolute;
|
|
8
|
-
top: 100%;
|
|
9
|
-
left: 15px;
|
|
10
|
-
width: 130px;
|
|
11
|
-
background: white;
|
|
12
|
-
border: 1px solid $nice-border-color;
|
|
13
|
-
box-shadow: $nice-box-shadow;
|
|
14
|
-
padding: 10px;
|
|
15
|
-
margin-top: 0.5rem;
|
|
16
|
-
|
|
17
|
-
display: grid;
|
|
18
|
-
grid-template-columns: 1fr 1fr;
|
|
19
|
-
gap: 10px;
|
|
20
|
-
|
|
21
|
-
.numbers {
|
|
22
|
-
font-size: 1.5rem;
|
|
23
|
-
color: $nice-font-color;
|
|
24
|
-
line-height: 1;
|
|
25
|
-
text-align: center;
|
|
26
|
-
padding: 5px 0;
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
.nice-background {
|
|
31
|
-
position: fixed;
|
|
32
|
-
top: 0;
|
|
33
|
-
left: 0;
|
|
34
|
-
width: 100%;
|
|
35
|
-
z-index: 800;
|
|
36
|
-
height: 100%;
|
|
37
|
-
}
|
|
1
|
+
.nice-time-picker {
|
|
2
|
+
position: relative;
|
|
3
|
+
|
|
4
|
+
.nice-time-picker-dropdown {
|
|
5
|
+
z-index: 900;
|
|
6
|
+
border-radius: $nice-border-radius;
|
|
7
|
+
position: absolute;
|
|
8
|
+
top: 100%;
|
|
9
|
+
left: 15px;
|
|
10
|
+
width: 130px;
|
|
11
|
+
background: white;
|
|
12
|
+
border: 1px solid $nice-border-color;
|
|
13
|
+
box-shadow: $nice-box-shadow;
|
|
14
|
+
padding: 10px;
|
|
15
|
+
margin-top: 0.5rem;
|
|
16
|
+
|
|
17
|
+
display: grid;
|
|
18
|
+
grid-template-columns: 1fr 1fr;
|
|
19
|
+
gap: 10px;
|
|
20
|
+
|
|
21
|
+
.numbers {
|
|
22
|
+
font-size: 1.5rem;
|
|
23
|
+
color: $nice-font-color;
|
|
24
|
+
line-height: 1;
|
|
25
|
+
text-align: center;
|
|
26
|
+
padding: 5px 0;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.nice-background {
|
|
31
|
+
position: fixed;
|
|
32
|
+
top: 0;
|
|
33
|
+
left: 0;
|
|
34
|
+
width: 100%;
|
|
35
|
+
z-index: 800;
|
|
36
|
+
height: 100%;
|
|
37
|
+
}
|
|
38
38
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<div class="nice-title col-xs-12" ng-class="[labelWidth ? labelWidth : 'col-sm-4', {'nice-title-empty': !text && !help} ]" ng-if="text">
|
|
2
|
-
<div class="nice-title-text">{{ text }}<span class="nice-title-required" ng-if="required">*</span></div>
|
|
3
|
-
<nice-help class="nice-title-help" ng-if="help" text="{{ help }}"></nice-help>
|
|
1
|
+
<div class="nice-title col-xs-12" ng-class="[labelWidth ? labelWidth : 'col-sm-4', {'nice-title-empty': !text && !help} ]" ng-if="text">
|
|
2
|
+
<div class="nice-title-text">{{ text }}<span class="nice-title-required" ng-if="required">*</span></div>
|
|
3
|
+
<nice-help class="nice-title-help" ng-if="help" text="{{ help }}"></nice-help>
|
|
4
4
|
</div>
|
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* @ngdoc directive
|
|
5
|
-
* @name niceElements.directive:niceTitle
|
|
6
|
-
* @description
|
|
7
|
-
* # niceTitle
|
|
8
|
-
*/
|
|
9
|
-
angular.module('niceElements')
|
|
10
|
-
.directive('niceTitle', function () {
|
|
11
|
-
return {
|
|
12
|
-
templateUrl: 'src/components/nice-title/nice-title.html',
|
|
13
|
-
restrict: 'E',
|
|
14
|
-
scope: {
|
|
15
|
-
labelWidth: '=?',
|
|
16
|
-
text: '=?',
|
|
17
|
-
required: '=?',
|
|
18
|
-
help: '=?'
|
|
19
|
-
}
|
|
20
|
-
};
|
|
21
|
-
});
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* @ngdoc directive
|
|
5
|
+
* @name niceElements.directive:niceTitle
|
|
6
|
+
* @description
|
|
7
|
+
* # niceTitle
|
|
8
|
+
*/
|
|
9
|
+
angular.module('niceElements')
|
|
10
|
+
.directive('niceTitle', function () {
|
|
11
|
+
return {
|
|
12
|
+
templateUrl: 'src/components/nice-title/nice-title.html',
|
|
13
|
+
restrict: 'E',
|
|
14
|
+
scope: {
|
|
15
|
+
labelWidth: '=?',
|
|
16
|
+
text: '=?',
|
|
17
|
+
required: '=?',
|
|
18
|
+
help: '=?'
|
|
19
|
+
}
|
|
20
|
+
};
|
|
21
|
+
});
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
<div class="nice-toasts" ng-class="position">
|
|
2
|
-
<div class="nice-toast" ng-class="toast.type" ng-repeat="toast in toasts">{{ toast.message }}</div>
|
|
1
|
+
<div class="nice-toasts" ng-class="position">
|
|
2
|
+
<div class="nice-toast" ng-class="toast.type" ng-repeat="toast in toasts">{{ toast.message }}</div>
|
|
3
3
|
</div>
|