@jetbrains/ring-ui-built 8.0.0-beta.3 → 8.0.0-beta.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.
Files changed (82) hide show
  1. package/components/_helpers/heading.js +2 -2
  2. package/components/_helpers/table.js +1 -1
  3. package/components/_helpers/theme.js +1 -1
  4. package/components/alert/alert.js +1 -1
  5. package/components/auth/iframe-flow.js +1 -1
  6. package/components/checkbox/checkbox.d.ts +1 -1
  7. package/components/collapsible-group/collapsible-group.d.ts +20 -0
  8. package/components/collapsible-group/collapsible-group.js +382 -0
  9. package/components/components/util-stories.js +63 -1
  10. package/components/data-list/data-list.js +1 -1
  11. package/components/data-list/title.js +1 -1
  12. package/components/date-picker/date-popup.js +3 -3
  13. package/components/dropdown-menu/dropdown-menu.js +6 -6
  14. package/components/editable-heading/editable-heading.js +122 -109
  15. package/components/expand/collapsible-group.d.ts +8 -20
  16. package/components/expand/collapsible-group.js +34 -365
  17. package/components/global/compose-refs.d.ts +2 -1
  18. package/components/global/compose-refs.js +44 -8
  19. package/components/global/focus-sensor-hoc.js +1 -0
  20. package/components/global/focus-with-temporary-tabindex.d.ts +11 -0
  21. package/components/global/focus-with-temporary-tabindex.js +23 -0
  22. package/components/global/intersection-observer-context.d.ts +29 -9
  23. package/components/global/intersection-observer-context.js +50 -52
  24. package/components/global/is-within-interactive-element.d.ts +6 -0
  25. package/components/global/is-within-interactive-element.js +11 -0
  26. package/components/global/is-within-navigable-element.d.ts +6 -0
  27. package/components/global/is-within-navigable-element.js +11 -0
  28. package/components/global/parse-css-duration.d.ts +5 -0
  29. package/components/global/parse-css-duration.js +14 -0
  30. package/components/global/rerender-hoc.js +1 -0
  31. package/components/global/schedule-with-cleanup.d.ts +12 -0
  32. package/components/global/schedule-with-cleanup.js +36 -0
  33. package/components/global/table-selection.js +1 -1
  34. package/components/global/theme.js +1 -1
  35. package/components/header/header.js +1 -1
  36. package/components/heading/heading.js +3 -3
  37. package/components/input/input.d.ts +1 -1
  38. package/components/internal/column-animation.js +133 -0
  39. package/components/internal/table-header.js +1109 -0
  40. package/components/{table/table-virtualize.js → internal/virtual-items.js} +108 -84
  41. package/components/legacy-table/header-cell.js +2 -2
  42. package/components/legacy-table/row-with-focus-sensor.js +1 -1
  43. package/components/legacy-table/row.d.ts +1 -1
  44. package/components/legacy-table/simple-table.js +1 -1
  45. package/components/legacy-table/smart-table.js +1 -1
  46. package/components/legacy-table/table.js +1 -1
  47. package/components/markdown/markdown.js +2 -2
  48. package/components/message/message.js +1 -1
  49. package/components/old-browsers-message/white-list.js +2 -2
  50. package/components/popup/popup.d.ts +2 -0
  51. package/components/popup/popup.js +5 -1
  52. package/components/select/select-popup.d.ts +1 -1
  53. package/components/select/select.d.ts +1 -1
  54. package/components/style.css +1 -1
  55. package/components/table/default-item-renderer.d.ts +23 -10
  56. package/components/table/default-item-renderer.js +104 -98
  57. package/components/table/internal/column-animation.d.ts +16 -0
  58. package/components/table/internal/table-header.d.ts +4 -0
  59. package/components/table/internal/virtual-items.d.ts +34 -0
  60. package/components/table/item-virtualization.d.ts +35 -0
  61. package/components/table/item-virtualization.js +71 -0
  62. package/components/table/table-const.d.ts +40 -6
  63. package/components/table/table-const.js +15 -6
  64. package/components/table/table-primitives.d.ts +9 -16
  65. package/components/table/table-primitives.js +11 -211
  66. package/components/table/table-props.d.ts +280 -0
  67. package/components/table/table-props.js +1 -0
  68. package/components/table/table.d.ts +205 -209
  69. package/components/table/table.js +356 -15
  70. package/components/tooltip/tooltip.js +1 -1
  71. package/components/user-agreement/service.js +6 -6
  72. package/components/util-stories.d.ts +26 -0
  73. package/package.json +2 -2
  74. package/components/date-picker/use-intersection-observer.d.ts +0 -6
  75. package/components/date-picker/use-intersection-observer.js +0 -93
  76. package/components/global/composeRefs.d.ts +0 -6
  77. package/components/global/composeRefs.js +0 -9
  78. package/components/table/table-component.d.ts +0 -80
  79. package/components/table/table-component.js +0 -290
  80. package/components/table/table-row-focus.d.ts +0 -4
  81. package/components/table/table-row-focus.js +0 -41
  82. package/components/table/table-virtualize.d.ts +0 -32
