nice-elements 1.15.1 → 1.16.1

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.
Files changed (48) hide show
  1. package/CHANGELOG.md +24 -0
  2. package/CLAUDE.md +1 -0
  3. package/README.md +1 -1
  4. package/bower.json +1 -1
  5. package/dist/nice.js +620 -509
  6. package/dist/nice.min.js +1 -1
  7. package/dist/style.css +145 -126
  8. package/dist/style.css.map +1 -1
  9. package/dist/style.min.css +2 -2
  10. package/package.json +5 -6
  11. package/src/components/nice-calendar/nice-calendar.html +3 -4
  12. package/src/components/nice-calendar/nice-calendar.scss +0 -9
  13. package/src/components/nice-date/nice-date-picker.html +60 -0
  14. package/src/components/nice-date/nice-date.html +29 -86
  15. package/src/components/nice-date/nice-date.js +7 -35
  16. package/src/components/nice-date/nice-date.scss +6 -15
  17. package/src/components/nice-datetime-picker/nice-datetime-picker.html +1 -4
  18. package/src/components/nice-datetime-picker/nice-datetime-picker.scss +9 -12
  19. package/src/components/nice-datetimerange-picker/nice-datetimerange-picker.html +1 -3
  20. package/src/components/nice-datetimerange-picker-2/nice-datetimerange-picker-2.html +32 -30
  21. package/src/components/nice-datetimerange-picker-2/nice-datetimerange-picker-2.js +1 -33
  22. package/src/components/nice-datetimerange-picker-2/nice-datetimerange-picker-2.scss +7 -12
  23. package/src/components/nice-dropdown/nice-dropdown.html +42 -40
  24. package/src/components/nice-dropdown/nice-dropdown.js +52 -54
  25. package/src/components/nice-dropdown/nice-dropdown.scss +25 -4
  26. package/src/components/nice-dropdown-old/nice-dropdown-old.html +1 -1
  27. package/src/components/nice-dropdown-old/nice-dropdown-old.scss +8 -2
  28. package/src/components/nice-dtp/nice-dtp.html +7 -7
  29. package/src/components/nice-notification/nice-notification.html +6 -6
  30. package/src/components/nice-notification/nice-notification.scss +7 -6
  31. package/src/components/nice-options/nice-options.scss +4 -0
  32. package/src/components/nice-popup/nice-popup.html +4 -4
  33. package/src/components/nice-popup/nice-popup.js +61 -75
  34. package/src/components/nice-popup/nice-popup.scss +10 -31
  35. package/src/components/nice-search/nice-search.html +21 -26
  36. package/src/components/nice-search/nice-search.js +9 -12
  37. package/src/components/nice-search/nice-search.scss +9 -10
  38. package/src/components/nice-search2/nice-search2.html +22 -18
  39. package/src/components/nice-search2/nice-search2.js +12 -56
  40. package/src/components/nice-search2/nice-search2.scss +3 -2
  41. package/src/components/nice-svgs/nice-svgs.html +8 -0
  42. package/src/components/nice-time-picker/nice-time-picker.html +1 -3
  43. package/src/components/nice-time-picker/nice-time-picker.scss +0 -8
  44. package/src/directives/nice-tooltip/_nice-tooltip.scss +7 -28
  45. package/src/directives/nice-tooltip/nice-tooltip.js +16 -29
  46. package/src/services/nice-service.js +236 -1
  47. package/src/styles/_nice-anchored.scss +75 -0
  48. package/src/styles/_nice.scss +1 -0
@@ -6,50 +6,52 @@
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 }}">
8
8
  <div class="nice-field-wrapper">
