nice-elements 1.12.1 → 1.12.2
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 +7 -0
- package/README.md +1 -1
- package/bower.json +1 -1
- package/dist/nice.js +2301 -1815
- package/dist/nice.min.js +1 -1
- package/package.json +1 -1
- package/src/components/nice-input/nice-input.html +2 -3
- package/src/components/nice-input/nice-input.js +3 -2
- package/src/modals/nice-multilangual-modal/nice-multilangual-modal.html +1 -1
- package/src/modals/nice-multilangual-modal/nice-multilangual-modal.js +14 -14
- package/src/services/nice-service.js +1 -1
package/package.json
CHANGED
|
@@ -12,12 +12,11 @@
|
|
|
12
12
|
'symbol': symbol,
|
|
13
13
|
'nice-disabled': isDisabled
|
|
14
14
|
}">
|
|
15
|
-
|
|
16
|
-
<textarea ng-if="textArea" class="form-control" ng-model="$parent.internalModel" id="{{ id }}" tabindex="{{ tabIndex }}" placeholder="{{ placeholder }}" rows="{{textAreaLines}}" max="{{ max }}" min="{{ min }}" autocomplete="{{ autocomplete }}" ng-minlength="minlength" ng-maxlength="maxlength" ng-required="required" ng-pattern="regexexp" ng-disabled="isDisabled"></textarea>
|
|
15
|
+
<textarea ng-if="textArea" class="form-control" ng-model="$parent.internalModel" id="{{ id }}" tabindex="{{ tabIndex }}" placeholder="{{ placeholder }}" rows="{{ textAreaLines }}" max="{{ max }}" min="{{ min }}" autocomplete="{{ autocomplete }}" ng-minlength="minlength" ng-maxlength="maxlength" ng-required="required" ng-pattern="regexexp" ng-disabled="isDisabled"></textarea>
|
|
17
16
|
<input ng-if="!textArea" class="form-control" type="{{ internalType }}" inputmode="{{ inputMode }}" ng-model="$parent.internalModel" name="{{ name }}" id="{{ id }}" tabindex="{{ tabIndex }}" placeholder="{{ placeholder }}" max="{{ max }}" min="{{ min }}" autocomplete="{{ autocomplete }}" ng-minlength="minlength" ng-maxlength="maxlength" ng-required="required" ng-keypress="keypress($event)" ng-pattern="regexexp" ng-disabled="isDisabled" />
|
|
18
17
|
|
|
19
18
|
<div class="input-group-addon" ng-if="symbol">{{ symbol }}</div>
|
|
20
|
-
<button type="button" class="input-group-btn" ng-if="multilanguageField" ng-click="openMultilanguage()">
|
|
19
|
+
<button type="button" class="input-group-btn" ng-if="!multilanguageDisabled && multilanguageField" ng-click="openMultilanguage()">
|
|
21
20
|
<nice-icon icon="icon-translate"></nice-icon>
|
|
22
21
|
<div class="nice-input-addon-bubble" ng-if="numberOfLanguages > 0">{{ numberOfLanguages }}</div>
|
|
23
22
|
</button>
|
|
@@ -40,6 +40,7 @@ angular.module('niceElements')
|
|
|
40
40
|
positiveOnly: '=?', // Allow only positive numbers in the input
|
|
41
41
|
multilanguage: '=?', // Multiple languages object
|
|
42
42
|
multilanguageField: '@?', // Multiple languages field name
|
|
43
|
+
multilanguageDisabled: '=', // Multiple languages field disabled
|
|
43
44
|
autocomplete: "@?"
|
|
44
45
|
},
|
|
45
46
|
controller: function ($scope, $attrs, $rootScope, $element, ngDialog) {
|
|
@@ -58,9 +59,9 @@ angular.module('niceElements')
|
|
|
58
59
|
if (!$attrs.minDecimalsCutZeros) { $attrs.minDecimalsCutZeros = 0; }
|
|
59
60
|
$attrs.hideValid = angular.isDefined($attrs.hideValid);
|
|
60
61
|
$attrs.showValid = angular.isDefined($attrs.showValid);
|
|
61
|
-
$attrs.textArea = angular.isDefined($attrs.textArea);
|
|
62
62
|
$attrs.noMargin = angular.isDefined($attrs.noMargin);
|
|
63
|
-
$
|
|
63
|
+
$scope.textArea = $attrs.textArea == 'true' || $attrs.textArea == true;
|
|
64
|
+
$attrs.required = $attrs.required === 'true' || $attrs.required === true;
|
|
64
65
|
$scope.inputMode = null;
|
|
65
66
|
$scope.lastKey = null;
|
|
66
67
|
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
<div class="nice-multilangual-languages">
|
|
12
12
|
<div class="nice-multilangual-language" ng-repeat="(key, field) in fields">
|
|
13
13
|
<!-- <nice-icon class="nice-multilangual-language-flag" icon="{{ 'flag-' + key }}"></nice-icon> -->
|
|
14
|
-
<nice-input title="{{ languagesMap[key] }}" class="flex-grow" model="fields[key]" is-inline="false" no-margin="true" on-clear="removeLanguage(key)"
|
|
14
|
+
<nice-input title="{{ languagesMap[key] }}" class="flex-grow" model="fields[key]" is-inline="false" no-margin="true" on-clear="removeLanguage(key)" text-area="true"></nice-input>
|
|
15
15
|
<!-- <button type="button" class="btn btn-danger btn-icon" ng-click="removeLanguage(key)">
|
|
16
16
|
<nice-icon icon="icon-trash-2"></nice-icon>
|
|
17
17
|
</button> -->
|
|
@@ -3,7 +3,6 @@ angular.module('niceElements')
|
|
|
3
3
|
return {
|
|
4
4
|
templateUrl: 'src/modals/nice-multilangual-modal/nice-multilangual-modal.html',
|
|
5
5
|
restrict: 'E',
|
|
6
|
-
transclude: true,
|
|
7
6
|
scope: {
|
|
8
7
|
model: '=',
|
|
9
8
|
callback: '=',
|
|
@@ -22,18 +21,19 @@ angular.module('niceElements')
|
|
|
22
21
|
$scope.fields = angular.copy($scope.multilanguage[$scope.multilanguageField]);
|
|
23
22
|
|
|
24
23
|
$scope.languages = [
|
|
25
|
-
{ id: 'sl', value: "Slovenščina" },
|
|
26
|
-
{ id: 'en', value: "English" },
|
|
27
|
-
{ id: '
|
|
28
|
-
{ id: '
|
|
29
|
-
{ id: '
|
|
24
|
+
{ id: 'sl', icon: '🇸🇮', value: "🇸🇮 Slovenščina" },
|
|
25
|
+
{ id: 'en', icon: '🇬🇧', value: "🇬🇧 English" },
|
|
26
|
+
{ id: 'hr', icon: '🇭🇷', value: "🇭🇷 Hrvatski" },
|
|
27
|
+
{ id: 'de', icon: '🇩🇪', value: "🇩🇪 Deutsch" },
|
|
28
|
+
{ id: 'it', icon: '🇮🇹', value: "🇮🇹 Italiano" },
|
|
29
|
+
{ id: 'fr', icon: '🇫🇷', value: "🇫🇷 Français" },
|
|
30
30
|
];
|
|
31
31
|
$scope.languagesMap = {};
|
|
32
|
-
angular.forEach($scope.languages, function (l) { $scope.languagesMap[l.id] = l.value; })
|
|
32
|
+
angular.forEach($scope.languages, function (l) { $scope.languagesMap[l.id] = l.value; });
|
|
33
33
|
|
|
34
34
|
|
|
35
35
|
$scope.filterLanguages = function (list) {
|
|
36
|
-
return _.filter(list, function (l) { return !Object.keys($scope.fields).includes(l.id); })
|
|
36
|
+
return _.filter(list, function (l) { return !Object.keys($scope.fields).includes(l.id); });
|
|
37
37
|
};
|
|
38
38
|
|
|
39
39
|
$scope.addLanguage = function () {
|
|
@@ -43,25 +43,25 @@ angular.module('niceElements')
|
|
|
43
43
|
$scope.hide = true;
|
|
44
44
|
$timeout(function () {
|
|
45
45
|
$scope.hide = false;
|
|
46
|
-
})
|
|
47
|
-
}
|
|
46
|
+
});
|
|
47
|
+
};
|
|
48
48
|
|
|
49
49
|
$scope.removeLanguage = function (key) {
|
|
50
50
|
delete $scope.fields[key];
|
|
51
51
|
$scope.hide = true;
|
|
52
52
|
$timeout(function () {
|
|
53
53
|
$scope.hide = false;
|
|
54
|
-
})
|
|
55
|
-
}
|
|
54
|
+
});
|
|
55
|
+
};
|
|
56
56
|
|
|
57
57
|
$scope.save = function () {
|
|
58
58
|
$scope.callback($scope.fields);
|
|
59
59
|
$scope.dialog.close();
|
|
60
|
-
}
|
|
60
|
+
};
|
|
61
61
|
|
|
62
62
|
$scope.close = function () {
|
|
63
63
|
$scope.dialog.close();
|
|
64
|
-
}
|
|
64
|
+
};
|
|
65
65
|
}
|
|
66
66
|
};
|
|
67
67
|
});
|