@@ -1,6 +1,6 @@
1
1
  import { c } from 'react/compiler-runtime';
2
2
  import * as React from 'react';
3
- import { useEffectEvent, useEffect } from 'react';
3
+ import { useEffectEvent, useLayoutEffect, useEffect } from 'react';
4
4
  import classNames from 'classnames';
5
5
  import Heading, { Levels } from '../heading/heading.js';
6
6
  import { Button } from '../button/button.js';
@@ -38,12 +38,12 @@ var styles = {"editableHeading":"ring-editable-heading-editableHeading","fullSiz
38
38
  function noop() {}
39
39
  // eslint-disable-next-line complexity
40
40
  const EditableHeading = props => {
41
- const $ = c(129);
42
- if ($[0] !== "7f58f2f72c51c33966552a21e4710894a686c3e1d3b939c62cf38b6b9080fa58") {
43
- for (let $i = 0; $i < 129; $i += 1) {
41
+ const $ = c(134);
42
+ if ($[0] !== "69c208dee49270703e9eadd0182734d1dca44cb4ecb35c235511c58f936a5946") {
43
+ for (let $i = 0; $i < 134; $i += 1) {
44
44
  $[$i] = Symbol.for("react.memo_cache_sentinel");
45
45
  }
46
- $[0] = "7f58f2f72c51c33966552a21e4710894a686c3e1d3b939c62cf38b6b9080fa58";
46
+ $[0] = "69c208dee49270703e9eadd0182734d1dca44cb4ecb35c235511c58f936a5946";
47
47
  }
48
48
  let children;
49
49
  let className;
@@ -274,12 +274,16 @@ const EditableHeading = props => {
274
274
  t21 = $[56];
275
275
  }
276
276
  const inputClasses = t21;
277
- const stretch = _temp2;
278
277
  let t22;
279
278
  if ($[57] !== multiline) {
280
- t22 = el_0 => {
281
- if (multiline && el_0 && el_0.scrollHeight >= el_0.clientHeight) {
282
- stretch(el_0);
279
+ t22 = el => {
280
+ if (multiline && el && el.scrollHeight >= el.clientHeight) {
281
+ el.style.height = "0";
282
+ const {
283
+ paddingTop,
284
+ paddingBottom
285
+ } = window.getComputedStyle(el);
286
+ el.style.height = `${el.scrollHeight - parseFloat(paddingTop) - parseFloat(paddingBottom)}px`;
283
287
  }
284
288
  };
285
289
  $[57] = multiline;
@@ -290,10 +294,10 @@ const EditableHeading = props => {
290
294
  const checkValue = t22;
291
295
  let t23;
292
296
  if ($[59] === Symbol.for("react.memo_cache_sentinel")) {
293
- t23 = el_1 => {
294
- const scrollHeight = el_1.scrollHeight || 0;
295
- const clientHeight = el_1.clientHeight || 0;
296
- const scrollTop = el_1.scrollTop || 0;
297
+ t23 = el_0 => {
298
+ const scrollHeight = el_0.scrollHeight || 0;
299
+ const clientHeight = el_0.clientHeight || 0;
300
+ const scrollTop = el_0.scrollTop || 0;
297
301
  setIsScrolledToBottom(scrollHeight - clientHeight <= scrollTop);
298
302
  setIsOverflow(scrollHeight > clientHeight);
299
303
  };
@@ -398,8 +402,28 @@ const EditableHeading = props => {
398
402
  }
399
403
  const onInputBlur = t30;
400
404
  let t31;
401
- if ($[78] !== onMouseMove || $[79] !== onMouseUp) {
405
+ let t32;
406
+ if ($[78] !== checkValue || $[79] !== isEditing || $[80] !== multiline) {
402
407
  t31 = () => {
408
+ if (multiline && isEditing && textAreaRef.current) {
409
+ checkValue(textAreaRef.current);
410
+ checkOverflow(textAreaRef.current);
411
+ }
412
+ };
413
+ t32 = [checkOverflow, checkValue, isEditing, multiline];
414
+ $[78] = checkValue;
415
+ $[79] = isEditing;
416
+ $[80] = multiline;
417
+ $[81] = t31;
418
+ $[82] = t32;
419
+ } else {
420
+ t31 = $[81];
421
+ t32 = $[82];
422
+ }
423
+ useLayoutEffect(t31, t32);
424
+ let t33;
425
+ if ($[83] !== onMouseMove || $[84] !== onMouseUp) {
426
+ t33 = () => {
403
427
  window.addEventListener("mousemove", onMouseMove);
404
428
  window.addEventListener("mouseup", onMouseUp);
405
429
  return () => {
@@ -407,23 +431,23 @@ const EditableHeading = props => {
407
431
  window.removeEventListener("mouseup", onMouseUp);
408
432
  };
409
433
  };
410
- $[78] = onMouseMove;
411
- $[79] = onMouseUp;
412
- $[80] = t31;
434
+ $[83] = onMouseMove;
435
+ $[84] = onMouseUp;
436
+ $[85] = t33;
413
437
  } else {
414
- t31 = $[80];
438
+ t33 = $[85];
415
439
  }
416
- let t32;
417
- if ($[81] === Symbol.for("react.memo_cache_sentinel")) {
418
- t32 = [];
419
- $[81] = t32;
440
+ let t34;
441
+ if ($[86] === Symbol.for("react.memo_cache_sentinel")) {
442
+ t34 = [];
443
+ $[86] = t34;
420
444
  } else {
421
- t32 = $[81];
445
+ t34 = $[86];
422
446
  }
423
- useEffect(t31, t32);
424
- let t33;
425
- if ($[82] !== autoFocus || $[83] !== children || $[84] !== dataTest || $[85] !== disabled || $[86] !== headingClasses || $[87] !== inputClasses || $[88] !== isEditing || $[89] !== isSaving || $[90] !== isScrolledToBottom || $[91] !== isShortcutsDisabled || $[92] !== level || $[93] !== maxInputRows || $[94] !== multiline || $[95] !== onChange || $[96] !== onInputBlur || $[97] !== onInputChange || $[98] !== onInputFocus || $[99] !== onInputScroll || $[100] !== restProps || $[101] !== shortcutsMap || $[102] !== shortcutsScope || $[103] !== size) {
426
- t33 = !disabled && isEditing ? /*#__PURE__*/jsxs(Fragment, {
447
+ useEffect(t33, t34);
448
+ let t35;
449
+ if ($[87] !== autoFocus || $[88] !== children || $[89] !== dataTest || $[90] !== disabled || $[91] !== headingClasses || $[92] !== inputClasses || $[93] !== isEditing || $[94] !== isSaving || $[95] !== isScrolledToBottom || $[96] !== isShortcutsDisabled || $[97] !== level || $[98] !== maxInputRows || $[99] !== multiline || $[100] !== onChange || $[101] !== onInputBlur || $[102] !== onInputChange || $[103] !== onInputFocus || $[104] !== onInputScroll || $[105] !== restProps || $[106] !== shortcutsMap || $[107] !== shortcutsScope || $[108] !== size) {
450
+ t35 = !disabled && isEditing ? /*#__PURE__*/jsxs(Fragment, {
427
451
  children: [/*#__PURE__*/jsx(Shortcuts, {
428
452
  map: shortcutsMap,
429
453
  scope: shortcutsScope,
@@ -470,44 +494,44 @@ const EditableHeading = props => {
470
494
  children: children
471
495
  })
472
496
  });
473
- $[82] = autoFocus;
474
- $[83] = children;
475
- $[84] = dataTest;
476
- $[85] = disabled;
477
- $[86] = headingClasses;
478
- $[87] = inputClasses;
479
- $[88] = isEditing;
480
- $[89] = isSaving;
481
- $[90] = isScrolledToBottom;
482
- $[91] = isShortcutsDisabled;
483
- $[92] = level;
484
- $[93] = maxInputRows;
485
- $[94] = multiline;
486
- $[95] = onChange;
487
- $[96] = onInputBlur;
488
- $[97] = onInputChange;
489
- $[98] = onInputFocus;
490
- $[99] = onInputScroll;
491
- $[100] = restProps;
492
- $[101] = shortcutsMap;
493
- $[102] = shortcutsScope;
494
- $[103] = size;
495
- $[104] = t33;
497
+ $[87] = autoFocus;
498
+ $[88] = children;
499
+ $[89] = dataTest;
500
+ $[90] = disabled;
501
+ $[91] = headingClasses;
502
+ $[92] = inputClasses;
503
+ $[93] = isEditing;
504
+ $[94] = isSaving;
505
+ $[95] = isScrolledToBottom;
506
+ $[96] = isShortcutsDisabled;
507
+ $[97] = level;
508
+ $[98] = maxInputRows;
509
+ $[99] = multiline;
510
+ $[100] = onChange;
511
+ $[101] = onInputBlur;
512
+ $[102] = onInputChange;
513
+ $[103] = onInputFocus;
514
+ $[104] = onInputScroll;
515
+ $[105] = restProps;
516
+ $[106] = shortcutsMap;
517
+ $[107] = shortcutsScope;
518
+ $[108] = size;
519
+ $[109] = t35;
496
520
  } else {
497
- t33 = $[104];
521
+ t35 = $[109];
498
522
  }
499
- let t34;
500
- if ($[105] !== isEditing || $[106] !== renderMenu) {
501
- t34 = !isEditing && renderMenu();
502
- $[105] = isEditing;
503
- $[106] = renderMenu;
504
- $[107] = t34;
523
+ let t36;
524
+ if ($[110] !== isEditing || $[111] !== renderMenu) {
525
+ t36 = !isEditing && renderMenu();
526
+ $[110] = isEditing;
527
+ $[111] = renderMenu;
528
+ $[112] = t36;
505
529
  } else {
506
- t34 = $[107];
530
+ t36 = $[112];
507
531
  }
508
- let t35;
509
- if ($[108] !== embedded || $[109] !== isCancelDisabled || $[110] !== isEditing || $[111] !== isSaveDisabled || $[112] !== isSaving || $[113] !== onCancel || $[114] !== onSave || $[115] !== translations) {
510
- t35 = isEditing && !embedded && /*#__PURE__*/jsxs(Fragment, {
532
+ let t37;
533
+ if ($[113] !== embedded || $[114] !== isCancelDisabled || $[115] !== isEditing || $[116] !== isSaveDisabled || $[117] !== isSaving || $[118] !== onCancel || $[119] !== onSave || $[120] !== translations) {
534
+ t37 = isEditing && !embedded && /*#__PURE__*/jsxs(Fragment, {
511
535
  children: [/*#__PURE__*/jsx(Button, {
512
536
  className: styles.button,
513
537
  primary: true,
@@ -522,71 +546,60 @@ const EditableHeading = props => {
522
546
  children: translations.cancel
523
547
  })]
524
548
  });
525
- $[108] = embedded;
526
- $[109] = isCancelDisabled;
527
- $[110] = isEditing;
528
- $[111] = isSaveDisabled;
529
- $[112] = isSaving;
530
- $[113] = onCancel;
531
- $[114] = onSave;
532
- $[115] = translations;
533
- $[116] = t35;
549
+ $[113] = embedded;
550
+ $[114] = isCancelDisabled;
551
+ $[115] = isEditing;
552
+ $[116] = isSaveDisabled;
553
+ $[117] = isSaving;
554
+ $[118] = onCancel;
555
+ $[119] = onSave;
556
+ $[120] = translations;
557
+ $[121] = t37;
534
558
  } else {
535
- t35 = $[116];
559
+ t37 = $[121];
536
560
  }
537
- let t36;
538
- if ($[117] !== classes || $[118] !== t33 || $[119] !== t34 || $[120] !== t35) {
539
- t36 = /*#__PURE__*/jsxs("div", {
561
+ let t38;
562
+ if ($[122] !== classes || $[123] !== t35 || $[124] !== t36 || $[125] !== t37) {
563
+ t38 = /*#__PURE__*/jsxs("div", {
540
564
  className: classes,
541
- children: [t33, t34, t35]
565
+ children: [t35, t36, t37]
542
566
  });
543
- $[117] = classes;
544
- $[118] = t33;
545
- $[119] = t34;
546
- $[120] = t35;
547
- $[121] = t36;
567
+ $[122] = classes;
568
+ $[123] = t35;
569
+ $[124] = t36;
570
+ $[125] = t37;
571
+ $[126] = t38;
548
572
  } else {
549
- t36 = $[121];
573
+ t38 = $[126];
550
574
  }
551
- let t37;
552
- if ($[122] !== error || $[123] !== isEditing || $[124] !== size) {
553
- t37 = isEditing && error && /*#__PURE__*/jsx("div", {
575
+ let t39;
576
+ if ($[127] !== error || $[128] !== isEditing || $[129] !== size) {
577
+ t39 = isEditing && error && /*#__PURE__*/jsx("div", {
554
578
  className: classNames(styles.errorText, size !== Size.AUTO && inputStyles[`size${size}`]),
555
579
  children: error
556
580
  });
557
- $[122] = error;
558
- $[123] = isEditing;
559
- $[124] = size;
560
- $[125] = t37;
581
+ $[127] = error;
582
+ $[128] = isEditing;
583
+ $[129] = size;
584
+ $[130] = t39;
561
585
  } else {
562
- t37 = $[125];
586
+ t39 = $[130];
563
587
  }
564
- let t38;
565
- if ($[126] !== t36 || $[127] !== t37) {
566
- t38 = /*#__PURE__*/jsxs(Fragment, {
567
- children: [t36, t37]
588
+ let t40;
589
+ if ($[131] !== t38 || $[132] !== t39) {
590
+ t40 = /*#__PURE__*/jsxs(Fragment, {
591
+ children: [t38, t39]
568
592
  });
569
- $[126] = t36;
570
- $[127] = t37;
571
- $[128] = t38;
593
+ $[131] = t38;
594
+ $[132] = t39;
595
+ $[133] = t40;
572
596
  } else {
573
- t38 = $[128];
597
+ t40 = $[133];
574
598
  }
575
- return t38;
599
+ return t40;
576
600
  };
577
601
  function _temp() {
578
602
  return null;
579
603
  }
580
- function _temp2(el) {
581
- if (!el || !el.style) {
582
- return;
583
- }
584
- el.style.height = "0";
585
- const {
586
- paddingTop,
587
- paddingBottom
588
- } = window.getComputedStyle(el);
589
- el.style.height = `${el.scrollHeight - parseFloat(paddingTop) - parseFloat(paddingBottom)}px`;
590
- }
591
604
 
592
605
  export { EditableHeading, Levels, Size, EditableHeading as default };
@@ -1,20 +1,8 @@
1
- import React from 'react';
2
- export interface CollapsibleGroupProps {
3
- ref?: React.Ref<HTMLDivElement>;
4
- avatar?: React.ReactNode;
5
- title: React.ReactNode;
6
- subtitle?: React.ReactNode;
7
- children?: React.ReactNode;
8
- className?: string | null | undefined;
9
- defaultExpanded?: boolean;
10
- expanded?: boolean | null | undefined;
11
- onChange?: (expanded: boolean) => void;
12
- disableAnimation?: boolean;
13
- interactive?: boolean;
14
- 'data-test'?: string | null | undefined;
15
- }
16
- declare const CollapsibleGroup: {
17
- ({ ref, avatar, title, subtitle, children, className, defaultExpanded, expanded, onChange, disableAnimation, interactive, "data-test": dataTest, }: CollapsibleGroupProps): React.JSX.Element;
18
- displayName: string;
19
- };
20
- export default CollapsibleGroup;
1
+ import { type CollapsibleGroupProps } from '../collapsible-group/collapsible-group';
2
+ /**
3
+ * @deprecated The `expand` module has been renamed to `collapsible-group`. This re-export will be removed in
4
+ * Ring UI 8.0. Use `CollapsibleGroup` from `@jetbrains/ring-ui/components/collapsible-group/collapsible-group` instead.
5
+ */
6
+ declare const DeprecatedCollapsibleGroup: import("react").ForwardRefExoticComponent<Omit<CollapsibleGroupProps, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
7
+ export type { CollapsibleGroupProps };
8
+ export default DeprecatedCollapsibleGroup;