@jetbrains/ring-ui 5.0.36 → 5.0.38

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 (239) hide show
  1. package/components/editable-heading/editable-heading.d.ts +4 -2
  2. package/components/editable-heading/editable-heading.js +3 -3
  3. package/components/input/input.css +2 -0
  4. package/components/query-assist/query-assist.js +1 -1
  5. package/dist/_helpers/_rollupPluginBabelHelpers.js +0 -4
  6. package/dist/_helpers/anchor.js +0 -1
  7. package/dist/_helpers/card.js +0 -3
  8. package/dist/_helpers/dialog__body-scroll-preventer.js +0 -11
  9. package/dist/_helpers/footer.js +2 -13
  10. package/dist/_helpers/query-assist__suggestions.js +0 -10
  11. package/dist/_helpers/select__filter.js +0 -11
  12. package/dist/_helpers/services-link.js +0 -2
  13. package/dist/_helpers/sidebar.js +0 -12
  14. package/dist/_helpers/theme.js +0 -3
  15. package/dist/_helpers/title.js +0 -9
  16. package/dist/alert/alert.js +2 -32
  17. package/dist/alert/container.js +0 -5
  18. package/dist/alert-service/alert-service.js +0 -26
  19. package/dist/analytics/analytics.js +0 -22
  20. package/dist/analytics/analytics__custom-plugin.js +0 -38
  21. package/dist/analytics/analytics__fus-plugin.js +0 -20
  22. package/dist/analytics/analytics__ga-plugin.js +0 -13
  23. package/dist/analytics/analytics__plugin-utils.js +0 -8
  24. package/dist/analytics-ng/analytics-ng.js +3 -9
  25. package/dist/auth/auth.js +2 -3
  26. package/dist/auth/auth__core.js +30 -243
  27. package/dist/auth/background-flow.js +2 -25
  28. package/dist/auth/down-notification.js +0 -7
  29. package/dist/auth/iframe-flow.js +2 -26
  30. package/dist/auth/landing.js +2 -6
  31. package/dist/auth/request-builder.js +0 -11
  32. package/dist/auth/response-parser.js +4 -26
  33. package/dist/auth/storage.js +4 -60
  34. package/dist/auth/token-validator.js +6 -42
  35. package/dist/auth/window-flow.js +2 -34
  36. package/dist/auth-dialog/auth-dialog.js +2 -12
  37. package/dist/auth-dialog-service/auth-dialog-service.js +2 -4
  38. package/dist/auth-ng/auth-ng.js +6 -22
  39. package/dist/auth-ng/auth-ng.mock.js +0 -4
  40. package/dist/autofocus-ng/autofocus-ng.js +0 -5
  41. package/dist/avatar/avatar.js +4 -17
  42. package/dist/avatar/fallback-avatar.js +2 -9
  43. package/dist/avatar-editor-ng/avatar-editor-ng.js +1 -17
  44. package/dist/badge/badge.js +0 -3
  45. package/dist/button/button.js +0 -8
  46. package/dist/button-group/button-group.js +0 -3
  47. package/dist/button-group/caption.js +0 -2
  48. package/dist/button-group-ng/button-group-ng.js +0 -4
  49. package/dist/button-ng/button-ng.js +3 -21
  50. package/dist/button-set/button-set.js +0 -3
  51. package/dist/button-set-ng/button-set-ng.js +0 -2
  52. package/dist/button-toolbar/button-toolbar.js +0 -3
  53. package/dist/button-toolbar-ng/button-toolbar-ng.js +0 -2
  54. package/dist/caret/caret.js +2 -53
  55. package/dist/checkbox/checkbox.js +0 -12
  56. package/dist/code/code.js +3 -25
  57. package/dist/compiler-ng/compiler-ng.js +0 -5
  58. package/dist/confirm/confirm.js +0 -6
  59. package/dist/confirm-service/confirm-service.js +10 -8
  60. package/dist/content-layout/content-layout.js +0 -7
  61. package/dist/contenteditable/contenteditable.js +6 -13
  62. package/dist/data-list/data-list.js +4 -28
  63. package/dist/data-list/item.js +0 -15
  64. package/dist/data-list/selection.js +0 -27
  65. package/dist/date-picker/consts.js +0 -7
  66. package/dist/date-picker/date-input.js +0 -20
  67. package/dist/date-picker/date-picker.js +2 -36
  68. package/dist/date-picker/date-popup.js +18 -71
  69. package/dist/date-picker/day.js +0 -14
  70. package/dist/date-picker/month-names.js +0 -9
  71. package/dist/date-picker/month-slider.js +0 -10
  72. package/dist/date-picker/month.js +2 -4
  73. package/dist/date-picker/months.js +6 -13
  74. package/dist/date-picker/years.js +0 -14
  75. package/dist/dialog/dialog.js +0 -19
  76. package/dist/dialog-ng/dialog-ng.js +17 -105
  77. package/dist/docked-panel-ng/docked-panel-ng.js +6 -29
  78. package/dist/dropdown/dropdown.js +2 -33
  79. package/dist/dropdown-menu/dropdown-menu.js +4 -8
  80. package/dist/editable-heading/editable-heading.d.ts +4 -2
  81. package/dist/editable-heading/editable-heading.js +7 -6
  82. package/dist/error-bubble/error-bubble.js +2 -4
  83. package/dist/error-message/error-message.js +0 -3
  84. package/dist/footer-ng/footer-ng.js +0 -13
  85. package/dist/form-ng/form-ng.js +1 -21
  86. package/dist/global/angular-component-factory.js +0 -10
  87. package/dist/global/compose.js +0 -1
  88. package/dist/global/composeRefs.js +0 -1
  89. package/dist/global/controls-height.js +0 -2
  90. package/dist/global/create-stateful-context.js +0 -5
  91. package/dist/global/data-tests.js +0 -4
  92. package/dist/global/dom.js +2 -11
  93. package/dist/global/focus-sensor-hoc.js +4 -33
  94. package/dist/global/fuzzy-highlight.js +2 -16
  95. package/dist/global/get-event-key.js +8 -17
  96. package/dist/global/get-uid.js +0 -2
  97. package/dist/global/linear-function.js +0 -2
  98. package/dist/global/listeners.js +0 -13
  99. package/dist/global/memoize.js +0 -2
  100. package/dist/global/normalize-indent.js +2 -5
  101. package/dist/global/react-dom-renderer.js +0 -8
  102. package/dist/global/react-render-adapter.js +0 -7
  103. package/dist/global/rerender-hoc.js +0 -7
  104. package/dist/global/ring-angular-component.js +0 -5
  105. package/dist/global/schedule-raf.js +0 -5
  106. package/dist/global/trivial-template-tag.js +2 -3
  107. package/dist/global/url.js +0 -27
  108. package/dist/grid/col.js +0 -4
  109. package/dist/grid/grid.js +0 -3
  110. package/dist/grid/row.js +0 -5
  111. package/dist/group/group.js +0 -3
  112. package/dist/header/header.js +0 -5
  113. package/dist/header/logo.js +0 -4
  114. package/dist/header/profile.js +0 -7
  115. package/dist/header/services.js +0 -11
  116. package/dist/header/smart-profile.js +4 -18
  117. package/dist/header/smart-services.js +0 -17
  118. package/dist/header/tray-icon.js +2 -3
  119. package/dist/header/tray.js +0 -3
  120. package/dist/heading/heading.js +0 -5
  121. package/dist/http/http.js +20 -65
  122. package/dist/http/http.mock.js +2 -14
  123. package/dist/hub-source/hub-source.js +0 -32
  124. package/dist/hub-source/hub-source__user.js +0 -1
  125. package/dist/hub-source/hub-source__users-groups.js +0 -12
  126. package/dist/icon/icon.js +0 -13
  127. package/dist/icon/icon__constants.js +0 -4
  128. package/dist/icon/icon__svg.js +0 -10
  129. package/dist/icon-ng/icon-ng.js +2 -7
  130. package/dist/input/input.js +0 -30
  131. package/dist/input-ng/input-ng.js +0 -17
  132. package/dist/island/adaptive-island-hoc.js +0 -7
  133. package/dist/island/content.js +0 -25
  134. package/dist/island/header.js +0 -7
  135. package/dist/island/island.js +0 -4
  136. package/dist/island-legacy/content-legacy.js +0 -2
  137. package/dist/island-legacy/header-legacy.js +0 -2
  138. package/dist/island-legacy/island-legacy.js +0 -2
  139. package/dist/island-ng/island-content-ng.js +0 -3
  140. package/dist/link/clickableLink.js +2 -10
  141. package/dist/link/link.js +2 -9
  142. package/dist/link-ng/link-ng.js +0 -2
  143. package/dist/list/consts.js +0 -4
  144. package/dist/list/list.js +6 -128
  145. package/dist/list/list__custom.js +0 -4
  146. package/dist/list/list__hint.js +0 -3
  147. package/dist/list/list__item.js +0 -8
  148. package/dist/list/list__link.js +2 -3
  149. package/dist/list/list__separator.js +0 -1
  150. package/dist/list/list__title.js +0 -1
  151. package/dist/list/list__users-groups-source.js +4 -17
  152. package/dist/loader/loader.js +0 -10
  153. package/dist/loader/loader__core.js +6 -70
  154. package/dist/loader-inline/loader-inline.js +0 -3
  155. package/dist/loader-ng/loader-ng.js +0 -7
  156. package/dist/loader-screen/loader-screen.js +0 -3
  157. package/dist/loader-screen-ng/loader-screen-ng.js +2 -14
  158. package/dist/login-dialog/login-dialog.js +0 -15
  159. package/dist/login-dialog/service.js +2 -4
  160. package/dist/markdown/code.js +0 -2
  161. package/dist/markdown/heading.js +0 -1
  162. package/dist/markdown/link.js +0 -1
  163. package/dist/markdown/markdown.js +0 -2
  164. package/dist/message/message.js +0 -24
  165. package/dist/message-bundle-ng/message-bundle-ng.js +2 -45
  166. package/dist/old-browsers-message/old-browsers-message.js +2 -21
  167. package/dist/old-browsers-message/white-list.js +2 -6
  168. package/dist/pager/pager.js +2 -39
  169. package/dist/panel/panel.js +0 -3
  170. package/dist/permissions/permissions.js +1 -43
  171. package/dist/permissions/permissions__cache.js +12 -63
  172. package/dist/permissions-ng/permissions-ng.js +11 -19
  173. package/dist/place-under-ng/place-under-ng.js +0 -19
  174. package/dist/popup/popup.consts.js +0 -11
  175. package/dist/popup/popup.js +6 -68
  176. package/dist/popup/position.js +8 -30
  177. package/dist/popup-menu/popup-menu.js +4 -13
  178. package/dist/progress-bar/progress-bar.js +0 -14
  179. package/dist/promised-click-ng/promised-click-ng.js +3 -22
  180. package/dist/query-assist/query-assist.js +17 -201
  181. package/dist/radio/radio.js +0 -6
  182. package/dist/radio/radio__item.js +0 -9
  183. package/dist/radio-ng/radio-ng.js +0 -4
  184. package/dist/save-field-ng/save-field-ng.js +1 -37
  185. package/dist/select/select.js +18 -208
  186. package/dist/select/select__popup.js +4 -76
  187. package/dist/select-ng/select-ng.js +18 -74
  188. package/dist/select-ng/select-ng__lazy.js +2 -17
  189. package/dist/select-ng/select-ng__options.js +3 -29
  190. package/dist/shortcuts/core.js +4 -56
  191. package/dist/shortcuts/shortcuts-hoc.js +0 -4
  192. package/dist/shortcuts/shortcuts.js +0 -10
  193. package/dist/shortcuts-hint-ng/shortcuts-hint-ng.js +0 -13
  194. package/dist/shortcuts-ng/shortcuts-ng.js +16 -46
  195. package/dist/sidebar-ng/sidebar-ng.js +2 -12
  196. package/dist/storage/storage.js +2 -5
  197. package/dist/storage/storage__fallback.js +2 -48
  198. package/dist/storage/storage__local.js +0 -23
  199. package/dist/style.css +1 -1
  200. package/dist/tab-trap/tab-trap.js +0 -37
  201. package/dist/table/cell.js +0 -2
  202. package/dist/table/disable-hover-hoc.js +0 -9
  203. package/dist/table/header-cell.js +0 -8
  204. package/dist/table/header.js +0 -16
  205. package/dist/table/multitable.js +0 -23
  206. package/dist/table/row-with-focus-sensor.js +0 -12
  207. package/dist/table/row.js +0 -18
  208. package/dist/table/selection-adapter.js +0 -2
  209. package/dist/table/selection-shortcuts-hoc.js +8 -42
  210. package/dist/table/selection.js +0 -50
  211. package/dist/table/smart-table.js +0 -9
  212. package/dist/table/table.js +6 -37
  213. package/dist/table-legacy-ng/table-legacy-ng.js +12 -42
  214. package/dist/table-legacy-ng/table-legacy-ng__selection-navigate-actions.js +0 -31
  215. package/dist/table-legacy-ng/table-legacy-ng__selection.js +0 -32
  216. package/dist/table-legacy-ng/table-legacy-ng__toolbar.js +2 -5
  217. package/dist/tabs/collapsible-more.js +0 -5
  218. package/dist/tabs/collapsible-tab.js +0 -4
  219. package/dist/tabs/collapsible-tabs.js +8 -28
  220. package/dist/tabs/dumb-tabs.js +0 -8
  221. package/dist/tabs/smart-tabs.js +0 -6
  222. package/dist/tabs/tab-link.js +0 -1
  223. package/dist/tabs/tab.js +0 -2
  224. package/dist/tabs-ng/tabs-ng.js +13 -29
  225. package/dist/tag/tag.js +0 -24
  226. package/dist/tags-input/tags-input.js +0 -76
  227. package/dist/tags-list/tags-list.js +0 -6
  228. package/dist/template-ng/template-ng.js +0 -12
  229. package/dist/text/text.js +0 -3
  230. package/dist/theme-ng/theme-ng.js +0 -8
  231. package/dist/title-ng/title-ng.js +6 -17
  232. package/dist/toggle/toggle.js +0 -4
  233. package/dist/tooltip/tooltip.js +4 -35
  234. package/dist/tooltip-ng/tooltip-ng.js +2 -8
  235. package/dist/user-agreement/service.js +0 -62
  236. package/dist/user-agreement/user-agreement.js +0 -8
  237. package/dist/user-card/smart-user-card-tooltip.js +2 -8
  238. package/dist/user-card/tooltip.js +0 -3
  239. package/package.json +37 -37