9
- <!------------------------- Button ------------------------->
10
- <button type="button" class="btn btn-dropdown" type="button" ng-ref="dropdown-button" ng-click="toggle()" ng-disabled="isDisabled || emptyList" aria-expanded="{{ isOpen }}" aria-haspopup="true" aria-controls="menu" id="nice-dropdown-{{ id }}">
11
- <input class="hidden-input" ng-model="model" ng-required="required" ng-disabled="disabled" tabindex="-1" />
12
- <div class="btn-dropdown-inside" ng-transclude="button" ng-if="selected != null">
13
- <span ng-if="!multiple">{{ selected[objValue] }}</span>
14
- <span ng-if="multiple" class="multiple-selected" ng-class="{ 'has-more': selected.length > maxSelectedShown }">
15
- <span ng-if="selected.length > 0" class="multiple-selected-values"><span ng-repeat="item in selected | limitTo: maxSelectedShown">{{ item[objValue] }}{{ $last ? '' : ', ' }}</span></span>
16
- <span ng-if="selected.length > maxSelectedShown" class="multiple-selected-more">+{{ selected.length - maxSelectedShown }} {{ moreText }}</span>
17
- <span ng-if="selected.length == 0" class="not-selected">{{ nullableText }}</span>
18
- </span>
19
- </div>
9
+ <!------------------------- Button + menu ------------------------->
10
+ <nice-popup trigger="manual" is-open="isOpen" placement="{{ placement }}" offset-distance="{{ dropdownDistance }}" same-width="true">
11
+ <nice-popup-target>
12
+ <button type="button" class="btn btn-dropdown" type="button" ng-ref="dropdown-button" ng-click="toggle()" ng-disabled="isDisabled || emptyList" aria-expanded="{{ isOpen }}" aria-haspopup="true" aria-controls="menu" id="nice-dropdown-{{ id }}">
13
+ <input class="hidden-input" ng-model="model" ng-required="required" ng-disabled="disabled" tabindex="-1" />
14
+ <div class="btn-dropdown-inside" ng-transclude="button" ng-if="selected != null">
15
+ <span ng-if="!multiple">{{ selected[objValue] }}</span>
16
+ <span ng-if="multiple" class="multiple-selected" ng-class="{ 'has-more': selected.length > maxSelectedShown }">
17
+ <span ng-if="selected.length > 0" class="multiple-selected-values"><span ng-repeat="item in selected | limitTo: maxSelectedShown">{{ item[objValue] }}{{ $last ? '' : ', ' }}</span></span>
18
+ <span ng-if="selected.length > maxSelectedShown" class="multiple-selected-more">+{{ selected.length - maxSelectedShown }} {{ moreText }}</span>
19
+ <span ng-if="selected.length == 0" class="not-selected">{{ nullableText }}</span>
20
+ </span>
21
+ </div>
20
22
 
21
- <div class="not-selected" ng-if="selected == null">{{ selectText }}</div>
22
-
23
- <span class="caret" ng-show="!loading"></span>
24
- <nice-loader ng-if="loading"></nice-loader>
25
- </button>
23
+ <div class="not-selected" ng-if="selected == null">{{ selectText }}</div>
26
24
 
25
+ <span class="caret" ng-show="!loading"></span>
26
+ <nice-loader ng-if="loading"></nice-loader>
27
+ </button>
28
+ </nice-popup-target>
27
29
 
