nice-elements 1.7.2 → 1.7.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 +6 -5
- package/bower.json +1 -1
- package/dist/nice.js +228 -257
- package/dist/nice.min.js +1 -1
- package/dist/style.css +26 -11
- package/dist/style.css.map +1 -1
- package/dist/style.min.css +2 -2
- package/package.json +1 -1
- package/src/components/nice-calendar/nice-calendar.html +9 -12
- package/src/components/nice-choice/nice-choice.html +3 -6
- package/src/components/nice-comment/nice-comment.html +5 -15
- package/src/components/nice-comment/nice-comment.js +7 -6
- package/src/components/nice-comment/nice-comment.scss +13 -9
- package/src/components/nice-date/nice-date.html +11 -14
- package/src/components/nice-date-input/nice-date-input.html +2 -5
- package/src/components/nice-date-range/nice-date-range.html +2 -5
- package/src/components/nice-datetime-picker/nice-datetime-picker.html +2 -5
- package/src/components/nice-datetime-picker/nice-datetime-picker.js +42 -41
- package/src/components/nice-datetimerange-picker/nice-datetimerange-picker.html +3 -8
- package/src/components/nice-datetimerange-picker/nice-datetimerange-picker.js +19 -18
- package/src/components/nice-datetimerange-picker-2/nice-datetimerange-picker-2.html +3 -6
- package/src/components/nice-datetimerange-picker-2/nice-datetimerange-picker-2.js +1 -1
- package/src/components/nice-dropdown/nice-dropdown.html +2 -6
- package/src/components/nice-dropdown/nice-dropdown.js +1 -2
- package/src/components/nice-dropdown/nice-dropdown.scss +3 -2
- package/src/components/nice-dropdown-date/nice-dropdown-date.html +7 -33
- package/src/components/nice-dropdown-date/nice-dropdown-date.scss +15 -15
- package/src/components/nice-dropdown-old/nice-dropdown-old.html +3 -13
- package/src/components/nice-dropdown-old/nice-dropdown-old.js +1 -1
- package/src/components/nice-help/nice-help.html +0 -1
- package/src/components/nice-help/nice-help.js +1 -0
- package/src/components/nice-icon/nice-icon.html +1 -1
- package/src/components/nice-icon/nice-icon.js +1 -0
- package/src/components/nice-input/nice-input.html +6 -6
- package/src/components/nice-input/nice-input.js +6 -0
- package/src/components/nice-label/nice-label.html +3 -6
- package/src/components/nice-number/nice-number.html +7 -10
- package/src/components/nice-number/nice-number.js +11 -11
- package/src/components/nice-percent/nice-percent.html +5 -22
- package/src/components/nice-percent/nice-percent.js +12 -12
- package/src/components/nice-progress-bar/nice-progress-bar.html +2 -5
- package/src/components/nice-quantity/nice-quantity.html +2 -5
- package/src/components/nice-search/nice-search.html +2 -5
- package/src/components/nice-search/nice-search.js +32 -32
- package/src/components/nice-search2/nice-search2.html +2 -5
- package/src/components/nice-slot/nice-slot.html +3 -6
- package/src/components/nice-slot/nice-slot.js +1 -1
- package/src/components/nice-time-picker/nice-time-picker.html +2 -5
- package/src/components/nice-title/nice-title.html +4 -0
- package/src/components/nice-title/nice-title.js +21 -0
- package/src/components/nice-upload/nice-upload.html +2 -5
- package/src/components/nice-yesno/nice-yesno.html +5 -8
- package/src/styles/_nice-common.scss +12 -1
- package/.sass-cache/1d4d0ffb237c3d9343c8307bb3646a3468e01635/_nice-time-picker.scssc +0 -0
- package/.sass-cache/1d4d0ffb237c3d9343c8307bb3646a3468e01635/nice-time-picker.scssc +0 -0
- package/.sass-cache/1f6e4ee3597ab85647886bc9c4e8109aa78717f7/_nice-comment.scssc +0 -0
- package/.sass-cache/1f6e4ee3597ab85647886bc9c4e8109aa78717f7/nice-comment.scssc +0 -0
- package/.sass-cache/1fa02acb98a7cebbbaaccd8ef62dedeb80075746/nice-quantity.scssc +0 -0
- package/.sass-cache/1fa94ee530c99ae186c7bd3283815b253c159498/_nice-date-range.scssc +0 -0
- package/.sass-cache/1fa94ee530c99ae186c7bd3283815b253c159498/nice-date-range.scssc +0 -0
- package/.sass-cache/2406fb0232b759324e272b7c77657baf27c90e42/_nice-button.scssc +0 -0
- package/.sass-cache/2406fb0232b759324e272b7c77657baf27c90e42/nice-button.scssc +0 -0
- package/.sass-cache/31b728a8c63158f4e90f2433807d8683ba9c2c31/_nice-steps.scssc +0 -0
- package/.sass-cache/31b728a8c63158f4e90f2433807d8683ba9c2c31/nice-steps.scssc +0 -0
- package/.sass-cache/37204b4bf5d558273e6880c7a4e167f7861ab03f/_nice-input.scssc +0 -0
- package/.sass-cache/37204b4bf5d558273e6880c7a4e167f7861ab03f/nice-input.scssc +0 -0
- package/.sass-cache/431ac0ca4bdfd08ba071d03a2ca7da0d436b3b83/_nice-calendar.scssc +0 -0
- package/.sass-cache/431ac0ca4bdfd08ba071d03a2ca7da0d436b3b83/nice-calendar.scssc +0 -0
- package/.sass-cache/459f898bda19afea4cd8d91d5c10187053da875e/_nice-notification.scssc +0 -0
- package/.sass-cache/459f898bda19afea4cd8d91d5c10187053da875e/nice-notification.scssc +0 -0
- package/.sass-cache/4930ed1ec4125e07b44755f9054b0955c5d670c1/_nice-datetimerange-picker.scssc +0 -0
- package/.sass-cache/4930ed1ec4125e07b44755f9054b0955c5d670c1/nice-datetimerange-picker.scssc +0 -0
- package/.sass-cache/50821918d2051e6c5077819410ba21c223fa5436/_nice-yesno.scssc +0 -0
- package/.sass-cache/50821918d2051e6c5077819410ba21c223fa5436/nice-yesno.scssc +0 -0
- package/.sass-cache/52335f6e13d042b07835d519f4267df952f94036/nice-dropdown-old.scssc +0 -0
- package/.sass-cache/52f492b94dd9f4468e58d8aa11ba26ac9cdcbbcf/nice-progress-bar.scssc +0 -0
- package/.sass-cache/6629f6f7b13f350c585c990e5699145891af0805/nice-help.scssc +0 -0
- package/.sass-cache/6dfd23eda68e4cff55e32e19d3bc5f0e6095bda9/nice-search2.scssc +0 -0
- package/.sass-cache/7870950c279970f0acdfb180a33c0d63a93fc5b0/nice-upload.scssc +0 -0
- package/.sass-cache/8262cded9a15ef6944463029ea13840a5c6a0a1c/_nice-button-toggle.scssc +0 -0
- package/.sass-cache/8262cded9a15ef6944463029ea13840a5c6a0a1c/nice-button-toggle.scssc +0 -0
- package/.sass-cache/857ba4c3c78aaab6e58c5b00a12da6c65d66676d/_bootstrap-variables.scssc +0 -0
- package/.sass-cache/857ba4c3c78aaab6e58c5b00a12da6c65d66676d/_nice-common.scssc +0 -0
- package/.sass-cache/857ba4c3c78aaab6e58c5b00a12da6c65d66676d/_nice.scssc +0 -0
- package/.sass-cache/857ba4c3c78aaab6e58c5b00a12da6c65d66676d/_variables.scssc +0 -0
- package/.sass-cache/857ba4c3c78aaab6e58c5b00a12da6c65d66676d/main.scssc +0 -0
- package/.sass-cache/857ba4c3c78aaab6e58c5b00a12da6c65d66676d/mian.scssc +0 -0
- package/.sass-cache/857ba4c3c78aaab6e58c5b00a12da6c65d66676d/style.scssc +0 -0
- package/.sass-cache/986d90a9d8ae3a4a5aa6f15810cce470ee21c1e4/_nice-date.scssc +0 -0
- package/.sass-cache/986d90a9d8ae3a4a5aa6f15810cce470ee21c1e4/nice-date.scssc +0 -0
- package/.sass-cache/9d06f237d2d27ccd53e7f33d4b297c0d8eb0b63f/_nice-number.scssc +0 -0
- package/.sass-cache/9d06f237d2d27ccd53e7f33d4b297c0d8eb0b63f/nice-number.scssc +0 -0
- package/.sass-cache/a03093fb7751330f3265c5ea28ca531de7f3d934/_nice-checkbox.scssc +0 -0
- package/.sass-cache/a03093fb7751330f3265c5ea28ca531de7f3d934/nice-checkbox.scssc +0 -0
- package/.sass-cache/a1b06abbd8698084475db896d8ff4a7f1265c271/_nice-dropdown-date.scssc +0 -0
- package/.sass-cache/a1b06abbd8698084475db896d8ff4a7f1265c271/nice-dropdown-date.scssc +0 -0
- package/.sass-cache/b19ce123b04f298b9f73064dd4bb3769bb7dac52/_nice-choice.scssc +0 -0
- package/.sass-cache/b19ce123b04f298b9f73064dd4bb3769bb7dac52/nice-choice.scssc +0 -0
- package/.sass-cache/ca90f8692023a08ca2b41d94fdfed54ba626bd71/_nice-datetimerange-picker-2.scssc +0 -0
- package/.sass-cache/ca90f8692023a08ca2b41d94fdfed54ba626bd71/nice-datetimerange-picker-2.scssc +0 -0
- package/.sass-cache/cecda35f57530d4aeece9f6e4b62149aefebc5d0/_mixins.scssc +0 -0
- package/.sass-cache/cecda35f57530d4aeece9f6e4b62149aefebc5d0/_variables.scssc +0 -0
- package/.sass-cache/d6e688001eb343b628b15651efd3d3f216ea3904/_nice-loader.scssc +0 -0
- package/.sass-cache/d6e688001eb343b628b15651efd3d3f216ea3904/nice-loader.scssc +0 -0
- package/.sass-cache/ea51e3b8d20bcedb108131c0024346d6e689f0ac/_alerts.scssc +0 -0
- package/.sass-cache/ea51e3b8d20bcedb108131c0024346d6e689f0ac/_background-variant.scssc +0 -0
- package/.sass-cache/ea51e3b8d20bcedb108131c0024346d6e689f0ac/_border-radius.scssc +0 -0
- package/.sass-cache/ea51e3b8d20bcedb108131c0024346d6e689f0ac/_buttons.scssc +0 -0
- package/.sass-cache/ea51e3b8d20bcedb108131c0024346d6e689f0ac/_center-block.scssc +0 -0
- package/.sass-cache/ea51e3b8d20bcedb108131c0024346d6e689f0ac/_clearfix.scssc +0 -0
- package/.sass-cache/ea51e3b8d20bcedb108131c0024346d6e689f0ac/_forms.scssc +0 -0
- package/.sass-cache/ea51e3b8d20bcedb108131c0024346d6e689f0ac/_gradients.scssc +0 -0
- package/.sass-cache/ea51e3b8d20bcedb108131c0024346d6e689f0ac/_grid-framework.scssc +0 -0
- package/.sass-cache/ea51e3b8d20bcedb108131c0024346d6e689f0ac/_grid.scssc +0 -0
- package/.sass-cache/ea51e3b8d20bcedb108131c0024346d6e689f0ac/_hide-text.scssc +0 -0
- package/.sass-cache/ea51e3b8d20bcedb108131c0024346d6e689f0ac/_image.scssc +0 -0
- package/.sass-cache/ea51e3b8d20bcedb108131c0024346d6e689f0ac/_labels.scssc +0 -0
- package/.sass-cache/ea51e3b8d20bcedb108131c0024346d6e689f0ac/_list-group.scssc +0 -0
- package/.sass-cache/ea51e3b8d20bcedb108131c0024346d6e689f0ac/_nav-divider.scssc +0 -0
- package/.sass-cache/ea51e3b8d20bcedb108131c0024346d6e689f0ac/_nav-vertical-align.scssc +0 -0
- package/.sass-cache/ea51e3b8d20bcedb108131c0024346d6e689f0ac/_opacity.scssc +0 -0
- package/.sass-cache/ea51e3b8d20bcedb108131c0024346d6e689f0ac/_pagination.scssc +0 -0
- package/.sass-cache/ea51e3b8d20bcedb108131c0024346d6e689f0ac/_panels.scssc +0 -0
- package/.sass-cache/ea51e3b8d20bcedb108131c0024346d6e689f0ac/_progress-bar.scssc +0 -0
- package/.sass-cache/ea51e3b8d20bcedb108131c0024346d6e689f0ac/_reset-filter.scssc +0 -0
- package/.sass-cache/ea51e3b8d20bcedb108131c0024346d6e689f0ac/_reset-text.scssc +0 -0
- package/.sass-cache/ea51e3b8d20bcedb108131c0024346d6e689f0ac/_resize.scssc +0 -0
- package/.sass-cache/ea51e3b8d20bcedb108131c0024346d6e689f0ac/_responsive-visibility.scssc +0 -0
- package/.sass-cache/ea51e3b8d20bcedb108131c0024346d6e689f0ac/_size.scssc +0 -0
- package/.sass-cache/ea51e3b8d20bcedb108131c0024346d6e689f0ac/_tab-focus.scssc +0 -0
- package/.sass-cache/ea51e3b8d20bcedb108131c0024346d6e689f0ac/_table-row.scssc +0 -0
- package/.sass-cache/ea51e3b8d20bcedb108131c0024346d6e689f0ac/_text-emphasis.scssc +0 -0
- package/.sass-cache/ea51e3b8d20bcedb108131c0024346d6e689f0ac/_text-overflow.scssc +0 -0
- package/.sass-cache/ea51e3b8d20bcedb108131c0024346d6e689f0ac/_vendor-prefixes.scssc +0 -0
- package/.sass-cache/f490af71b12507baba9bcbb0dd054fe1ecf75736/_nice-datetime-picker.scssc +0 -0
- package/.sass-cache/f490af71b12507baba9bcbb0dd054fe1ecf75736/nice-datetime-picker.scssc +0 -0
- package/.sass-cache/f5acd1dc0d835dc1887b3ac8ec2eecf82b650935/_nice-search.scssc +0 -0
- package/.sass-cache/f5acd1dc0d835dc1887b3ac8ec2eecf82b650935/nice-search.scssc +0 -0
- package/.sass-cache/fd9f4f9e07e96510c3ea7c8543d71e342ea61d29/_nice-dropdown.scssc +0 -0
- package/.sass-cache/fd9f4f9e07e96510c3ea7c8543d71e342ea61d29/nice-dropdown.scssc +0 -0
|
@@ -1,23 +1,13 @@
|
|
|
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
|
-
<!-------------------------
|
|
4
|
-
<
|
|
5
|
-
<div class="nice-title-text">{{ title }}<span ng-if="required">*</span></div>
|
|
6
|
-
<nice-help class="nice-title-help" ng-if="help" text="{{ help }}"></nice-help>
|
|
7
|
-
</div>
|
|
3
|
+
<!------------------------- Title ------------------------->
|
|
4
|
+
<nice-title title="title" help="help" required="required" label-width="labelWidth"></nice-title>
|
|
8
5
|
|
|
9
6
|
<!------------------------- Field ------------------------->
|
|
10
7
|
<div class="nice-field col-xs-12" ng-class="fieldWidth ? fieldWidth : 'col-sm-8'">
|
|
11
8
|
<div ng-class="addButtonEnable && !isDisabled ? 'input-group': ''">
|
|
12
9
|
<div class="btn-group" dropdown is-open="status.isopen" ng-class="{ 'disabled': isDisabled || emptyList }">
|
|
13
|
-
<button
|
|
14
|
-
type="button"
|
|
15
|
-
class="btn btn-block btn-dropdown dropdown-toggle"
|
|
16
|
-
title="{{ getLabel(internalSelected) }}"
|
|
17
|
-
dropdown-toggle
|
|
18
|
-
ng-disabled="isDisabled || emptyList"
|
|
19
|
-
>
|
|
20
|
-
|
|
10
|
+
<button type="button" class="btn btn-block btn-dropdown dropdown-toggle" title="{{ getLabel(internalSelected) }}" dropdown-toggle ng-disabled="isDisabled || emptyList">
|
|
21
11
|
<span ng-if="internalSelected.color_hex_code" class="dropdown-color" ng-style="{'background': internalSelected.color_hex_code}"></span>
|
|
22
12
|
<span ng-if="!multiple">{{ getLabel(internalSelected) }}</span>
|
|
23
13
|
|
|
@@ -25,7 +25,7 @@ angular.module('niceElements')
|
|
|
25
25
|
objKey: '@?', // Optional - default is 'id'. Used only when returnOnlyKey=true
|
|
26
26
|
selectedIsObj: '@', // Optional parameter.
|
|
27
27
|
nullable: '@', // No selection is possible
|
|
28
|
-
required: '
|
|
28
|
+
required: '=', // Model cannot be NULL
|
|
29
29
|
showTax: '@', // Shows tax rate
|
|
30
30
|
noMargin: '@', // margin-bottom: 0px
|
|
31
31
|
multiple: '@', // Can select multiple items
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
<div class="nice-help" ng-mouseover="onHover()">
|
|
2
|
-
<!-- <i class="fa fa-question-circle nice-help-button" aria-label=""></i> -->
|
|
3
2
|
<nice-icon icon="icon-help-circle" class="nice-help-button"></nice-icon>
|
|
4
3
|
<div class="nice-help-popup">
|
|
5
4
|
<span ng-bind-html="text">{{ text }}</span>
|
|
@@ -1,10 +1,7 @@
|
|
|
1
1
|
<ng-form class="nice-component nice-input" ng-class="{ 'margin-bottom-0' : noMargin, 'nice-component-inline': isInline }" name="forma">
|
|
2
2
|
<div class="row">
|
|
3
|
-
<!-------------------------
|
|
4
|
-
<
|
|
5
|
-
<div class="nice-title-text">{{ title }}<span ng-if="required">*</span></div>
|
|
6
|
-
<nice-help class="nice-title-help" ng-if="help" text="{{ help }}"></nice-help>
|
|
7
|
-
</div>
|
|
3
|
+
<!------------------------- Title ------------------------->
|
|
4
|
+
<nice-title title="title" help="help" required="required" label-width="labelWidth"></nice-title>
|
|
8
5
|
|
|
9
6
|
<!------------------------- Field ------------------------->
|
|
10
7
|
<div class="nice-field col-xs-12" ng-class="fieldWidth ? fieldWidth : 'col-sm-8'">
|
|
@@ -26,7 +23,10 @@
|
|
|
26
23
|
|
|
27
24
|
<div ng-if="forma.$error && forma.$dirty">
|
|
28
25
|
<div class="error-message" ng-if="forma.$dirty && forma.$error.email" translate translate-context="Nice">Email is not valid.</div>
|
|
29
|
-
<div class="error-message" ng-if="forma.$dirty && forma.$error.pattern"
|
|
26
|
+
<div class="error-message" ng-if="forma.$dirty && forma.$error.pattern">
|
|
27
|
+
<span ng-if="regexError">{{ regexError }}</span>
|
|
28
|
+
<span ng-if="!regexError" translate translate-context="Nice">This field requires a specific pattern.</span>
|
|
29
|
+
</div>
|
|
30
30
|
<div class="error-message" ng-if="forma.$error.minlength">
|
|
31
31
|
<translate translate-context="Nice">Your input is too short. It must contain at least</translate> {{ minlength }} <translate translate-context="Nice">characters</translate>.
|
|
32
32
|
</div>
|
|
@@ -11,6 +11,8 @@ angular.module('niceElements')
|
|
|
11
11
|
type: '@',
|
|
12
12
|
title: '@?',
|
|
13
13
|
regex: '@?',
|
|
14
|
+
regexRaw: '@?',
|
|
15
|
+
regexError: '@?',
|
|
14
16
|
placeholder: '@',
|
|
15
17
|
min: '@?',
|
|
16
18
|
max: '@?',
|
|
@@ -101,6 +103,10 @@ angular.module('niceElements')
|
|
|
101
103
|
scope.regexexp = new RegExp(scope.regex);
|
|
102
104
|
}
|
|
103
105
|
|
|
106
|
+
if (angular.isDefined(scope.regexRaw) && scope.regexRaw != '') {
|
|
107
|
+
scope.regexexp = regexRaw;
|
|
108
|
+
}
|
|
109
|
+
|
|
104
110
|
scope.$watch('model', function (value_new, value_old) {
|
|
105
111
|
scope.internalModel = scope.model;
|
|
106
112
|
});
|
|
@@ -1,14 +1,11 @@
|
|
|
1
1
|
<div class="nice-component nice-label" ng-class="{ 'margin-bottom-0' : noMargin, 'nice-component-inline': isInline }">
|
|
2
2
|
<div class="row">
|
|
3
|
-
<!-------------------------
|
|
4
|
-
<
|
|
5
|
-
<div class="nice-title-text">{{ title }}</div>
|
|
6
|
-
<nice-help class="nice-title-help" ng-if="help" text="{{ help }}"></nice-help>
|
|
7
|
-
</div>
|
|
3
|
+
<!------------------------- Title ------------------------->
|
|
4
|
+
<nice-title title="title" help="help" required="required" label-width="labelWidth"></nice-title>
|
|
8
5
|
|
|
9
6
|
<!------------------------- Field ------------------------->
|
|
10
7
|
<div class="nice-field col-xs-12" ng-class="fieldWidth ? fieldWidth : 'col-xs-8'">
|
|
11
8
|
<p class="value">{{ value }}</p>
|
|
12
9
|
</div>
|
|
13
10
|
</div>
|
|
14
|
-
</div>
|
|
11
|
+
</div>
|
|
@@ -1,24 +1,21 @@
|
|
|
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
|
-
<!-------------------------
|
|
4
|
-
<
|
|
5
|
-
<div class="nice-title-text">{{ title }}<span ng-if="required">*</span></div>
|
|
6
|
-
<nice-help class="nice-title-help" ng-if="help" text="{{ help }}"></nice-help>
|
|
7
|
-
</div>
|
|
3
|
+
<!------------------------- Title ------------------------->
|
|
4
|
+
<nice-title title="title" help="help" required="required" label-width="labelWidth"></nice-title>
|
|
8
5
|
|
|
9
6
|
<!------------------------- Field ------------------------->
|
|
10
|
-
<div class="nice-field col-xs-12" ng-class="fieldWidth ? fieldWidth : 'col-sm-8'">
|
|
11
|
-
<div class="input-group" ng-class="{'has-warning': !
|
|
7
|
+
<div class="nice-field col-xs-12" ng-class="[fieldWidth ? fieldWidth : 'col-sm-8', { 'nice-disabled': isDisabled }]">
|
|
8
|
+
<div class="input-group" ng-class="{'has-warning': !isDisabled && niceNumberForm.$invalid && niceNumberForm.$dirty}">
|
|
12
9
|
<span class="input-group-btn">
|
|
13
|
-
<button class="btn btn-default btn-left" type="button" ng-disabled="!canSubstract" ng-click="subtract()" tabindex="-1">
|
|
10
|
+
<button class="btn btn-default btn-left" type="button" ng-disabled="!canSubstract || isDisabled" ng-click="subtract()" tabindex="-1">
|
|
14
11
|
<nice-icon icon="icon-minus"></nice-icon>
|
|
15
12
|
</button>
|
|
16
13
|
</span>
|
|
17
14
|
|
|
18
|
-
<input type="number" step="{{ step }}" ng-change="inputChanged()" class="form-control" max="{{ max }}" min="{{ min }}" ng-model="model" />
|
|
15
|
+
<input type="number" step="{{ step }}" ng-change="inputChanged()" class="form-control" max="{{ max }}" min="{{ min }}" ng-disabled="isDisabled" ng-model="model" />
|
|
19
16
|
|
|
20
17
|
<span class="input-group-btn">
|
|
21
|
-
<button class="btn btn-default btn-right" type="button" ng-disabled="!canAdd" ng-click="add()" tabindex="-1">
|
|
18
|
+
<button class="btn btn-default btn-right" type="button" ng-disabled="!canAdd || isDisabled" ng-click="add()" tabindex="-1">
|
|
22
19
|
<nice-icon icon="icon-plus"></nice-icon>
|
|
23
20
|
</button>
|
|
24
21
|
</span>
|
|
@@ -14,12 +14,12 @@ angular.module('niceElements')
|
|
|
14
14
|
scope: {
|
|
15
15
|
model: '=',
|
|
16
16
|
valid: '=',
|
|
17
|
-
|
|
17
|
+
isDisabled: '=',
|
|
18
18
|
title: '@?',
|
|
19
19
|
min: '@',
|
|
20
20
|
max: '@',
|
|
21
21
|
defaultValue: '@',
|
|
22
|
-
required: '
|
|
22
|
+
required: '=',
|
|
23
23
|
fieldWidth: '@',
|
|
24
24
|
labelWidth: '@',
|
|
25
25
|
hideError: '@',
|
|
@@ -34,7 +34,7 @@ angular.module('niceElements')
|
|
|
34
34
|
onChange: '&?'
|
|
35
35
|
},
|
|
36
36
|
|
|
37
|
-
controller: function($scope, $timeout) {
|
|
37
|
+
controller: function ($scope, $timeout) {
|
|
38
38
|
$scope.canAdd = true;
|
|
39
39
|
$scope.canSubstract = true;
|
|
40
40
|
$scope.preventZero = $scope.preventZero == "true";
|
|
@@ -75,7 +75,7 @@ angular.module('niceElements')
|
|
|
75
75
|
if (!$scope.model) {
|
|
76
76
|
$scope.model = $scope.defaultValue;
|
|
77
77
|
} else {
|
|
78
|
-
if(parseFloat($scope.model)) {
|
|
78
|
+
if (parseFloat($scope.model)) {
|
|
79
79
|
$scope.model = parseFloat($scope.model);
|
|
80
80
|
} else {
|
|
81
81
|
$scope.model = $scope.defaultValue;
|
|
@@ -83,7 +83,7 @@ angular.module('niceElements')
|
|
|
83
83
|
}
|
|
84
84
|
|
|
85
85
|
// Check canAdd or canSubtract
|
|
86
|
-
$scope.check = function() {
|
|
86
|
+
$scope.check = function () {
|
|
87
87
|
if ($scope.required && ($scope.model == undefined || $scope.model == null)) {
|
|
88
88
|
$scope.niceNumberForm.$setValidity("no-value", false);
|
|
89
89
|
} else {
|
|
@@ -115,25 +115,25 @@ angular.module('niceElements')
|
|
|
115
115
|
|
|
116
116
|
|
|
117
117
|
// Check when load
|
|
118
|
-
$timeout(function() {
|
|
118
|
+
$timeout(function () {
|
|
119
119
|
$scope.check();
|
|
120
120
|
});
|
|
121
121
|
|
|
122
122
|
|
|
123
123
|
// On input change
|
|
124
|
-
$scope.inputChanged = function() {
|
|
124
|
+
$scope.inputChanged = function () {
|
|
125
125
|
$scope.check();
|
|
126
126
|
};
|
|
127
|
-
|
|
127
|
+
|
|
128
128
|
|
|
129
129
|
// Watch for model change
|
|
130
|
-
$scope.$watch("model", function() {
|
|
130
|
+
$scope.$watch("model", function () {
|
|
131
131
|
$scope.check();
|
|
132
132
|
});
|
|
133
133
|
|
|
134
134
|
|
|
135
135
|
// Add to the value
|
|
136
|
-
$scope.add = function() {
|
|
136
|
+
$scope.add = function () {
|
|
137
137
|
var result = new Decimal($scope.model != undefined ? $scope.model : $scope.defaultValue).plus($scope.step).toNumber(); //.toFixed($scope.decimals);
|
|
138
138
|
if ($scope.max) {
|
|
139
139
|
if (result <= parseFloat($scope.max)) {
|
|
@@ -149,7 +149,7 @@ angular.module('niceElements')
|
|
|
149
149
|
|
|
150
150
|
|
|
151
151
|
// Subtract to the value
|
|
152
|
-
$scope.subtract = function() {
|
|
152
|
+
$scope.subtract = function () {
|
|
153
153
|
var result = new Decimal($scope.model != undefined ? $scope.model : $scope.defaultValue).minus($scope.step).toNumber();
|
|
154
154
|
if (result >= Number($scope.min)) {
|
|
155
155
|
$scope.model = result;
|
|
@@ -1,33 +1,16 @@
|
|
|
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
|
-
<!-------------------------
|
|
4
|
-
<
|
|
5
|
-
<div class="nice-title-text">{{ title }}<span ng-if="required">*</span></div>
|
|
6
|
-
<nice-help class="nice-title-help" ng-if="help" text="{{ help }}"></nice-help>
|
|
7
|
-
</div>
|
|
3
|
+
<!------------------------- Title ------------------------->
|
|
4
|
+
<nice-title title="title" help="help" required="required" label-width="labelWidth"></nice-title>
|
|
8
5
|
|
|
9
6
|
<!------------------------- Field ------------------------->
|
|
10
7
|
<div class="nice-field col-xs-12" ng-class="fieldWidth ? fieldWidth : 'col-sm-8'">
|
|
11
|
-
<div
|
|
12
|
-
class="input-group has-feedback symbol"
|
|
13
|
-
ng-class="{
|
|
8
|
+
<div class="input-group has-feedback symbol" ng-class="{
|
|
14
9
|
'has-warning': !isDisabled && form.$invalid && form.$dirty && !hideValid,
|
|
15
10
|
'has-success': !isDisabled && form.$valid && form.$dirty && showValid,
|
|
16
11
|
'disabled': isDisabled
|
|
17
|
-
}"
|
|
18
|
-
|
|
19
|
-
<input
|
|
20
|
-
class="form-control"
|
|
21
|
-
type="text"
|
|
22
|
-
max="100"
|
|
23
|
-
min="0"
|
|
24
|
-
ng-model="internalModel"
|
|
25
|
-
placeholder="{{ placeholder }}"
|
|
26
|
-
ng-required="required"
|
|
27
|
-
ng-keypress="keypress($event)"
|
|
28
|
-
ng-change="change()"
|
|
29
|
-
ng-disabled="isDisabled"
|
|
30
|
-
>
|
|
12
|
+
}">
|
|
13
|
+
<input class="form-control" type="text" max="100" min="0" ng-model="internalModel" placeholder="{{ placeholder }}" ng-required="required" ng-keypress="keypress($event)" ng-change="change()" ng-disabled="isDisabled">
|
|
31
14
|
<span class="input-group-addon">%</span>
|
|
32
15
|
<!--<span ng-if="!disabled && showValid && form.$valid && form.$dirty" class="glyphicon glyphicon-ok form-control-feedback feedback-valid" aria-hidden="true"></span>-->
|
|
33
16
|
<!--<span ng-if="!disabled && !hideValid && form.$invalid && form.$dirty" class="glyphicon glyphicon-remove form-control-feedback feedback-invalid" aria-hidden="true"></span>-->
|
|
@@ -17,7 +17,7 @@ angular.module('niceElements')
|
|
|
17
17
|
valid: '=',
|
|
18
18
|
isDisabled: '=',
|
|
19
19
|
title: '@?',
|
|
20
|
-
required: '
|
|
20
|
+
required: '=',
|
|
21
21
|
fieldWidth: '@',
|
|
22
22
|
labelWidth: '@',
|
|
23
23
|
placeholder: '@',
|
|
@@ -36,27 +36,27 @@ angular.module('niceElements')
|
|
|
36
36
|
attrs.noMargin = angular.isDefined(attrs.noMargin);
|
|
37
37
|
},
|
|
38
38
|
|
|
39
|
-
controller: function($rootScope, $scope) {
|
|
39
|
+
controller: function ($rootScope, $scope) {
|
|
40
40
|
// Link form object with valid object
|
|
41
|
-
if (angular.isDefined($scope.valid)){
|
|
41
|
+
if (angular.isDefined($scope.valid)) {
|
|
42
42
|
$scope.valid = $scope.form;
|
|
43
43
|
}
|
|
44
44
|
|
|
45
|
-
var roundN = function(number, decimals){
|
|
45
|
+
var roundN = function (number, decimals) {
|
|
46
46
|
return Number(new Decimal(String(number)).toFixed(decimals, 4));
|
|
47
47
|
};
|
|
48
48
|
|
|
49
|
-
if (angular.isDefined($scope.model)){
|
|
49
|
+
if (angular.isDefined($scope.model)) {
|
|
50
50
|
$scope.internalModel = roundN((angular.copy($scope.model) * 100), 6);
|
|
51
51
|
} else {
|
|
52
52
|
$scope.internalModel = "0";
|
|
53
53
|
$scope.model = 0;
|
|
54
54
|
}
|
|
55
55
|
|
|
56
|
-
$scope.change = function(){
|
|
57
|
-
if($scope.internalModel){
|
|
56
|
+
$scope.change = function () {
|
|
57
|
+
if ($scope.internalModel) {
|
|
58
58
|
$scope.internalModel = String($scope.internalModel).replace(',', '.');
|
|
59
|
-
if(parseFloat($scope.internalModel) > 100) $scope.internalModel = 100;
|
|
59
|
+
if (parseFloat($scope.internalModel) > 100) $scope.internalModel = 100;
|
|
60
60
|
$scope.model = roundN(parseFloat($scope.internalModel) / 100, 6);
|
|
61
61
|
} else {
|
|
62
62
|
$scope.model = 0;
|
|
@@ -64,9 +64,9 @@ angular.module('niceElements')
|
|
|
64
64
|
if ($scope.onChange) $scope.onChange({ model: $scope.model });
|
|
65
65
|
};
|
|
66
66
|
|
|
67
|
-
$scope.keypress = function(event) {
|
|
67
|
+
$scope.keypress = function (event) {
|
|
68
68
|
if (event.charCode == 46 || event.charCode == 44) { // Handle "." and "," key (only one allowed)
|
|
69
|
-
if($scope.internalModel.indexOf(".") >= 0){
|
|
69
|
+
if ($scope.internalModel.indexOf(".") >= 0) {
|
|
70
70
|
event.preventDefault();
|
|
71
71
|
return false;
|
|
72
72
|
}
|
|
@@ -79,13 +79,13 @@ angular.module('niceElements')
|
|
|
79
79
|
};
|
|
80
80
|
|
|
81
81
|
$scope.$watch('model', function (value_new, value_old) {
|
|
82
|
-
if (value_new){
|
|
82
|
+
if (value_new) {
|
|
83
83
|
$scope.internalModel = roundN(angular.copy($scope.model) * 100, 6);
|
|
84
84
|
}
|
|
85
85
|
});
|
|
86
86
|
|
|
87
87
|
$scope.$watch('internalModel', function (value_new, value_old) {
|
|
88
|
-
if(!$scope.internalModel){
|
|
88
|
+
if (!$scope.internalModel) {
|
|
89
89
|
$scope.internalModel = "0";
|
|
90
90
|
}
|
|
91
91
|
});
|
|
@@ -1,10 +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
|
-
<!-------------------------
|
|
4
|
-
<
|
|
5
|
-
<div class="nice-title-text">{{ title }}<span ng-if="required">*</span></div>
|
|
6
|
-
<nice-help class="nice-title-help" ng-if="help" text="{{ help }}"></nice-help>
|
|
7
|
-
</div>
|
|
3
|
+
<!------------------------- Title ------------------------->
|
|
4
|
+
<nice-title title="title" help="help" required="required" label-width="labelWidth"></nice-title>
|
|
8
5
|
|
|
9
6
|
<!------------------------- Field ------------------------->
|
|
10
7
|
<div class="nice-field col-xs-12" ng-class="fieldWidth ? fieldWidth : 'col-sm-8'">
|
|
@@ -1,10 +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
|
-
<!-------------------------
|
|
4
|
-
<
|
|
5
|
-
<div class="nice-title-text">{{ title }}<span ng-if="required">*</span></div>
|
|
6
|
-
<nice-help class="nice-title-help" ng-if="help" text="{{ help }}"></nice-help>
|
|
7
|
-
</div>
|
|
3
|
+
<!------------------------- Title ------------------------->
|
|
4
|
+
<nice-title title="title" help="help" required="required" label-width="labelWidth"></nice-title>
|
|
8
5
|
|
|
9
6
|
<!------------------------- Field ------------------------->
|
|
10
7
|
<div class="nice-field col-xs-12" ng-class="[fieldWidth ? fieldWidth : 'col-sm-8', { 'nice-disabled': isDisabled }]">
|
|
@@ -1,10 +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
|
-
<!-------------------------
|
|
4
|
-
<
|
|
5
|
-
<div class="nice-title-text">{{ title }}<span ng-if="required">*</span></div>
|
|
6
|
-
<nice-help class="nice-title-help" ng-if="help" text="{{ help }}"></nice-help>
|
|
7
|
-
</div>
|
|
3
|
+
<!------------------------- Title ------------------------->
|
|
4
|
+
<nice-title title="title" help="help" required="required" label-width="labelWidth"></nice-title>
|
|
8
5
|
|
|
9
6
|
<!------------------------- Field ------------------------->
|
|
10
7
|
<div class="nice-field col-xs-12" ng-class="[fieldWidth ? fieldWidth : 'col-sm-8', { 'nice-disabled': isDisabled }]">
|
|
@@ -17,7 +17,7 @@ angular.module('niceElements')
|
|
|
17
17
|
isDisabled: '=',
|
|
18
18
|
title: '@?',
|
|
19
19
|
placeholder: '@',
|
|
20
|
-
required: '
|
|
20
|
+
required: '=',
|
|
21
21
|
fieldWidth: '@',
|
|
22
22
|
labelWidth: '@',
|
|
23
23
|
hideValid: '@',
|
|
@@ -58,38 +58,38 @@ angular.module('niceElements')
|
|
|
58
58
|
// });
|
|
59
59
|
|
|
60
60
|
// Set default text
|
|
61
|
-
scope.$watch("setText", function(){
|
|
61
|
+
scope.$watch("setText", function () {
|
|
62
62
|
scope.modelString = scope.setText;
|
|
63
63
|
});
|
|
64
64
|
|
|
65
65
|
// Check if object is defined
|
|
66
|
-
if(angular.isDefined(scope.model)){
|
|
66
|
+
if (angular.isDefined(scope.model)) {
|
|
67
67
|
if (angular.isDefined(scope.keyForInputLabel))
|
|
68
68
|
scope.modelString = scope.model[scope.keyForInputLabel];
|
|
69
69
|
else
|
|
70
70
|
scope.modelString = scope.model;
|
|
71
71
|
}
|
|
72
72
|
|
|
73
|
-
var setValid = function(isValid){
|
|
74
|
-
if(scope.required){
|
|
73
|
+
var setValid = function (isValid) {
|
|
74
|
+
if (scope.required) {
|
|
75
75
|
scope.form.$setValidity('objectSelected', isValid);
|
|
76
76
|
}
|
|
77
77
|
};
|
|
78
78
|
|
|
79
|
-
scope.$watch('model', function(newValue){
|
|
80
|
-
if(scope.model && scope.model.id){
|
|
79
|
+
scope.$watch('model', function (newValue) {
|
|
80
|
+
if (scope.model && scope.model.id) {
|
|
81
81
|
setValid(true);
|
|
82
82
|
} else {
|
|
83
83
|
setValid(false);
|
|
84
84
|
}
|
|
85
85
|
});
|
|
86
86
|
|
|
87
|
-
scope.selectRow = function(obj){
|
|
88
|
-
if (angular.isDefined(scope.refreshSelectedCallback)){
|
|
87
|
+
scope.selectRow = function (obj) {
|
|
88
|
+
if (angular.isDefined(scope.refreshSelectedCallback)) {
|
|
89
89
|
scope.refreshSelectedCallback(obj);
|
|
90
90
|
}
|
|
91
91
|
|
|
92
|
-
if (scope.resetSearchInput){
|
|
92
|
+
if (scope.resetSearchInput) {
|
|
93
93
|
scope.model = null;
|
|
94
94
|
} else {
|
|
95
95
|
scope.model = obj;
|
|
@@ -104,10 +104,10 @@ angular.module('niceElements')
|
|
|
104
104
|
|
|
105
105
|
};
|
|
106
106
|
|
|
107
|
-
scope.clear = function(){
|
|
107
|
+
scope.clear = function () {
|
|
108
108
|
scope.results = [];
|
|
109
109
|
|
|
110
|
-
if(scope.clearInput){
|
|
110
|
+
if (scope.clearInput) {
|
|
111
111
|
scope.modelString = "";
|
|
112
112
|
}
|
|
113
113
|
|
|
@@ -115,7 +115,7 @@ angular.module('niceElements')
|
|
|
115
115
|
};
|
|
116
116
|
|
|
117
117
|
// Close the dropdown if clicked outside
|
|
118
|
-
var onClick = function(event){
|
|
118
|
+
var onClick = function (event) {
|
|
119
119
|
var isClickedElementChildOfPopup = element.find(event.target).length > 0;
|
|
120
120
|
|
|
121
121
|
if (isClickedElementChildOfPopup) return;
|
|
@@ -128,24 +128,24 @@ angular.module('niceElements')
|
|
|
128
128
|
angular.element(element).on('click', onClick);
|
|
129
129
|
|
|
130
130
|
// Keyboard up/down on search results
|
|
131
|
-
var onKeyDown = function(event) {
|
|
132
|
-
if((event.keyCode == 38 || event.keyCode == 40 || event.keyCode == 13 || event.keyCode == 27) && scope.results && scope.results.length>0){
|
|
131
|
+
var onKeyDown = function (event) {
|
|
132
|
+
if ((event.keyCode == 38 || event.keyCode == 40 || event.keyCode == 13 || event.keyCode == 27) && scope.results && scope.results.length > 0) {
|
|
133
133
|
event.preventDefault();
|
|
134
134
|
|
|
135
|
-
if(event.keyCode == 27){ // Escape
|
|
135
|
+
if (event.keyCode == 27) { // Escape
|
|
136
136
|
scope.modelString = "";
|
|
137
137
|
scope.clear();
|
|
138
138
|
}
|
|
139
139
|
|
|
140
|
-
if(event.keyCode == 13){ // Enter
|
|
140
|
+
if (event.keyCode == 13) { // Enter
|
|
141
141
|
scope.selectRow(scope.results[scope.selectedIndex]);
|
|
142
142
|
}
|
|
143
143
|
|
|
144
|
-
if(event.keyCode == 40 && scope.results && scope.selectedIndex+1 < scope.results.length){ // Down
|
|
144
|
+
if (event.keyCode == 40 && scope.results && scope.selectedIndex + 1 < scope.results.length) { // Down
|
|
145
145
|
scope.selectedIndex += 1;
|
|
146
146
|
}
|
|
147
147
|
|
|
148
|
-
if(event.keyCode == 38 && scope.results && scope.selectedIndex-1 >= 0){ // Up
|
|
148
|
+
if (event.keyCode == 38 && scope.results && scope.selectedIndex - 1 >= 0) { // Up
|
|
149
149
|
scope.selectedIndex -= 1;
|
|
150
150
|
}
|
|
151
151
|
|
|
@@ -163,13 +163,13 @@ angular.module('niceElements')
|
|
|
163
163
|
});
|
|
164
164
|
|
|
165
165
|
},
|
|
166
|
-
controller: function($scope, $timeout, $element) {
|
|
166
|
+
controller: function ($scope, $timeout, $element) {
|
|
167
167
|
$scope.id = Math.random().toString(36).substring(7);
|
|
168
168
|
$scope.loading = false;
|
|
169
169
|
$scope.noResults = false;
|
|
170
170
|
$scope.requests = 0;
|
|
171
171
|
|
|
172
|
-
$scope.focus = function() {
|
|
172
|
+
$scope.focus = function () {
|
|
173
173
|
var input = $element[0].getElementsByTagName('input')[0];
|
|
174
174
|
if (input) {
|
|
175
175
|
input.focus();
|
|
@@ -182,14 +182,14 @@ angular.module('niceElements')
|
|
|
182
182
|
}
|
|
183
183
|
|
|
184
184
|
$scope.results = [];
|
|
185
|
-
var updateList = function(results, requestNumber){
|
|
185
|
+
var updateList = function (results, requestNumber) {
|
|
186
186
|
|
|
187
|
-
if(results){
|
|
188
|
-
if ($scope.requests == requestNumber){
|
|
187
|
+
if (results) {
|
|
188
|
+
if ($scope.requests == requestNumber) {
|
|
189
189
|
$scope.noResults = results.length == 0;
|
|
190
190
|
$scope.results = results;
|
|
191
191
|
|
|
192
|
-
if(!$scope.noResults){
|
|
192
|
+
if (!$scope.noResults) {
|
|
193
193
|
$scope.selectedIndex = 0;
|
|
194
194
|
}
|
|
195
195
|
}
|
|
@@ -204,13 +204,13 @@ angular.module('niceElements')
|
|
|
204
204
|
if ($scope.timer_promise)
|
|
205
205
|
$timeout.cancel($scope.timer_promise);
|
|
206
206
|
|
|
207
|
-
$scope.timer_promise = $timeout(function() {
|
|
207
|
+
$scope.timer_promise = $timeout(function () {
|
|
208
208
|
if ($scope.onChange) $scope.onChange({ model: $scope.model, modelString: $scope.modelString });
|
|
209
209
|
$scope.requests = $scope.requests + 1;
|
|
210
210
|
var requestNumber = angular.copy($scope.requests);
|
|
211
|
-
$scope.refreshFunction($scope.modelString).then(function(response){
|
|
211
|
+
$scope.refreshFunction($scope.modelString).then(function (response) {
|
|
212
212
|
updateList(response, requestNumber);
|
|
213
|
-
}, function(error){
|
|
213
|
+
}, function (error) {
|
|
214
214
|
$scope.loading = false;
|
|
215
215
|
});
|
|
216
216
|
// Why was this here?
|
|
@@ -220,9 +220,9 @@ angular.module('niceElements')
|
|
|
220
220
|
};
|
|
221
221
|
|
|
222
222
|
// If search button is clicked set focus or make request
|
|
223
|
-
$scope.search = function(){
|
|
224
|
-
if (!$scope.isDisabled){
|
|
225
|
-
if($scope.showDropdown) {
|
|
223
|
+
$scope.search = function () {
|
|
224
|
+
if (!$scope.isDisabled) {
|
|
225
|
+
if ($scope.showDropdown) {
|
|
226
226
|
$scope.updateSearch();
|
|
227
227
|
}
|
|
228
228
|
$scope.focus();
|
|
@@ -230,7 +230,7 @@ angular.module('niceElements')
|
|
|
230
230
|
};
|
|
231
231
|
|
|
232
232
|
// Clear model
|
|
233
|
-
$scope.remove = function(){
|
|
233
|
+
$scope.remove = function () {
|
|
234
234
|
$scope.model = null;
|
|
235
235
|
$scope.modelString = null;
|
|
236
236
|
}
|
|
@@ -1,10 +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
|
-
<!-------------------------
|
|
4
|
-
<
|
|
5
|
-
<div class="nice-title-text">{{ title }}</div>
|
|
6
|
-
<nice-help class="nice-title-help" ng-if="help" text="{{ help }}"></nice-help>
|
|
7
|
-
</div>
|
|
3
|
+
<!------------------------- Title ------------------------->
|
|
4
|
+
<nice-title title="title" help="help" required="required" label-width="labelWidth"></nice-title>
|
|
8
5
|
|
|
9
6
|
<!------------------------- Field ------------------------->
|
|
10
7
|
<div class="nice-field col-xs-12" ng-class="[fieldWidth ? fieldWidth : 'col-sm-8', { 'nice-disabled': isDisabled }]" click-outside="close()">
|
|
@@ -1,14 +1,11 @@
|
|
|
1
1
|
<div class="nice-component nice-slot" ng-class="{ 'margin-bottom-0' : noMargin, 'nice-component-inline': isInline }">
|
|
2
2
|
<div class="row">
|
|
3
|
-
<!-------------------------
|
|
4
|
-
<
|
|
5
|
-
<div class="nice-title-text" ng-if="title">{{ title }}</div>
|
|
6
|
-
<nice-help class="nice-title-help" ng-if="help" text="{{ help }}"></nice-help>
|
|
7
|
-
</div>
|
|
3
|
+
<!------------------------- Title ------------------------->
|
|
4
|
+
<nice-title title="title" help="help" required="required" label-width="labelWidth"></nice-title>
|
|
8
5
|
|
|
9
6
|
<!------------------------- Field ------------------------->
|
|
10
7
|
<div class="nice-field col-xs-12" ng-class="fieldWidth ? fieldWidth : 'col-xs-8'">
|
|
11
8
|
<ng-transclude></ng-transclude>
|
|
12
9
|
</div>
|
|
13
10
|
</div>
|
|
14
|
-
</div>
|
|
11
|
+
</div>
|
|
@@ -23,7 +23,7 @@ angular.module('niceElements')
|
|
|
23
23
|
link: function postLink(scope, element, attrs) {
|
|
24
24
|
if (!attrs.fieldWidth) { attrs.fieldWidth = 'col-sm-8'; }
|
|
25
25
|
if (!attrs.labelWidth) { attrs.labelWidth = 'col-sm-4'; }
|
|
26
|
-
if (!attrs.title) { attrs.
|
|
26
|
+
if (!attrs.title) { attrs.title = ' '; }
|
|
27
27
|
}
|
|
28
28
|
};
|
|
29
29
|
});
|