@@ -115,7 +115,6 @@ angularModule.directive('rgLegacyTable', function rgLegacyTableDirective() {
115
115
  transclude: true,
116
116
  template: '<div><table class="ring-table" ng-transclude></table></div>',
117
117
  controllerAs: 'ctrl',
118
-
119
118
  /**
120
119
  * {{
121
120
  * items: array, items of table
@@ -133,20 +132,19 @@ angularModule.directive('rgLegacyTable', function rgLegacyTableDirective() {
133
132
  if (this.disableSelection) {
134
133
  return;
135
134
  }
135
+
136
136
  /**
137
137
  * Create Selection instance first to make sure it is always available
138
138
  * @type {Selection}
139
139
  */
140
-
141
-
142
140
  this.selection = new Selection(this.items, (name, item, index) => {
143
141
  $scope.$emit(name, item, index);
144
142
  $scope.$broadcast(name, item, index);
145
143
  });
144
+
146
145
  /**
147
146
  * Updating items when data is initiated or updated
148
147
  */
149
-
150
148
  $scope.$watch(() => this.items, newItems => {
151
149
  if (newItems) {
152
150
  this.selection.setItems(newItems);
@@ -171,21 +169,19 @@ angularModule.directive('rgLegacyTableHeader', ["getClosestElementWithCommonPare
171
169
  link: function link(scope, iElement, iAttrs) {
172
170
  const element = iElement[0];
173
171
  let stickToElement = null;
174
- scope.stickToSelector = iAttrs.stickTo; //Shortcut for placing under table toolbar
172
+ scope.stickToSelector = iAttrs.stickTo;
175
173
 
174
+ //Shortcut for placing under table toolbar
176
175
  if (iAttrs.stickToToolbar !== undefined) {
177
176
  scope.stickToSelector = '.ring-table__toolbar';
178
177
  }
179
-
180
178
  const scrollableHeader = element.querySelector('.ring-table__header:not(.ring-table__header_sticky)');
181
179
  const fixedHeader = element.querySelector('.ring-table__header_sticky');
182
-
183
180
  const toolbarFixed = () => stickToElement.querySelector(`.${TOOLBAR_FIXED_CLASSNAME}`) !== null;
181
+
184
182
  /**
185
183
  * Sync header columns width with real table
186
184
  */
187
-
188
-
189
185
  const resizeFixedHeader = debounce(() => {
190
186
  fixedHeader.style.width = `${scrollableHeader.offsetWidth}px`;
191
187
  const titles = Array.from(fixedHeader.querySelectorAll('.ring-table__title'));
@@ -194,10 +190,10 @@ angularModule.directive('rgLegacyTableHeader', ["getClosestElementWithCommonPare
194
190
  titleElement.style.width = getStyles(targetHeaderTitle).width;
195
191
  });
196
192
  }, HEADER_RESIZE_DEBOUNCE, true);
193
+
197
194
  /**
198
195
  * Toggle headers on scroll. Also resize header columns with some big interval
199
196
  */
200
-
201
197
  const scrollListener = debounce(() => {
202
198
  if (toolbarFixed()) {
203
199
  fixedHeader.style.display = 'block';
@@ -206,10 +202,8 @@ angularModule.directive('rgLegacyTableHeader', ["getClosestElementWithCommonPare
206
202
  fixedHeader.style.display = 'none';
207
203
  scrollableHeader.style.visibility = 'visible';
208
204
  }
209
-
210
205
  resizeFixedHeader();
211
206
  }, HEADER_SCROLL_DEBOUNCE);
212
-
213
207
  function startSticking() {
214
208
  scope.$evalAsync(() => {
215
209
  window.addEventListener('resize', resizeFixedHeader);
@@ -217,7 +211,6 @@ angularModule.directive('rgLegacyTableHeader', ["getClosestElementWithCommonPare
217
211
  scope.$on('rgLegacyTable:itemsChanged', scrollListener);
218
212
  });
219
213
  }
220
-
221
214
  if (scope.stickToSelector) {
222
215
  stickToElement = getClosestElementWithCommonParent(element, scope.stickToSelector);
223
216
  startSticking();
@@ -264,14 +257,11 @@ angularModule.directive('rgLegacyTableRow', function rgLegacyTableRowDirective()
264
257
  controller: ["$scope", "$element", function controller($scope, $element) {
265
258
  const element = $element[0];
266
259
  let watchRowCheckFlag;
267
-
268
260
  this.setSelection = selection => {
269
261
  if (!selection) {
270
262
  return;
271
263
  }
272
-
273
264
  this.selection = selection;
274
-
275
265
  if (!watchRowCheckFlag) {
276
266
  watchRowCheckFlag = $scope.$watch('rowCtrl.rowItem.checked', newValue => {
277
267
  if (newValue !== undefined) {
@@ -280,29 +270,23 @@ angularModule.directive('rgLegacyTableRow', function rgLegacyTableRowDirective()
280
270
  });
281
271
  }
282
272
  };
283
-
284
273
  this.setActiveItem = item => {
285
274
  item && !item.unselectable && this.selection && this.selection.activateItem(item);
286
275
  };
287
-
288
276
  this.onMouseOver = item => {
289
277
  item && !item.unselectable && this.selection && this.selection.setSuggestedItem(item);
290
278
  };
291
-
292
279
  this.onMouseOut = item => {
293
280
  item && this.selection && item === this.selection.suggestedItem && this.selection.setSuggestedItem(null);
294
281
  };
295
-
296
282
  this.hasCheckedItems = () => {
297
283
  if (!this.selection) {
298
284
  return false;
299
- } //TODO: cache this operation if there are performance issues
300
-
301
-
285
+ }
286
+ //TODO: cache this operation if there are performance issues
302
287
  const checkedItems = this.selection.getCheckedItems();
303
288
  return checkedItems && checkedItems.length > 0;
304
289
  };
305
-
306
290
  function getRowOutOfViewInfo(el, offsetInRows) {
307
291
  const rect = getRect(el);
308
292
  const offset = rect.height * offsetInRows;
@@ -315,17 +299,14 @@ angularModule.directive('rgLegacyTableRow', function rgLegacyTableRowDirective()
315
299
  isGoneDown
316
300
  };
317
301
  }
318
-
319
302
  function addSpacingAfterScroll(offset) {
320
303
  if (window.scrollY) {
321
304
  window.scrollBy(0, offset);
322
305
  }
323
306
  }
324
-
325
307
  $scope.$on('rgLegacyTable:activateItem', (e, item) => {
326
308
  if (item === this.rowItem) {
327
309
  const scrollInfo = getRowOutOfViewInfo(element, 2);
328
-
329
310
  if (scrollInfo.isOutOfView) {
330
311
  element.scrollIntoView(scrollInfo.isGoneUp);
331
312
  addSpacingAfterScroll(scrollInfo.isGoneDown ? scrollInfo.offset : -scrollInfo.offset);
@@ -344,7 +325,6 @@ angularModule.directive('rgLegacyTableHeaderCheckbox', function rgLegacyTableHea
344
325
  link: function link(scope, iElement, iAttrs, tableCtrl) {
345
326
  // TODO: reduce number of recheckSelection() calls
346
327
  scope.allChecked = false;
347
-
348
328
  function recheckSelection() {
349
329
  if (tableCtrl.items && tableCtrl.items.length) {
350
330
  scope.allChecked = tableCtrl.items.every(item => item.checked);
@@ -352,32 +332,28 @@ angularModule.directive('rgLegacyTableHeaderCheckbox', function rgLegacyTableHea
352
332
  scope.allChecked = false;
353
333
  }
354
334
  }
355
-
356
335
  function markAllItemsAs(state) {
357
336
  tableCtrl.items.forEach(item => {
358
337
  item.checked = state;
359
338
  });
360
339
  }
361
-
362
340
  scope.$on('rgLegacyTable:itemsChanged', () => {
363
341
  if (scope.allChecked) {
364
342
  markAllItemsAs(true);
365
343
  }
366
-
367
344
  recheckSelection();
368
345
  });
369
346
  scope.$on('rgLegacyTable:selectionChanged', recheckSelection);
370
-
371
347
  scope.onClickChange = () => {
372
348
  markAllItemsAs(scope.allChecked);
373
349
  };
374
350
  }
375
351
  };
376
352
  });
353
+
377
354
  /**
378
355
  * A checkbox cell for table. Uses rg-table-row parent directive as model host
379
356
  */
380
-
381
357
  angularModule.directive('rgLegacyTableCheckboxCell', function rgLegacyTableCheckboxCellDirective() {
382
358
  return {
383
359
  restrict: 'E',
@@ -394,15 +370,13 @@ angularModule.directive('rgLegacyTableCheckboxCell', function rgLegacyTableCheck
394
370
  * rowItem getter to use it as ng-model for checkbox
395
371
  */
396
372
  scope.getRowItem = () => rowCtrl.rowItem;
397
-
398
373
  scope.getTitle = () => iAttrs.title || rowCtrl.rowItem.name;
399
-
400
374
  scope.geAriaLabel = () => iAttrs.ariaLabel;
401
-
402
375
  scope.isEmbedded = angular.isDefined(iAttrs.embedded);
403
376
  }
404
377
  };
405
378
  });
379
+
406
380
  /**
407
381
  * Table title wrapper, receive next attributes:
408
382
  * {{
@@ -410,7 +384,6 @@ angularModule.directive('rgLegacyTableCheckboxCell', function rgLegacyTableCheck
410
384
  active: makes title more bolder
411
385
  }}
412
386
  */
413
-
414
387
  angularModule.directive('rgLegacyTableTitle', function rgLegacyTableTitleDirective() {
415
388
  return {
416
389
  restrict: 'E',
@@ -438,6 +411,7 @@ angularModule.directive('rgLegacyTableTitle', function rgLegacyTableTitleDirecti
438
411
  }
439
412
  };
440
413
  });
414
+
441
415
  /**
442
416
  * Column wrapper, receive next attributes:
443
417
  * {{
@@ -446,7 +420,6 @@ angularModule.directive('rgLegacyTableTitle', function rgLegacyTableTitleDirecti
446
420
  avatar: for columns contains avatar
447
421
  }}
448
422
  */
449
-
450
423
  angularModule.directive('rgLegacyTableColumn', function rgLegacyTableColumnDirective() {
451
424
  return {
452
425
  restrict: 'E',
@@ -476,25 +449,22 @@ angularModule.directive('rgLegacyTableColumn', function rgLegacyTableColumnDirec
476
449
  scope.isGray = angular.isDefined(iAttrs.gray);
477
450
  scope.isPullRight = angular.isDefined(iAttrs.pullRight);
478
451
  scope.isPullLeft = angular.isDefined(iAttrs.pullLeft);
479
-
480
452
  function adjustUnlimitedColumnWidths() {
481
453
  const unlimitedColumnsCount = element.parentNode.querySelectorAll('.ring-table__column[unlimited]').length;
482
-
483
454
  if (unlimitedColumnsCount > 1) {
484
455
  element.style.width = `${(FULL_WIDTH / unlimitedColumnsCount).toFixed()}%`;
485
456
  }
486
457
  }
487
-
488
458
  if (scope.isUnlimited) {
489
459
  adjustUnlimitedColumnWidths();
490
460
  }
491
461
  }
492
462
  };
493
463
  });
464
+
494
465
  /**
495
466
  * Class with default hotkeys navigation actions (e.g. select, clear selection, move up/down)
496
467
  */
497
-
498
468
  angularModule.constant('SelectionNavigateActions', SelectionNavigateActions);
499
469
  var tableLegacyNg = angularModule.name;
500
470
 
@@ -8,116 +8,85 @@ class SelectionNavigateActions {
8
8
  this._selection = tableSelection;
9
9
  this._addSelectionMode = null;
10
10
  }
11
-
12
11
  setSelection(tableSelection) {
13
12
  this._selection = tableSelection;
14
13
  }
15
-
16
14
  moveUp() {
17
15
  if (!this._selection) {
18
16
  return false;
19
17
  }
20
-
21
18
  const activeItem = this._selection.activatePreviousItem();
22
-
23
19
  if (activeItem && activeItem.unselectable) {
24
20
  return this.moveUp();
25
21
  }
26
-
27
22
  return !activeItem;
28
23
  }
29
-
30
24
  moveDown() {
31
25
  if (this._selection) {
32
26
  const activeItem = this._selection.activateNextItem();
33
-
34
27
  if (!activeItem) {
35
28
  this._selection.setActiveItemIndex(0);
36
29
  } else if (activeItem.unselectable) {
37
30
  return this.moveDown();
38
31
  }
39
32
  }
40
-
41
33
  return false;
42
34
  }
43
-
44
35
  reset() {
45
36
  this._addSelectionMode = null;
46
37
  return !!this._selection;
47
38
  }
48
-
49
39
  selectUp() {
50
40
  if (!this._selection) {
51
41
  return false;
52
42
  }
53
-
54
43
  this._changeCheckedItemsArray();
55
-
56
44
  return this.moveUp();
57
45
  }
58
-
59
46
  selectDown() {
60
47
  if (!this._selection) {
61
48
  return false;
62
49
  }
63
-
64
50
  this._changeCheckedItemsArray();
65
-
66
51
  return this.moveDown();
67
52
  }
68
-
69
53
  selectCurrent() {
70
54
  if (!this._selection) {
71
55
  return false;
72
56
  }
73
-
74
57
  const activeItem = this._selection.getActiveItem();
75
-
76
58
  if (!activeItem) {
77
59
  return true;
78
60
  } else {
79
61
  this._selection.toggleCheck(activeItem);
80
-
81
62
  return false;
82
63
  }
83
64
  }
84
-
85
65
  clearSelection() {
86
66
  if (!this._selection) {
87
67
  return false;
88
68
  }
89
-
90
69
  const activeItem = this._selection.getActiveItem();
91
-
92
70
  if (activeItem) {
93
71
  if (this._selection.getCheckedItems().length > 0) {
94
72
  this._selection.clearSelection();
95
-
96
73
  return false;
97
74
  }
98
-
99
75
  this._selection.clearActivity();
100
76
  }
101
-
102
77
  return true;
103
78
  }
104
-
105
79
  _changeCheckedItemsArray() {
106
80
  if (!this._selection) {
107
81
  return false;
108
82
  }
109
-
110
83
  const activeItem = this._selection.getActiveItem();
111
-
112
84
  if (activeItem && !this._addSelectionMode) {
113
85
  this._addSelectionMode = activeItem.checked ? 'uncheckItem' : 'checkItem';
114
86
  }
115
-
116
87
  this._selection[this._addSelectionMode](activeItem);
117
-
118
88
  return undefined;
119
89
  }
120
-
121
90
  }
122
91
 
123
92
  export { SelectionNavigateActions as default };
@@ -6,20 +6,16 @@ import { _ as _defineProperty } from '../_helpers/_rollupPluginBabelHelpers.js';
6
6
  class Selection {
7
7
  constructor(items, emitEvent) {
8
8
  let singleActiveElementAsSelection = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
9
-
10
9
  _defineProperty(this, "suggestedItem", null);
11
-
12
10
  this.items = items;
13
11
  this.emitEvent = emitEvent;
14
12
  this.singleActiveElementAsSelection = singleActiveElementAsSelection;
15
13
  }
16
-
17
14
  setItems(items) {
18
15
  this.items = items;
19
16
  this.suggestedItem = null;
20
17
  this.emitEvent('rgLegacyTable:itemsChanged', items);
21
18
  }
22
-
23
19
  activateItem(item) {
24
20
  if (item && !item.unselectable) {
25
21
  this.clearActivity();
@@ -27,27 +23,21 @@ class Selection {
27
23
  this.emitEvent('rgLegacyTable:activateItem', item, this.items.indexOf(item));
28
24
  }
29
25
  }
30
-
31
26
  getActiveItem() {
32
27
  if (!this.items) {
33
28
  return undefined;
34
29
  }
35
-
36
30
  return this.items.find(item => item.active);
37
31
  }
38
-
39
32
  getActiveItemIndex() {
40
33
  return this.items.indexOf(this.getActiveItem());
41
34
  }
42
-
43
35
  setActiveItemIndex(index) {
44
36
  const item = this.items[index];
45
37
  this.activateItem(item);
46
38
  }
47
-
48
39
  findNextActiveItem(startIndex, direction) {
49
40
  const maxIndex = this.items.length - 1;
50
-
51
41
  if (direction) {
52
42
  for (let i = startIndex + 1; i <= maxIndex; i++) {
53
43
  if (!this.items[i].unselectable) {
@@ -61,13 +51,10 @@ class Selection {
61
51
  }
62
52
  }
63
53
  }
64
-
65
54
  return undefined;
66
55
  }
67
-
68
56
  activateNextItem() {
69
57
  const activeItemIndex = this.items.indexOf(this.getActiveItem());
70
-
71
58
  if (activeItemIndex === -1 && this.suggestedItem) {
72
59
  this.activateItem(this.suggestedItem);
73
60
  return this.suggestedItem;
@@ -80,10 +67,8 @@ class Selection {
80
67
  return undefined;
81
68
  }
82
69
  }
83
-
84
70
  activatePreviousItem() {
85
71
  const activeItemIndex = this.items.indexOf(this.getActiveItem());
86
-
87
72
  if (activeItemIndex === -1 && this.suggestedItem) {
88
73
  this.activateItem(this.suggestedItem);
89
74
  return this.suggestedItem;
@@ -96,70 +81,55 @@ class Selection {
96
81
  return undefined;
97
82
  }
98
83
  }
99
-
100
84
  clearSelection() {
101
85
  this.clearCheckedItems();
102
-
103
86
  if (this.singleActiveElementAsSelection) {
104
87
  this.clearActivity();
105
88
  }
106
89
  }
107
-
108
90
  clearCheckedItems() {
109
91
  this.items.forEach(item => {
110
92
  item.checked = false;
111
93
  });
112
94
  }
113
-
114
95
  clearActivity() {
115
96
  const activeItem = this.getActiveItem();
116
-
117
97
  if (activeItem) {
118
98
  activeItem.active = false;
119
99
  }
120
-
121
100
  this.emitEvent('rgLegacyTable:activateItem', null);
122
101
  }
123
-
124
102
  checkItem(item) {
125
103
  if (item && !item.uncheckable && !item.unselectable) {
126
104
  item.checked = true;
127
105
  this.triggerSelectionChanged(item);
128
106
  }
129
107
  }
130
-
131
108
  uncheckItem(item) {
132
109
  if (item) {
133
110
  item.checked = false;
134
111
  this.triggerSelectionChanged(item);
135
112
  }
136
113
  }
137
-
138
114
  toggleCheck(item) {
139
115
  if (item && !item.uncheckable && !item.unselectable) {
140
116
  item.checked = !item.checked;
141
117
  this.triggerSelectionChanged(item);
142
118
  }
143
119
  }
144
-
145
120
  triggerSelectionChanged(item) {
146
121
  this.emitEvent('rgLegacyTable:selectionChanged', item);
147
122
  }
148
-
149
123
  getCheckedItems() {
150
124
  if (!this.items) {
151
125
  return [];
152
126
  }
153
-
154
127
  return this.items.filter(item => item.checked);
155
128
  }
156
-
157
129
  getSelectedItems() {
158
130
  const checked = this.getCheckedItems();
159
-
160
131
  if (!checked.length) {
161
132
  const active = this.getActiveItem();
162
-
163
133
  if (active && this.singleActiveElementAsSelection) {
164
134
  return [active];
165
135
  } else {
@@ -169,11 +139,9 @@ class Selection {
169
139
  return checked;
170
140
  }
171
141
  }
172
-
173
142
  setSuggestedItem(item) {
174
143
  this.suggestedItem = item;
175
144
  }
176
-
177
145
  }
178
146
 
179
147
  export { Selection as default };
@@ -21,12 +21,10 @@ angularModule.directive('rgLegacyTableToolbar', function rgLegacyTableToolbarDir
21
21
  const element = iElement[0];
22
22
  const controlsContainer = element.querySelector('.ring-table__toolbar-controls');
23
23
  let savedToolbarTop;
24
-
25
24
  const toolbarScrollListener = () => scheduleScrollListener(() => {
26
25
  const scrolledTop = getDocumentScrollTop();
27
26
  const elementTop = element.getBoundingClientRect().top + scrolledTop;
28
27
  const toolbarTop = savedToolbarTop || elementTop;
29
-
30
28
  if (scrolledTop > toolbarTop && !savedToolbarTop) {
31
29
  //save height to style to prevent collapsing after fixing controls
32
30
  element.style.height = `${element.offsetHeight}px`;
@@ -37,16 +35,15 @@ angularModule.directive('rgLegacyTableToolbar', function rgLegacyTableToolbarDir
37
35
  element.style.height = null;
38
36
  controlsContainer.classList.remove('ring-table__toolbar-controls_fixed');
39
37
  }
40
- }); //Stick toolbar if sticking is enabled
41
-
38
+ });
42
39
 
40
+ //Stick toolbar if sticking is enabled
43
41
  if (attrs.stick !== undefined) {
44
42
  window.addEventListener('scroll', toolbarScrollListener);
45
43
  scope.$on('$destroy', () => {
46
44
  window.removeEventListener('scroll', toolbarScrollListener);
47
45
  });
48
46
  }
49
-
50
47
  scope.toolbarIsReady = true;
51
48
  }
52
49
  };
@@ -101,7 +101,6 @@ const MoreButton = /*#__PURE__*/React.memo(_ref2 => {
101
101
  if (listItem.disabled === true || listItem.custom === true) {
102
102
  return;
103
103
  }
104
-
105
104
  const cb = onSelect(String(listItem.key));
106
105
  cb();
107
106
  }, [onSelect]);
@@ -123,7 +122,6 @@ const MoreButton = /*#__PURE__*/React.memo(_ref2 => {
123
122
  custom
124
123
  };
125
124
  });
126
-
127
125
  if (morePopupBeforeEnd) {
128
126
  popupItems.push({
129
127
  template: morePopupBeforeEnd,
@@ -132,7 +130,6 @@ const MoreButton = /*#__PURE__*/React.memo(_ref2 => {
132
130
  rgItemType: ListProps.Type.CUSTOM
133
131
  });
134
132
  }
135
-
136
133
  return popupItems;
137
134
  }, [items, morePopupBeforeEnd, morePopupItemClassName, selected]);
138
135
  const popupAnchor = React.useMemo(() => /*#__PURE__*/React.createElement(AnchorLink, {
@@ -146,11 +143,9 @@ const MoreButton = /*#__PURE__*/React.memo(_ref2 => {
146
143
  onSelect: onSelectHandler,
147
144
  data: data
148
145
  }), [data, morePopupClassName, onSelectHandler]);
149
-
150
146
  if (items.length === 0) {
151
147
  return null;
152
148
  }
153
-
154
149
  return /*#__PURE__*/React.createElement("div", {
155
150
  className: classNames(modules_02138f4a.title, moreClassName, hasActiveChild && moreActiveClassName)
156
151
  }, /*#__PURE__*/React.createElement(Dropdown, {
@@ -13,7 +13,6 @@ import '../link/clickableLink.js';
13
13
  import '../_helpers/link.js';
14
14
 
15
15
  function noop() {}
16
-
17
16
  const TabTitle = /*#__PURE__*/React.memo(function TabTitle(_ref) {
18
17
  let {
19
18
  selected,
@@ -22,11 +21,9 @@ const TabTitle = /*#__PURE__*/React.memo(function TabTitle(_ref) {
22
21
  collapsed = false,
23
22
  tabIndex
24
23
  } = _ref;
25
-
26
24
  if (child == null || typeof child !== 'object' || child.type === CustomItem) {
27
25
  return child;
28
26
  }
29
-
30
27
  const {
31
28
  title,
32
29
  titleProps,
@@ -64,7 +61,6 @@ TabTitle.propTypes = {
64
61
  collapsed: PropTypes.bool,
65
62
  tabIndex: PropTypes.number
66
63
  };
67
-
68
64
  const getTabTitles = _ref2 => {
69
65
  let {
70
66
  items,