28
- <!------------------------- Dropdown menu ------------------------->
29
- <div class="nice-dropdown-menu-wrapper">
30
- <div class="nice-dropdown-menu" ng-if="isOpen">
31
- <div class="search-bar" ng-if="!noSearch && searchFunction">
32
- <input class="search-bar-input" ng-model="internal.search" ng-model-options="{ debounce: 500 }" ng-change="handleSearch()" placeholder="{{ searchText }}" />
33
- <div class="count" ng-if="internalList && internalList._metadata && enableLoadMore">{{ internalList.length }}/{{ internalList._metadata.count }}</div>
34
- <nice-icon ng-if="!internal.search" class="icon" icon="icon-search"></nice-icon>
35
- <nice-icon ng-if="internal.search" class="icon" icon="icon-x" ng-click="clearSearch()"></nice-icon>
36
- </div>
37
- <div class="nice-dropdown-actions" ng-if="multiple">
38
- <button type="button" class="btn btn-default btn-sm" ng-click="selectAll()" translate translate-context="Nice">All</button>
39
- <button type="button" class="btn btn-default btn-sm" ng-click="selectNone()">{{ nullableText }}</button>
40
- </div>
41
- <div class="nice-dropdown-items" aria-labelledby="nice-dropdown-{{ id }}" role="listbox">
42
- <div role="none" type="button" class="nice-no-data" ng-if="internalList && internalList.length == 0">{{ noDataText }}</div>
43
- <button type="button" role="option" class="nice-dropdown-item null-item" ng-if="!multiple && nullable && internalList.length != 0" ng-click="handleSelected(null, -1)" ng-disabled="isDisabled">
44
- {{ nullableText }}
45
- </button>
46
- <button type="button" role="option" class="nice-dropdown-item" ng-repeat="item in internalList" ng-click="handleSelected(item, $index)" ng-class="{ 'selected': item._selected }" ng-disabled="isDisabled">
47
- <div class="choice-checkbox" ng-if="multiple" role="menuitemcheckbox"><i class="fa fa-check"></i></div>
48
- <div class="choice-option" ng-transclude="option" ng-class="{ 'multiple-item': multiple }">{{ item[objValue] }}</div>
49
- </button>
30
+ <nice-popup-content>
31
+ <div class="nice-dropdown-menu" ng-if="isOpen">
32
+ <div class="search-bar" ng-if="!noSearch && searchFunction">
33
+ <input class="search-bar-input" ng-model="internal.search" ng-model-options="{ debounce: 500 }" ng-change="handleSearch()" placeholder="{{ searchText }}" />
34
+ <div class="count" ng-if="internalList && internalList._metadata && enableLoadMore">{{ internalList.length }}/{{ internalList._metadata.count }}</div>
35
+ <nice-icon ng-if="!internal.search" class="icon" icon="icon-search"></nice-icon>
36
+ <nice-icon ng-if="internal.search" class="icon" icon="icon-x" ng-click="clearSearch()"></nice-icon>
37
+ </div>
38
+ <div class="nice-dropdown-actions" ng-if="multiple">
39
+ <button type="button" class="btn btn-default btn-sm" ng-click="selectAll()" translate translate-context="Nice">All</button>
40
+ <button type="button" class="btn btn-default btn-sm" ng-click="selectNone()">{{ nullableText }}</button>
41
+ </div>
42
+ <div class="nice-dropdown-items" aria-labelledby="nice-dropdown-{{ id }}" role="listbox">
43
+ <div role="none" type="button" class="nice-no-data" ng-if="internalList && internalList.length == 0">{{ noDataText }}</div>
44
+ <button type="button" role="option" class="nice-dropdown-item null-item" ng-if="!multiple && nullable && internalList.length != 0" ng-click="handleSelected(null, -1)" ng-disabled="isDisabled">
45
+ {{ nullableText }}
46
+ </button>
47
+ <button type="button" role="option" class="nice-dropdown-item" ng-repeat="item in internalList" ng-click="handleSelected(item, $index)" ng-class="{ 'selected': item._selected }" ng-disabled="isDisabled">
48
+ <div class="choice-checkbox" ng-if="multiple" role="menuitemcheckbox"><nice-icon icon="icon-check"></nice-icon></div>
49
+ <div class="choice-option" ng-transclude="option" ng-class="{ 'multiple-item': multiple }">{{ item[objValue] }}</div>
50
+ </button>
51
+ </div>
50
52
  </div>
51
- </div>
52
- </div>
53
+ </nice-popup-content>
54
+ </nice-popup>
53
55
 
54
56
 
55
57
  <!------------------------- Add button ------------------------->
@@ -51,12 +51,13 @@ angular.module('niceElements')
51
51
  dropdownDistance: '@',
52
52
  searchFunction: '=?',
53
53
  filterFunction: '=?',
54
+ selectedFunction: '=?', // Loads selected options missing from the list: function(keys) → promise of objects
54
55
  isInline: '=',
55
56
  clearOnSelect: '@',
56
57
  enableLoadMore: '@', // Enable load more
57
- placement: '@', // Describes the preferred placement of the popper
58
+ placement: '@', // Preferred placement of the menu
58
59
  },
