nice-elements 1.13.2 → 1.13.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +14 -0
- package/README.md +1 -1
- package/bower.json +1 -1
- package/dist/nice.js +313 -145
- package/dist/nice.min.js +1 -1
- package/dist/style.css +108 -74
- package/dist/style.css.map +1 -1
- package/dist/style.min.css +2 -2
- package/package.json +1 -1
- package/src/components/nice-alert/nice-alert.js +3 -2
- package/src/components/nice-calendar/nice-calendar.html +105 -12
- package/src/components/nice-calendar/nice-calendar.js +118 -47
- package/src/components/nice-calendar/nice-calendar.scss +137 -95
- package/src/components/nice-checkbox/nice-checkbox.html +1 -1
- package/src/components/nice-choice/nice-choice.html +1 -1
- package/src/components/nice-choice/nice-choice.js +1 -0
- package/src/components/nice-comment/nice-comment.html +1 -1
- package/src/components/nice-comment/nice-comment.js +1 -0
- package/src/components/nice-date/nice-date.html +18 -9
- package/src/components/nice-date/nice-date.js +67 -36
- package/src/components/nice-date/nice-date.scss +21 -27
- package/src/components/nice-date-input/nice-date-input.html +1 -1
- package/src/components/nice-date-input/nice-date-input.js +1 -0
- package/src/components/nice-date-range/nice-date-range.html +1 -1
- package/src/components/nice-date-range/nice-date-range.js +1 -0
- package/src/components/nice-datetime-picker/nice-datetime-picker.html +1 -1
- package/src/components/nice-datetime-picker/nice-datetime-picker.js +1 -0
- package/src/components/nice-datetimerange-picker/nice-datetimerange-picker.html +1 -1
- package/src/components/nice-datetimerange-picker/nice-datetimerange-picker.js +1 -0
- package/src/components/nice-datetimerange-picker-2/nice-datetimerange-picker-2.html +1 -1
- package/src/components/nice-datetimerange-picker-2/nice-datetimerange-picker-2.js +1 -0
- package/src/components/nice-dropdown/nice-dropdown.html +1 -1
- package/src/components/nice-dropdown/nice-dropdown.js +1 -0
- package/src/components/nice-dropdown-date/nice-dropdown-date.html +1 -1
- package/src/components/nice-dropdown-date/nice-dropdown-date.js +1 -0
- package/src/components/nice-dropdown-old/nice-dropdown-old.html +1 -1
- package/src/components/nice-dropdown-old/nice-dropdown-old.js +1 -0
- package/src/components/nice-dtp/nice-dtp.js +1 -0
- package/src/components/nice-input/nice-input.js +1 -1
- package/src/components/nice-label/nice-label.html +1 -1
- package/src/components/nice-label/nice-label.js +1 -0
- package/src/components/nice-number/nice-number.html +1 -1
- package/src/components/nice-number/nice-number.js +1 -0
- package/src/components/nice-options/nice-options.html +1 -1
- package/src/components/nice-options/nice-options.js +1 -0
- package/src/components/nice-percent/nice-percent.html +1 -1
- package/src/components/nice-percent/nice-percent.js +1 -0
- package/src/components/nice-progress-bar/nice-progress-bar.html +1 -1
- package/src/components/nice-progress-bar/nice-progress-bar.js +1 -0
- package/src/components/nice-quantity/nice-quantity.html +1 -1
- package/src/components/nice-quantity/nice-quantity.js +1 -0
- package/src/components/nice-search/nice-search.html +1 -1
- package/src/components/nice-search/nice-search.js +1 -0
- package/src/components/nice-search2/nice-search2.html +1 -1
- package/src/components/nice-search2/nice-search2.js +1 -0
- package/src/components/nice-slot/nice-slot.html +1 -1
- package/src/components/nice-slot/nice-slot.js +1 -0
- package/src/components/nice-time-picker/nice-time-picker.html +1 -1
- package/src/components/nice-time-picker/nice-time-picker.js +1 -0
- package/src/components/nice-toggle/nice-toggle.html +1 -1
- package/src/components/nice-upload/nice-upload.html +17 -3
- package/src/components/nice-upload/nice-upload.js +12 -6
- package/src/components/nice-wrapper/nice-wrapper.js +1 -0
- package/src/components/nice-yesno/nice-yesno.html +1 -1
- package/src/components/nice-yesno/nice-yesno.js +1 -0
- package/src/filters/nice-highlight.js +15 -6
- package/src/services/nice-service.js +1 -1
- package/src/styles/_nice-common.scss +11 -1
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
|
|
4
4
|
<div class="row">
|
|
5
5
|
<!------------------------- Title ------------------------->
|
|
6
|
-
<nice-title text="title || niceTitle" help="help" required="required" label-width="labelWidth"></nice-title>
|
|
6
|
+
<nice-title text="title || niceTitle" help="help" required="required" description="description" label-width="labelWidth"></nice-title>
|
|
7
7
|
|
|
8
8
|
<!------------------------- Field ------------------------->
|
|
9
9
|
<div class="nice-field col-xs-12" ng-class="[fieldWidth ? fieldWidth : 'col-sm-8', { 'nice-disabled': isDisabled }]">
|
|
@@ -26,6 +26,7 @@ angular.module('niceElements').directive('niceDatetimePicker', function () {
|
|
|
26
26
|
cancelText: '@',
|
|
27
27
|
shortTime: '@', // default: false,
|
|
28
28
|
niceTitle: '@',
|
|
29
|
+
description: '@?',
|
|
29
30
|
title: '@', // default: ''
|
|
30
31
|
noMargin: '@', // default: false, if noMargin==true then entire directive can be injected inside other divs
|
|
31
32
|
fieldWidth: '@', // default: 'col-sm-8', bootstrap classes that defines width of field
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
|
|
4
4
|
<div class="row">
|
|
5
5
|
<!------------------------- Title ------------------------->
|
|
6
|
-
<nice-title text="title || niceTitle" help="help" required="required" label-width="labelWidth"></nice-title>
|
|
6
|
+
<nice-title text="title || niceTitle" help="help" required="required" description="description" label-width="labelWidth"></nice-title>
|
|
7
7
|
|
|
8
8
|
<!------------------------- Field ------------------------->
|
|
9
9
|
<div class="nice-field col-xs-12" ng-class="[fieldWidth ? fieldWidth : 'col-sm-8', { 'nice-disabled': isDisabled }]">
|
|
@@ -26,6 +26,7 @@ angular.module('niceElements')
|
|
|
26
26
|
cancelText: '@',
|
|
27
27
|
shortTime: '@', // default: false,
|
|
28
28
|
niceTitle: '@',
|
|
29
|
+
description: '@?',
|
|
29
30
|
title: '@', // default: ''
|
|
30
31
|
noMargin: '@', // default: false, if noMargin==true then entire directive can be injected inside other divs
|
|
31
32
|
fieldWidth: '@', // default: 'col-sm-8', bootstrap classes that defines width of field
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
|
|
4
4
|
<div class="row">
|
|
5
5
|
<!------------------------- Title ------------------------->
|
|
6
|
-
<nice-title text="title || niceTitle" help="help" required="required" label-width="labelWidth"></nice-title>
|
|
6
|
+
<nice-title text="title || niceTitle" help="help" required="required" description="description" label-width="labelWidth"></nice-title>
|
|
7
7
|
|
|
8
8
|
<!------------------------- Field ------------------------->
|
|
9
9
|
<div class="nice-field col-xs-12" ng-class="[fieldWidth ? fieldWidth : 'col-sm-8', { 'nice-disabled': isDisabled }]">
|
|
@@ -18,6 +18,7 @@ angular.module('niceElements')
|
|
|
18
18
|
minDate: '@', // default: undefined
|
|
19
19
|
maxDate: '@', // default: undefined
|
|
20
20
|
niceTitle: '@',
|
|
21
|
+
description: '@?',
|
|
21
22
|
title: '@', // default: ''
|
|
22
23
|
noMargin: '@', // default: false, if noMargin==true then entire directive can be injected inside other divs
|
|
23
24
|
fieldWidth: '@', // default: 'col-sm-8', bootstrap classes that defines width of field
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<div class="nice-component nice-dropdown" ng-class="{ 'margin-bottom-0': noMargin, 'nice-component-inline': isInline }" ng-form="formDropdown">
|
|
2
2
|
<div class="row">
|
|
3
3
|
<!------------------------- Title ------------------------->
|
|
4
|
-
<nice-title text="title || niceTitle" help="help" required="required" label-width="labelWidth"></nice-title>
|
|
4
|
+
<nice-title text="title || niceTitle" help="help" required="required" description="description" label-width="labelWidth"></nice-title>
|
|
5
5
|
|
|
6
6
|
<!------------------------- Field ------------------------->
|
|
7
7
|
<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 }}">
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<div class="nice-component nice-dropdown-date" ng-form="dropdownDateForm" ng-class="{ 'margin-bottom-0': noMargin, 'nice-component-inline': isInline }">
|
|
2
2
|
<div class="row">
|
|
3
3
|
<!------------------------- Title ------------------------->
|
|
4
|
-
<nice-title text="title || niceTitle" help="help" required="required" label-width="labelWidth"></nice-title>
|
|
4
|
+
<nice-title text="title || niceTitle" help="help" required="required" description="description" label-width="labelWidth"></nice-title>
|
|
5
5
|
|
|
6
6
|
<!------------------------- Field ------------------------->
|
|
7
7
|
<div class="nice-field col-xs-12" ng-class="[
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<div class="nice-component nice-dropdown-old" ng-class="{ 'margin-bottom-0': noMargin, 'nice-component-inline': isInline }">
|
|
2
2
|
<div class="row">
|
|
3
3
|
<!------------------------- Title ------------------------->
|
|
4
|
-
<nice-title text="title || niceTitle" help="help" required="required" label-width="labelWidth"></nice-title>
|
|
4
|
+
<nice-title text="title || niceTitle" help="help" required="required" description="description" label-width="labelWidth"></nice-title>
|
|
5
5
|
|
|
6
6
|
<!------------------------- Field ------------------------->
|
|
7
7
|
<div class="nice-field col-xs-12" ng-class="fieldWidth ? fieldWidth : 'col-sm-8'">
|
|
@@ -29,6 +29,7 @@ angular.module('niceElements')
|
|
|
29
29
|
cancelText: '@',
|
|
30
30
|
shortTime: '@', // default: false,
|
|
31
31
|
niceTitle: '@',
|
|
32
|
+
description: '@?',
|
|
32
33
|
title: '@', // default: ''
|
|
33
34
|
noMargin: '@', // default: false, if noMargin==true then entire directive can be injected inside other divs
|
|
34
35
|
fieldWidth: '@', // default: 'col-sm-8', bootstrap classes that defines width of field
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<div class="nice-component nice-label" ng-class="{ 'margin-bottom-0' : noMargin, 'nice-component-inline': isInline }">
|
|
2
2
|
<div class="row">
|
|
3
3
|
<!------------------------- Title ------------------------->
|
|
4
|
-
<nice-title text="title || niceTitle" help="help" required="required" label-width="labelWidth"></nice-title>
|
|
4
|
+
<nice-title text="title || niceTitle" help="help" required="required" description="description" label-width="labelWidth"></nice-title>
|
|
5
5
|
|
|
6
6
|
<!------------------------- Field ------------------------->
|
|
7
7
|
<div class="nice-field col-xs-12" ng-class="fieldWidth ? fieldWidth : 'col-xs-8'">
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<div class="nice-component nice-number" ng-form="niceNumberForm" ng-class="{ 'margin-bottom-0' : noMargin, 'nice-component-inline': isInline }">
|
|
2
2
|
<div ng-class="{'row' : !disableRow}">
|
|
3
3
|
<!------------------------- Title ------------------------->
|
|
4
|
-
<nice-title text="title || niceTitle" help="help" required="required" label-width="labelWidth"></nice-title>
|
|
4
|
+
<nice-title text="title || niceTitle" help="help" required="required" description="description" label-width="labelWidth"></nice-title>
|
|
5
5
|
|
|
6
6
|
<!------------------------- Field ------------------------->
|
|
7
7
|
<div class="nice-field col-xs-12" ng-class="[fieldWidth ? fieldWidth : 'col-sm-8', { 'nice-disabled': isDisabled }]">
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<div class="nice-component nice-options" ng-class="{ 'margin-bottom-0' : noMargin, 'nice-component-inline': isInline, 'nice-disabled': isDisabled }" ng-form="formNiceOptions">
|
|
2
2
|
<div class="row">
|
|
3
3
|
<!------------------------- Title ------------------------->
|
|
4
|
-
<nice-title text="title || niceTitle" help="help" required="required" label-width="labelWidth"></nice-title>
|
|
4
|
+
<nice-title text="title || niceTitle" help="help" required="required" description="description" label-width="labelWidth"></nice-title>
|
|
5
5
|
|
|
6
6
|
<!------------------------- Field ------------------------->
|
|
7
7
|
<div class="nice-field col-xs-12" ng-class="[fieldWidth ? fieldWidth : 'col-sm-8']">
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<ng-form class="nice-component nice-input" ng-class="{ 'margin-bottom-0' : noMargin, 'nice-component-inline': isInline }" name="form">
|
|
2
2
|
<div class="row">
|
|
3
3
|
<!------------------------- Title ------------------------->
|
|
4
|
-
<nice-title text="title || niceTitle" help="help" required="required" label-width="labelWidth"></nice-title>
|
|
4
|
+
<nice-title text="title || niceTitle" help="help" required="required" description="description" label-width="labelWidth"></nice-title>
|
|
5
5
|
|
|
6
6
|
<!------------------------- Field ------------------------->
|
|
7
7
|
<div class="nice-field col-xs-12" ng-class="fieldWidth ? fieldWidth : 'col-sm-8'">
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<div class="nice-component nice-progress-bar" ng-class="{ 'margin-bottom-0': noMargin, 'nice-component-inline': isInline }">
|
|
2
2
|
<div class="row">
|
|
3
3
|
<!------------------------- Title ------------------------->
|
|
4
|
-
<nice-title text="title || niceTitle" help="help" required="required" label-width="labelWidth"></nice-title>
|
|
4
|
+
<nice-title text="title || niceTitle" help="help" required="required" description="description" label-width="labelWidth"></nice-title>
|
|
5
5
|
|
|
6
6
|
<!------------------------- Field ------------------------->
|
|
7
7
|
<div class="nice-field col-xs-12" ng-class="fieldWidth ? fieldWidth : 'col-sm-8'">
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<div class="nice-component nice-quantity" ng-class="{ 'margin-bottom-0': noMargin, 'nice-component-inline': isInline }">
|
|
2
2
|
<div class="row">
|
|
3
3
|
<!------------------------- Title ------------------------->
|
|
4
|
-
<nice-title text="title || niceTitle" help="help" required="required" label-width="labelWidth"></nice-title>
|
|
4
|
+
<nice-title text="title || niceTitle" help="help" required="required" description="description" label-width="labelWidth"></nice-title>
|
|
5
5
|
|
|
6
6
|
<!------------------------- Field ------------------------->
|
|
7
7
|
<div class="nice-field col-xs-12" ng-class="[fieldWidth ? fieldWidth : 'col-sm-8', { 'nice-disabled': isDisabled }]">
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<ng-form class="nice-component nice-input nice-search" ng-class="{ 'margin-bottom-0': noMargin, 'nice-component-inline': isInline}" name="form">
|
|
2
2
|
<div class="row">
|
|
3
3
|
<!------------------------- Title ------------------------->
|
|
4
|
-
<nice-title text="title || niceTitle" help="help" required="required" label-width="labelWidth"></nice-title>
|
|
4
|
+
<nice-title text="title || niceTitle" help="help" required="required" description="description" label-width="labelWidth"></nice-title>
|
|
5
5
|
|
|
6
6
|
<!------------------------- Field ------------------------->
|
|
7
7
|
<div class="nice-field col-xs-12" ng-class="[fieldWidth ? fieldWidth : 'col-sm-8', { 'nice-disabled': isDisabled }]">
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<ng-form class="nice-component nice-input nice-search2" ng-class="{ 'margin-bottom-0' : noMargin, 'nice-component-inline': isInline }" name="form">
|
|
2
2
|
<div class="row">
|
|
3
3
|
<!------------------------- Title ------------------------->
|
|
4
|
-
<nice-title text="title || niceTitle" help="help" required="required" label-width="labelWidth"></nice-title>
|
|
4
|
+
<nice-title text="title || niceTitle" help="help" required="required" description="description" label-width="labelWidth"></nice-title>
|
|
5
5
|
|
|
6
6
|
<!------------------------- Field ------------------------->
|
|
7
7
|
<div class="nice-field col-xs-12" ng-class="[fieldWidth ? fieldWidth : 'col-sm-8', { 'nice-disabled': isDisabled }]" click-outside="close()">
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<div class="nice-component nice-slot" ng-class="{ 'margin-bottom-0' : noMargin, 'nice-component-inline': isInline }">
|
|
2
2
|
<div class="row">
|
|
3
3
|
<!------------------------- Title ------------------------->
|
|
4
|
-
<nice-title text="title || niceTitle" help="help" required="required" label-width="labelWidth"></nice-title>
|
|
4
|
+
<nice-title text="title || niceTitle" help="help" required="required" description="description" label-width="labelWidth"></nice-title>
|
|
5
5
|
|
|
6
6
|
<!------------------------- Field ------------------------->
|
|
7
7
|
<div class="nice-field col-xs-12" ng-class="fieldWidth ? fieldWidth : 'col-xs-8'">
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<div class="nice-component nice-time-picker" ng-form="forma" ng-class="{ 'margin-bottom-0': noMargin, 'nice-component-inline': isInline }">
|
|
2
2
|
<div class="row">
|
|
3
3
|
<!------------------------- Title ------------------------->
|
|
4
|
-
<nice-title text="title || niceTitle" help="help" required="required" label-width="labelWidth"></nice-title>
|
|
4
|
+
<nice-title text="title || niceTitle" help="help" required="required" description="description" label-width="labelWidth"></nice-title>
|
|
5
5
|
|
|
6
6
|
<!------------------------- Field ------------------------->
|
|
7
7
|
<div class="nice-field col-xs-12" ng-class="fieldWidth ? fieldWidth : 'col-sm-8'">
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<div class="nice-component nice-toggle" ng-class="{ 'margin-bottom-0': noMargin, 'title-right': titleRight, 'nice-component-inline': isInline, 'nice-component-block': isBlock, 'active': inverted ? !model : model }" ng-form="formToggle">
|
|
2
2
|
<div class="row">
|
|
3
3
|
<!------------------------- Title ------------------------->
|
|
4
|
-
<nice-title text="title || niceTitle" help="help" required="required" description="description" label-width="labelWidth"></nice-title>
|
|
4
|
+
<nice-title text="title || niceTitle" help="help" required="required" description="description" description="description" label-width="labelWidth"></nice-title>
|
|
5
5
|
|
|
6
6
|
<!------------------------- Field ------------------------->
|
|
7
7
|
<div class="nice-field col-xs-12" ng-class="[fieldWidth ? fieldWidth : 'col-sm-8', { 'nice-disabled': isDisabled }]">
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
<ng-form class="nice-component nice-upload" ng-class="{ 'margin-bottom-0' : noMargin, 'nice-component-inline': isInline }" name="form">
|
|
2
2
|
<div class="row">
|
|
3
3
|
<!------------------------- Title ------------------------->
|
|
4
|
-
<nice-title text="title || niceTitle" help="help" required="required" label-width="labelWidth"></nice-title>
|
|
4
|
+
<nice-title text="title || niceTitle" help="help" required="required" description="description" label-width="labelWidth"></nice-title>
|
|
5
5
|
|
|
6
6
|
<!------------------------- Field ------------------------->
|
|
7
7
|
<div class="nice-field col-xs-12" ng-class="[fieldWidth ? fieldWidth : 'col-sm-8', { 'nice-disabled': isDisabled }]">
|
|
8
8
|
<div class="nice-upload-area">
|
|
9
|
+
<!-- Input area texts -->
|
|
9
10
|
<div class="input-area" ng-class="{ 'dragging': dragging || draggingGlobal }">
|
|
10
11
|
<div class="middle-text" ng-if="!imageSource && !loading">
|
|
11
12
|
<nice-icon icon="icon-upload"></nice-icon>
|
|
@@ -17,10 +18,23 @@
|
|
|
17
18
|
<img data-ng-src="{{ imageSource }}" />
|
|
18
19
|
</div>
|
|
19
20
|
</div>
|
|
20
|
-
|
|
21
|
+
|
|
22
|
+
<!-- Clear button -->
|
|
23
|
+
<button type="button" ng-click="clear()" ng-if="imageSource && !loading && showClear" class="btn btn-primary nice-upload-clear-button">
|
|
21
24
|
<nice-icon icon="icon-x"></nice-icon>
|
|
22
25
|
</button>
|
|
23
|
-
|
|
26
|
+
|
|
27
|
+
<!-- Input file -->
|
|
28
|
+
<input
|
|
29
|
+
class="input-file"
|
|
30
|
+
type="file"
|
|
31
|
+
accept="{{ accept }}"
|
|
32
|
+
ng-model="file"
|
|
33
|
+
ng-required="required"
|
|
34
|
+
ng-disabled="isDisabled || loading"
|
|
35
|
+
/>
|
|
36
|
+
|
|
37
|
+
<!-- Loading -->
|
|
24
38
|
<nice-loader fulldiv="true" ng-if="loading"></nice-loader>
|
|
25
39
|
</div>
|
|
26
40
|
</div>
|
|
@@ -16,6 +16,7 @@ angular.module('niceElements')
|
|
|
16
16
|
scope: {
|
|
17
17
|
model: '=',
|
|
18
18
|
niceTitle: '@',
|
|
19
|
+
description: '@?',
|
|
19
20
|
title: '@',
|
|
20
21
|
text: '@',
|
|
21
22
|
fieldWidth: '@',
|
|
@@ -28,7 +29,7 @@ angular.module('niceElements')
|
|
|
28
29
|
callbackUrl: '=',
|
|
29
30
|
isDisabled: '=',
|
|
30
31
|
isInline: '=',
|
|
31
|
-
|
|
32
|
+
showClear: '=',
|
|
32
33
|
help: '@',
|
|
33
34
|
maxFileSize: '@',
|
|
34
35
|
required: '=',
|
|
@@ -46,6 +47,7 @@ angular.module('niceElements')
|
|
|
46
47
|
scope.endDragging = function () { $timeout(function () { scope.dragging = false; }); };
|
|
47
48
|
scope.startDraggingGlobal = function () { $timeout(function () { scope.draggingGlobal = true; }); };
|
|
48
49
|
scope.endDraggingGlobal = function () { $timeout(function () { scope.dragging = false; scope.draggingGlobal = false; }); };
|
|
50
|
+
scope.file = null;
|
|
49
51
|
|
|
50
52
|
scope.dragging = false;
|
|
51
53
|
scope.draggingGlobal = false;
|
|
@@ -149,8 +151,8 @@ angular.module('niceElements')
|
|
|
149
151
|
});
|
|
150
152
|
},
|
|
151
153
|
|
|
152
|
-
controller: function ($scope) {
|
|
153
|
-
$scope.$watch("model", function (
|
|
154
|
+
controller: function ($scope, $element) {
|
|
155
|
+
$scope.$watch("model", function () {
|
|
154
156
|
$scope.imageSource = angular.copy($scope.model);
|
|
155
157
|
});
|
|
156
158
|
|
|
@@ -158,10 +160,14 @@ angular.module('niceElements')
|
|
|
158
160
|
$scope.model = null;
|
|
159
161
|
$scope.imageSource = null;
|
|
160
162
|
$scope.form.$setDirty();
|
|
163
|
+
const inputElement = $element[0].querySelector(".input-file");
|
|
164
|
+
if (inputElement) inputElement.value = null;
|
|
165
|
+
|
|
161
166
|
$scope.text = gettextCatalog.getString('Click to upload file', null, 'Nice');
|
|
162
|
-
if ($scope.callbackFunction) $scope.callbackFunction(
|
|
163
|
-
if ($scope.callbackFile) $scope.callbackFile(
|
|
164
|
-
if ($scope.callbackUrl) $scope.callbackUrl(
|
|
167
|
+
if ($scope.callbackFunction) $scope.callbackFunction();
|
|
168
|
+
if ($scope.callbackFile) $scope.callbackFile();
|
|
169
|
+
if ($scope.callbackUrl) $scope.callbackUrl();
|
|
170
|
+
if ($scope.uploadFunction) $scope.uploadFunction();
|
|
165
171
|
};
|
|
166
172
|
}
|
|
167
173
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<div class="nice-component nice-yesno" ng-class="{ 'margin-bottom-0' : noMargin, 'nice-component-inline': isInline }" ng-form="formYesno">
|
|
2
2
|
<div class="row">
|
|
3
3
|
<!------------------------- Title ------------------------->
|
|
4
|
-
<nice-title text="title || niceTitle" help="help" required="required" label-width="labelWidth"></nice-title>
|
|
4
|
+
<nice-title text="title || niceTitle" help="help" required="required" description="description" label-width="labelWidth"></nice-title>
|
|
5
5
|
|
|
6
6
|
<!------------------------- Field ------------------------->
|
|
7
7
|
<div class="nice-field col-xs-12" ng-class="[fieldWidth ? fieldWidth : 'col-sm-8', { 'nice-disabled': isDisabled }]">
|
|
@@ -6,12 +6,21 @@
|
|
|
6
6
|
* # niceHighlight
|
|
7
7
|
* Filter in the niceElements.
|
|
8
8
|
*/
|
|
9
|
-
angular.module('niceElements').filter('niceHighlight', function () {
|
|
10
|
-
return function (
|
|
11
|
-
if (!
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
9
|
+
angular.module('niceElements').filter('niceHighlight', function ($sanitize, $sce) {
|
|
10
|
+
return function (text, phrase) {
|
|
11
|
+
if (!phrase || !text) return text;
|
|
12
|
+
|
|
13
|
+
// 1. Sanitize the original text to prevent XSS
|
|
14
|
+
let cleanText = $sanitize(text);
|
|
15
|
+
|
|
16
|
+
// 2. Create the case-insensitive global Regex
|
|
17
|
+
const regex = new RegExp('(' + phrase + ')', 'gi');
|
|
18
|
+
|
|
19
|
+
// 3. Replace matches with the h element
|
|
20
|
+
const highlighted = cleanText.replace(regex, '<h>$1</h>');
|
|
21
|
+
|
|
22
|
+
// 4. Trust the result so ng-bind-html renders it
|
|
23
|
+
return $sce.trustAsHtml(highlighted);
|
|
15
24
|
};
|
|
16
25
|
});
|
|
17
26
|
|
|
@@ -129,6 +129,7 @@ label.nice {
|
|
|
129
129
|
}
|
|
130
130
|
|
|
131
131
|
.nice-title-description {
|
|
132
|
+
text-align: right;
|
|
132
133
|
font-size: 0.8em;
|
|
133
134
|
font-style: italic;
|
|
134
135
|
opacity: 0.8;
|
|
@@ -156,6 +157,11 @@ label.nice {
|
|
|
156
157
|
.nice-title-text {
|
|
157
158
|
text-align: left;
|
|
158
159
|
}
|
|
160
|
+
|
|
161
|
+
.nice-title-description {
|
|
162
|
+
margin-top: -3px;
|
|
163
|
+
text-align: left;
|
|
164
|
+
}
|
|
159
165
|
}
|
|
160
166
|
}
|
|
161
167
|
|
|
@@ -230,8 +236,12 @@ label.nice {
|
|
|
230
236
|
width: 100%;
|
|
231
237
|
min-height: auto;
|
|
232
238
|
margin-bottom: 3px;
|
|
233
|
-
}
|
|
234
239
|
|
|
240
|
+
.nice-title-description {
|
|
241
|
+
text-align: left;
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
|
|
235
245
|
.nice-field {
|
|
236
246
|
width: 100%;
|
|
237
247
|
}
|