59
- controller: function ($scope, $attrs, $http, $element, $timeout, gettextCatalog, NiceService) {
60
+ controller: function ($scope, $attrs, $http, $q, $element, $timeout, gettextCatalog, NiceService) {
60
61
  NiceService.bindFlag($scope, $attrs, 'selectedIsKey');
61
62
  NiceService.bindFlag($scope, $attrs, 'enableLoadMore');
62
63
 
@@ -81,7 +82,6 @@ angular.module('niceElements')
81
82
  $scope.isOpen = false;
82
83
  $scope.selected = null;
83
84
  // $scope.selectedIndex = 0;
84
- $scope.popper = null;
85
85
 
86
86
  $scope.internal = {
87
87
  search: ""
@@ -91,52 +91,9 @@ angular.module('niceElements')
91
91
  $scope.originalList = angular.copy($scope.list);
92
92
  }
93
93
 
94
- // Setup popper
95
- // https://popper.js.org/docs/v2/constructors/
96
- $scope.setupPopper = function () {
97
- const button = $element[0].getElementsByClassName('btn-dropdown')[0];
98
- const tooltip = $element[0].getElementsByClassName('nice-dropdown-menu-wrapper')[0];
99
- $scope.popper = Popper.createPopper(button, tooltip, {
100
- strategy: 'fixed',
101
- placement: $scope.placement,
102
- modifiers: [
103
- {
104
- name: 'offset',
105
- options: {
106
- offset: [0, $scope.dropdownDistance],
107
- },
108
- },
109
- {
110
- name: "sameWidth",
111
- enabled: true,
112
- phase: "beforeWrite",
113
- requires: ["computeStyles"],
114
- fn: function (e) {
115
- const state = e.state;
116
- let width = state.rects.reference.width;
117
- if (width < 200) width = 200;
118
- state.styles.popper.width = width + "px";
119
- },
120
- effect: function (e) {
121
- const state = e.state;
122
- let width = state.elements.reference.width;
123
- if (width < 200) width = 200;
124
- state.elements.popper.style.width = width + "px";
125
- }
126
- }
127
- ],
128
- });
129
- };
130
-
131
- const setupTimer = $timeout(function () {
132
- $scope.setupPopper();
133
- });
134
-
135
- // Popper adds scroll/resize listeners to window; remove them with the component
136
- $scope.$on('$destroy', function () {
137
- $timeout.cancel(setupTimer);
138
- if ($scope.popper) $scope.popper.destroy();
139
- $scope.popper = null;
94
+ // The menu is a nice-popup (positioning, Escape); on-close fires on every close
95
+ $scope.$watch('isOpen', function (isOpen, wasOpen) {
96
+ if (wasOpen && !isOpen && $scope.onClose) $scope.onClose();
140
97
  });
141
98
 
142
99
 
@@ -151,18 +108,13 @@ angular.module('niceElements')
151
108
 
152
109
  $scope.close = function () {
153
110
  $scope.isOpen = false;
154
- if ($scope.onClose) $scope.onClose();
155
111
  };
156
112
 
157
113
  $scope.open = function () {
158
- if ($scope.popper) $scope.popper.update();
159
114
  if ($scope.filterFunction) $scope.internalList = $scope.filterFunction($scope.originalList, $scope.model);
160
115
  $timeout(function () {
161
116
  $scope.isOpen = true;
162
117
  if ($scope.onOpen) $scope.onOpen();
163
- $timeout(function () {
164
- if ($scope.popper) $scope.popper.update();
165
- });
166
118
  });
167
119
  $timeout(function () {
168
120
  $scope.focusInput();
@@ -408,10 +360,17 @@ angular.module('niceElements')
408
360
  $scope.handleModelChange();
409
361
  });
410
362
 
363
+ // Options seen so far by key (lists, search results, loaded with selected-function),
364
+ // so selected keys keep their label when they are not in the current list
365
+ const knownItems = {};
366
+ // Keys already passed to selected-function (load each one only once)
367
+ const requestedKeys = {};
368
+
411
369
  $scope.handleModelChange = function () {
412
370
  $scope.selected = angular.copy($scope.model);
413
371
  angular.forEach($scope.internalList, function (i, index) {
414
372
  i._selected = false;
373
+ knownItems[i[$scope.objKey]] = i;
415
374
 
416
375
  if ($scope.selectedIsKey) {
417
376
  // Not object
@@ -457,10 +416,49 @@ angular.module('niceElements')
457
416
  }
458
417
  });
459
418
 
419
+ // Selected keys that are not in the list are still raw keys here
420
+ if ($scope.selectedIsKey && $scope.selected != null) {
421
+ if ($scope.multiple) $scope.selected = $scope.selected.map($scope.resolveKey);
422
+ else $scope.selected = $scope.resolveKey($scope.selected);
423
+ $scope.loadMissingSelected();
424
+ }
425
+
460
426
  // Handle required
461
427
  $timeout($scope.checkRequired);
462
428
  }
463
429
 
430
+ // ----------------------------------- Selected keys missing from the list -----------------------------------
431
+ // Turn a selected key into an option: one from the list, one seen before,
432
+ // or a placeholder that shows the key (until selected-function loads it)
433
+ $scope.resolveKey = function (key) {
434
+ if (angular.isObject(key)) return key; // already an option from the list
435
+ if (knownItems[key]) return knownItems[key];
436
+ const placeholder = { _missing: true };
437
+ placeholder[$scope.objKey] = key;
438
+ placeholder[$scope.objValue] = String(key);
439
+ return placeholder;
440
+ };
441
+
442
+ // Ask selected-function for the options of placeholder keys, then show them
443
+ $scope.loadMissingSelected = function () {
444
+ if (!$scope.selectedFunction) return;
445
+ const selected = $scope.multiple ? $scope.selected : [$scope.selected];
446
+ const keys = selected.filter(function (s) {
447
+ return s._missing && !requestedKeys[s[$scope.objKey]];
448
+ }).map(function (s) {
449
+ return s[$scope.objKey];
450
+ });
451
+ if (keys.length == 0) return;
452
+
453
+ keys.forEach(function (key) { requestedKeys[key] = true; });
454
+ $q.when($scope.selectedFunction(keys)).then(function (items) {
455
+ angular.forEach(items, function (item) {
456
+ knownItems[item[$scope.objKey]] = item;
457
+ });
458
+ $scope.handleModelChange();
459
+ });
460
+ };
461
+
464
462
  // ----------------------------------- Required -----------------------------------
465
463
  // Form is invalid when required and nothing is selected
466
464
  $scope.checkRequired = function () {
@@ -32,8 +32,23 @@
32
32
  }
33
33
  }
34
34
 
35
- .nice-dropdown-menu-wrapper {
36
- z-index: 1000;
35
+ // Menu is a nice-popup, as wide as the button but at least 200px.
36
+ // The <nice-popup> element is the flex item next to the add button.
37
+ nice-popup {
38
+ flex-grow: 1;
39
+ min-width: 0;
40
+ }
41
+
42
+ .nice-popup-target {
43
+ display: block;
44
+
45
+ .btn-dropdown {
46
+ width: 100%;
47
+ }
48
+ }
49
+
50
+ .nice-popup-content {
51
+ min-width: 200px;
37
52
  }
38
53
 
39
54
  .nice-dropdown-menu {
@@ -138,14 +153,20 @@
138
153
  transition: all 0.2s;
139
154
  background: $nice-choice-bg;
140
155
  color: $nice-choice-bg;
141
- line-height: 22px;
142
156
  width: 25px;
143
157
  height: 25px;
144
158
  border: 1px solid $nice-border-color;
145
159
  margin-right: 1rem;
146
160
  border-radius: $nice-border-radius;
147
- text-align: center;
161
+ display: flex;
162
+ align-items: center;
163
+ justify-content: center;
148
164
  flex-shrink: 0;
165
+
166
+ .nice-icon {
167
+ width: 16px;
168
+ height: 16px;
169
+ }
149
170
  }
150
171
 
151
172
  .choice-option {
@@ -25,7 +25,7 @@
25
25
  <ul id="{{id}}" class="dropdown-menu" role="menu">
26
26
  <li id="{{id}}-{{$index}}" ng-repeat="item in internalList" ng-click="clicked(item)">
27
27
  <a href>
28
- <span class="choice-checkbox" ng-if="multiple" ng-class="{ 'selected' : isItemSelected(item) }"><i class="fa fa-check"></i></span>
28
+ <span class="choice-checkbox" ng-if="multiple" ng-class="{ 'selected' : isItemSelected(item) }"><nice-icon icon="icon-check"></nice-icon></span>
29
29
  <span ng-if="item.color_hex_code" class="dropdown-color" ng-style="{'background': item.color_hex_code}"></span>
30
30
  <span ng-class="{'multiple-item': multiple}">{{ getLabel(item) }}</span>
31
31
  <!--<span ng-if="showTax && item.value">{{ item.value * 100 }}%</span>-->
@@ -43,13 +43,19 @@
43
43
 
44
44
  background: $nice-choice-bg;
45
45
  color: $nice-choice-bg;
46
- line-height: 22px;
47
46
  width: 25px;
48
47
  height: 25px;
49
48
  border: 2px solid $nice-border-color;
50
49
  position: absolute;
51
50
  border-radius: 2px;
52
- text-align: center;
51
+ display: flex;
52
+ align-items: center;
53
+ justify-content: center;
54
+
55
+ .nice-icon {
56
+ width: 16px;
57
+ height: 16px;
58
+ }
53
59
 
54
60
  &.selected {
55
61
  border-color: $nice-choice-selected-bg;
@@ -4,27 +4,27 @@
4
4
  <div class="dtp-date-view">
5
5
  <div class="dtp-header" ng-if="!inline">
6
6
  <div class="dtp-actual-day">{{actualDay}}</div>
7
- <div class="dtp-close" ng-if="!inline"><a href="javascript:void(0);" ng-click="onCloseClick()"><i class="fa fa-close"></i></div>
7
+ <div class="dtp-close" ng-if="!inline"><a href="javascript:void(0);" ng-click="onCloseClick()"><nice-icon icon="icon-x"></nice-icon></a></div>
8
8
  </div>
9
9
  <div class="dtp-date" ng-if="!inline" ng-class="{'hidden': !showDateHeader}">
10
10
  <div>
11
11
  <div class="left center p10">
12
- <a href="javascript:void(0);" class="dtp-select-month-before" ng-click="onMonthBeforeClick()" ng-class="{'disabled': !btnMonthBeforeEnabled}"><i class="fa fa-chevron-left"></i></a>
12
+ <a href="javascript:void(0);" class="dtp-select-month-before" ng-click="onMonthBeforeClick()" ng-class="{'disabled': !btnMonthBeforeEnabled}"><nice-icon icon="icon-chevron-left"></nice-icon></a>
13
13
  </div>
14
14
  <div class="dtp-actual-month p80" ng-click="initDate()">{{actualMonth}}</div>
15
15
  <div class="right center p10">
16
- <a href="javascript:void(0);" class="dtp-select-month-after" ng-click="onMonthAfterClick()" ng-class="{'disabled': !btnMonthAfterEnabled}"><i class="fa fa-chevron-right"></i></a>
16
+ <a href="javascript:void(0);" class="dtp-select-month-after" ng-click="onMonthAfterClick()" ng-class="{'disabled': !btnMonthAfterEnabled}"><nice-icon icon="icon-chevron-right"></nice-icon></a>
17
17
  </div>
18
18
  <div class="clearfix"></div>
19
19
  </div>
20
20
  <div class="dtp-actual-num" ng-click="initDate()">{{actualNum}}</div>
21
21
  <div>
22
22
  <div class="left center p10">
23
- <a href="javascript:void(0);" class="dtp-select-year-before" ng-click="onYearBeforeClick()" ng-class="{'disabled': !btnYearBeforeEnabled}""><i class=" fa fa-chevron-left"></i></a>
23
+ <a href="javascript:void(0);" class="dtp-select-year-before" ng-click="onYearBeforeClick()" ng-class="{'disabled': !btnYearBeforeEnabled}"><nice-icon icon="icon-chevron-left"></nice-icon></a>
24
24
  </div>
25
25
  <div class="dtp-actual-year p80" ng-click="initDate()">{{actualYear}}</div>
26
26
  <div class="right center p10">
27
- <a href="javascript:void(0);" class="dtp-select-year-after" ng-click="onYearAfterClick()" ng-class="{'disabled': !btnYearAfterEnabled}"><i class="fa fa-chevron-right"></i></a>
27
+ <a href="javascript:void(0);" class="dtp-select-year-after" ng-click="onYearAfterClick()" ng-class="{'disabled': !btnYearAfterEnabled}"><nice-icon icon="icon-chevron-right"></nice-icon></a>
28
28
  </div>
29
29
  <div class="clearfix"></div>
30
30
  </div>
@@ -38,11 +38,11 @@
38
38
  <div class="dtp-picker-calendar" ng-class="{'hidden': !showCalendar}">
39
39
  <div>
40
40
  <div ng-if="inline" class="left center p10">
41
- <a href="javascript:void(0);" class="dtp-select-month-before" ng-click="onMonthBeforeClick()" ng-class="{'disabled': !btnMonthBeforeEnabled}"><i class="fa fa-chevron-left"></i></a>
41
+ <a href="javascript:void(0);" class="dtp-select-month-before" ng-click="onMonthBeforeClick()" ng-class="{'disabled': !btnMonthBeforeEnabled}"><nice-icon icon="icon-chevron-left"></nice-icon></a>
42
42
  </div>
43
43
  <div class="dtp-picker-month" ng-class="{'p80': inline}">{{monthAndYear}}</div>
44
44
  <div class="right center p10" ng-if="inline">
45
- <a href="javascript:void(0);" class="dtp-select-month-after" ng-click="onMonthAfterClick()" ng-class="{'disabled': !btnMonthAfterEnabled}"><i class="fa fa-chevron-right"></i></a>
45
+ <a href="javascript:void(0);" class="dtp-select-month-after" ng-click="onMonthAfterClick()" ng-class="{'disabled': !btnMonthAfterEnabled}"><nice-icon icon="icon-chevron-right"></nice-icon></a>
46
46
  </div>
47
47
  </div>
48
48
 
@@ -1,9 +1,9 @@
1
- <div class="notification" ng-class="{ 'has-icon': icon }">
2
- <div class="notification-inner">
3
- <nice-icon ng-if="icon" class="notification-icon" icon="{{ icon }}"></nice-icon>
4
- <div class="notification-content">
5
- <div class="notification-title" ng-show="title" ng-bind-html="title"></div>
6
- <div class="notification-message" ng-bind-html="message"></div>
1
+ <div class="nice-notification" ng-class="{ 'has-icon': icon }">
2
+ <div class="nice-notification-inner">
3
+ <nice-icon ng-if="icon" class="nice-notification-icon" icon="{{ icon }}"></nice-icon>
4
+ <div class="nice-notification-content">
5
+ <div class="nice-notification-title" ng-show="title" ng-bind-html="title"></div>
6
+ <div class="nice-notification-message" ng-bind-html="message"></div>
7
7
  </div>
8
8
  </div>
9
9
  </div>
@@ -10,7 +10,7 @@
10
10
  display: flex;
11
11
  flex-direction: column;
12
12
  flex-wrap: wrap-reverse;
13
- align-items: flex-end;
13
+ align-items: flex-start;
14
14
  align-content: flex-start;
15
15
  column-gap: 10px;
16
16
  max-height: calc(100vh - var(--nice-notification-top));
@@ -49,7 +49,7 @@
49
49
  }
50
50
  }
51
51
 
52
- .notification {
52
+ .nice-notification {
53
53
  // Single grid row animated between 0fr and 1fr: lets the card collapse/expand
54
54
  // to its natural height so the cards below slide smoothly, without JS
55
55
  display: grid;
@@ -60,6 +60,7 @@
60
60
  border-radius: $border-radius-base;
61
61
  cursor: pointer;
62
62
  font-weight: normal;
63
+ max-width: 500px;
63
64
  min-width: 300px;
64
65
  color: $nice-notification-color;
65
66
  background: $nice-notification-bg;
@@ -83,7 +84,7 @@
83
84
  }
84
85
  }
85
86
 
86
- .notification-inner {
87
+ .nice-notification-inner {
87
88
  min-height: 0; // required for the 0fr collapse
88
89
  overflow: hidden;
89
90
  display: flex;
@@ -92,7 +93,7 @@
92
93
  }
93
94
 
94
95
  // Icon sits left of the title/message, aligned with the first line
95
- .notification-icon {
96
+ .nice-notification-icon {
96
97
  flex: 0 0 auto;
97
98
  width: 20px;
98
99
  height: 20px;
@@ -100,12 +101,12 @@
100
101
  flex-shrink: 0;
101
102
  }
102
103
 
103
- .notification-content {
104
+ .nice-notification-content {
104
105
  flex: 1 1 auto;
105
106
  min-width: 0;
106
107
  }
107
108
 
108
- .notification-title {
109
+ .nice-notification-title {
109
110
  display: block;
110
111
  text-align: left;
111
112
  font-size: 1em;
@@ -11,6 +11,10 @@
11
11
  display: flex;
12
12
  flex-direction: column;
13
13
  gap: 3px;
14
+ // Text wraps inside the cell (.btn is nowrap), also in transcluded content
15
+ white-space: normal;
16
+ overflow-wrap: anywhere;
17
+ min-width: 0;
14
18
 
15
19
  .nice-options-wrapper-icon {
16
20
  height: 20px;
@@ -1,7 +1,7 @@
1
- <div class="nice-popup" click-outside="close()">
2
- <div class="nice-popup-target" ng-transclude="target" ng-click="toggle()"></div>
1
+ <div class="nice-popup" click-outside="clickedOutside()">
2
+ <div class="nice-popup-target" ng-transclude="target" ng-click="targetClicked()"></div>
3
3
  <div class="nice-popup-content">
4
- <div class="nice-popup-arrow" data-popper-arrow ng-show="isOpen && showArrow"></div>
4
+ <div class="nice-popup-arrow" ng-show="isOpen && showArrow"></div>
5
5
  <div ng-transclude="content" ng-if="isOpen"></div>
6
6
  </div>
7
- </div>
7
+ </div>